Object
Assert
Deprecated, for removal: This API element is subject to removal in a future version.
Extension to JUnit assertion methods.
- Since:
- 2.2
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertBetween(String message, double minimum, double maximum, double value) Deprecated, for removal: This API element is subject to removal in a future version.Asserts that the given value is inside the given range.static voidassertBetween(String message, int minimum, int maximum, int value) Deprecated, for removal: This API element is subject to removal in a future version.Asserts that the given value is inside the given range.static <T> voidassertBetween(String message, Comparable<T> minimum, Comparable<T> maximum, T value) Deprecated, for removal: This API element is subject to removal in a future version.Asserts that the given value is inside the given range.static voidassertContains(String message, Collection<?> collection, Object value) Deprecated, for removal: This API element is subject to removal in a future version.Asserts that the given value is contained in the given collection.static voidassertIdentifierEquals(String message, CharSequence expected, CharSequence value) Deprecated.Renamedfor avoiding confusion with theinvalid reference
Assertions#assertUnicodeIdentifierEquals(String, CharSequence, CharSequence, boolean)Identifierinterface.static voidassertInstanceOf(String message, Class<?> expectedType, Object value) Deprecated.Replaced byorg.junit.jupiter.api.Assertions.assertInstanceOf(…).static voidassertPositive(String message, int value) Deprecated, for removal: This API element is subject to removal in a future version.Asserts that the given integer value is positive, including zero.static voidassertStrictlyPositive(String message, int value) Deprecated, for removal: This API element is subject to removal in a future version.Asserts that the given integer value is strictly positive, excluding zero.static voidassertValidRange(String message, double minimum, double maximum) Deprecated, for removal: This API element is subject to removal in a future version.Asserts that the given minimum is smaller or equals to the given maximum.static voidassertValidRange(String message, int minimum, int maximum) Deprecated, for removal: This API element is subject to removal in a future version.Asserts that the given minimum is smaller or equals to the given maximum.static <T> voidassertValidRange(String message, Comparable<T> minimum, Comparable<T> maximum) Deprecated, for removal: This API element is subject to removal in a future version.Asserts that the given minimum and maximum values make a valid range.
-
Method Details
-
assertInstanceOf
@Deprecated public static void assertInstanceOf(String message, Class<?> expectedType, Object value) Deprecated.Replaced byorg.junit.jupiter.api.Assertions.assertInstanceOf(…).Asserts that the given value is an instance of the given class. No tests are performed if the type isnull. If the type is not-null but the value is null, this is considered as a failure.- Parameters:
message- header of the exception message in case of failure, ornullif none.expectedType- the expected parent class of the value, ornullif unrestricted.value- the value to test, ornull(which is a failure).
-
assertPositive
Deprecated, for removal: This API element is subject to removal in a future version.Asserts that the given integer value is positive, including zero.- Parameters:
message- header of the exception message in case of failure, ornullif none.value- the value to test.
-
assertStrictlyPositive
Deprecated, for removal: This API element is subject to removal in a future version.Asserts that the given integer value is strictly positive, excluding zero.- Parameters:
message- header of the exception message in case of failure, ornullif none.value- the value to test.
-
assertValidRange
public static <T> void assertValidRange(String message, Comparable<T> minimum, Comparable<T> maximum) Deprecated, for removal: This API element is subject to removal in a future version.Asserts that the given minimum and maximum values make a valid range. More specifically asserts that if both values are non-null, then the minimum value is not greater than the maximum value.- Type Parameters:
T- the type of values being compared.- Parameters:
message- header of the exception message in case of failure, ornullif none.minimum- the lower bound of the range to test, ornullif unbounded.maximum- the upper bound of the range to test, ornullif unbounded.
-
assertValidRange
Deprecated, for removal: This API element is subject to removal in a future version.Asserts that the given minimum is smaller or equals to the given maximum.- Parameters:
message- header of the exception message in case of failure, ornullif none.minimum- the lower bound of the range to test.maximum- the upper bound of the range to test.
-
assertValidRange
Deprecated, for removal: This API element is subject to removal in a future version.Asserts that the given minimum is smaller or equals to the given maximum. If one bound is or both bounds are NaN, then the test fails.- Parameters:
message- header of the exception message in case of failure, ornullif none.minimum- the lower bound of the range to test.maximum- the upper bound of the range to test.
-
assertBetween
public static <T> void assertBetween(String message, Comparable<T> minimum, Comparable<T> maximum, T value) Deprecated, for removal: This API element is subject to removal in a future version.Asserts that the given value is inside the given range. This method does not test the validity of the given [minimum…maximum] range.- Type Parameters:
T- the type of values being compared.- Parameters:
message- header of the exception message in case of failure, ornullif none.minimum- the lower bound of the range (inclusive), ornullif unbounded.maximum- the upper bound of the range (inclusive), ornullif unbounded.value- the value to test, ornull(which is a failure).
-
assertBetween
Deprecated, for removal: This API element is subject to removal in a future version.Asserts that the given value is inside the given range. This method does not test the validity of the given [minimum…maximum] range.- Parameters:
message- header of the exception message in case of failure, ornullif none.minimum- the lower bound of the range, inclusive.maximum- the upper bound of the range, inclusive.value- the value to test.
-
assertBetween
Deprecated, for removal: This API element is subject to removal in a future version.Asserts that the given value is inside the given range. If the givenvalueis NaN, then this test passes silently. This method does not test the validity of the given [minimum…maximum] range.- Parameters:
message- header of the exception message in case of failure, ornullif none.minimum- the lower bound of the range, inclusive.maximum- the upper bound of the range, inclusive.value- the value to test.
-
assertContains
Deprecated, for removal: This API element is subject to removal in a future version.Asserts that the given value is contained in the given collection. If the given collection is null, then this test passes silently (a null collection is considered as "unknown", not empty). If the given value is null, then the test passes only if the given collection contains the null element.- Parameters:
message- header of the exception message in case of failure, ornullif none.collection- the collection where to look for inclusion, ornullif unrestricted.value- the value to test for inclusion.
-
assertIdentifierEquals
@Deprecated public static void assertIdentifierEquals(String message, CharSequence expected, CharSequence value) Deprecated.Renamedfor avoiding confusion with theinvalid reference
Assertions#assertUnicodeIdentifierEquals(String, CharSequence, CharSequence, boolean)Identifierinterface.- Parameters:
message- header of the exception message in case of failure, ornullif none.expected- the expected character sequence.value- the character sequence to compare.
-
invalid reference