Skip to content

Commit cc7d45b

Browse files
committed
Merge branch 'concurrent-run-listeners' into concurrent-run-listeners_remove-jcip-deps
Conflicts: src/test/java/org/junit/runner/notification/SynchronizedRunListenerTest.java
2 parents 789c302 + 02f1486 commit cc7d45b

File tree

4 files changed

+26
-6
lines changed

4 files changed

+26
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.junit.experimental.annotations;
2+
3+
import java.lang.annotation.*;
4+
5+
/**
6+
* Implementation is guaranteed to be free of race conditions
7+
* when accessed by multiple threads simultaneously.
8+
*
9+
* @author Tibor Digana (tibor17)
10+
* @version 4.12
11+
* @since 4.12
12+
*/
13+
@Documented
14+
@Target(ElementType.TYPE)
15+
@Retention(RetentionPolicy.RUNTIME)
16+
public @interface ThreadSafe {
17+
}

Diff for: src/main/java/org/junit/runner/notification/SynchronizedRunListener.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@
44
import org.junit.runner.Result;
55

66
/**
7-
* SynchronizedRunListener decorates {@link RunListener} and
8-
* has all methods synchronized.
7+
* SynchronizedRunListener decorates {@link RunListener}, has all methods
8+
* synchronized and is <em>not</em> public.
9+
* <p>
10+
* Due to backward compatibility, this synchronized listener behaves thread
11+
* safe as {@link RunListener} in the old synchronized {@link RunNotifier}.
912
*
1013
* @author Tibor Digana (tibor17)
1114
* @version 4.12
1215
* @since 4.12
16+
*
17+
* @see RunNotifier
1318
*/
1419
@Concurrent
1520
final class SynchronizedRunListener extends RunListener {

Diff for: src/test/java/org/junit/runner/notification/SynchronizedRunListenerTest.java

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// Copyright 2013 Google Inc. All Rights Reserved.
2-
31
package org.junit.runner.notification;
42

53
import static org.hamcrest.CoreMatchers.instanceOf;

Diff for: src/test/java/org/junit/tests/AllTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@
173173
StopwatchTest.class,
174174
RunNotifierTest.class,
175175
ConcurrentRunNotifierTest.class,
176-
SynchronizedRunListenerTest.class,
177-
AddRemoveListenerTest.class
176+
AddRemoveListenerTest.class,
177+
SynchronizedRunListenerTest.class
178178
})
179179
public class AllTests {
180180
public static Test suite() {

0 commit comments

Comments
 (0)