|
Keel 2.1RC2 | ||||||||||
| 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
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 |
beanThe test bean for each test. |
protected java.lang.String[] |
describesThe set of properties that should be described. |
| Fields inherited from class junit.framework.TestCase |
|
| Constructor Summary | |
BeanUtilsTestCase(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) |
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 |
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 |
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 |
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 |
testSetPropertyByte()Test narrowing and widening conversions on byte. |
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 |
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 |
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, name, run, run, runBare, runTest, setName, toString |
| Methods inherited from class junit.framework.Assert |
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, 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 java.lang.String[] describes
| Constructor Detail |
public BeanUtilsTestCase(java.lang.String name)
name - Name of the test case| Method Detail |
public void setUp()
public static junit.framework.Test suite()
public void tearDown()
public void testCopyPropertiesDynaBean()
public void testCopyPropertiesMap()
Map.
public void testCopyPropertiesStandard()
public void testDescribe()
public void testGetArrayProperty()
public void testGetIndexedProperty1()
public void testGetIndexedProperty2()
public void testGetNestedProperty()
public void testGetGeneralProperty()
public void testGetSimpleProperty()
public void testPopulateArrayElements()
public void testPopulateArrayProperties()
public void testPopulateMapped()
public void testPopulateNested()
public void testPopulateScalar()
public void testSetPropertyNullValues()
throws java.lang.Exception
java.lang.Exception
public void testSetPropertyOnPrimitiveWrappers()
throws java.lang.Exception
java.lang.Exception
public void testSetPropertyByte()
throws java.lang.Exception
java.lang.Exception
public void testSetPropertyDouble()
throws java.lang.Exception
java.lang.Exception
public void testSetPropertyFloat()
throws java.lang.Exception
java.lang.Exception
public void testSetPropertyInteger()
throws java.lang.Exception
java.lang.Exception
public void testSetPropertyLong()
throws java.lang.Exception
java.lang.Exception
public void testSetPropertyShort()
throws java.lang.Exception
java.lang.Exception
public void testCopyPropertyByte()
throws java.lang.Exception
java.lang.Exception
public void testCopyPropertyDouble()
throws java.lang.Exception
java.lang.Exception
public void testCopyPropertyFloat()
throws java.lang.Exception
java.lang.Exception
public void testCopyPropertyInteger()
throws java.lang.Exception
java.lang.Exception
public void testCopyPropertyLong()
throws java.lang.Exception
java.lang.Exception
public void testCopyPropertyShort()
throws java.lang.Exception
java.lang.Exception
public void testCopyPropertyNestedIndexedArray()
throws java.lang.Exception
java.lang.Exception
public void testCopyPropertyNestedMappedMap()
throws java.lang.Exception
java.lang.Exception
public void testCopyPropertyNestedSimple()
throws java.lang.Exception
java.lang.Exception
public void testCopyPropertyWriteOnly()
throws java.lang.Exception
java.lang.Exception
public void testSetPropertyWriteOnly()
throws java.lang.Exception
java.lang.Exception
protected void checkIntArray(int[] actual,
int[] expected)
protected void checkMap(java.util.Map actual,
java.util.Map expected)
|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||