jbeantester.framework
Class Assert

java.lang.Object
  |
  +--jbeantester.framework.Assert

public class Assert
extends Object

Convenience class that provides basic assertion checking


Field Summary
protected static Logger cat
          A Logger to use in this object and all derivatives.
static boolean DEBUG
          variable used for debugging purposes only
 
Method Summary
static void isNonNull(Object o)
          Assert that the given argument is not null, halt execution otherwise.
static void isNonNull(Object o, String message)
          Assert that the given argument is not null, halt execution otherwise.
static void isTrue(boolean b)
          Assert that the given argument is true, halt execution otherwise.
static void isTrue(boolean b, String message)
          Assert that the given argument is true, halt execution otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cat

protected static final Logger cat
A Logger to use in this object and all derivatives.


DEBUG

public static final boolean DEBUG
variable used for debugging purposes only

See Also:
Constant Field Values
Method Detail

isTrue

public static final void isTrue(boolean b)
Assert that the given argument is true, halt execution otherwise.

Parameters:
b - the argument to check for truth
Throws:
AssertionError - if the given argument is false

isTrue

public static final void isTrue(boolean b,
                                String message)
Assert that the given argument is true, halt execution otherwise.

Parameters:
b - the argument to check for truth
message - an error message to display if the argument is false
Throws:
AssertionError - if the given argument is false

isNonNull

public static final void isNonNull(Object o)
Assert that the given argument is not null, halt execution otherwise.

Parameters:
o - the argument to check for null-ness
Throws:
AssertionError - if the given argument is null

isNonNull

public static final void isNonNull(Object o,
                                   String message)
Assert that the given argument is not null, halt execution otherwise.

Parameters:
o - the argument to check for null-ness
message - an error message to display if the argument is null
Throws:
AssertionError - if the given argument is null