[arquillian-issues] [JBoss JIRA] Updated: (ARQ-254) Allow the use of @Deployment on non-static method
Elias Ross (JIRA)
jira-events at lists.jboss.org
Thu Aug 12 13:23:49 EDT 2010
[ https://jira.jboss.org/browse/ARQ-254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Elias Ross updated ARQ-254:
---------------------------
Summary: Allow the use of @Deployment on non-static method (was: Use @Deployment on non-static method)
Description:
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.
was:
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...
> 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
>
> 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