Skip to content
Discussion options

You must be logged in to vote

One of the tests uses Locale.setDefault, so I want to make sure JUnit does not execute the class/test concurrently with the others.

@Isolated is only applicable to test classes, not methods. Putting it on @ClassTemplate class currently fails and I've just opened an issue to fix that:

Instead of @Isolated, you could annotate all methods that read/write Locale.getDefault() with a @ResourceLock annotation (or use Pioneer's @ReadsDefaultLocale and @WritesDefaultLocale). However, there are currently somee issues with that as well:

Until those issues are resolved, I think your best bet is to move the test method using Locale.setDefault to a separate class unparameterized…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@vlsi
Comment options

Answer selected by vlsi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants