Package org.meteoinfo.util
Class Assert
- java.lang.Object
-
- org.meteoinfo.util.Assert
-
public class Assert extends java.lang.ObjectA utility for making programming assertions.
-
-
Constructor Summary
Constructors Constructor Description Assert()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidequals(java.lang.Object expectedValue, java.lang.Object actualValue)Throws anAssertionFailedExceptionif the given objects are not equal, according to theequalsmethod.static voidequals(java.lang.Object expectedValue, java.lang.Object actualValue, java.lang.String message)Throws anAssertionFailedExceptionwith the given message if the given objects are not equal, according to theequalsmethod.static voidisTrue(boolean assertion)Throws anAssertionFailedExceptionif the given assertion is not true.static voidisTrue(boolean assertion, java.lang.String message)Throws anAssertionFailedExceptionwith the given message if the given assertion is not true.static voidshouldNeverReachHere()Always throws anAssertionFailedException.static voidshouldNeverReachHere(java.lang.String message)Always throws anAssertionFailedExceptionwith the given message.
-
-
-
Method Detail
-
isTrue
public static void isTrue(boolean assertion)
Throws anAssertionFailedExceptionif the given assertion is not true.- Parameters:
assertion- a condition that is supposed to be true- Throws:
AssertionFailedException- if the condition is false
-
isTrue
public static void isTrue(boolean assertion, java.lang.String message)Throws anAssertionFailedExceptionwith the given message if the given assertion is not true.- Parameters:
assertion- a condition that is supposed to be truemessage- a description of the assertion- Throws:
AssertionFailedException- if the condition is false
-
equals
public static void equals(java.lang.Object expectedValue, java.lang.Object actualValue)Throws anAssertionFailedExceptionif the given objects are not equal, according to theequalsmethod.- Parameters:
expectedValue- the correct valueactualValue- the value being checked- Throws:
AssertionFailedException- if the two objects are not equal
-
equals
public static void equals(java.lang.Object expectedValue, java.lang.Object actualValue, java.lang.String message)Throws anAssertionFailedExceptionwith the given message if the given objects are not equal, according to theequalsmethod.- Parameters:
expectedValue- the correct valueactualValue- the value being checkedmessage- a description of the assertion- Throws:
AssertionFailedException- if the two objects are not equal
-
shouldNeverReachHere
public static void shouldNeverReachHere()
Always throws anAssertionFailedException.- Throws:
AssertionFailedException- thrown always
-
shouldNeverReachHere
public static void shouldNeverReachHere(java.lang.String message)
Always throws anAssertionFailedExceptionwith the given message.- Parameters:
message- a description of the assertion- Throws:
AssertionFailedException- thrown always
-
-