Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.commons.beanutils
Class DynaBeanUtilsTestCase  view DynaBeanUtilsTestCase download DynaBeanUtilsTestCase.java

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.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: 1.22 $ $Date: 2004/02/28 13:18:36 $

Field Summary
protected  DynaBean bean
          The basic test bean for each test.
protected  java.lang.String[] describes
          The set of properties that should be described.
protected  TestBean nested
          The nested bean pointed at by the "nested" property.
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
DynaBeanUtilsTestCase(java.lang.String name)
          Construct a new instance of this test case.
 
Method Summary
protected  void checkIntArray(int[] actual, int[] expected)
           
protected  void checkMap(java.util.Map actual, java.util.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 java.lang.String[] describes
The set of properties that should be described.

Constructor Detail

DynaBeanUtilsTestCase

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

Method Detail

setUp

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


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.


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 java.lang.Exception
Test calling setProperty() with null property values.


testSetPropertyOnPrimitiveWrappers

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


testSetPropertyNull

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


testCopyPropertyByte

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


testCopyPropertyDouble

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


testCopyPropertyFloat

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


testCopyPropertyInteger

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


testCopyPropertyLong

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


testCopyPropertyNull

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


testCopyPropertyShort

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


testCopyPropertyNestedIndexedArray

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


testCopyPropertyNestedMappedMap

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


testCopyPropertyNestedSimple

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


checkIntArray

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

checkMap

protected void checkMap(java.util.Map actual,
                        java.util.Map expected)

createDynaClass

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