0 Replies Latest reply on Aug 18, 2010 7:58 PM by michaelschuetz

    JunitRunner ignores Arquillian

    michaelschuetz

      Hi to all,

       

      together with my colleague we spent half day in hunting following unexpected behavior:

       

      We have an JMS integration test which uses cargo to start AS4.2 and arquillian to start and execute tests against AS 5.1. Both containers are connected with each other due to JMS (jboss messaging). What happens whilst executing test is that cargo works as expected, but AS5.1 arquillian test was not executed within container. Instead, it was executed as plain unit test. No exceptions. After not understanding and building back step by step, we finally found the problem:

       

      We did not use junit directly, we did use following (hidden) transititve dependencies:

       

      <dependency>

                      <groupId>junit</groupId>

                      <artifactId>junit-dep</artifactId>

                      <version>4.8.1</version>

                      <scope>test</scope>

                  </dependency>


                  <dependency>

                      <groupId>org.hamcrest</groupId>

                      <artifactId>hamcrest-all</artifactId>

                      <version>1.2</version>

                      <scope>test</scope>

                  </dependency>

       

      With that configuration, JunitRunner ignores Arquillian completely. This was not so easy to spot cause those dependencies were defined in parent POM.

       

      After switching back to selfcontained Junit dependency, everything works as expected:

       

      <dependency>

                      <groupId>junit</groupId>

                      <artifactId>junit</artifactId>

                      <version>4.8.1</version>

                      <scope>test</scope>

                  </dependency>

       

      Hm, so is that an arquillian issue? Or is there something arquillian can do to reveal this, at least? Because not having any exception provided makes finding bug quite hard and frustrating.

       

       

      Thanks and regards

      Michael