[arquillian-issues] [JBoss JIRA] Created: (ARQ-254) Use @Deployment on non-static method

Elias Ross (JIRA) jira-events at lists.jboss.org
Thu Aug 12 13:19:49 EDT 2010


Use @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



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 static Archive createTestArchive() throws Exception { ... }

}

public class XXXTest extends DeploymentTest {

    {
        addClass(FooEJB.class);
        addClass(BarEJB.class);
    }

}

e.g. you do new XXXTest().createTestArchive() instead...


-- 
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