2 Replies Latest reply on May 2, 2014 8:33 AM by Libor Krzyžanek

    Run Arquillian tests during Openshift deployment

    Libor Krzyžanek Apprentice

      Hi there,

      I'm trying to run Arquillian test as a part of Openshift deployment.

      I read article http://arquillian.org/guides/testing_in_the_cloud/ and other posts like Testing persistence with Arquillian on OpenShift | Planet JBoss Community but they cover running Arquilliann test separately on Openshift which is different use case.

       

      I guess it should be doable because I know where is JBOSS_HOME, what is JMX IP address and port (via Openshift's system variables).

      arquillian.xml is:

      <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">
      
      
          <!--Uncomment to have test archives exported to the file system for inspection -->
          <engine>
              <property name="deploymentExportPath">target/</property>
          </engine>
      
      
        <container qualifier="jbossas-managed-7" default="true">
        <configuration>
        <property name="jbossHome">${arquillian.jboss.home}</property>
        <property name="managementAddress">${arquillian.jboss.managementAddress}</property>
        <property name="managementPort">${arquillian.jboss.managementPort}</property>
        <property name="javaVmArguments">-Xms1024m -Xmx1024m -XX:MaxPermSize=512m</property>
        <property name="startupTimeoutInSeconds">30</property>
        <property name="outputToConsole">true</property>
        </configuration>
        </container>
      
      
      </arquillian>
      

       

      and maven replaces those values via filtering see here:  pom.xml (branch iss12).

       

      When I push git repo to Openshift Arquillian is able to start EAP but waits 30 sec and ends with

      org.jboss.arquillian.container.spi.client.container.LifecycleException: Could not start container
              at org.jboss.as.arquillian.container.managed.ManagedDeployableContainer.startInternal(ManagedDeployableContainer.java:176)
              at org.jboss.as.arquillian.container.CommonDeployableContainer.start(CommonDeployableContainer.java:110)
              at org.jboss.arquillian.container.impl.ContainerImpl.start(ContainerImpl.java:199)
              at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$8.perform(ContainerLifecycleController.java:163)
              at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$8.perform(ContainerLifecycleController.java:157)
              at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.forContainer(ContainerLifecycleController.java:255)
              at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.startContainer(ContainerLifecycleController.java:156)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:606)
              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
              at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
              at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
              at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:57)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:606)
              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
              at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
              at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
              at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
              at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
              at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$2.perform(ContainerLifecycleController.java:77)
      

       

      It seems to me that Arquillian has problem to connect to started AS.

      We uses Openshift's default standalone.xml see here: searchisko/.openshift/config/standalone.xml

       

      Any idea where is the problem?

       

      Thanks,

      Libor

        • 1. Re: Run Arquillian tests during Openshift deployment
          Karel Piwko Master

          Hi Libor,

           

          try to set up host address for protocol. It is apparently not running on localhost (127.0.0.1). You can do that by including <protocol> into <container> configuration, more details here:

           

          Servlet 3.0 - Arquillian - Project Documentation Editor

           

          I would also recommend to setup protocol to Servlet 3.0 via <defaultProtocol> tag - JBoss AS 7.1, JBoss EAP 6.0 - Managed - Arquillian - Project Documentation Editor

           

          HTH,

           

          Karel

          • 2. Re: Re: Run Arquillian tests during Openshift deployment
            Libor Krzyžanek Apprentice

            Hi,

            AS is running on different IP for sure.

             

            I tried to add configuration as you mentioned but with no luck.

            Could you please check it: searchisko/ftest/src/test/resources/arquillian.xml at iss78 · searchisko/searchisko · GitHub

             

            Output from Maven:

            remote: INFO: Starting container with: [/etc/alternatives/java_sdk_1.7.0/bin/java, -Xms1024m, -Xmx1024m, -XX:MaxPermSize=512m, -ea, -Djboss.home.dir=/var/lib/openshift/535f90d75004466353000af6/jbosseap/, -Dorg.jboss.boot.log.file=/var/lib/openshift/535f90d75004466353000af6/jbosseap/standalone/log/boot.log, -Dlogging.configuration=file:/var/lib/openshift/535f90d75004466353000af6/jbosseap/standalone/configuration/logging.properties, -Djboss.bundles.dir=/var/lib/openshift/535f90d75004466353000af6/jbosseap//bundles, -jar, /var/lib/openshift/535f90d75004466353000af6/jbosseap/jboss-modules.jar, -mp, /var/lib/openshift/535f90d75004466353000af6/jbosseap//modules, -jaxpmodule, javax.xml.jaxp-provider, org.jboss.as.standalone, -server-config, standalone.xml]
            remote: Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 35.996 sec <<< FAILURE!
            remote: org.searchisko.ftest.ProviderRestServiceTest  Time elapsed: 35.995 sec  <<< ERROR!
            remote: org.jboss.arquillian.container.spi.client.container.LifecycleException: Could not start container
            

             

            AS log:

            014/05/02 08:27:31,284 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-4) JBAS010406: Registered connection factory java:/JmsXA
            2014/05/02 08:27:31,382 INFO  [org.hornetq.ra] (MSC service thread 1-4) HornetQ resource adaptor started
            2014/05/02 08:27:31,383 INFO  [org.jboss.as.connector.services.resourceadapters.ResourceAdapterActivatorService$ResourceAdapterActivator] (MSC service thread 1-4) IJ020002: Deployed: file://RaActivatorhornetq-ra
            2014/05/02 08:27:31,387 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-1) JBAS010401: Bound JCA ConnectionFactory [java:/JmsXA]
            2014/05/02 08:27:31,561 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.6.42.129:9990/management
            2014/05/02 08:27:31,561 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.6.42.129:9990
            2014/05/02 08:27:31,562 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss EAP 6.2.2.GA (AS 7.3.2.Final-redhat-2) started in 15714ms - Started 160 of 300 services (137 services are passive or on-demand)
            
            
            
            
            
            
            2014/05/02 08:27:48,188 INFO  [org.apache.coyote.http11] (MSC service thread 1-4) JBWEB003075: Coyote HTTP/1.1 pausing on: http-127.6.42.129/127.6.42.129:8080
            2014/05/02 08:27:48,229 INFO  [org.apache.coyote.http11] (MSC service thread 1-4) JBWEB003077: Coyote HTTP/1.1 stopping on : http-127.6.42.129/127.6.42.129:8080
            2014/05/02 08:27:48,254 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-2) JBAS010410: Unbound JCA ConnectionFactory [java:/JmsXA]
            2014/05/02 08:27:48,254 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010409: Unbound data source [java:jboss/datasources/ExampleDS]
            2014/05/02 08:27:48,269 INFO  [org.jboss.jaxr] (MSC service thread 1-3) JBAS014002: UnBinding JAXR ConnectionFactory: java:jboss/jaxr/ConnectionFactory
            2014/05/02 08:27:48,342 INFO  [org.jboss.as.messaging] (ServerService Thread Pool -- 27) JBAS011605: Unbound messaging object to jndi name java:jboss/exported/jms/RemoteConnectionFa
            

             

            Thanks,

            Libor