I want to test a Java EE application with Arquillian. A simple installation works to enable test classes on an Arquillian-managed server to test them.
Now I want to use the EAR file that was created during the build process. Via
@Deployment public static EnterpriseArchive createDeployment() { File earFile = ... EnterpriseArchive archive = ShrinkWrap.createFromZipFile(EnterpriseArchive.class, earFile); return archive; }
I can put an EAR through Arquillian in JBoss. I see the deployment, and there are no errors during the deployment. Only Arkillian returns with the error that he cannot find a test class, which is obviously good.
Now the question is where to put the test class. I can put the test class in test.war placed in EAR by Arquillian, but I get an ArquillianServletRunner exception that is not found. When I put test classes in JAR files as a module or library, test classes are not detected when installed as a module or injections do not work when they are placed in libraries due to dependency problems.
Where do I need to put test classes on ???
My arquillian.xml:
<?xml version="1.0" encoding="UTF-8"?> <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"> <defaultProtocol type="Servlet 3.0" /> <container qualifier="jboss7" default="true"> <configuration> <property name="jbossHome">${cargo.dir}/jboss-as-dist-7.1.1.Final/jboss-as-7.1.1.Final</property> </configuration> </container> <engine> <property name="deploymentExportPath">target/deployments</property> </engine> </arquillian>
source share