org.infinitest.toolkit
Class StrictEqualsHashCodeTestSupport

java.lang.Object
  extended by org.infinitest.toolkit.EqualsHashCodeTestSupport
      extended by org.infinitest.toolkit.StrictEqualsHashCodeTestSupport

public abstract class StrictEqualsHashCodeTestSupport
extends EqualsHashCodeTestSupport

Support structure for testing a class's compliance with the equals and hashCode contract more strictly -- use this for classes that should compare equal only to objects of the same runtime class. equalButDifferentClass() should return objects of a subclass of the classes of EqualsHashCodeTestSupport.equal() and EqualsHashCodeTestSupport.notEqual(), that has the same values as the instances returned from EqualsHashCodeTestSupport.equal(). If the class under test is final, use EqualsHashCodeTestSupport instead.

Author:
Paul Holser

Constructor Summary
StrictEqualsHashCodeTestSupport()
           
 
Method Summary
 void initializeStrictHarness()
           
 void subclassInstanceWithSameValuesShouldNotCompareEqualToSuperclassInstance()
           
 
Methods inherited from class org.infinitest.toolkit.EqualsHashCodeTestSupport
equalObjectsShouldGiveSameHashCode, equalsShouldBeConsistentAcrossInvocations, equalsShouldBeReflexive, equalsShouldBeSymmetricAndTransitive, hashCodeShouldBeConsistentAcrossInvocations, initializeHarness, shouldNotBeEqualToJavaLangObject, shouldNotBeEqualToNull, unequalObjectsShouldNotCompareEqual
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StrictEqualsHashCodeTestSupport

public StrictEqualsHashCodeTestSupport()
Method Detail

initializeStrictHarness

public void initializeStrictHarness()
                             throws Exception
Throws:
Exception

subclassInstanceWithSameValuesShouldNotCompareEqualToSuperclassInstance

public void subclassInstanceWithSameValuesShouldNotCompareEqualToSuperclassInstance()


© Copyright 2009 Paul R. Holser, Jr. All rights reserved. pholser@alumni.rice.edu