|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.apache.commons.beanutils.BeanUtilsTestCase
public class BeanUtilsTestCase
Test Case for the BeanUtils class. The majority of these tests use instances of the TestBean class, so be sure to update the tests if you change the characteristics of that class.
Template for this stolen from Craigs PropertyUtilsTestCase
Note that the tests are dependant upon the static aspects (such as array sizes...) of the TestBean.java class, so ensure than all changes to TestBean are reflected here.
So far, this test case has tests for the following methods of the
BeanUtils class:
| Field Summary | |
|---|---|
protected TestBean |
bean
The test bean for each test. |
protected String[] |
describes
The set of properties that should be described. |
protected Calendar |
testCalendar
Test Calendar value |
protected String |
testStringDate
Test String Date value |
protected Date |
testUtilDate
Test java.util.Date value |
| Constructor Summary | |
|---|---|
BeanUtilsTestCase(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)
|
void |
setUp()
Set up instance variables required by this test case. |
protected void |
setUpShared()
Shared Set up. |
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 |
testArrayPropertyConversion()
|
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 |
testCopyPropertyConvert()
Test copyProperty() conversion. |
void |
testCopyPropertyConvertFromString()
Test copyProperty() converting from a String. |
void |
testCopyPropertyConvertToString()
Test copyProperty() converting to a String. |
void |
testCopyPropertyConvertToStringArray()
Test copyProperty() converting to a String. |
void |
testCopyPropertyConvertToStringIndexed()
Test copyProperty() converting to a String on indexed property |
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 |
testCopyPropertyWriteOnly()
Test copying a new value to a write-only property, with and without conversions. |
void |
testDescribe()
Test the describe() method. |
void |
testGetArrayProperty()
tests the string and int arrays of TestBean |
void |
testGetArrayPropertyDate()
Test getArrayProperty() converting to a String. |
void |
testGetGeneralProperty()
tests getting a 'whatever' property |
void |
testGetIndexedProperty1()
tests getting an indexed property |
void |
testGetIndexedProperty2()
tests getting an indexed property |
void |
testGetIndexedPropertyDate()
Test getArrayProperty() converting to a String. |
void |
testGetNestedProperty()
tests getting a nested property |
void |
testGetSimpleProperty()
tests getting a 'whatever' property |
void |
testGetSimplePropertyDate()
Test getSimpleProperty() converting to a String. |
void |
testInitCause()
Test for BeanUtilsBean.initCause(Throwable, Throwable) method. |
void |
testMappedProperty()
|
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 |
testSeparateInstances()
Tests that separate instances can register separate instances |
void |
testSetMappedMap()
Test setting a value out of a mapped Map |
void |
testSetPropertyByte()
Test narrowing and widening conversions on byte. |
void |
testSetPropertyConvert()
Test setProperty() conversion. |
void |
testSetPropertyConvertFromString()
Test setProperty() converting from a String. |
void |
testSetPropertyConvertToString()
Test setProperty() converting to a String. |
void |
testSetPropertyConvertToStringArray()
Test setProperty() converting to a String array. |
void |
testSetPropertyConvertToStringIndexed()
Test setProperty() converting to a String on indexed property |
void |
testSetPropertyDouble()
Test narrowing and widening conversions on double. |
void |
testSetPropertyFloat()
Test narrowing and widening conversions on float. |
void |
testSetPropertyInteger()
Test narrowing and widening conversions on int. |
void |
testSetPropertyLong()
Test narrowing and widening conversions on long. |
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. |
void |
testSetPropertyShort()
Test narrowing and widening conversions on short. |
void |
testSetPropertyStringToArray()
Test setting a String value to a String array property |
void |
testSetPropertyWriteOnly()
Test setting a new value to a write-only property, with and without conversions. |
| 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 |
|---|
protected TestBean bean
protected String[] describes
protected Calendar testCalendar
protected Date testUtilDate
protected String testStringDate
| Constructor Detail |
|---|
public BeanUtilsTestCase(String name)
name - Name of the test case| Method Detail |
|---|
public void setUp()
setUp in class junit.framework.TestCaseprotected void setUpShared()
public static junit.framework.Test suite()
public void tearDown()
tearDown in class junit.framework.TestCasepublic void testCopyPropertiesDynaBean()
public void testCopyPropertiesMap()
Map.
public void testCopyPropertiesStandard()
public void testDescribe()
public void testGetArrayProperty()
public void testGetArrayPropertyDate()
getArrayProperty() converting to a String.
public void testGetIndexedProperty1()
public void testGetIndexedPropertyDate()
getArrayProperty() converting to a String.
public void testGetIndexedProperty2()
public void testGetNestedProperty()
public void testGetGeneralProperty()
public void testGetSimpleProperty()
public void testGetSimplePropertyDate()
getSimpleProperty() converting to a String.
public void testPopulateArrayElements()
public void testPopulateArrayProperties()
public void testPopulateMapped()
public void testPopulateNested()
public void testPopulateScalar()
public void testSetPropertyNullValues()
throws Exception
Exception
public void testSetPropertyOnPrimitiveWrappers()
throws Exception
Exception
public void testSetPropertyByte()
throws Exception
Exceptionpublic void testSetPropertyConvert()
setProperty() conversion.
public void testSetPropertyConvertFromString()
setProperty() converting from a String.
public void testSetPropertyConvertToString()
setProperty() converting to a String.
public void testSetPropertyConvertToStringArray()
setProperty() converting to a String array.
public void testSetPropertyConvertToStringIndexed()
setProperty() converting to a String on indexed property
public void testSetPropertyDouble()
throws Exception
Exception
public void testSetPropertyFloat()
throws Exception
Exception
public void testSetPropertyInteger()
throws Exception
Exception
public void testSetPropertyLong()
throws Exception
Exception
public void testSetPropertyNull()
throws Exception
Exception
public void testSetPropertyShort()
throws Exception
Exception
public void testSetPropertyStringToArray()
throws Exception
Exception
public void testCopyPropertyByte()
throws Exception
Exceptionpublic void testCopyPropertyConvert()
copyProperty() conversion.
public void testCopyPropertyConvertFromString()
copyProperty() converting from a String.
public void testCopyPropertyConvertToString()
copyProperty() converting to a String.
public void testCopyPropertyConvertToStringArray()
copyProperty() converting to a String.
public void testCopyPropertyConvertToStringIndexed()
copyProperty() converting to a String on indexed property
public void testCopyPropertyDouble()
throws Exception
Exception
public void testCopyPropertyFloat()
throws Exception
Exception
public void testCopyPropertyInteger()
throws Exception
Exception
public void testCopyPropertyLong()
throws Exception
Exception
public void testCopyPropertyShort()
throws Exception
Exception
public void testCopyPropertyNestedIndexedArray()
throws Exception
Exception
public void testCopyPropertyNestedMappedMap()
throws Exception
Exception
public void testCopyPropertyNestedSimple()
throws Exception
Exception
public void testCopyPropertyNull()
throws Exception
Exception
public void testCopyPropertyWriteOnly()
throws Exception
Exception
public void testSetPropertyWriteOnly()
throws Exception
Exceptionpublic void testSetMappedMap()
public void testSeparateInstances()
throws Exception
Exception
public void testArrayPropertyConversion()
throws Exception
Exception
protected void checkIntArray(int[] actual,
int[] expected)
protected void checkMap(Map actual,
Map expected)
public void testMappedProperty()
throws Exception
Exceptionpublic void testInitCause()
BeanUtilsBean.initCause(Throwable, Throwable) method.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||