org.pojomatic.junit
Class PojomaticAssert

java.lang.Object
  extended by org.pojomatic.junit.PojomaticAssert

public class PojomaticAssert
extends java.lang.Object

Pojomatic-related JUnit-style assertion methods useful for writing tests.

See Also:
Assert

Method Summary
static void assertEqualsWithDiff(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 void assertEqualsWithDiff(java.lang.Object expected, java.lang.Object actual, java.lang.String message)
          Asserts that two objects are either 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

assertEqualsWithDiff

public static void assertEqualsWithDiff(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:
expected - the expected object
actual - the object which should be tested to equal the expected object
Throws:
java.lang.AssertionError - if the objects are not equal.
See Also:
assertEqualsWithDiff(Object, Object, String)

assertEqualsWithDiff

public static void assertEqualsWithDiff(java.lang.Object expected,
                                        java.lang.Object actual,
                                        java.lang.String message)
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:
expected - the expected object
actual - the object which should be tested to equal the expected object
message - a message (possibly null) to include at the beginning of the AssertionError message.
Throws:
java.lang.AssertionError - if the objects are not equal.


Copyright © 2008-2010. All Rights Reserved.