org.apache.commons.beanutils
Class BeanComparatorTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.commons.beanutils.BeanComparatorTestCase
All Implemented Interfaces:
junit.framework.Test

public class BeanComparatorTestCase
extends junit.framework.TestCase

Test Case for the BeanComparator class.

Version:
$Revision: 745074 $
Author:
Eric Pugh

Field Summary
protected  AlphaBean alphaBean1
           
protected  AlphaBean alphaBean2
           
protected  TestBean bean
          The test beans for each test.
protected  BeanComparator beanComparator
           
 
Constructor Summary
BeanComparatorTestCase(String name)
          Construct a new instance of this test case.
 
Method Summary
 void setUp()
          Set up instance variables required by this test case.
static junit.framework.Test suite()
          Return the tests included in this test suite.
 void tearDown()
          Tear down instance variables required by this test case.
 void testCompareBeanAgainstSelf()
          tests comparing one bean against itself.
 void testCompareIdentical()
          tests comparing two beans via their name using the default Comparator where they have the same value.
 void testCompareOnBooleanProperty()
          tests comparing two beans on a boolean property, which is not possible.
 void testCompareOnMissingProperty()
          tests comparing two beans who don't have a property
 void testCompareWithNulls()
          tests comparing two beans via their name using the default Comparator, but with one of the beans being null.
 void testSetProperty()
          tests comparing two beans on a boolean property, then changing the property and testing
 void testSimpleCompare()
          tests comparing two beans via their name using the default Comparator
 void testSimpleCompareInverse()
          tests comparing two beans via their name using the default Comparator, but the inverse
 
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
 

Field Detail

bean

protected TestBean bean
The test beans for each test.


alphaBean1

protected AlphaBean alphaBean1

alphaBean2

protected AlphaBean alphaBean2

beanComparator

protected BeanComparator beanComparator
Constructor Detail

BeanComparatorTestCase

public BeanComparatorTestCase(String name)
Construct a new instance of this test case.

Parameters:
name - Name of the test case
Method Detail

setUp

public void setUp()
Set up instance variables required by this test case.

Overrides:
setUp in class junit.framework.TestCase

suite

public static junit.framework.Test suite()
Return the tests included in this test suite.


tearDown

public void tearDown()
Tear down instance variables required by this test case.

Overrides:
tearDown in class junit.framework.TestCase

testSimpleCompare

public void testSimpleCompare()
tests comparing two beans via their name using the default Comparator


testSimpleCompareInverse

public void testSimpleCompareInverse()
tests comparing two beans via their name using the default Comparator, but the inverse


testCompareIdentical

public void testCompareIdentical()
tests comparing two beans via their name using the default Comparator where they have the same value.


testCompareBeanAgainstSelf

public void testCompareBeanAgainstSelf()
tests comparing one bean against itself.


testCompareWithNulls

public void testCompareWithNulls()
tests comparing two beans via their name using the default Comparator, but with one of the beans being null.


testCompareOnMissingProperty

public void testCompareOnMissingProperty()
tests comparing two beans who don't have a property


testCompareOnBooleanProperty

public void testCompareOnBooleanProperty()
tests comparing two beans on a boolean property, which is not possible.


testSetProperty

public void testSetProperty()
tests comparing two beans on a boolean property, then changing the property and testing



Copyright © 2000-2010 The Apache Software Foundation. All Rights Reserved.