-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically adding the test class can cause duplicate class problems #157
Comments
Thanks @tevans78 for reporting it. Would you be so kind and provide reproducer to ask? This will help us work on the fix. I don't dare to ask you to deliver an actual patch, but if you could that would be more than awesome. You can obviously count on our help! |
@bartoszmajsak bit tricky to provide a standalone test case that you can easily run but I can refer you to the microprofile tck code where we found the problem The test uses shrinkwrap to create a war with a jar inside. If you look at line 55, you can see two classes being added to the jar When arquillian adds the test class into the application archive (war) as well, we end up with the test class and it's CDI bean in two places inside the war. This leads to CDI bean resolution errors. There is a work-around, to not nest the CDI bean inside the test class, but that isn't always ideal. |
This also occurred here - eclipse/microprofile-config#145 |
@bartoszmajsak don't know if it's still useful but here's a simple reproducer: https://github.com/spyrkob/test Looking at the DeploymentGenerator maybe the solution would be to check if the test class is already in one of embedded archives? Something like master...spyrkob:issue-157 (very hacky;)) |
Automatically adding the test class to the application archive can result in duplicate classes within the application. In some cases, such as when the test class contains CDI beans, having duplicate classes within the same application causes deployment errors.
arquillian-core/container/test-impl-base/src/main/java/org/jboss/arquillian/container/test/impl/client/deployment/DeploymentGenerator.java
Line 171 in 31fd0ee
The text was updated successfully, but these errors were encountered: