-
Notifications
You must be signed in to change notification settings - Fork 61
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
JsonProviderTest fails if run after other Junits in a test suite #376
Comments
Here is the stack trace of this failure:
|
TCK user guide currently does not allow having both test suites on the classpath at the same time or better - this setup is not documented/supported |
@lukasj I am confused by this statement. The TCK user guide makes no mention of the |
Right, my bad, I have misread it as you mean running both groups at once (which is with or in the UG) current runner runs each test (=testclass) in its own VM (as does the platform tck I believe), so the problem is not visible there. Do you think this has to made explicit somewhere? There is no way to avoid test interference without it. |
Hey Lukas, I think if this is a requirement then there should be a mention of it in the TCK User Guide. |
Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
ee.jakarta.tck.jsonp.api.provider.JsonProviderTest.java will fail if run in a Junit test suite if it executes after any other TCK test that calls JsonProvider.provider(). Junits don't guarantee order of execution of tests within a test suite by default.
This is because the JsonProvider loads the provider as a static final the first time it is requested. The JsonProviderTest.java class attempts to set a system property to a dummy provider class, call JsonProvider.provider(), and then tries to validate that the provider returned is the dummy provider class. However, if any other TCK test that calls JsonProvider.provider() is run before this test, it will fail because the returned provider will be of the class initially used, not the dummy provider.
To recreate, create a Junit Test suite with the JsonProviderTest and any other test that calls JsonProvider.provider() and runs before Json ProviderTest.
This causes problems when trying to develop test automation for Open Liberty support of JSONP 2.1
The text was updated successfully, but these errors were encountered: