Say I have an Arquillian test that creates a ShrinkWrap .war archive. Then, autodetection runs over that archive, but doesn't find anything web-related, so the undertow fraction isn't included. Then, when the uberjar boots, Swarm fails to create a default deployment, because there's no DefaultDeploymentFactory for .war-s, which means that an empty .jar is created, which leads to all kinds of interesting failures. (Actually no, I've only observed a single failure, a NPE in org.wildfly.swarm.arquillian.daemon.TestRunner.executeTest.)
Should Swarm possibly autodetect the undertow fraction automatically, when the autodetection process runs over a .war?
I found this issue after a couple of hours of debugging the NPE mentioned above, which appeared when running the Arquillian tests in a couple of EAP quickstarts. Here are complete steps to reproduce:
- git clone -b 7.0.x https://github.com/jboss-developer/jboss-eap-quickstarts.git
- cd jboss-eap-quickstarts/bean-validation-custom-constraint
- change version.jboss.bom.eap in pom.xml to 7.0.0.GA
- change pom.xml to include this profile:
- add src/test/resources/arquillian-swarm.xml file with this content:
- mvn clean test -Parq-wildfly-swarm
I understand that adding an explicit dependency on the undertow fraction (and on H2, because the test use a database) solves the issue. The question I'm asking is: should I have to do that?