org.pojomatic.testng
Class PojomaticAssert

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

public class PojomaticAssert
extends java.lang.Object

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

See Also:
Assert

Method Summary
static void assertEqualsWithDiff(java.lang.Object actual, java.lang.Object expected)
          Asserts that two objects are either both null or are equal according to Object.equals(Object).
static void assertEqualsWithDiff(java.lang.Object actual, java.lang.Object expected, 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 actual,
                                        java.lang.Object expected)
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, with details of the differences included in the message
See Also:
assertEqualsWithDiff(Object, Object, String)

assertEqualsWithDiff

public static void assertEqualsWithDiff(java.lang.Object actual,
                                        java.lang.Object expected,
                                        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 - an optional message provided along with the diff if the objects are not equal
Throws:
java.lang.AssertionError - if the objects are not equal, with details of the differences included in the message


Copyright © 2008-2010. All Rights Reserved.