Closed KyleAure closed 2 years ago
@KyleAure I took a look at this last week and it seems that it is not a straight forward change. The test cases in https://github.com/OpenLiberty/arquillian-liberty-dependencies fail after making the change, and my first couple of attempts to resolve the failures did not work. The @RunsWith
is no longer available and neither is the org.jboss.arquillian.junit.Arquillian
used in the @RunsWith
.
If you have some insight as to the changes needed in the testcases in that repo (which is also where the Junit runner would need updating), please let me know.
One other point, I don't think we would want to make this change for the non-Jakarta artifacts.
@cherylking For testing, we will need to have a separate test package and it will need to run in a separate JVM. Junit5 has a vintage Junit4 runner which can be used to run the Junit4 test classes. But the problem is the Arquillian container, only one container can be loaded per JVM.
Long story short: Junit5 supports running Junit4 tests, but the Arquillian Junit5 Container cannot run Junit4 Container tests.
The @RunsWith is no longer available and neither is the org.jboss.arquillian.junit.Arquillian used in the @RunsWith.
The proper way to annotate Junit5 tests is with extensions (instead of runners):
@ExtendWith(ArquillianExtension.class)
public class WLPJunit5TestCase {
}
One other point, I don't think we would want to make this change for the non-Jakarta artifacts.
I agree
Options:
Issue Overview
The current Open Liberty Arquillian artifacts for JUnit:
All have a common dependency on
More modern tests are being written using Junit5 which require the Arquillian Junit5 Runner:
Expected Behaviour
Liberty Arquillian should support the JUnit 5 Runner
Current Behaviour
As-is it does not seem as if Liberty Arquillian supports the JUnit5 Runner
Additional Information
Current workaround: