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
FieldsModifier and TypeFieldDescriptionprotected org.apache.struts.action.DynaActionFormThe basicDynaActionFormto use for testing.protected org.apache.struts.action.ActionMappingDummy ActionMapping for calls to reset() and validate().protected org.apache.struts.config.ModuleConfigDummy 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetUp()voidtearDown()voidvoidCorner cases on getDynaProperty invalid arguments.voidtestGetDescriptorBase(String name, Class<?> type) Base for testGetDescriptorXxxxx() series of tests.voidPositive getDynaProperty on propertybooleanProperty.voidPositive getDynaProperty on propertydoubleProperty.voidPositive getDynaProperty on propertyfloatProperty.voidPositive getDynaProperty on propertyintProperty.voidPositive getDynaProperty on propertylongProperty.voidPositive test for getDynaPropertys().voidPositive getDynaProperty on propertybooleanSecondthat uses an "is" method as the getter.voidPositive getDynaProperty on propertyshortProperty.voidPositive getDynaProperty on propertystringProperty.voidCorner cases on getIndexedProperty invalid arguments.voidPositive and negative tests on getIndexedProperty valid arguments.voidCorner cases on getMappedProperty invalid arguments.voidPositive and negative tests on getMappedProperty valid arguments.voidCorner cases on getSimpleProperty invalid arguments.voidTest getSimpleProperty on a boolean property.voidTest getSimpleProperty on a double property.voidTest getSimpleProperty on a float property.voidTest getSimpleProperty on a int property.voidTest getSimpleProperty on a long property.voidTest getSimpleProperty on a short property.voidTest getSimpleProperty on a String property.voidvoidTestcontains()method for mapped properties.voidTestremove()method for mapped properties.voidTest the reset method when the request method is GET.voidTest the reset method when the request method is GET.voidvoidCorner cases on setIndexedProperty invalid arguments.voidPositive and negative tests on setIndexedProperty valid arguments.voidPositive and negative tests on setMappedProperty valid arguments.voidTest setSimpleProperty on a boolean property.voidTest setSimpleProperty on a double property.voidTest setSimpleProperty on a float property.voidTest setSimpleProperty on a int property.voidTest setSimpleProperty on a long property.voidTest setSimpleProperty on a short property.voidTest 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 basicDynaActionFormto 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:
setUpin classTestDynaActionFormClass
-
tearDown
- Overrides:
tearDownin 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 propertybooleanSecondthat 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 inpropertiesshould 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
-