aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/junit/function/ThrowingRunnable.java
diff options
context:
space:
mode:
authorPete Bentley <prb@google.com>2021-03-03 14:33:07 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-03-03 14:33:07 +0000
commita9a7715d84046efd231e038b0dc2f551daf61701 (patch)
tree10923530939981dd1dc5f44ceb6316fb9442428a /src/main/java/org/junit/function/ThrowingRunnable.java
parent138b64feb682b90292d36002f3aff9869d6a9e4b (diff)
parentc7a6d4ec7defd99aab81c3add6e2916629a79a24 (diff)
downloadjunit-a9a7715d84046efd231e038b0dc2f551daf61701.tar.gz
Merge changes I578a2676,I4b37c2d0,Id1e2d638,I1ebe37da,I6135799c am: b6446bec0a am: fcd81b3e3f am: c7a6d4ec7d
Original change: https://android-review.googlesource.com/c/platform/external/junit/+/1613132 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Ie1a9bf8405e1b57da206312f5694e8c3ff5ce613
Diffstat (limited to 'src/main/java/org/junit/function/ThrowingRunnable.java')
-rw-r--r--src/main/java/org/junit/function/ThrowingRunnable.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/org/junit/function/ThrowingRunnable.java b/src/main/java/org/junit/function/ThrowingRunnable.java
new file mode 100644
index 0000000..d0eb782
--- /dev/null
+++ b/src/main/java/org/junit/function/ThrowingRunnable.java
@@ -0,0 +1,14 @@
+package org.junit.function;
+
+/**
+ * This interface facilitates the use of
+ * {@link org.junit.Assert#assertThrows(Class, ThrowingRunnable)} from Java 8. It allows method
+ * references to void methods (that declare checked exceptions) to be passed directly into
+ * {@code assertThrows}
+ * without wrapping. It is not meant to be implemented directly.
+ *
+ * @since 4.13
+ */
+public interface ThrowingRunnable {
+ void run() throws Throwable;
+}