net.sf.japaki.basic
Class Assert

java.lang.Object
  extended by net.sf.japaki.basic.Assert

public class Assert
extends Object

A set of assertion methods. Inspired by org.junit.Assert.


Method Summary
static void assertElementsNotNull(String message, List list)
          Asserts that no element of a list is null.
static void assertNotNull(String message, Object object)
          Asserts that an object is not null.
static void assertPositive(String message, int value)
          Asserts that the value is greater than zero.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

assertNotNull

public static void assertNotNull(String message,
                                 Object object)
Asserts that an object is not null.

Parameters:
message - the identifying message for the exception
object - object to check
Throws:
NullPointerException - if object is null.

assertElementsNotNull

public static void assertElementsNotNull(String message,
                                         List list)
Asserts that no element of a list is null.

Parameters:
message - the identifying message for the exception
list - list to check
Throws:
NullPointerException - if any element of the list is null.

assertPositive

public static void assertPositive(String message,
                                  int value)
Asserts that the value is greater than zero.

Parameters:
message - the identifying message for the exception
value - value to check
Throws:
IllegalArgumentException - if value <= 0