org.apache.commons.beanutils
Class DynaBeanUtilsTestCase

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

public class DynaBeanUtilsTestCase
extends junit.framework.TestCase

Test case for BeanUtils when the underlying bean is actually a DynaBean.

Version:
$Revision: 552279 $ $Date: 2007-07-01 07:04:26 -0400 (Sun, 01 Jul 2007) $
Author:
Craig R. McClanahan

Field Summary
protected  DynaBean bean
          The basic test bean for each test.
protected  String[] describes
          The set of properties that should be described.
protected  TestBean nested
          The nested bean pointed at by the "nested" property.
 
Constructor Summary
DynaBeanUtilsTestCase(String name)
          Construct a new instance of this test case.
 
Method Summary
protected  void checkIntArray(int[] actual, int[] expected)
           
protected  void checkMap(Map actual, Map expected)
           
protected static DynaClass createDynaClass()
          Create and return a DynaClass instance for our test DynaBean.
 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 testCloneDynaBean()
          Test the cloneBean() method from a DynaBean.
 void testCopyPropertiesDynaBean()
          Test the copyProperties() method from a DynaBean.
 void testCopyPropertiesMap()
          Test copyProperties() when the origin is a a Map.
 void testCopyPropertiesStandard()
          Test the copyProperties() method from a standard JavaBean.
 void testCopyPropertyByte()
          Test narrowing and widening conversions on byte.
 void testCopyPropertyDouble()
          Test narrowing and widening conversions on double.
 void testCopyPropertyFloat()
          Test narrowing and widening conversions on float.
 void testCopyPropertyInteger()
          Test narrowing and widening conversions on int.
 void testCopyPropertyLong()
          Test narrowing and widening conversions on long.
 void testCopyPropertyNestedIndexedArray()
          Test copying a property using a nested indexed array expression, with and without conversions.
 void testCopyPropertyNestedMappedMap()
          Test copying a property using a nested mapped map property.
 void testCopyPropertyNestedSimple()
          Test copying a property using a nested simple expression, with and without conversions.
 void testCopyPropertyNull()
          Test copying a null property value.
 void testCopyPropertyShort()
          Test narrowing and widening conversions on short.
 void testDescribe()
          Test the describe() method.
 void testGetArrayProperty()
          tests the string and int arrays of TestBean
 void testGetGeneralProperty()
          tests getting a 'whatever' property
 void testGetIndexedProperty1()
          tests getting an indexed property
 void testGetIndexedProperty2()
          tests getting an indexed property
 void testGetNestedProperty()
          tests getting a nested property
 void testGetSimpleProperty()
          tests getting a 'whatever' property
 void testPopulateArrayElements()
          Test populate() method on individual array elements.
 void testPopulateArrayProperties()
          Test populate() method on array properties as a whole.
 void testPopulateMapped()
          Test populate() on mapped properties.
 void testPopulateNested()
          Test populate() method on nested properties.
 void testPopulateScalar()
          Test populate() method on scalar properties.
 void testSetPropertyNull()
          Test setting a null property value.
 void testSetPropertyNullValues()
          Test calling setProperty() with null property values.
 void testSetPropertyOnPrimitiveWrappers()
          Test converting to and from primitive wrapper types.
 
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 DynaBean bean
The basic test bean for each test.


nested

protected TestBean nested
The nested bean pointed at by the "nested" property.


describes

protected String[] describes
The set of properties that should be described.

Constructor Detail

DynaBeanUtilsTestCase

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

Parameters:
name - Name of the test case
Method Detail

setUp

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

Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception

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

testCloneDynaBean

public void testCloneDynaBean()
Test the cloneBean() method from a DynaBean.


testCopyPropertiesDynaBean

public void testCopyPropertiesDynaBean()
Test the copyProperties() method from a DynaBean.


testCopyPropertiesMap

public void testCopyPropertiesMap()
Test copyProperties() when the origin is a a Map.


testCopyPropertiesStandard

public void testCopyPropertiesStandard()
Test the copyProperties() method from a standard JavaBean.


testDescribe

public void testDescribe()
Test the describe() method.


testPopulateArrayProperties

public void testPopulateArrayProperties()
Test populate() method on array properties as a whole.


testGetArrayProperty

public void testGetArrayProperty()
tests the string and int arrays of TestBean


testGetIndexedProperty1

public void testGetIndexedProperty1()
tests getting an indexed property


testGetIndexedProperty2

public void testGetIndexedProperty2()
tests getting an indexed property


testGetNestedProperty

public void testGetNestedProperty()
tests getting a nested property


testGetGeneralProperty

public void testGetGeneralProperty()
tests getting a 'whatever' property


testGetSimpleProperty

public void testGetSimpleProperty()
tests getting a 'whatever' property


testPopulateArrayElements

public void testPopulateArrayElements()
Test populate() method on individual array elements.


testPopulateMapped

public void testPopulateMapped()
Test populate() on mapped properties.


testPopulateNested

public void testPopulateNested()
Test populate() method on nested properties.


testPopulateScalar

public void testPopulateScalar()
Test populate() method on scalar properties.


testSetPropertyNullValues

public void testSetPropertyNullValues()
                               throws Exception
Test calling setProperty() with null property values.

Throws:
Exception

testSetPropertyOnPrimitiveWrappers

public void testSetPropertyOnPrimitiveWrappers()
                                        throws Exception
Test converting to and from primitive wrapper types.

Throws:
Exception

testSetPropertyNull

public void testSetPropertyNull()
                         throws Exception
Test setting a null property value.

Throws:
Exception

testCopyPropertyByte

public void testCopyPropertyByte()
                          throws Exception
Test narrowing and widening conversions on byte.

Throws:
Exception

testCopyPropertyDouble

public void testCopyPropertyDouble()
                            throws Exception
Test narrowing and widening conversions on double.

Throws:
Exception

testCopyPropertyFloat

public void testCopyPropertyFloat()
                           throws Exception
Test narrowing and widening conversions on float.

Throws:
Exception

testCopyPropertyInteger

public void testCopyPropertyInteger()
                             throws Exception
Test narrowing and widening conversions on int.

Throws:
Exception

testCopyPropertyLong

public void testCopyPropertyLong()
                          throws Exception
Test narrowing and widening conversions on long.

Throws:
Exception

testCopyPropertyNull

public void testCopyPropertyNull()
                          throws Exception
Test copying a null property value.

Throws:
Exception

testCopyPropertyShort

public void testCopyPropertyShort()
                           throws Exception
Test narrowing and widening conversions on short.

Throws:
Exception

testCopyPropertyNestedIndexedArray

public void testCopyPropertyNestedIndexedArray()
                                        throws Exception
Test copying a property using a nested indexed array expression, with and without conversions.

Throws:
Exception

testCopyPropertyNestedMappedMap

public void testCopyPropertyNestedMappedMap()
                                     throws Exception
Test copying a property using a nested mapped map property.

Throws:
Exception

testCopyPropertyNestedSimple

public void testCopyPropertyNestedSimple()
                                  throws Exception
Test copying a property using a nested simple expression, with and without conversions.

Throws:
Exception

checkIntArray

protected void checkIntArray(int[] actual,
                             int[] expected)

checkMap

protected void checkMap(Map actual,
                        Map expected)

createDynaClass

protected static DynaClass createDynaClass()
Create and return a DynaClass instance for our test DynaBean.



Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.