org.apache.commons.lang.builder
Class HashCodeBuilderAndEqualsBuilderTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.apache.commons.lang.builder.HashCodeBuilderAndEqualsBuilderTest
All Implemented Interfaces:
junit.framework.Test

public class HashCodeBuilderAndEqualsBuilderTest
extends junit.framework.TestCase

Tests HashCodeBuilder and EqualsBuilderTest to insure that equal objects must have equal hash codes.

Version:
$Id: HashCodeBuilderAndEqualsBuilderTest.java 437554 2006-08-28 06:21:41Z bayard $
Author:
Gary Gregory

Constructor Summary
HashCodeBuilderAndEqualsBuilderTest(java.lang.String name)
          Constructor for HashCodeBuilderAndEqualsBuilderTest.
 
Method Summary
 void assertEqualsAndHashCodeContract(java.lang.Object lhs, java.lang.Object rhs, boolean testTransients)
          Asserts that if lhs equals rhs then their hash codes MUST be identical.
static void main(java.lang.String[] args)
           
protected  void setUp()
           
static junit.framework.Test suite()
           
protected  void tearDown()
           
 void testFixture()
           
 void testFixture(boolean testTransients)
           
 void testFixtureWithTransients()
           
 void testInteger()
           
 void testInteger(boolean testTransients)
           
 void testIntegerWithTransients()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HashCodeBuilderAndEqualsBuilderTest

public HashCodeBuilderAndEqualsBuilderTest(java.lang.String name)
Constructor for HashCodeBuilderAndEqualsBuilderTest.

Parameters:
name -
Method Detail

main

public static void main(java.lang.String[] args)

suite

public static junit.framework.Test suite()

setUp

protected void setUp()
              throws java.lang.Exception
Throws:
java.lang.Exception

tearDown

protected void tearDown()
                 throws java.lang.Exception
Throws:
java.lang.Exception

testInteger

public void testInteger(boolean testTransients)

testInteger

public void testInteger()

testIntegerWithTransients

public void testIntegerWithTransients()

testFixture

public void testFixture()

testFixtureWithTransients

public void testFixtureWithTransients()

testFixture

public void testFixture(boolean testTransients)

assertEqualsAndHashCodeContract

public void assertEqualsAndHashCodeContract(java.lang.Object lhs,
                                            java.lang.Object rhs,
                                            boolean testTransients)
Asserts that if lhs equals rhs then their hash codes MUST be identical.

Parameters:
lhs - The Left-Hand-Side of the equals test
rhs - The Right-Hand-Side of the equals test
testTransients - wether to test transient fields


Copyright © 2001-2008 The Apache Software Foundation. All Rights Reserved.