Skip to content

Commit 4ef7b03

Browse files
committed
More documentation on removed features and features that have been replaced by junit5 defaults.
1 parent c17f500 commit 4ef7b03

2 files changed

Lines changed: 15 additions & 13 deletions

File tree

etc/junit4-missing-features.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
[ai generated overview of junit4 features]
22

3-
4. seed annotations
4-
- @Seed on a class fixes the main seed, making execution fully deterministic
5-
- @Seeds / @Seed on a method pins a per-method seed for regression coverage
6-
while still running once with a fresh random seed
7-
8-
6. Repeating tests with @Repeat
9-
- @Repeat(iterations = N, useConstantSeed = true) reruns a test N times with
10-
the same seed (verifies determinism or checks if failure is consistent)
11-
- @Repeat(iterations = N, useConstantSeed = false) reruns with a new
12-
pseudo-random seed each time (measures failure frequency)
13-
143
8. Timeouts
154
- Standard JUnit @Test(timeout=N) is honoured
165
- @Timeout(millis=N) annotation provides an explicit alternative

randomizedtesting-jupiter/src/test/java/com/carrotsearch/randomizedtesting/jupiter/F999_RemovedFeatures.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,17 @@ removed or replaced by built-in functionality in junit5.
88
* This feature is already part of JUnit5: use `@ParameterizedClass`, `@ParameterizedTest`
99
or any other way to create dynamic tests that JUnit5 offers.
1010

11-
## Test groups
11+
## Test groups and test filtering
1212

13-
* This feature is already part of JUnit5 (as `@Tag` annotations).
13+
* This feature is already part of JUnit5 in the
14+
form of[`@Tag` annotations](https://docs.junit.org/6.0.3/writing-tests/tagging-and-filtering.html).
1415

16+
* Direct use of `tests.filter` and `tests.[group-name]` properties
17+
is not as straightforward as it was with `RandomizedRunner`. These properties
18+
need to be converted and passed to JUnit Jupiter using your build system's
19+
facilities: system properties alone won't have any effect. Here is
20+
an [example for gradle](https://docs.gradle.org/current/userguide/java_testing.html#test_grouping).
21+
1522
## Custom test case order (`@TestCaseOrdering`)
1623

1724
* This feature is already part of JUnit5 (`@TestMethodOrder`). However,
@@ -47,3 +54,9 @@ Stream<DynamicTest> includeTestMethodsWithNoAnnotations() {
4754
}));
4855
}
4956
```
57+
58+
## Repeating tests with @Repeat
59+
60+
* Use standard JUnit5 test repetition facilities (like test templates, or `@RepeatedTest`
61+
annotation). To repeat the same test with a constant seed, `@FixSeed` at class or test level.
62+
If the seed is not fixed, it will be different for each test repetition by default.

0 commit comments

Comments
 (0)