Skip to content

Commit 7837182

Browse files
committed
Adding javadocs.
1 parent adadb70 commit 7837182

5 files changed

Lines changed: 15 additions & 9 deletions

File tree

etc/junit4-missing-features.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@
2626
- can we enforce the order of extensions (randomized testing > leaked threads)
2727
- how are jupiter timeouts working together with leaked threads ext.?
2828
- maybe bring back thread leak zombies annotation (if we can't cleanly terminate leaked threads, ignore all remaining tests).
29+
- maybe move some of the implementation details to a non-exposed package?
30+
- regenerate the javadocs with public API only.

randomizedtesting-jupiter/src/main/java/com/carrotsearch/randomizedtesting/jupiter/Seed.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.carrotsearch.randomizedtesting.jupiter;
22

3+
/** A single randomization seed (typically part of a larger {@link SeedChain}). */
34
public record Seed(long value) {
45
private static final char[] HEX = "0123456789ABCDEF".toCharArray();
56
static final Seed UNSPECIFIED = new Seed(0);

randomizedtesting-jupiter/src/main/java/com/carrotsearch/randomizedtesting/jupiter/SeedChain.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22

33
import java.util.List;
44
import java.util.Locale;
5-
import java.util.Random;
65
import java.util.stream.Collectors;
76
import java.util.stream.Stream;
87

9-
record SeedChain(List<Seed> seeds) {
8+
/**
9+
* A seed chain determines randomization if {@link Randomized} extension is used. A seed chain is a
10+
* sequence of {@link Seed}s, typically associated with one or more hierarchical junit jupiter
11+
* contexts.
12+
*/
13+
public record SeedChain(List<Seed> seeds) {
1014
private static final SeedChain EMPTY = new SeedChain(List.of());
1115

1216
static SeedChain parse(String chain) {
@@ -37,7 +41,7 @@ public String toString() {
3741

3842
record FirstAndRest(Seed first, SeedChain rest) {}
3943

40-
public FirstAndRest pop() {
44+
FirstAndRest pop() {
4145
if (seeds.isEmpty()) {
4246
return new FirstAndRest(Seed.UNSPECIFIED, SeedChain.EMPTY);
4347
}
@@ -46,8 +50,4 @@ public FirstAndRest pop() {
4650
var rest = new SeedChain(seeds.subList(1, seeds.size()));
4751
return new FirstAndRest(first, rest);
4852
}
49-
50-
private long nextRandomValue() {
51-
return new Random().nextLong();
52-
}
5353
}

randomizedtesting-jupiter/src/main/java/com/carrotsearch/randomizedtesting/jupiter/SystemThreadFilter.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
import java.util.regex.Pattern;
55

66
/**
7+
* The default filter containing sane defaults excluding system and ignorable threads when {@link
8+
* DetectThreadLeaks} extension is used.
9+
*
710
* @see DetectThreadLeaks.ExcludeThreads
811
*/
912
public class SystemThreadFilter implements Predicate<Thread> {

randomizedtesting-jupiter/src/main/java/com/carrotsearch/randomizedtesting/jupiter/Threads.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package com.carrotsearch.randomizedtesting.jupiter;
22

3-
public final class Threads {
3+
final class Threads {
44
Threads() {}
55

66
/** Collect thread information, JVM vendor insensitive. */
7-
public static String threadName(Thread t) {
7+
static String threadName(Thread t) {
88
return "Thread["
99
+ ("id=" + t.threadId())
1010
+ (", name=" + t.getName())

0 commit comments

Comments
 (0)