public class Assert extends Object
| Constructor and Description |
|---|
Assert()
|
| Modifier and Type | Method and Description |
|---|---|
static void |
equals(Object
Throws an
AssertionFailedException if the given objects are not equal, according to the
equals method.
|
static void |
equals(Object
Throws an
AssertionFailedException with the given message if the given objects are not equal, according to the
equals method.
|
static void |
isTrue(boolean assertion)
Throws an
AssertionFailedException if the given assertion is not true.
|
static void |
isTrue(boolean assertion, String
Throws an
AssertionFailedException with the given message if the given assertion is not true.
|
static void |
shouldNeverReachHere()
Always throws an
AssertionFailedException.
|
static void |
shouldNeverReachHere(String
Always throws an
AssertionFailedException with the given message.
|
public static void isTrue(boolean assertion)
AssertionFailedException if the given assertion is not true.
assertion - a condition that is supposed to be true
AssertionFailedException - if the condition is false
public static void isTrue(boolean assertion,
String message)
AssertionFailedException with the given message if the given assertion is not true.
assertion - a condition that is supposed to be true
message - a description of the assertion
AssertionFailedException - if the condition is false
public static void equals(ObjectexpectedValue, Object actualValue)
AssertionFailedException if the given objects are not equal, according to the
equals method.
expectedValue - the correct value
actualValue - the value being checked
AssertionFailedException - if the two objects are not equal
public static void equals(ObjectexpectedValue, Object actualValue, String message)
AssertionFailedException with the given message if the given objects are not equal, according to the
equals method.
expectedValue - the correct value
actualValue - the value being checked
message - a description of the assertion
AssertionFailedException - if the two objects are not equal
public static void shouldNeverReachHere()
AssertionFailedException.
AssertionFailedException - thrown always
public static void shouldNeverReachHere(Stringmessage)
AssertionFailedException with the given message.
message - a description of the assertion
AssertionFailedException - thrown always