net.sf.molae.pipe.test
Class MapEntryTest<B extends Map.Entry<K,V>,K,V>

java.lang.Object
  extended by org.junit.Assert
      extended by net.sf.molae.pipe.test.ObjectTest<B>
          extended by net.sf.molae.pipe.test.MapEntryTest<B,K,V>

public class MapEntryTest<B extends Map.Entry<K,V>,K,V>
extends ObjectTest<B>

Test methods to check the contract of map entry implementing classes.


Constructor Summary
protected MapEntryTest(B testObject)
          Creates a new test with the specified candidate.
 
Method Summary
 void assertConsistency()
          Checks consistency of all reading map entry methods.
 void assertImmutability()
          Calls all modifying methods of the underlying map entry and checks if they throw an UnsupportedOperationException.
protected static
<K,V> MapEntryTest<Map.Entry<K,V>,K,V>
newInstance(Map.Entry<K,V> testObject)
          Creates a new test with the specified candidate.
 
Methods inherited from class net.sf.molae.pipe.test.ObjectTest
assertFalse, assertTestValuesSet, getTestObject, setTestValuesSet, toString
 
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

MapEntryTest

protected MapEntryTest(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

newInstance

protected static <K,V> MapEntryTest<Map.Entry<K,V>,K,V> newInstance(Map.Entry<K,V> 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.

assertConsistency

public void assertConsistency()
Checks consistency of all reading map entry methods.

Overrides:
assertConsistency in class ObjectTest<B extends Map.Entry<K,V>>
Throws:
AssertionFailedError - if the map entry contract is broken by the tested entry.

assertImmutability

public void assertImmutability()
Calls all modifying methods of the underlying map entry and checks if they throw an UnsupportedOperationException.

Throws:
AssertionFailedError - if any of the called operations did not throw an UnsupportedOperationException