Remote tests with manual deployment
brettcave Nov 9, 2011 6:21 AMI 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:
- Package the default war that gets deployed to the app server.
- 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
- Update web.xml with ArquillianServletRunner servlet + mapping
- Added WEB-INF/META-INF/org.jboss.arquillian.core.spi.LoadableExtension with contents "org.jboss.arquillian.protocol.servlet.runner.ServletRemoteExtension"
- 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.
- The archive is deployed to tomcat 6 as "test" (exploded war)
- 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?