Package org.apache.struts.action
Class TestDynaActionForm
java.lang.Object
org.apache.struts.action.TestDynaActionFormClass
org.apache.struts.action.TestDynaActionForm
Suite of unit tests for the
DynaActionForm
class.-
Field Summary
Modifier and TypeFieldDescriptionprotected org.apache.struts.action.DynaActionForm
The basicDynaActionForm
to use for testing.protected org.apache.struts.action.ActionMapping
Dummy ActionMapping for calls to reset() and validate().protected org.apache.struts.config.ModuleConfig
Dummy ModuleConfig for calls to reset() and validate().protected static final String[]
The set of property names we expect to have returned when callinggetDynaProperties()
.Fields inherited from class org.apache.struts.action.TestDynaActionFormClass
beanConfig, dynaClass, dynaProperties
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
setUp()
void
tearDown()
void
void
Corner cases on getDynaProperty invalid arguments.void
testGetDescriptorBase
(String name, Class<?> type) Base for testGetDescriptorXxxxx() series of tests.void
Positive getDynaProperty on propertybooleanProperty
.void
Positive getDynaProperty on propertydoubleProperty
.void
Positive getDynaProperty on propertyfloatProperty
.void
Positive getDynaProperty on propertyintProperty
.void
Positive getDynaProperty on propertylongProperty
.void
Positive test for getDynaPropertys().void
Positive getDynaProperty on propertybooleanSecond
that uses an "is" method as the getter.void
Positive getDynaProperty on propertyshortProperty
.void
Positive getDynaProperty on propertystringProperty
.void
Corner cases on getIndexedProperty invalid arguments.void
Positive and negative tests on getIndexedProperty valid arguments.void
Corner cases on getMappedProperty invalid arguments.void
Positive and negative tests on getMappedProperty valid arguments.void
Corner cases on getSimpleProperty invalid arguments.void
Test getSimpleProperty on a boolean property.void
Test getSimpleProperty on a double property.void
Test getSimpleProperty on a float property.void
Test getSimpleProperty on a int property.void
Test getSimpleProperty on a long property.void
Test getSimpleProperty on a short property.void
Test getSimpleProperty on a String property.void
void
Testcontains()
method for mapped properties.void
Testremove()
method for mapped properties.void
Test the reset method when the request method is GET.void
Test the reset method when the request method is GET.void
void
Corner cases on setIndexedProperty invalid arguments.void
Positive and negative tests on setIndexedProperty valid arguments.void
Positive and negative tests on setMappedProperty valid arguments.void
Test setSimpleProperty on a boolean property.void
Test setSimpleProperty on a double property.void
Test setSimpleProperty on a float property.void
Test setSimpleProperty on a int property.void
Test setSimpleProperty on a long property.void
Test setSimpleProperty on a short property.void
Test setSimpleProperty on a String property.Methods inherited from class org.apache.struts.action.TestDynaActionFormClass
testClassCreate, testConfigAdd, testConfigCreate, testConfigDuplicate, testConfigInitialValues, testConfigProperties, testConfigRemove
-
Field Details
-
properties
The set of property names we expect to have returned when callinggetDynaProperties()
. You should update this list when new properties are added to TestBean. -
moduleConfig
protected org.apache.struts.config.ModuleConfig moduleConfigDummy ModuleConfig for calls to reset() and validate(). -
dynaForm
protected org.apache.struts.action.DynaActionForm dynaFormThe basicDynaActionForm
to use for testing. -
mapping
protected org.apache.struts.action.ActionMapping mappingDummy ActionMapping for calls to reset() and validate().
-
-
Constructor Details
-
TestDynaActionForm
public TestDynaActionForm()
-
-
Method Details
-
setUp
- Overrides:
setUp
in classTestDynaActionFormClass
-
tearDown
- Overrides:
tearDown
in classTestDynaActionFormClass
-
testBeanCreate
-
testIndexedInitialize
-
testScalarInitialize
-
testGetDescriptorArguments
Corner cases on getDynaProperty invalid arguments. -
testGetDescriptorBoolean
Positive getDynaProperty on propertybooleanProperty
. -
testGetDescriptorDouble
Positive getDynaProperty on propertydoubleProperty
. -
testGetDescriptorFloat
Positive getDynaProperty on propertyfloatProperty
. -
testGetDescriptorInt
Positive getDynaProperty on propertyintProperty
. -
testGetDescriptorLong
Positive getDynaProperty on propertylongProperty
. -
testGetDescriptorSecond
Positive getDynaProperty on propertybooleanSecond
that uses an "is" method as the getter. -
testGetDescriptorShort
Positive getDynaProperty on propertyshortProperty
. -
testGetDescriptorString
Positive getDynaProperty on propertystringProperty
. -
testGetDescriptors
Positive test for getDynaPropertys(). Each property name listed inproperties
should be returned exactly once. -
testGetIndexedArguments
Corner cases on getIndexedProperty invalid arguments. -
testGetIndexedValues
Positive and negative tests on getIndexedProperty valid arguments. -
testGetMappedArguments
Corner cases on getMappedProperty invalid arguments. -
testGetMappedValues
Positive and negative tests on getMappedProperty valid arguments. -
testGetSimpleArguments
Corner cases on getSimpleProperty invalid arguments. -
testGetSimpleBoolean
Test getSimpleProperty on a boolean property. -
testGetSimpleDouble
Test getSimpleProperty on a double property. -
testGetSimpleFloat
Test getSimpleProperty on a float property. -
testGetSimpleInt
Test getSimpleProperty on a int property. -
testGetSimpleLong
Test getSimpleProperty on a long property. -
testGetSimpleShort
Test getSimpleProperty on a short property. -
testGetSimpleString
Test getSimpleProperty on a String property. -
testMappedContains
Testcontains()
method for mapped properties. -
testMappedRemove
Testremove()
method for mapped properties. -
testResetGet
Test the reset method when the request method is GET. -
testResetPost
Test the reset method when the request method is GET. -
testSetIndexedArguments
Corner cases on setIndexedProperty invalid arguments. -
testSetIndexedValues
Positive and negative tests on setIndexedProperty valid arguments. -
testSetMappedValues
Positive and negative tests on setMappedProperty valid arguments. -
testSetSimpleBoolean
Test setSimpleProperty on a boolean property. -
testSetSimpleDouble
Test setSimpleProperty on a double property. -
testSetSimpleFloat
Test setSimpleProperty on a float property. -
testSetSimpleInt
Test setSimpleProperty on a int property. -
testSetSimpleLong
Test setSimpleProperty on a long property. -
testSetSimpleShort
Test setSimpleProperty on a short property. -
testSetSimpleString
Test setSimpleProperty on a String property. -
testGetDescriptorBase
Base for testGetDescriptorXxxxx() series of tests.- Parameters:
name
- Name of the property to be retrievedtype
- Expected class type of this property
-