1 Reply Latest reply on Jul 22, 2016 10:29 AM by mjobanek

    Remote Arquillian Test on Wildfly 10 fail when container running on a remote machine

    axelberle

      I just tested a simple example setup of how to run a remote test on Wildfly 10. I posted an issue here: Remote Wildfly 10 Test fail when running on a remote machine  · Issue #1 · MatousJobanek/examples · GitHub

       

      Could anybody share a working wildfly 10 or 9 setup, that permit the remote execution of arquillian tests? This seems to be a little bit difficult, and I cannot figure out if it is an Arquillian issue or a Wildfly issue.

      Anyhow this is what happens:

       

       

      1. This is the test project: examples/wildfly-arquillian/wildfly-arquillian-remote-example at master · MatousJobanek/examples · GitHub
      2. I added the following arquillian.xml, configuring the access to the remote machine on IP 192.168.0.91

        <?xml version="1.0" encoding="UTF-8"?>
        <arquillian xmlns="http://jboss.org/schema/arquillian"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
          <container qualifier="wildfly-remote" default="true">
          <configuration>
          <property name="managementAddress">192.168.0.91</property>
          <property name="managementPort">9990</property>
          <property name="username">admin</property>
          <property name="password">1admin1</property>
          </configuration>
          </container>
        </arquillian>
      3. The wildfly 10 has the following standalone.xml config:

          ...
        
          <interfaces>
          <interface name="management">
          <any-address/>
          </interface>
          <interface name="public">
          <any-address/>
          </interface>
          </interfaces>
        
          <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
          <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
          <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/>
          <socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
          <socket-binding name="http" port="${jboss.http.port:8080}"/>
          <socket-binding name="https" port="${jboss.https.port:8443}"/>
          <socket-binding name="txn-recovery-environment" port="4712"/>
          <socket-binding name="txn-status-manager" port="4713"/>
          <outbound-socket-binding name="mail-smtp">
          <remote-destination host="localhost" port="25"/>
          </outbound-socket-binding>
          </socket-binding-group>
      4. The machine running the test via maven has the following output:

        ...
        Caused by: java.lang.IllegalStateException: Error launching request at http://127.0.0.1:8080/test/ArquillianServletRunner?outputMode=serializedObject&className=org.jboss.arquillian.wildfly.remote.example.EmptyDeploymentTest&methodName=emptyInContainerTest. No result returned
          at org.jboss.arquillian.protocol.servlet.ServletMethodExecutor.executeWithRetry(ServletMethodExecutor.java:139)
          at org.jboss.arquillian.protocol.servlet.ServletMethodExecutor.invoke(ServletMethodExecutor.java:99)
          ... 82 more
      5. The remote machine running wildfly 10 shows the following output (it seems arquillian connects to the wildlfy container and succeeds in depoying the test, but I think it does not get executed (no System.out.println showing) .

      ...
      13:56:06,990 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0012: Started server default-server.
      13:56:07,139 INFO [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0018: Host default-host starting
      13:56:07,242 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0006: Undertow HTTP listener default listening on 0.0.0.0:8080
      13:56:07,522 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) WFLYJCA0001: Bound data source [java:jboss/jdbc/carf_test_integration]
      13:56:08,071 INFO [org.jboss.ws.common.management] (MSC service thread 1-2) JBWS022052: Starting JBossWS 5.1.3.Final (Apache CXF 3.1.4) 
      13:56:08,196 INFO [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-2) ISPN000128: Infinispan version: Infinispan 'Mahou' 8.1.0.Final
      13:56:08,279 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-2) WFLYDS0013: Started FileSystemDeploymentService for directory /opt/jboss/wildfly/standalone/deployments
      13:56:08,619 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://0.0.0.0:9990/management
      13:56:08,625 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://0.0.0.0:9990
      13:56:08,625 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final) started in 5321ms - Started 267 of 553 services (371 services are lazy, passive or on-demand)
      13:56:34,212 INFO [org.jboss.as.repository] (management-handler-thread - 1) WFLYDR0001: Content added at location /opt/jboss/wildfly/standalone/data/content/78/693a4aa9b50b6207e99f3fc84f0077b3be50be/content
      13:56:34,245 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0027: Starting deployment of "test.war" (runtime-name: "test.war")
      13:56:35,002 WARN [org.jboss.weld.deployer] (MSC service thread 1-2) WFLYWELD0013: Deployment deployment "test.war" contains CDI annotations but no bean archive was not found. (No beans.xml nor class with bean defining annotations)
      13:56:35,362 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 63) WFLYUT0021: Registered web context: /test
      13:56:35,472 INFO [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0010: Deployed "test.war" (runtime-name : "test.war")
      13:56:37,015 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 63) WFLYUT0022: Unregistered web context: /test
      13:56:37,070 INFO [org.hibernate.validator.internal.util.Version] (MSC service thread 1-2) HV000001: Hibernate Validator 5.2.3.Final
      13:56:37,178 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0028: Stopped deployment test.war (runtime-name: test.war) in 169ms
      13:56:37,244 INFO [org.jboss.as.repository] (management-handler-thread - 2) WFLYDR0002: Content removed from location /opt/jboss/wildfly/standalone/data/content/78/693a4aa9b50b6207e99f3fc84f0077b3be50be/content
      13:56:37,245 INFO [org.jboss.as.server] (management-handler-thread - 2) WFLYSRV0009: Undeployed "test.war" (runtime-name: "test.war")
      
      

       

           6. The test being run:

       

      package org.jboss.arquillian.wildfly.remote.example;
      
      import org.jboss.arquillian.container.test.api.Deployment;
      import org.jboss.arquillian.junit.Arquillian;
      import org.jboss.shrinkwrap.api.Archive;
      import org.jboss.shrinkwrap.api.ShrinkWrap;
      import org.jboss.shrinkwrap.api.spec.WebArchive;
      import org.junit.Test;
      import org.junit.runner.RunWith;
      
      /**
       * @author <a href="mailto:mjobanek@redhat.com">Matous Jobanek</a>
       */
      @RunWith(Arquillian.class)
      public class EmptyDeploymentTest {
      
          @Deployment
          public static Archive deploy(){
              return ShrinkWrap.create(WebArchive.class, "test.war");
          }
      
          @Test
          public void emptyInContainerTest(){
              System.out.println("=========================================");
              System.out.println("This test should run inside the container");
              System.out.println("=========================================");
          }
      }
      

       

           7. The pom.xml is:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <project xmlns="http://maven.apache.org/POM/4.0.0"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
          <modelVersion>4.0.0</modelVersion>
      
          <groupId>org.jboss.arquillian</groupId>
          <artifactId>wildfly-arquillian-remote-example</artifactId>
          <version>1.0-SNAPSHOT</version>
      
          <dependencyManagement>
              <dependencies>
                  <dependency>
                      <groupId>org.jboss.arquillian</groupId>
                      <artifactId>arquillian-bom</artifactId>
                      <version>1.1.11.Final</version>
                      <scope>import</scope>
                      <type>pom</type>
                  </dependency>
              </dependencies>
          </dependencyManagement>
      
          <dependencies>
              <dependency>
                  <groupId>junit</groupId>
                  <artifactId>junit</artifactId>
                  <version>4.12</version>
              </dependency>
              <dependency>
                  <groupId>org.jboss.arquillian.junit</groupId>
                  <artifactId>arquillian-junit-container</artifactId>
              </dependency>
              <dependency>
                  <groupId>org.wildfly.arquillian</groupId>
                  <artifactId>wildfly-arquillian-container-remote</artifactId>
                  <version>2.0.0.Final</version>
              </dependency>
          </dependencies>
      
      </project>
      

       

      Could someone post a sample wildfly standalone.xml setup showing how to do it?

       

      Thanks,

       

      Axel