diff options
author | Pete Bentley <prb@google.com> | 2021-02-21 18:26:28 +0000 |
---|---|---|
committer | Pete Bentley <prb@google.com> | 2021-02-22 18:38:53 +0000 |
commit | aa1524950fb5fbffbb61d23c5442984cb731a1eb (patch) | |
tree | 7ce2c9779133dd053d314fdb25818acbbb4fa2be /src/main/java/org/junit/Assume.java | |
parent | e938015d2d5a2157ed20eb622fcd9750a12bb4af (diff) | |
download | junit-aa1524950fb5fbffbb61d23c5442984cb731a1eb.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.
Bug: 129054170
Test: m
Change-Id: I5ec909df6840f6c54cbab9c509c5addaee3f94e6
Diffstat (limited to 'src/main/java/org/junit/Assume.java')
-rw-r--r-- | src/main/java/org/junit/Assume.java | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/main/java/org/junit/Assume.java b/src/main/java/org/junit/Assume.java index b7687f7..29b705b 100644 --- a/src/main/java/org/junit/Assume.java +++ b/src/main/java/org/junit/Assume.java @@ -14,7 +14,7 @@ import org.hamcrest.Matcher; * basically means "don't run this test if these conditions don't apply". The default JUnit runner skips tests with * failing assumptions. Custom runners may behave differently. * <p> - * A good example of using assumptions is in <a href="https://github.com/junit-team/junit/wiki/Theories">Theories</a> where they are needed to exclude certain datapoints that aren't suitable or allowed for a certain test case. + * A good example of using assumptions is in <a href="https://github.com/junit-team/junit4/wiki/Theories">Theories</a> where they are needed to exclude certain datapoints that aren't suitable or allowed for a certain test case. * </p> * Failed assumptions are usually not logged, because there may be many tests that don't apply to certain * configurations. @@ -29,11 +29,20 @@ import org.hamcrest.Matcher; * </pre> * </p> * - * @see <a href="https://github.com/junit-team/junit/wiki/Theories">Theories</a> + * @see <a href="https://github.com/junit-team/junit4/wiki/Theories">Theories</a> * * @since 4.4 */ public class Assume { + + /** + * Do not instantiate. + * @deprecated since 4.13. + */ + @Deprecated + public Assume() { + } + /** * If called with an expression evaluating to {@code false}, the test will halt and be ignored. */ @@ -45,7 +54,7 @@ public class Assume { * The inverse of {@link #assumeTrue(boolean)}. */ public static void assumeFalse(boolean b) { - assumeTrue(!b); + assumeThat(b, is(false)); } /** @@ -67,9 +76,11 @@ public class Assume { } /** - * If called with one or more null elements in <code>objects</code>, the test will halt and be ignored. + * If called with a {@code null} array or one or more {@code null} elements in {@code objects}, + * the test will halt and be ignored. */ public static void assumeNotNull(Object... objects) { + assumeThat(objects, notNullValue()); assumeThat(asList(objects), everyItem(notNullValue())); } |