2 Replies Latest reply on Jun 28, 2015 5:06 PM by Paul Holding

    Arquillian integration tests fail with Glassfish container but work with Wildfly container

    Paul Holding Newbie

      Hi

      I'm working on a project that makes use of Arquillian and Maven to perform integration tests against a remote Glassfish 4.1 container and a remote Wildfly 8.2 container. When the tests are running against the remote Wildfly container everything works fine, however when running against the remote Glassfish container the tests fail with a series of errors.

      The Maven output reports an internal server error and also shows that the test failed due to a NullPointerException but I believe this is actually a result of the Shrinkwrap deployment not being deployed to the Glassfish container rather than an error in the code itself.

      The Glassfish server log shows no sign of anything being deployed to the container but there is a TimeoutException recorded in the log file when the integration test is run.

      What I don't understand is what I'm doing wrong that prevents the test running against a remote Glassfish 4.1 container. Given that the same test passes without any problems on a remote Wildfly 8.2 container, I believe the problem lies with the Arquillian configuration in my project rather than the code being tested.

      The relevant section of the arquillian.xml file is as follows

      <container qualifier="arquillian-glassfish-remote">

        <configuration>

         <property name="adminUser">xxxx</property>

         <property name="adminPassword">xxxx</property>

         <property name="adminHttps">true</property>

         <property name="adminHost">xxxx</property>

         <property name="adminPort">4848</property>

         <property name="target">server</property>

        </configuration>

        <protocol type="Servlet 3.0">

         <property name="host">xxxx</property>

         <property name="port">8080</property>

        </protocol>

      </container>

      The relevant section of the pom.xml file is as follows:

      <dependencies>

        <!-- Java EE Dependencies -->

        <dependency>

          <groupId>javax</groupId>

         <artifactId>javaee-api</artifactId>

         <version>7.0</version>

        </dependency>

        <!-- Internal Dependencies -->

        <dependency>

          <groupId>${project.groupId}</groupId>

          <artifactId>project-ejb</artifactId>

          <version>${project.version}</version>

        </dependency>

        <!-- Test Dependencies -->

        <dependency>

          <groupId>junit</groupId>

          <artifactId>junit</artifactId>

          <version>4.12</version>

          <scope>test</scope>

        </dependency>

        <dependency>

          <groupId>org.jboss.arquillian.junit</groupId>

          <artifactId>arquillian-junit-container</artifactId>

          <scope>test</scope>

        </dependency>

      </dependencies>

      ...

      <profile>

        <id>arquillian-glassfish-remote</id>

        <dependencies>

          <dependency>

            <groupId>org.jboss.arquillian.container</groupId>

            <artifactId>arquillian-glassfish-remote-3.1</artifactId>

            <version>1.0.0.CR4</version>

            <scope>test</scope>

          </dependency>

        </dependencies>

        <build>

          <testResources>

            <testResource>

              <directory>src/test/resources</directory>

            </testResource>

          </testResources>

          <plugins>

            <plugin>

              <groupId>org.apache.maven.plugins</groupId>

              <artifactId>maven-failsafe-plugin</artifactId>

              <configuration>

                <encoding>UTF-8</encoding>

                <includes>

                  <include>**/IT*.java</include>

                  <include>**/*IT.java</include>

                  <include>**/*ITCase.java</include>

                </includes>

                <systemPropertyVariables>

                  <arquillian.launch>arquillian-glassfish-remote</arquillian.launch>

                </systemPropertyVariables>

              </configuration>

              <executions>

                <execution>

                  <goals>

                    <goal>integration-test</goal>

                    <goal>verify</goal>

                  </goals>

                </execution>

              </executions>

            </plugin>

          </plugins>

        </build>

      </profile>

      The relevant section of the parent pom.xml is as follows:

      <dependencyManagement>

        <dependencies>

          <dependency>

            <groupId>org.jboss.arquillian</groupId>

            <artifactId>arquillian-bom</artifactId>

            <version>1.1.8.Final</version>

            <scope>import</scope>

            <type>pom</type>

          </dependency>

        </dependencies>

      </dependencyManagement>

      I've also uploaded the relevant sections of the Maven output and Glassfish server.log file to PasteBin as otherwise this post would be too long. The respective URLs are http://pastebin.com/mR1N3P6z and Arquillian Glassfish issue server.log output - Pastebin.com

      Is anyone able to offer any suggestions or pointers as to where I might be going wrong.

       

      Many Thanks

       

      Paul