This Ruby script edits Java codes.
If there exists JUnit test case with @Test
annotation, the script adds @Ignore
annotation and import statement for org.junit.Ignore
.
IgnoreAnnotater.new().annotate_ignore_all(YOUR_PROJECT_DIR)
In some project, test cases are not maintained and not executed. There exists many dangerous test cases that spoils local DB records and local file sets. And I cannot know which tests are safe or which tests are dangerous, because there are too many tests.
To fix such project, we need to
- Ignore all current test cases.
- Setup build setting to execute all tests on every build.
- Make sure to add safe tests and fix dangerous tests one by one
This script helps step 1.