0 Replies Latest reply on Mar 26, 2013 9:42 AM by Stephan Herzfeld

    Arquillian ant ivy

    Stephan Herzfeld Newbie

      Hello,

       

      I want to use arquillian with ant and ivy and websphere.

       

      This is my ivy.xml:

       

      <ivy-module version="2.0">

          <info organisation="webware.preparation.risikomanagement" module="testing-arquillian" />

          <configurations>

              <conf name="compile"></conf>

          </configurations>

          <dependencies>

              <dependency org="org.jboss.arquillian.container" name="arquillian-was-remote-8"

                  rev="1.0" conf="compile->default (*)" />

              <dependency org="webware.preparation.risikomanagement"

                  name="testing-jpa" rev="1.0" conf="compile->distrib" />

              <dependency org="org.jboss.spec" name="jboss-javaee-6.0"

                  rev="1.0.0.Final" conf="compile->compile(*)">

                  <artifact name="jboss-javaee-6.0" type="pom" ext="pom" conf="" />

              </dependency>

              <dependency org="org.jboss.arquillian.junit" name="arquillian-junit-container"

                  rev="1.0.0.CR1" conf="compile->default(*)">

              </dependency>

              <dependency org="junit" name="junit" rev="4.8.1" conf="compile->default(*)" />

              <dependency org="org.jboss.arquillian.container" name="arquillian-was-remote-8"

                  rev="1.0" conf="compile->default" />

              <dependency org="org.hibernate" name="hibernate-entitymanager"

                  rev="4.1.9.Final" conf="compile->default" />

              <dependency org="org.jboss.shrinkwrap.descriptors" name="shrinkwrap-descriptors-api-javaee"

                  rev="2.0.0-alpha-4" conf="compile->default" />

              <dependency org="org.jboss.shrinkwrap.descriptors" name="shrinkwrap-descriptors-impl-javaee"

                  rev="2.0.0-alpha-4" conf="compile->default" />

              <dependency org="org.jboss.arquillian.protocol" name="arquillian-protocol-servlet"

                  rev="1.0.0.CR1" conf="compile->default" />

       

          </dependencies>

      </ivy-module>

       

       

      I have the following testclass:

       

      @RunWith(Arquillian.class)

      public class JunitForEJBTest {

       

          @EJB

          TestingForEJB testingEJB;

       

          @EJB

          TestingForEJBUserManagedTransaction testingEJBUserTransaction;

       

          @Deployment

          public static Archive<?> createDeployment() {

              Archive<?> archive = ShrinkWrap

                      .create(WebArchive.class, "test.war")

                      .addClasses(TestingForEJB.class, BlogEntry.class,

                              Commentar.class, TitleAndBlogValidationGroup.class,

                              TitleAndBlogValidator.class, TitleAndBlogValid.class,

                              TestingForEJBUserManagedTransaction.class)

                      .addAsLibraries(

                              new File(

                                      "C:/Entwicklung/workspace/arquillian-ant/lib/compile/hibernate-entitymanager.jar"),

                              new File(

                                      "C:/Entwicklung/workspace/arquillian-ant/lib/compile/antlr.jar"),

                              new File(

                                      "C:/Entwicklung/workspace/arquillian-ant/lib/compile/dom4j.jar"),

                              new File(

                                      "C:/Entwicklung/workspace/arquillian-ant/lib/compile/hibernate-commons-annotations.jar"),

                              new File(

                                      "C:/Entwicklung/workspace/arquillian-ant/lib/compile/hibernate-core.jar"),

                              new File(

                                      "C:/Entwicklung/workspace/arquillian-ant/lib/compile/hibernate-jpa-2.0-api.jar"),

                              new File(

                                      "C:/Entwicklung/workspace/arquillian-ant/lib/compile/javassist.jar"),

                              new File(

                                      "C:/Entwicklung/workspace/arquillian-ant/lib/compile/jboss-logging.jar"),

                              new File(

                                      "C:/Entwicklung/workspace/arquillian-ant/lib/compile/jboss-transaction-api_1.1_spec.jar"))

                      .addAsResource("persistence.xml", "META-INF/persistence.xml")

                      .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");

       

              return archive;

          }

       

          @Test

          public void saveNewCommentarOnNewBlogEntry() {

              BlogEntry blogEntry = new BlogEntry();

              blogEntry.setBlog("Junit Test Blog");

              blogEntry.setTitle("JunitTest Title");

              blogEntry = testingEJB.saveBlog(blogEntry);

              blogEntry = testingEJB.findBlog(blogEntry);

              Assert.assertNotNull(blogEntry);

              Commentar commentar = new Commentar();

              commentar.setCommentar("Junit Commentar");

              System.out.println("TEST 1");

              testingEJB.saveCommentarToBlog(blogEntry, commentar);

              List<Commentar> commentarList = testingEJB

                      .findCommentarsForBlog(blogEntry);

              Assert.assertTrue(commentarList.size() == 1);

              testingEJB.deleteCommentar(commentar, blogEntry);

              commentarList = testingEJB.findCommentarsForBlog(blogEntry);

              Assert.assertTrue(commentarList.size() == 1);

              testingEJB.deleteBlog(blogEntry);

              blogEntry = testingEJB.findBlog(blogEntry);

              Assert.assertNull(blogEntry);

       

          }

       

       

      My Stacktrace:

       

      junit] INFO: ssl.disable.url.hostname.verification.CWPKI0027I
          [junit] 26.03.2013 13:23:49 com.ibm.ws.amm.scan.util.AnnotationInfoDefaultVisitor visitAnnotation
          [junit] WARNING: [ com.ibm.ws.amm.scan.util.InfoVisitor@-158508 ] for method [ com.ibm.ws.amm.scan.util.info.impl.MethodInfoImpl@-158442 ( javax.persistence.AssociationOverride.joinTable ) ] Name [ null ] Description [ Ljavax/persistence/JoinTable; ] Call in violation of protocol
          [junit] 26.03.2013 13:23:52 com.ibm.ws.amm.scan.util.AnnotationInfoDefaultVisitor visitAnnotation
          [junit] WARNING: [ com.ibm.ws.amm.scan.util.InfoVisitor@-158508 ] for method [ com.ibm.ws.amm.scan.util.info.impl.MethodInfoImpl@-4544910 ( org.hibernate.annotations.JoinColumnOrFormula.formula ) ] Name [ null ] Description [ Lorg/hibernate/annotations/JoinFormula; ] Call in violation of protocol
          [junit] 26.03.2013 13:23:52 com.ibm.ws.amm.scan.util.AnnotationInfoDefaultVisitor visitAnnotation
          [junit] WARNING: [ com.ibm.ws.amm.scan.util.InfoVisitor@-158508 ] for method [ com.ibm.ws.amm.scan.util.info.impl.MethodInfoImpl@-4542852 ( org.hibernate.annotations.JoinColumnOrFormula.column ) ] Name [ null ] Description [ Ljavax/persistence/JoinColumn; ] Call in violation of protocol
          [junit] 26.03.2013 13:23:52 com.ibm.ws.amm.scan.util.AnnotationInfoDefaultVisitor visitAnnotation
          [junit] WARNING: [ com.ibm.ws.amm.scan.util.InfoVisitor@-158508 ] for method [ com.ibm.ws.amm.scan.util.info.impl.MethodInfoImpl@-4428693 ( org.hibernate.annotations.Table.foreignKey ) ] Name [ null ] Description [ Lorg/hibernate/annotations/ForeignKey; ] Call in violation of protocol
          [junit] 26.03.2013 13:23:52 com.ibm.ws.amm.scan.util.AnnotationInfoDefaultVisitor visitAnnotation
          [junit] WARNING: [ com.ibm.ws.amm.scan.util.InfoVisitor@-158508 ] for method [ com.ibm.ws.amm.scan.util.info.impl.MethodInfoImpl@-4426290 ( org.hibernate.annotations.Table.sqlInsert ) ] Name [ null ] Description [ Lorg/hibernate/annotations/SQLInsert; ] Call in violation of protocol
          [junit] 26.03.2013 13:23:52 com.ibm.ws.amm.scan.util.AnnotationInfoDefaultVisitor visitAnnotation
          [junit] WARNING: [ com.ibm.ws.amm.scan.util.InfoVisitor@-158508 ] for method [ com.ibm.ws.amm.scan.util.info.impl.MethodInfoImpl@-4424246 ( org.hibernate.annotations.Table.sqlUpdate ) ] Name [ null ] Description [ Lorg/hibernate/annotations/SQLUpdate; ] Call in violation of protocol
          [junit] 26.03.2013 13:23:52 com.ibm.ws.amm.scan.util.AnnotationInfoDefaultVisitor visitAnnotation
          [junit] WARNING: [ com.ibm.ws.amm.scan.util.InfoVisitor@-158508 ] for method [ com.ibm.ws.amm.scan.util.info.impl.MethodInfoImpl@-4422209 ( org.hibernate.annotations.Table.sqlDelete ) ] Name [ null ] Description [ Lorg/hibernate/annotations/SQLDelete; ] Call in violation of protocol
          [junit] 26.03.2013 13:23:52 com.ibm.ws.amm.scan.util.AnnotationInfoDefaultVisitor visitAnnotation
          [junit] WARNING: [ com.ibm.ws.amm.scan.util.InfoVisitor@-5937753 ] for method [ com.ibm.ws.amm.scan.util.info.impl.MethodInfoImpl@-5937687 ( javax.persistence.AssociationOverride.joinTable ) ] Name [ null ] Description [ Ljavax/persistence/JoinTable; ] Call in violation of protocol
          [junit] 26.03.2013 13:23:54 com.ibm.ws.amm.scan.util.AnnotationInfoDefaultVisitor visitAnnotation
          [junit] WARNING: [ com.ibm.ws.amm.scan.util.InfoVisitor@-10567336 ] for method [ com.ibm.ws.amm.scan.util.info.impl.MethodInfoImpl@-8725445 ( org.hibernate.annotations.JoinColumnOrFormula.formula ) ] Name [ null ] Description [ Lorg/hibernate/annotations/JoinFormula; ] Call in violation of protocol
          [junit] 26.03.2013 13:23:54 com.ibm.ws.amm.scan.util.AnnotationInfoDefaultVisitor visitAnnotation
          [junit] WARNING: [ com.ibm.ws.amm.scan.util.InfoVisitor@-10567336 ] for method [ com.ibm.ws.amm.scan.util.info.impl.MethodInfoImpl@-8723378 ( org.hibernate.annotations.JoinColumnOrFormula.column ) ] Name [ null ] Description [ Ljavax/persistence/JoinColumn; ] Call in violation of protocol
          [junit] 26.03.2013 13:23:54 com.ibm.ws.amm.scan.util.AnnotationInfoDefaultVisitor visitAnnotation
          [junit] WARNING: [ com.ibm.ws.amm.scan.util.InfoVisitor@-10567336 ] for method [ com.ibm.ws.amm.scan.util.info.impl.MethodInfoImpl@-8613047 ( org.hibernate.annotations.Table.foreignKey ) ] Name [ null ] Description [ Lorg/hibernate/annotations/ForeignKey; ] Call in violation of protocol
          [junit] 26.03.2013 13:23:54 com.ibm.ws.amm.scan.util.AnnotationInfoDefaultVisitor visitAnnotation
          [junit] WARNING: [ com.ibm.ws.amm.scan.util.InfoVisitor@-10567336 ] for method [ com.ibm.ws.amm.scan.util.info.impl.MethodInfoImpl@-8610635 ( org.hibernate.annotations.Table.sqlInsert ) ] Name [ null ] Description [ Lorg/hibernate/annotations/SQLInsert; ] Call in violation of protocol
          [junit] 26.03.2013 13:23:54 com.ibm.ws.amm.scan.util.AnnotationInfoDefaultVisitor visitAnnotation
          [junit] WARNING: [ com.ibm.ws.amm.scan.util.InfoVisitor@-10567336 ] for method [ com.ibm.ws.amm.scan.util.info.impl.MethodInfoImpl@-8608582 ( org.hibernate.annotations.Table.sqlUpdate ) ] Name [ null ] Description [ Lorg/hibernate/annotations/SQLUpdate; ] Call in violation of protocol
          [junit] 26.03.2013 13:23:54 com.ibm.ws.amm.scan.util.AnnotationInfoDefaultVisitor visitAnnotation
          [junit] WARNING: [ com.ibm.ws.amm.scan.util.InfoVisitor@-10567336 ] for method [ com.ibm.ws.amm.scan.util.info.impl.MethodInfoImpl@-8606536 ( org.hibernate.annotations.Table.sqlDelete ) ] Name [ null ] Description [ Lorg/hibernate/annotations/SQLDelete; ] Call in violation of protocol
          [junit] 26.03.2013 13:23:54 ArchiveInputStreamData mapData
          [junit] INFO: Collision on [ org/jboss/arquillian/protocol/servlet/runner/ServletTestRunner.class ] in [ WEB-INF/lib/arquillian-protocol.jar ]
          [junit] 26.03.2013 13:23:58 org.jboss.arquillian.container.was.remote_8.WebSphereRemoteContainer deploy
          [junit] INFO: Target server for deployment is WebSphere:cell=wwdeveloper-PCNode01Cell,node=wwdeveloper-PCNode01,server=server1
          [junit] 26.03.2013 13:24:23 org.jboss.arquillian.container.was.remote_8.WebSphereRemoteContainer deploy
          [junit] INFO: Application was started on the following targets: WebSphere:cell=wwdeveloper-PCNode01Cell,node=wwdeveloper-PCNode01,server=server1
          [junit] ------------- ---------------- ---------------
          [junit] Testcase: saveNewCommentarOnNewBlogEntry took 3,759 sec
          [junit]     Caused an ERROR
          [junit] null
          [junit] java.lang.NullPointerException
          [junit]     at org.arquilllian.example.JunitForEJBTest.saveNewCommentarOnNewBlogEntry(Unknown Source)
          [junit]     at org.jboss.arquillian.junit.Arquillian$6$1.invoke(Arquillian.java:246)
          [junit]     at org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.java:60)
          [junit]     at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
          [junit]     at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
          [junit]     at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
          [junit]     at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:134)
          [junit]     at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:114)
          [junit]     at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
          [junit]     at org.jboss.arquillian.container.test.impl.execution.ContainerTestExecuter.execute(ContainerTestExecuter.java:38)
          [junit]     at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
          [junit]     at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
          [junit]     at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
          [junit]     at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:82)
          [junit]     at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
          [junit]     at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
          [junit]     at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:68)
          [junit]     at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
          [junit]     at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
          [junit]     at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:54)
          [junit]     at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
          [junit]     at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
          [junit]     at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:134)
          [junit]     at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:111)
          [junit]     at org.jboss.arquillian.junit.Arquillian$6.evaluate(Arquillian.java:239)
          [junit]     at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:202)
          [junit]     at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:290)
          [junit]     at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:45)
          [junit]     at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:216)
          [junit]     at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:161)
          [junit]     at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:290)
          [junit]     at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:45)
          [junit]     at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:175)
          [junit]     at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:123)
          [junit]     at org.jboss.arquillian.junit.container.JUnitTestRunner.execute(JUnitTestRunner.java:65)
          [junit]     at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.executeTest(ServletTestRunner.java:160)
          [junit]     at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.execute(ServletTestRunner.java:126)
          [junit]     at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.doGet(ServletTestRunner.java:90)
          [junit]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:575)
          [junit]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
          [junit]     at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1147)
          [junit]     at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:722)
          [junit]     at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:449)
          [junit]     at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
          [junit]     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1020)
          [junit]     at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3639)
          [junit]     at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
          [junit]     at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:950)
          [junit]     at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1659)
          [junit]     at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195)
          [junit]     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)
          [junit]     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)
          [junit]     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)
          [junit]     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:276)
          [junit]     at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
          [junit]     at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
          [junit]     at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
          [junit]     at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
          [junit]     at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
          [junit]     at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
          [junit]     at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
          [junit]     at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
          [junit]     at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
          [junit]     at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1648)
          [junit] Test org.arquilllian.example.JunitForEJBTest FAILED

       

       

      I am getting a Nullpointerexception for the injected ejb(@EJB  TestingForEJB testingEJB). Additionally i have two dependencis for two ibm libraries (was_public.jar, com.ibm.ws.admin.client_8.0.0.jar). Can you  help me?

       

       

      Regards

       

      Stephan