Skip to content

Commit 6b07957

Browse files
committed
Javadoc and comments
1 parent 65f3e38 commit 6b07957

File tree

1 file changed

+11
-22
lines changed

1 file changed

+11
-22
lines changed

src/test/java/org/apache/commons/lang3/concurrent/locks/LockingVisitorsTest.java

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
import org.apache.commons.lang3.function.FailableConsumer;
3636
import org.junit.jupiter.api.Test;
3737

38+
/**
39+
* Tests {@link LockingVisitors}.
40+
*/
3841
class LockingVisitorsTest extends AbstractLangTest {
3942

4043
private static final Duration SHORT_DELAY = Duration.ofMillis(100);
@@ -109,24 +112,18 @@ void testDeprecatedConstructor() {
109112

110113
@Test
111114
void testReentrantReadWriteLockExclusive() throws Exception {
112-
113-
/*
114-
* If our threads are running concurrently, then we expect to be no faster than running one after the other.
115-
*/
115+
// If our threads are running concurrently, then we expect to be no faster than running one after the other.
116116
final boolean[] booleanValues = new boolean[10];
117117
runTest(DELAY, true, millis -> assertTrue(millis >= TOTAL_DELAY.toMillis()), booleanValues,
118-
LockingVisitors.reentrantReadWriteLockVisitor(booleanValues));
118+
LockingVisitors.reentrantReadWriteLockVisitor(booleanValues));
119119
}
120120

121121
@Test
122122
void testReentrantReadWriteLockNotExclusive() throws Exception {
123-
124-
/*
125-
* If our threads are running concurrently, then we expect to be faster than running one after the other.
126-
*/
123+
// If our threads are running concurrently, then we expect to be faster than running one after the other.
127124
final boolean[] booleanValues = new boolean[10];
128125
runTest(DELAY, false, millis -> assertTrue(millis < TOTAL_DELAY.toMillis()), booleanValues,
129-
LockingVisitors.reentrantReadWriteLockVisitor(booleanValues));
126+
LockingVisitors.reentrantReadWriteLockVisitor(booleanValues));
130127
}
131128

132129
@Test
@@ -143,23 +140,15 @@ void testResultValidation() {
143140

144141
@Test
145142
void testStampedLockExclusive() throws Exception {
146-
147-
/*
148-
* If our threads are running concurrently, then we expect to be no faster than running one after the other.
149-
*/
143+
// If our threads are running concurrently, then we expect to be no faster than running one after the other.
150144
final boolean[] booleanValues = new boolean[10];
151-
runTest(DELAY, true, millis -> assertTrue(millis >= TOTAL_DELAY.toMillis()), booleanValues,
152-
LockingVisitors.stampedLockVisitor(booleanValues));
145+
runTest(DELAY, true, millis -> assertTrue(millis >= TOTAL_DELAY.toMillis()), booleanValues, LockingVisitors.stampedLockVisitor(booleanValues));
153146
}
154147

155148
@Test
156149
void testStampedLockNotExclusive() throws Exception {
157-
158-
/*
159-
* If our threads are running concurrently, then we expect to be faster than running one after the other.
160-
*/
150+
// If our threads are running concurrently, then we expect to be faster than running one after the other.
161151
final boolean[] booleanValues = new boolean[10];
162-
runTest(DELAY, false, millis -> assertTrue(millis < TOTAL_DELAY.toMillis()), booleanValues,
163-
LockingVisitors.stampedLockVisitor(booleanValues));
152+
runTest(DELAY, false, millis -> assertTrue(millis < TOTAL_DELAY.toMillis()), booleanValues, LockingVisitors.stampedLockVisitor(booleanValues));
164153
}
165154
}

0 commit comments

Comments
 (0)