net.sf.molae.pipe.test
Class ObjectTest<B>

java.lang.Object
  extended by org.junit.Assert
      extended by net.sf.molae.pipe.test.ObjectTest<B>
Direct Known Subclasses:
BinaryFunctionTest, CollectionTest, CubeTest, IteratorTest, MapEntryTest, MapTest

public abstract class ObjectTest<B>
extends Assert

Test methods to check objects. Parent class for interface test beds.


Constructor Summary
ObjectTest(B testObject)
          Creates a new test with the specified candidate.
 
Method Summary
 void assertConsistency()
          Checks if the test object fulfils the equals and hashCode contract.
static void assertFalse(String message, boolean condition)
          Redefinition, because this method is not defined in older JUnit versions.
protected  void assertTestValuesSet()
          Checks if the test values have been set.
 B getTestObject()
          Returns the candidate (the object that is tested).
protected  void setTestValuesSet()
          States that test values have been correctly set.
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class org.junit.Assert
assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectTest

public ObjectTest(B testObject)
Creates a new test with the specified candidate.

Parameters:
testObject - the candidate of the test
Throws:
NullPointerException - if the specified test objects is null.
Method Detail

assertFalse

public static final void assertFalse(String message,
                                     boolean condition)
Redefinition, because this method is not defined in older JUnit versions.

Parameters:
message - the message to be displayed if the assertion fails
condition - the condition to test

getTestObject

public final B getTestObject()
Returns the candidate (the object that is tested).

Returns:
the test object of this test.

toString

public String toString()
Returns a string representation of the object.

Overrides:
toString in class Object
Returns:
a string representation of the object.

assertConsistency

public void assertConsistency()
Checks if the test object fulfils the equals and hashCode contract.

Throws:
AssertionFailedError - if the a contract is broken by the test object.

setTestValuesSet

protected void setTestValuesSet()
States that test values have been correctly set.


assertTestValuesSet

protected void assertTestValuesSet()
Checks if the test values have been set.

Throws:
IllegalStateException - if test values have not been set.