Skip to content
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

Implement JUnit 4 Support using Rules [SPR-10217] #14850

Closed
spring-projects-issues opened this issue Jan 25, 2013 · 2 comments
Closed

Implement JUnit 4 Support using Rules [SPR-10217] #14850

spring-projects-issues opened this issue Jan 25, 2013 · 2 comments
Assignees
Labels
in: test status: duplicate type: enhancement

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Jan 25, 2013

Philippe Marschall opened SPR-10217 and commented

Currently JUnit 4 support is provided by SpringJUnit4ClassRunner which is a custom BlockJUnit4ClassRunner. There is no support for using other runners like Theories or Parameterized or 3rd party runners like MockitoJUnitRunner. A runner based approach does not seem to offer much promise as runners are not composable, a custom Spring version of every runner has to be developed and maintained.

With JUnit 4.9+ the preferred way to implement such behavior is to use rules. Unlike runners there can be several ones of them and they can be composed.

In theory TestExecutionListener could be deprecated and be replaced with standard JUnit rules but this seems to be a bit on the drastic side.


Issue Links:

  • #12387 Provide @Rule alternative to SpringJUnit4ClassRunner ("duplicates")
@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jan 25, 2013

Philippe Marschall commented

Pull request at
#222

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jan 26, 2013

Sam Brannen commented

This issue duplicates #12387.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test status: duplicate type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants