diff options
author | Pete Bentley <prb@google.com> | 2021-02-21 18:26:28 +0000 |
---|---|---|
committer | Pete Bentley <prb@google.com> | 2021-03-02 23:54:01 +0000 |
commit | 8e80a2a7b89329f95cb41e8b2981044362478c04 (patch) | |
tree | c863bdca20bca95fc2dcfa52c63c84b048d61751 /src/main/java/org/junit/runner/notification/SynchronizedRunListener.java | |
parent | 565f36d28118dce0c0a08fe71924dcd25e039022 (diff) | |
download | junit-8e80a2a7b89329f95cb41e8b2981044362478c04.tar.gz |
Upgrade external/junit to 4.13.2
Contains just the changes from 4.12 to 4.13.2 and undoes local
Android changes. Will re-patch those in in subsequent CLs.
This change re-lands https://r.android.com/1598413.
Bug: 129054170
Test: m
Change-Id: I6135799c8be5db2ec4c3f13951c18c072427e30d
Diffstat (limited to 'src/main/java/org/junit/runner/notification/SynchronizedRunListener.java')
-rw-r--r-- | src/main/java/org/junit/runner/notification/SynchronizedRunListener.java | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/src/main/java/org/junit/runner/notification/SynchronizedRunListener.java b/src/main/java/org/junit/runner/notification/SynchronizedRunListener.java index c53c1ee..400fed8 100644 --- a/src/main/java/org/junit/runner/notification/SynchronizedRunListener.java +++ b/src/main/java/org/junit/runner/notification/SynchronizedRunListener.java @@ -10,7 +10,7 @@ import org.junit.runner.Result; * <p>This class synchronizes all listener calls on a RunNotifier instance. This is done because * prior to JUnit 4.12, all listeners were called in a synchronized block in RunNotifier, * so no two listeners were ever called concurrently. If we instead made the methods here - * sychronized, clients that added multiple listeners that called common code might see + * synchronized, clients that added multiple listeners that called common code might see * issues due to the reduced synchronization. * * @author Tibor Digana (tibor17) @@ -43,6 +43,37 @@ final class SynchronizedRunListener extends RunListener { } } + /** + * {@inheritDoc} + * <p/> + * Synchronized decorator for {@link RunListener#testSuiteStarted(Description)}. + * @param description the description of the test suite that is about to be run + * (generally a class name). + * @throws Exception if any occurs. + * @since 4.13 + */ + @Override + public void testSuiteStarted(Description description) throws Exception { + synchronized (monitor) { + listener.testSuiteStarted(description); + } + } + + /** + * {@inheritDoc} + * <p/> + * Synchronized decorator for {@link RunListener#testSuiteFinished(Description)}. + * @param description the description of the test suite that just ran. + * @throws Exception + * @since 4.13 + */ + @Override + public void testSuiteFinished(Description description) throws Exception { + synchronized (monitor) { + listener.testSuiteFinished(description); + } + } + @Override public void testStarted(Description description) throws Exception { synchronized (monitor) { |