Skip to content

Replacing XtextSmokeTestRunner in JUnit 5 #3039

Closed Answered by trancexpress
trancexpress asked this question in Q&A
Discussion options

You must be logged in to vote

OK, I tried to stay as close as possible to the setup/restore logic in XtextSmokeTestRunner and that seems to work.

To do so, I replaced the @InjectWith IInjectorProvider of all tests used in a smoke test, with an IInjectorProvider that does the following:

If smoke tests are not running (ENV variable for us), delegate to an instance of the original IInjectorProvider type.
If smoke tests are running, use InjectorCache to wrap the original IInjectorProvider.

Then, implement an exception handler that does this:

public class SmokeTestExecutionHandler implements TestExecutionExceptionHandler, BeforeTestExecutionCallback {

    /* The TestDataCarrier class is package protected, so we cannot do …

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by trancexpress
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant