5 Replies Latest reply on Dec 30, 2016 7:39 AM by willrock

    Remote tests with manual deployment

    brettcave

      I have configured an arquillian test environment with tomcat 6 remote. But, instead of using ShrinkWrap to package a war and then deploy to tomcat using the manager (via arquillian tomcat-6-remote container), I would like to manually package the war, deploy it to tomcat and then run tests against it (using the arquillian servlet runner)

       

      This is what I have done so far:

      1. Package the default war that gets deployed to the app server.
      2. Add arquillian libraries to the WEB-INF/lib. This includes: arquillian-core, arquillian-junit, arquillian-testenricher-cdi, arquillian-testenricher-initialcontext and testenricher-resource, as well as async-http-tomcat6-2.2.2.GA.jar
      3. Update web.xml with ArquillianServletRunner servlet + mapping
      4. Added WEB-INF/META-INF/org.jboss.arquillian.core.spi.LoadableExtension with contents "org.jboss.arquillian.protocol.servlet.runner.ServletRemoteExtension"
      5. Added a test class to the archive, in WEB-INF/classes. The test class is annotated with @RunWith(Arquillian.class). The @Deployment method has been removed.
      6. The archive is deployed to tomcat 6 as "test" (exploded war)
      7. The manager has been removed. JMX is configured in arquillian.xml on the classpath (not packaged or deployed in the container).

       

      The test case looks something like:

       

      @RunWith(Arquillian.class)
      public class MyServiceTestCase {
      
          @Inject
          Identity identity;
      
          @Test
          public void testService() {
              Assert.assertNotNull(identity);
          }
      
      }
      

       

      The test fails.

       

      arquillian.xml is as follows (though surely the manager details are redundant, as that is only used for deployment, and only the host and jmxPort would be used?):

       

      <?xml version="1.0"?>
      <arquillian
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xmlns="http://jboss.org/schema/arquillian"
              xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
      
          <container qualifier="tomcat" default="true">
              <configuration>
                  <property name="jmxPort">8099</property>
                  <property name="host">localhost</property>
                  <property name="port">8080</property>
                  <property name="user">somemanager</property>
                  <property name="pass">somepass</property>
              </configuration>
          </container>
      </arquillian>
      

       

      How would I run tests against the remote container without manually deploying?