[arquillian-issues] [JBoss JIRA] Closed: (ARQ-254) Allow the use of @Deployment on non-static method
Aslak Knutsen (JIRA)
jira-events at lists.jboss.org
Thu Aug 12 13:55:49 EDT 2010
[ https://jira.jboss.org/browse/ARQ-254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Aslak Knutsen closed ARQ-254.
-----------------------------
Assignee: Aslak Knutsen
Resolution: Rejected
The TestCase to get the @Deployment might not even run in the same JVM as the TestClass Instance.
> Allow the use of @Deployment on non-static method
> -------------------------------------------------
>
> Key: ARQ-254
> URL: https://jira.jboss.org/browse/ARQ-254
> Project: Arquillian
> Issue Type: Feature Request
> Reporter: Elias Ross
> Assignee: Aslak Knutsen
>
> Some tests I have test the deployment as is, some tests add in additional EJBs. (I exclude certain EJBs and MDBs to speed up testing.)
> This is currently what I do:
> @RunWith(org.jboss.arquillian.junit.Arquillian.class)
> public class DeploymentTest {
> private static List<Class> ejb = new ArrayList<Class>();
>
> protected static void addClass(Class c) {
> ejb.add(c);
> }
> @Deployment
> public static Archive createTestArchive() throws Exception { ... }
> }
> public class XXXTest extends DeploymentTest {
> static {
> addClass(FooEJB.class);
> addClass(BarEJB.class);
> }
> @Deployment
> public static Archive createTestArchive() throws Exception { return DeploymentTest.createTestArchive(); }
> }
> It'd be nice if, in the case of @Deployment on a non-static class, Arquillian could just created a new instance of the class and obtain the deployment that way. So, it'd look like this:
> @RunWith(org.jboss.arquillian.junit.Arquillian.class)
> public class DeploymentTest {
> private List<Class> ejb = new ArrayList<Class>();
>
> protected void addClass(Class c) {
> ejb.add(c);
> }
> @Deployment
> public Archive createTestArchive() throws Exception { ... }
> }
> public class XXXTest extends DeploymentTest {
> {
> addClass(FooEJB.class);
> addClass(BarEJB.class);
> }
> }
> Arquillian should be able to simply do:
> new XXXTest().createTestArchive()
> in this case.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the arquillian-issues
mailing list