org.pojomatic.test
Class AssertUtils

java.lang.Object
  extended by org.pojomatic.test.AssertUtils

public class AssertUtils
extends java.lang.Object

This class is not meant to be a part of the public API.


Method Summary
static void assertEquals(java.lang.String message, java.lang.Object expected, java.lang.Object actual)
          Asserts that two objects are either both null or are equal according to Object.equals(Object).
static boolean equal(java.lang.Object first, java.lang.Object second)
          Determines if two objects are both null or are equal according to Object.equals(Object).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

equal

public static boolean equal(java.lang.Object first,
                            java.lang.Object second)
Determines if two objects are both null or are equal according to Object.equals(Object).

Parameters:
first - the first object to compare
second - the second object to compare
Returns:
true if both objects are null, or first is non-null and first.equals(second), false otherwise
See Also:
Object.equals(Object)

assertEquals

public static void assertEquals(java.lang.String message,
                                java.lang.Object expected,
                                java.lang.Object actual)
Asserts that two objects are either both null or are equal according to Object.equals(Object). If not, an AssertionError is thrown. If the objects are not equal, but the types of two objects are compatible for equality, then the differences as determined by Pojomatic.diff(Object, Object) are included in the failure message.

Parameters:
message - the message to add if the assertion fails
expected - will be displayed first if the assertion fails
actual - will be displayed second if the assertion fails
Throws:
java.lang.AssertionError - if the objects are not equal. Throwable.getMessage() will include information about the differences


Copyright © 2008-2010. All Rights Reserved.