https://github.com/ttrelle/junit5-vintage-junit4-category
The JUnit5 Vintage Engine ignores @Category annotation
https://github.com/ttrelle/junit5-vintage-junit4-category
Last synced: about 2 months ago
JSON representation
The JUnit5 Vintage Engine ignores @Category annotation
- Host: GitHub
- URL: https://github.com/ttrelle/junit5-vintage-junit4-category
- Owner: ttrelle
- Created: 2018-05-18T12:34:51.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-22T06:04:45.000Z (almost 7 years ago)
- Last Synced: 2025-01-21T01:11:35.904Z (3 months ago)
- Language: Java
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This small project demonstrates that the `@Category` annotation from JUnit 4 is not honoured by the JUnit 5 Vintage engine. Run
```
$ mvn clean test
```to see that the test `CategorizedTest` fails although is should not run at all according to the configuration of the maven-surefire-plugin:
```
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running junit4.CategorizedTest
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0 s <<< FAILURE! - in junit4.CategorizedTest
[ERROR] should_not_run Time elapsed: 0 s <<< FAILURE!
java.lang.AssertionError: Test should not be executed at all!
at junit4.CategorizedTest.should_not_run(CategorizedTest.java:12)[INFO] Running junit4.SimpleTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in junit4.SimpleTest
[INFO] Running junit5.AnotherSimpleTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in junit5.AnotherSimpleTest
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] CategorizedTest.should_not_run:12 Test should not be executed at all!
[INFO]
[ERROR] Tests run: 3, Failures: 1, Errors: 0, Skipped: 0
```