|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
org.jcoderz.commons.util.Assert
public final class Assert
Utility class for assertions.
Method Summary | |
---|---|
static void |
assertEquals( message,
int expected,
int actual)
Asserts that two integers are equal. |
static void |
assertEquals( message,
expected,
actual)
Asserts that two objects are equal. |
static void |
assertTrue( message,
boolean condition)
Asserts that a condition is true. |
static void |
fail( message)
Can be called if an assertion already failed. |
static void |
fail( message,
ex)
Can be called if an exception is unexpectedly caught. |
static void |
notNull( parameter,
argumentName)
Asserts that an object isn't null. |
Methods inherited from class java.lang. |
---|
, , , , , , , , , , |
Method Detail |
---|
public static void notNull( parameter, argumentName)
parameter
- object to be tested against null.argumentName
- name of the provided argument within the
used interface.public static void assertEquals( message, int expected, int actual) throws AssertionFailedException
message
- The message for the condition. This message is
used in the exception if the integers are not equal.expected
- the expected integer.actual
- the actual integer.
AssertionFailedException
- if the two objects are not equal.public static void assertEquals( message, expected, actual) throws AssertionFailedException
message
- The message for the condition. This message is
used in the exception if the objects are not equal.expected
- the expected object.actual
- the actual object.
AssertionFailedException
- if the two objects are not equal.public static void assertTrue( message, boolean condition) throws AssertionFailedException
message
- The message for the condition. This message is
used in the exception if the condition is false.condition
- the condition to test.
AssertionFailedException
- if the condition is false.public static void fail( message) throws AssertionFailedException
message
- The message to be used in the exception.
AssertionFailedException
- always.public static void fail( message, ex) throws AssertionFailedException
message
- The message to be used in the exception.ex
- the exception that was not expected
AssertionFailedException
- always.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |