Status: Closed (View Workflow)
Affects Version/s: 2018.5.0, 2.0.0.Final
Fix Version/s: 2.3.0.Final
Ubuntu 18.04 x64, openjdk 220.127.116.11
Windows 10 x64, oracle jdk 18.104.22.168
Steps to Reproduce:
https://gist.github.com/albihasani94/1c0e9cfdf546d4698fd54f017650e762 Add arquillian version 1.3.0.Final/1.4.0.Final in your pom.xml Create a test designated to run with Arquillian Specify a method that returns a ShrinkWrap archive to be used as deployment, either with a custom name or it will take " DEFAULT " Run `mvn package` or `mvn test` In the test phase, the deployment will throw an Exception: `java.lang.IllegalArgumentException: Can not add multiple org.jboss.shrinkwrap.api.Archive deployments with the same name: DEFAULT `
- Add arquillian version 1.3.0.Final/1.4.0.Final in your pom.xml
- Create a test designated to run with Arquillian
- Specify a method that returns a ShrinkWrap archive to be used as deployment, either with a custom name or it will take "DEFAULT"
- Run `mvn package` or `mvn test`
- In the test phase, the deployment will throw an Exception: `java.lang.IllegalArgumentException: Can not add multiple org.jboss.shrinkwrap.api.Archive deployments with the same name: DEFAULT`
Git Pull Request:
When running integration testing with Arquillian, and you are using Arquillian versions newer than 1.2.1.Final, the deployment is likely to fail in the scenario I will describe below.
I have specified a createArchive method annotated with @Deployment, and I have not annotated my test class with @DefaultDeployment.
Up to Arquillian version 1.2.1.Final, the deployment that I have specified is running fine and the tests are run on this deployment.
When you update the version of Arquillian to newer versions such as either 1.3.0.Final or 1.4.0.Final, the deployment archive cannot be created. This is due to an attempt by to create the same deployment twice.
I have run some tests, between Wildfly Swarm 2018.5.0 and Thorntail 2.0 in conjuction with Arquillian 1.2.1 and Arquillian 1.3.0, and the results seem to indicate that testing works fine for either of the Thorntail versions on Arquillian 1.2.1, and it fails for both on Arquillian 1.3.0. In the later case the deployment that I have specified is attempting to be created two consecutive times, failing the second time because a deployment with the same name has already been created once.
I am aware that most of our tests use 1.1.x.Final, but I still think incompatibility with newer versions of Arquillian would be somewhat of an issue. If we are planning to keep Arquillian fixed at the old version, which I doubt would be the case, the problem would not arise.
If we need to ensure compatibility with the newer versions of Arquillian, which I believe would be the case, I think I can investigate this further, to find the cause of the issue, and see whether a fix could be provided on Thorntail or Arquillian side.
I am listing below two of the configurations I have tested:
Thorntail 2.0 with Arquillian 1.3.0.Final (bug): https://gist.github.com/albihasani94/1c0e9cfdf546d4698fd54f017650e762
Thorntail 2.0 with Arquillian 1.2.1.Final (working): https://gist.github.com/albihasani94/5413c3410fd027dd98688f7a1cb8ea7a