Choosing your Container
alrubinger Feb 5, 2010 5:28 PMEarlier today a bunch of us had a discussion in #jbosstesting on Freenode about some explicit metadata to mark a test as targeted for a particular container.
Currently the implementation picks the container using the service provider mechanism, based upon what's on the classpath. This makes things difficult in the case where you've got more than one target container visible to the TCCL.
Case in point, the "demo" module of Arquillian has:
<profiles> <profile> <id>weld-se</id> <dependencies> <dependency> <groupId>org.jboss.arquillian</groupId> <artifactId>arquillian-weld-embedded</artifactId> <version>${project.version}</version> </dependency> </dependencies> </profile> <profile> <id>jboss-embedded</id> <dependencies> <dependency> <groupId>org.jboss.arquillian</groupId> <artifactId>arquillian-jboss-embedded</artifactId> <version>${project.version}</version> </dependency> </dependencies> </profile> ... </profiles>
Here we set up the classpath specific to a particular profile.
Now we go to run the default build lifecycle: "mvn clean install". No target container is on the ClassPath, and we fail. Assume we explicitly pass in a profile using -P: we're now testing only one of the containers.
I think what we need is a way to execute tests for all containers, all within the same build cycle. CI should be able to run once, and hit as many targets as configured. Look to the ClassPath as a default, but if non-deterministic, require some more metadata. Much like how @EJB injection will work on unique beanInterface alone, but oif not unique, we need beanName as well.
In the meantime I'll set up the surefire config to either ignore or skip these tests: for instance "weld-se" profile fails with NoClassDefFoundError.
S,
ALR