Skip to content

JUnit 4 and Jupiter integration #293

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

Closed

Conversation

TWiStErRob
Copy link
Contributor

@TWiStErRob TWiStErRob commented Nov 3, 2021

As promised in #282. See the individual commits.

Let me know what you think of it so far, and happy to help with other things, if necessary, but also feel free to commit and finish this branch/PR.

Few things of note left to do (anyone can chip in!):

  • Introduce a Paparazzi Interface which can be implemented by the JUnit rule and delegates to instance
    (unless you're ok with paparazzi.instance.snapshot)
  • Add the logic of AgentTestRule to PaparazziExtension (not sure if it can be composed the same way, might need to inline it there as one extension.
  • Add registerInterceptors to PaparazziExtension (I didn't do this because it wasn't clear what was your intended lifecycle of this. I'm not sure if it's defined when the body of TestRule.apply is executed. I don't think that can be relied on as a "lifecycle" event. Anyway, I'm sure there's a fitting lifecycle interface in org.junit.jupiter.api.extension package.
  • Consider renaming junit5 to jupiter, 5 is not the most fitting, see https://junit.org/junit5/docs/current/user-guide/#overview-what-is-junit-5.
  • Mention in Paparazzi docs and on extension class that any kind of parallel execution of jupiter is not supported by Paparazzi because <reason>.
  • Fix all the compilation errors and tests, and provide migration path / docs for users.
  • Review TestName implementation, I'm not sure that's the right thing to do in Paparazzi, it looks like doesn't take into account JUnit @Parameterized tests, JUnitParams @Parameters(...) or JUnit Jupiter @ParameterizedTest.

@TWiStErRob
Copy link
Contributor Author

I'm closing this POC as I'm not planning to complete it. If anyone picks it up in the future, can use it as a reference for what to do, probably in separate PRs.

@TWiStErRob TWiStErRob closed this Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant