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 void
assertBetween
(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 void
assertBetween
(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> 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.static void
assertContains
(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 void
assertIdentifierEquals
(String message, CharSequence expected, CharSequence value) Deprecated.Renamedinvalid reference
Assertions#assertUnicodeIdentifierEquals(String, CharSequence, CharSequence, boolean)
Identifier
interface.static void
assertInstanceOf
(String message, Class<?> expectedType, Object value) Deprecated.Replaced byorg.junit.jupiter.api.Assertions.assertInstanceOf(…)
.static void
assertPositive
(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 void
assertStrictlyPositive
(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 void
assertValidRange
(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 void
assertValidRange
(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> 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.
-
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, ornull
if none.expectedType
- the expected parent class of the value, ornull
if 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, ornull
if 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, ornull
if 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, ornull
if none.minimum
- the lower bound of the range to test, ornull
if unbounded.maximum
- the upper bound of the range to test, ornull
if 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, ornull
if 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, ornull
if 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, ornull
if none.minimum
- the lower bound of the range (inclusive), ornull
if unbounded.maximum
- the upper bound of the range (inclusive), ornull
if 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, ornull
if 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 givenvalue
is 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, ornull
if 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, ornull
if none.collection
- the collection where to look for inclusion, ornull
if unrestricted.value
- the value to test for inclusion.
-
assertIdentifierEquals
@Deprecated public static void assertIdentifierEquals(String message, CharSequence expected, CharSequence value) Deprecated.Renamedinvalid reference
Assertions#assertUnicodeIdentifierEquals(String, CharSequence, CharSequence, boolean)
Identifier
interface.- Parameters:
message
- header of the exception message in case of failure, ornull
if none.expected
- the expected character sequence.value
- the character sequence to compare.
-
invalid reference