org.jtiger.assertion
Class ObjectFactoryContract

java.lang.Object
  extended by org.jtiger.assertion.ObjectFactoryContract

public final class ObjectFactoryContract
extends Object

Provides the ability to make assertions on the contract defined by ObjectFactory. The contract has five (5) aspects, which are specified by ObjectFactory.

Version:
2.1
Build Number 0376
Build Time 2006-07-28 01:50.16.218 CET (GMT + 1)
Author:
Tony Morris
See Also:
ObjectFactory

Method Summary
static void assertObjectFactoryFillsContract(ObjectFactory<?> factory, Object... message)
          Asserts that the given ObjectFactory meets the entire contract.
static void assertObjectFactoryXConsistentlyEqual(ObjectFactory<?> factory, Object... message)
          Asserts that the given ObjectFactory meets one aspect of the entire contract.
static void assertObjectFactoryXConsistentlyNewInstance(ObjectFactory<?> factory, Object... message)
          Asserts that the given ObjectFactory meets one aspect of the entire contract.
static void assertObjectFactoryXYConsistentlyUnequal(ObjectFactory<?> factory, Object... message)
          Asserts that the given ObjectFactory meets one aspect of the entire contract.
static void assertObjectFactoryYConsistentlyEqual(ObjectFactory<?> factory, Object... message)
          Asserts that the given ObjectFactory meets one aspect of the entire contract.
static void assertObjectFactoryYConsistentlyNewInstance(ObjectFactory<?> factory, Object... message)
          Asserts that the given ObjectFactory meets one aspect of the entire contract.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

assertObjectFactoryXConsistentlyNewInstance

public static void assertObjectFactoryXConsistentlyNewInstance(ObjectFactory<?> factory,
                                                               Object... message)
                                                        throws AssertionException
Asserts that the given ObjectFactory meets one aspect of the entire contract. The ObjectFactory.newInstanceX() method must consistently return new instances.

Parameters:
factory - The object factory to assert has met the aspect of the contract.
message - The assertion message.
Throws:
AssertionException - If the ObjectFactory.newInstanceX() method does not consistently return new instances.

assertObjectFactoryYConsistentlyNewInstance

public static void assertObjectFactoryYConsistentlyNewInstance(ObjectFactory<?> factory,
                                                               Object... message)
                                                        throws AssertionException
Asserts that the given ObjectFactory meets one aspect of the entire contract. The ObjectFactory.newInstanceY() method must consistently return new instances.

Parameters:
factory - The object factory to assert has met the aspect of the contract.
message - The assertion message.
Throws:
AssertionException - If the ObjectFactory.newInstanceY() method does not consistently return new instances.

assertObjectFactoryXConsistentlyEqual

public static void assertObjectFactoryXConsistentlyEqual(ObjectFactory<?> factory,
                                                         Object... message)
                                                  throws AssertionException
Asserts that the given ObjectFactory meets one aspect of the entire contract. The ObjectFactory.newInstanceX() method must consistently return equal instances.

Parameters:
factory - The object factory to assert has met the aspect of the contract.
message - The assertion message.
Throws:
AssertionException - If the ObjectFactory.newInstanceX() method does not consistently return equal instances.

assertObjectFactoryYConsistentlyEqual

public static void assertObjectFactoryYConsistentlyEqual(ObjectFactory<?> factory,
                                                         Object... message)
                                                  throws AssertionException
Asserts that the given ObjectFactory meets one aspect of the entire contract. The ObjectFactory.newInstanceY() method must consistently return equal instances.

Parameters:
factory - The object factory to assert has met the aspect of the contract.
message - The assertion message.
Throws:
AssertionException - If the ObjectFactory.newInstanceY() method does not consistently return equal instances.

assertObjectFactoryXYConsistentlyUnequal

public static void assertObjectFactoryXYConsistentlyUnequal(ObjectFactory<?> factory,
                                                            Object... message)
                                                     throws AssertionException
Asserts that the given ObjectFactory meets one aspect of the entire contract. The ObjectFactory.newInstanceX() method must consistently return instances that are unequal to instances returned by the ObjectFactory.newInstanceY() method.

Parameters:
factory - The object factory to assert has met the aspect of the contract.
message - The assertion message.
Throws:
AssertionException - If the ObjectFactory.newInstanceY() method does not consistently return instances that are unequal to instances returned by the ObjectFactory.newInstanceY() method.

assertObjectFactoryFillsContract

public static void assertObjectFactoryFillsContract(ObjectFactory<?> factory,
                                                    Object... message)
                                             throws AssertionException
Asserts that the given ObjectFactory meets the entire contract.

Parameters:
factory - The object factory to assert has met the contract.
message - The assertion message.
Throws:
AssertionException - If the object factory does not meet the entire contract.
See Also:
ObjectFactory