org.wounittest
Class WOAssert

java.lang.Object
  extended by org.wounittest.WOAssert

public class WOAssert
extends Object

WOAssert is a set of assertion methods useful for writing tests related to EOF. These methods can be used directly: WOAssert.assertEquals(...), however, they read better if they are referenced through static import:
import static org.wounittest.WOAssert.*;
...
  assertEquals(...);

See Also:
Assert

Constructor Summary
WOAssert()
           
 
Method Summary
protected static boolean areArraysEqualAsBags(NSArray firstArray, NSArray secondArray)
          Internal helper method for assertArraysEqualAsBags and assertArraysNotEqualAsBags.
static void assertArraysEqualAsBags(NSArray expectedArray, NSArray actualArray)
          Asserts that two NSArrays contain the same or equal objects independent of their order.
static void assertArraysEqualAsBags(Object[] expectedJavaArray, NSArray actualArray)
          Asserts that an NSArray and a java array contain the same or equal objects independent of their order.
static void assertArraysNotEqualAsBags(NSArray expectedArray, NSArray actualArray)
          Asserts that two NSArrays don't contain the same or equal objects independent of their order.
static void assertArraysNotEqualAsBags(Object[] expectedJavaArray, NSArray actualArray)
          Asserts that an NSArray and a java array don't contain the same or equal objects independent of their order.
static void assertEquals(Date expectedDate, Date actualDate, long deltaMilliseconds)
          Asserts that two Dates are equal concerning a delta in milliseconds.
static void assertEquals(Object[] expectedJavaArray, NSArray actualArray)
          Asserts that an NSArray and a java array are equal.
static void assertEquals(String message, Date expectedDate, Date actualDate, long deltaMilliseconds)
          Asserts that two Dates are equal concerning a delta in milliseconds.
static void assertInvalidForClientUpdate(EOValidation validationObject)
          Asserts that the object is not in a consistent state from the server-side perspective.
static void assertInvalidForDelete(EOValidation validationObject)
          Asserts that the object can not be deleted in its current state.
static void assertInvalidForInsert(EOValidation validationObject)
          Asserts that the object can not be inserted in its current state.
static void assertInvalidForSave(EOValidation validationObject)
          Asserts that the object can not be saved in its current state.
static void assertInvalidForUpdate(EOValidation validationObject)
          Asserts that the object can not be updated in its current state.
static void assertValidForClientUpdate(EOValidation validationObject)
          Asserts that the object is in a consistent state from the server-side perspective.
static void assertValidForDelete(EOValidation validationObject)
          Asserts that the object can be deleted in its current state.
static void assertValidForInsert(EOValidation validationObject)
          Asserts that the object can be inserted in its current state.
static void assertValidForSave(EOValidation validationObject)
          Asserts that the object can be saved in its current state.
static void assertValidForUpdate(EOValidation validationObject)
          Asserts that the object can be updated in its current state.
protected static void failNotEquals(String message, Object expected, Object actual)
          Internal helper method, fails with message for the unequal objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WOAssert

public WOAssert()
Method Detail

failNotEquals

protected static void failNotEquals(String message,
                                    Object expected,
                                    Object actual)
Internal helper method, fails with message for the unequal objects.


assertEquals

public static void assertEquals(Date expectedDate,
                                Date actualDate,
                                long deltaMilliseconds)
Asserts that two Dates are equal concerning a delta in milliseconds.


assertEquals

public static void assertEquals(String message,
                                Date expectedDate,
                                Date actualDate,
                                long deltaMilliseconds)
Asserts that two Dates are equal concerning a delta in milliseconds. If they are not, an AssertionFailedError is thrown with the given message.


areArraysEqualAsBags

protected static boolean areArraysEqualAsBags(NSArray firstArray,
                                              NSArray secondArray)
Internal helper method for assertArraysEqualAsBags and assertArraysNotEqualAsBags.


assertArraysEqualAsBags

public static void assertArraysEqualAsBags(NSArray expectedArray,
                                           NSArray actualArray)
Asserts that two NSArrays contain the same or equal objects independent of their order.


assertArraysNotEqualAsBags

public static void assertArraysNotEqualAsBags(NSArray expectedArray,
                                              NSArray actualArray)
Asserts that two NSArrays don't contain the same or equal objects independent of their order.


assertArraysEqualAsBags

public static void assertArraysEqualAsBags(Object[] expectedJavaArray,
                                           NSArray actualArray)
Asserts that an NSArray and a java array contain the same or equal objects independent of their order. Convenience method to allow for: assertArraysEqualAsBags(new Object[] {a, b}, testObject.methodReturningNSArray());


assertArraysNotEqualAsBags

public static void assertArraysNotEqualAsBags(Object[] expectedJavaArray,
                                              NSArray actualArray)
Asserts that an NSArray and a java array don't contain the same or equal objects independent of their order. Convenience method to allow for: assertArraysNotEqualAsBags(new Object[] {a, b}, testObject.methodReturningNSArray());


assertEquals

public static void assertEquals(Object[] expectedJavaArray,
                                NSArray actualArray)
Asserts that an NSArray and a java array are equal. Convenience method to allow for: assertEquals(new Object[] {a, b}, testObject.methodReturningNSArray());


assertValidForClientUpdate

public static void assertValidForClientUpdate(EOValidation validationObject)
Asserts that the object is in a consistent state from the server-side perspective.

See Also:
EOValidation.validateClientUpdate()

assertInvalidForClientUpdate

public static void assertInvalidForClientUpdate(EOValidation validationObject)
Asserts that the object is not in a consistent state from the server-side perspective.

See Also:
EOValidation.validateClientUpdate()

assertValidForDelete

public static void assertValidForDelete(EOValidation validationObject)
Asserts that the object can be deleted in its current state.

See Also:
EOValidation.validateForDelete()

assertInvalidForDelete

public static void assertInvalidForDelete(EOValidation validationObject)
Asserts that the object can not be deleted in its current state.

See Also:
EOValidation.validateForDelete()

assertValidForInsert

public static void assertValidForInsert(EOValidation validationObject)
Asserts that the object can be inserted in its current state.

See Also:
EOValidation.validateForInsert()

assertInvalidForInsert

public static void assertInvalidForInsert(EOValidation validationObject)
Asserts that the object can not be inserted in its current state.

See Also:
EOValidation.validateForInsert()

assertValidForSave

public static void assertValidForSave(EOValidation validationObject)
Asserts that the object can be saved in its current state.

See Also:
EOValidation.validateForSave()

assertInvalidForSave

public static void assertInvalidForSave(EOValidation validationObject)
Asserts that the object can not be saved in its current state.

See Also:
EOValidation.validateForSave()

assertValidForUpdate

public static void assertValidForUpdate(EOValidation validationObject)
Asserts that the object can be updated in its current state.

See Also:
EOValidation.validateForUpdate()

assertInvalidForUpdate

public static void assertInvalidForUpdate(EOValidation validationObject)
Asserts that the object can not be updated in its current state.

See Also:
EOValidation.validateForUpdate()