I've gotten the examples working...now trying to use Arquillian to test an existing EJB project to no avail
flossware Feb 4, 2014 2:16 PMI've been able to use the examples provided with great success This includes using JBoss EAP 6.1 - works like a charm.
However, when attempting to now leverage Arquillian within my existing JEE project(s) I am having mixed results...
For starters I put the appropriate configuration in my parent pom (the pom.xml attachment contains parts of my parent pom denoting what I've done but is not the complete pom.xml)...
I then tried a simple test against some of my EJBs in one of my child sub-projects and noted that the container (EAP 6.1) started but nothing deployed. Of course, I presumed I either messed up my parent pom...or I did something else wrong...
So, I made a "new" child sub-project that inherited the parent pom and copied the code out of the area I was working with the Arquillian examples to test to see if it worked... And it did...
So leveraging the parent pom works fine I added this to the BasketTest just for fun:
@Deployment
public static JavaArchive createDeployment() {
JavaArchive retVal = ShrinkWrap.create(JavaArchive.class, "test.jar")
.addClasses(Basket.class, OrderRepository.class, SingletonOrderRepository.class)
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
System.out.println ("\n*****\n" + retVal.toString(true) + "\n******\n");
return retVal;
}
When the tests run, I see the deploy happen as well as the System.out.println above:
*****
test.jar:
/META-INF/
/META-INF/beans.xml
/org/
/org/arquillian/
/org/arquillian/example/
/org/arquillian/example/SingletonOrderRepository.class
/org/arquillian/example/Basket.class
/org/arquillian/example/OrderRepository.class
******
14:08:04,639 INFO [org.jboss.as.repository] (management-handler-thread - 3) JBAS014900: Content added at location /home/sfloess/Tools/jboss-eap-6.1-arquillian/standalone/data/content/41/06d7b776caae94b290486c1b8fa8b8e7ff4e29/content
14:08:04,643 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "test.jar" (runtime-name: "test.jar")
14:08:04,747 INFO [org.jboss.weld.deployer] (MSC service thread 1-5) JBAS016002: Processing weld deployment test.jar
14:08:04,757 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-5) JNDI bindings for session bean named SingletonOrderRepository in deployment unit deployment "test.jar" are as follows:
java:global/test/SingletonOrderRepository!org.arquillian.example.OrderRepository
java:app/test/SingletonOrderRepository!org.arquillian.example.OrderRepository
java:module/SingletonOrderRepository!org.arquillian.example.OrderRepository
java:global/test/SingletonOrderRepository
java:app/test/SingletonOrderRepository
java:module/SingletonOrderRepository
I am running maven as such:
mvn -P JBoss-EAP-6.1 -DjbossHome=[path to EAP 6.1] clean install test
Please note, the value I do use for jbossHome does point to my EAP 6.1 dir
I then decided to grab the pom from my EJB sub-project and copy it to the new arquillian sub-project to see if that's the culprit. Sure enough, the container starts but nothing is deployed. In fact, I never see the output either (meaning the createDeployment is not being called). Again, I use the aforementioned maven command line...
Oddly, I thought I'd omit the JBoss-EAP-6.1 profile to see what happens... Interestingly enough I do see the System.out's happen - so I know Arquillian is working...but of course it fails because I didn't specify the container: org.arquillian.example.BasketTest: DeploymentScenario contains a target (_DEFAULT_) not matching any defined Container in the registry.(..)
So what I see is when I enable my JBoss-EAP-6.1 profile something breaks in such a way that Arquillian doesn't run the test (note the Deployment annotated method is not called).
I'm betting there is some dependency mess getting in the way on my end (in my pom) but I'm not sure what it is or how to better diagnose/fix...
Any and all help is appreciated!!!!
-
pom.xml 2.0 KB
-
arquillian.xml 570 bytes