Java Doc for PropertyUtilsTestCase.java in  » Library » Apache-commons-beanutils-1.8.0-BETA-src » org » apache » commons » beanutils » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Library » Apache commons beanutils 1.8.0 BETA src » org.apache.commons.beanutils 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.commons.beanutils.PropertyUtilsTestCase

PropertyUtilsTestCase
public class PropertyUtilsTestCase extends TestCase (Code)

Test Case for the PropertyUtils 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.

So far, this test case has tests for the following methods of the PropertyUtils class:

  • getIndexedProperty(Object,String)
  • getIndexedProperty(Object,String,int)
  • getMappedProperty(Object,String)
  • getMappedProperty(Object,String,String
  • getNestedProperty(Object,String)
  • getPropertyDescriptor(Object,String)
  • getPropertyDescriptors(Object)
  • getPropertyType(Object,String)
  • getSimpleProperty(Object,String)
  • setIndexedProperty(Object,String,Object)
  • setIndexedProperty(Object,String,String,Object)
  • setMappedProperty(Object,String,Object)
  • setMappedProperty(Object,String,String,Object)
  • setNestedProperty(Object,String,Object)
  • setSimpleProperty(Object,String,Object)

author:
   Craig R. McClanahan
author:
   Jan Sorensen
version:
   $Revision: 555184 $ $Date: 2007-07-11 07:25:35 +0100 (Wed, 11 Jul 2007) $


Field Summary
protected  TestBeanbean
     The basic test bean for each test.
protected  TestBeanPackageSubclassbeanPackageSubclass
     The "package private subclass" test bean for each test.
protected  PrivateDirectbeanPrivate
     The test bean for private access tests.
protected  PrivateDirectbeanPrivateSubclass
     The test bean for private access tests of subclasses.
protected  TestBeanPublicSubclassbeanPublicSubclass
     The "public subclass" test bean for each test.
protected  Stringdescribes
     The set of properties that should be described.
final protected static  String[]properties
     The set of property names we expect to have returned when calling getPropertyDescriptors().

Constructor Summary
public  PropertyUtilsTestCase(String name)
     Construct a new instance of this test case.

Method Summary
public  voidsetUp()
     Set up instance variables required by this test case.
public static  Testsuite()
     Return the tests included in this test suite.
public  voidtearDown()
     Tear down instance variables required by this test case.
public  voidtestCopyPropertiesMap()
     Test copyProperties() when the origin is a a Map.
public  voidtestDescribe()
     Test the describe() method.
public  voidtestExceptionFromInvoke()
    
public  voidtestGetDescriptorArguments()
     Corner cases on getPropertyDescriptor invalid arguments.
protected  voidtestGetDescriptorBase(String name, String read, String write)
     Base for testGetDescriptorXxxxx() series of tests.
public  voidtestGetDescriptorBoolean()
     Positive getPropertyDescriptor on property booleanProperty.
public  voidtestGetDescriptorDouble()
     Positive getPropertyDescriptor on property doubleProperty.
public  voidtestGetDescriptorFloat()
     Positive getPropertyDescriptor on property floatProperty.
public  voidtestGetDescriptorInt()
     Positive getPropertyDescriptor on property intProperty.
public  voidtestGetDescriptorInvalidBoolean()
    
public  voidtestGetDescriptorLong()
     Positive getPropertyDescriptor on property longProperty.
public  voidtestGetDescriptorMappedPeriods()
     Test getting mapped descriptor with periods in the key.
public  voidtestGetDescriptorReadOnly()
     Positive getPropertyDescriptor on property readOnlyProperty.
public  voidtestGetDescriptorSecond()
     Positive getPropertyDescriptor on property booleanSecond that uses an "is" method as the getter.
public  voidtestGetDescriptorShort()
     Positive getPropertyDescriptor on property shortProperty.
public  voidtestGetDescriptorString()
     Positive getPropertyDescriptor on property stringProperty.
public  voidtestGetDescriptorUnknown()
     Negative getPropertyDescriptor on property unknown.
public  voidtestGetDescriptorWriteOnly()
     Positive getPropertyDescriptor on property writeOnlyProperty.
public  voidtestGetDescriptors()
     Positive test for getPropertyDescriptors().
public  voidtestGetDescriptorsArguments()
     Corner cases on getPropertyDescriptors invalid arguments.
public  voidtestGetIndexedArguments()
     Corner cases on getIndexedProperty invalid arguments.
public  voidtestGetIndexedArray()
    
public  voidtestGetIndexedList()
    
public  voidtestGetIndexedMap()
    
public  voidtestGetIndexedValues()
     Positive and negative tests on getIndexedProperty valid arguments.
public  voidtestGetMappedArguments()
     Corner cases on getMappedProperty invalid arguments.
public  voidtestGetMappedArray()
    
public  voidtestGetMappedList()
    
public  voidtestGetMappedMap()
    
public  voidtestGetMappedPeriods()
     Test getting mapped values with periods in the key.
public  voidtestGetMappedSlashes()
     Test getting mapped values with slashes in the key.
public  voidtestGetMappedValues()
     Positive and negative tests on getMappedProperty valid arguments.
public  voidtestGetNestedArguments()
     Corner cases on getNestedProperty invalid arguments.
public  voidtestGetNestedBoolean()
     Test getNestedProperty on a boolean property.
public  voidtestGetNestedDouble()
     Test getNestedProperty on a double property.
public  voidtestGetNestedFloat()
     Test getNestedProperty on a float property.
public  voidtestGetNestedInt()
     Test getNestedProperty on an int property.
public  voidtestGetNestedLong()
     Test getNestedProperty on a long property.
public  voidtestGetNestedReadOnly()
     Test getNestedProperty on a read-only String property.
public  voidtestGetNestedShort()
     Test getNestedProperty on a short property.
public  voidtestGetNestedString()
     Test getNestedProperty on a String property.
public  voidtestGetNestedUnknown()
     Negative test getNestedProperty on an unknown property.
public  voidtestGetNestedWriteOnly()
     Test getNestedProperty on a write-only String property.
public  voidtestGetPropertyType()
     Test getPropertyType() on all kinds of properties.
protected  voidtestGetReadMethod(Object bean, String properties, String className)
     Base for testGetReadMethod() series of tests.
public  voidtestGetReadMethodBasic()
     Test getting accessible property reader methods for a specified list of properties of our standard test bean.
public  voidtestGetReadMethodPackageSubclass()
     Test getting accessible property reader methods for a specified list of properties of a package private subclass of our standard test bean.
public  voidtestGetReadMethodPublicInterface()
     Test getting accessible property reader methods for a specified list of properties that are declared either directly or via implemented interfaces.
public  voidtestGetReadMethodPublicSubclass()
     Test getting accessible property reader methods for a specified list of properties of a public subclass of our standard test bean.
public  voidtestGetSetInnerBean()
    
public  voidtestGetSetParentBean()
    
public  voidtestGetSimpleArguments()
     Corner cases on getSimpleProperty invalid arguments.
public  voidtestGetSimpleBoolean()
     Test getSimpleProperty on a boolean property.
public  voidtestGetSimpleDouble()
     Test getSimpleProperty on a double property.
public  voidtestGetSimpleFloat()
     Test getSimpleProperty on a float property.
public  voidtestGetSimpleIndexed()
     Negative test getSimpleProperty on an indexed property.
public  voidtestGetSimpleInt()
     Test getSimpleProperty on an int property.
public  voidtestGetSimpleLong()
     Test getSimpleProperty on a long property.
public  voidtestGetSimpleNested()
     Negative test getSimpleProperty on a nested property.
public  voidtestGetSimpleReadOnly()
     Test getSimpleProperty on a read-only String property.
public  voidtestGetSimpleShort()
     Test getSimpleProperty on a short property.
public  voidtestGetSimpleString()
     Test getSimpleProperty on a String property.
public  voidtestGetSimpleUnknown()
     Negative test getSimpleProperty on an unknown property.
public  voidtestGetSimpleWriteOnly()
     Test getSimpleProperty on a write-only String property.
protected  voidtestGetWriteMethod(Object bean, String properties, String className)
     Base for testGetWriteMethod() series of tests.
public  voidtestGetWriteMethodBasic()
     Test getting accessible property writer methods for a specified list of properties of our standard test bean.
public  voidtestGetWriteMethodPackageSubclass()
     Test getting accessible property writer methods for a specified list of properties of a package private subclass of our standard test bean.
public  voidtestGetWriteMethodPublicSubclass()
     Test getting accessible property writer methods for a specified list of properties of a public subclass of our standard test bean.
public  voidtestIsReadable()
     Test isReadable() method.
public  voidtestIsWriteable()
     Test isWriteable() method.
public  voidtestMapExtensionCustom()
     This tests to see that it is possible to subclass PropertyUtilsBean and change the behaviour of setNestedProperty/getNestedProperty when dealing with objects that implement Map.
public  voidtestMapExtensionDefault()
     This tests to see that classes that implement Map always have their custom properties ignored.

Note that this behaviour has changed several times over past releases of beanutils, breaking backwards compatibility each time.

public  voidtestMappedPropertyType()
     Test the mappedPropertyType of MappedPropertyDescriptor.
public  voidtestNestedPropertyKeyOrIndexOnBeanImplementingMap()
     There is an issue in setNestedProperty/getNestedProperty when the target bean is a map and the name string requests mapped or indexed operations on a field.
public  voidtestNestedWithIndex()
    
public  voidtestSetIndexedArguments()
     Corner cases on setIndexedProperty invalid arguments.
public  voidtestSetIndexedArray()
    
public  voidtestSetIndexedList()
    
public  voidtestSetIndexedMap()
    
public  voidtestSetIndexedValues()
     Positive and negative tests on setIndexedProperty valid arguments.
public  voidtestSetMappedArguments()
     Corner cases on getMappedProperty invalid arguments.
public  voidtestSetMappedArray()
    
public  voidtestSetMappedList()
    
public  voidtestSetMappedMap()
    
public  voidtestSetMappedPeriods()
     Test setting mapped values with periods in the key.
public  voidtestSetMappedValues()
     Positive and negative tests on setMappedProperty valid arguments.
public  voidtestSetNestedArguments()
     Corner cases on setNestedProperty invalid arguments.
public  voidtestSetNestedBoolean()
     Test setNextedProperty on a boolean property.
public  voidtestSetNestedDouble()
     Test setNestedProperty on a double property.
public  voidtestSetNestedFloat()
     Test setNestedProperty on a float property.
public  voidtestSetNestedInt()
     Test setNestedProperty on a int property.
public  voidtestSetNestedLong()
     Test setNestedProperty on a long property.
public  voidtestSetNestedReadOnly()
     Test setNestedProperty on a read-only String property.
public  voidtestSetNestedShort()
     Test setNestedProperty on a short property.
public  voidtestSetNestedString()
     Test setNestedProperty on a String property.
public  voidtestSetNestedUnknown()
     Test setNestedProperty on an unknown property name.
public  voidtestSetNestedWriteOnly()
     Test setNestedProperty on a write-only String property.
public  voidtestSetNoGetter()
    
public  voidtestSetSimpleArguments()
     Corner cases on setSimpleProperty invalid arguments.
public  voidtestSetSimpleBoolean()
     Test setSimpleProperty on a boolean property.
public  voidtestSetSimpleDouble()
     Test setSimpleProperty on a double property.
public  voidtestSetSimpleFloat()
     Test setSimpleProperty on a float property.
public  voidtestSetSimpleIndexed()
     Negative test setSimpleProperty on an indexed property.
public  voidtestSetSimpleInt()
     Test setSimpleProperty on a int property.
public  voidtestSetSimpleLong()
     Test setSimpleProperty on a long property.
public  voidtestSetSimpleNested()
     Negative test setSimpleProperty on a nested property.
public  voidtestSetSimpleReadOnly()
     Test setSimpleProperty on a read-only String property.
public  voidtestSetSimpleShort()
     Test setSimpleProperty on a short property.
public  voidtestSetSimpleString()
     Test setSimpleProperty on a String property.
public  voidtestSetSimpleUnknown()
     Test setSimpleProperty on an unknown property name.
public  voidtestSetSimpleWriteOnly()
     Test setSimpleProperty on a write-only String property.
public  voidtestThrowNestedNull()
     When a bean has a null property which is reference by the standard access language, this should throw a NestedNullException.

Field Detail
bean
protected TestBean bean(Code)
The basic test bean for each test.



beanPackageSubclass
protected TestBeanPackageSubclass beanPackageSubclass(Code)
The "package private subclass" test bean for each test.



beanPrivate
protected PrivateDirect beanPrivate(Code)
The test bean for private access tests.



beanPrivateSubclass
protected PrivateDirect beanPrivateSubclass(Code)
The test bean for private access tests of subclasses.



beanPublicSubclass
protected TestBeanPublicSubclass beanPublicSubclass(Code)
The "public subclass" test bean for each test.



describes
protected String describes(Code)
The set of properties that should be described.



properties
final protected static String[] properties(Code)
The set of property names we expect to have returned when calling getPropertyDescriptors(). You should update this list when new properties are added to TestBean.




Constructor Detail
PropertyUtilsTestCase
public PropertyUtilsTestCase(String name)(Code)
Construct a new instance of this test case.
Parameters:
  name - Name of the test case




Method Detail
setUp
public void setUp()(Code)
Set up instance variables required by this test case.



suite
public static Test suite()(Code)
Return the tests included in this test suite.



tearDown
public void tearDown()(Code)
Tear down instance variables required by this test case.



testCopyPropertiesMap
public void testCopyPropertiesMap()(Code)
Test copyProperties() when the origin is a a Map.



testDescribe
public void testDescribe()(Code)
Test the describe() method.



testExceptionFromInvoke
public void testExceptionFromInvoke() throws Exception(Code)
Test PropertyUtilsBean 's invoke method throwing an IllegalArgumentException and check that the "cause" has been properly initialized for JDK 1.4+ See BEANUTILS-266 for changes and reason for test



testGetDescriptorArguments
public void testGetDescriptorArguments()(Code)
Corner cases on getPropertyDescriptor invalid arguments.



testGetDescriptorBase
protected void testGetDescriptorBase(String name, String read, String write)(Code)
Base for testGetDescriptorXxxxx() series of tests.
Parameters:
  name - Name of the property to be retrieved
Parameters:
  read - Expected name of the read method (or null)
Parameters:
  write - Expected name of the write method (or null)



testGetDescriptorBoolean
public void testGetDescriptorBoolean()(Code)
Positive getPropertyDescriptor on property booleanProperty.



testGetDescriptorDouble
public void testGetDescriptorDouble()(Code)
Positive getPropertyDescriptor on property doubleProperty.



testGetDescriptorFloat
public void testGetDescriptorFloat()(Code)
Positive getPropertyDescriptor on property floatProperty.



testGetDescriptorInt
public void testGetDescriptorInt()(Code)
Positive getPropertyDescriptor on property intProperty.



testGetDescriptorInvalidBoolean
public void testGetDescriptorInvalidBoolean() throws Exception(Code)

Negative tests on an invalid property with two different boolean getters (which is fine, according to the JavaBeans spec) but a String setter instead of a boolean setter.

Although one could logically argue that this combination of method signatures should not identify a property at all, there is a sentence in Section 8.3.1 making it clear that the behavior tested for here is correct: "If we find only one of these methods, then we regard it as defining either a read-only or write-only property called <property-name>.




testGetDescriptorLong
public void testGetDescriptorLong()(Code)
Positive getPropertyDescriptor on property longProperty.



testGetDescriptorMappedPeriods
public void testGetDescriptorMappedPeriods()(Code)
Test getting mapped descriptor with periods in the key.



testGetDescriptorReadOnly
public void testGetDescriptorReadOnly()(Code)
Positive getPropertyDescriptor on property readOnlyProperty.



testGetDescriptorSecond
public void testGetDescriptorSecond()(Code)
Positive getPropertyDescriptor on property booleanSecond that uses an "is" method as the getter.



testGetDescriptorShort
public void testGetDescriptorShort()(Code)
Positive getPropertyDescriptor on property shortProperty.



testGetDescriptorString
public void testGetDescriptorString()(Code)
Positive getPropertyDescriptor on property stringProperty.



testGetDescriptorUnknown
public void testGetDescriptorUnknown()(Code)
Negative getPropertyDescriptor on property unknown.



testGetDescriptorWriteOnly
public void testGetDescriptorWriteOnly()(Code)
Positive getPropertyDescriptor on property writeOnlyProperty.



testGetDescriptors
public void testGetDescriptors()(Code)
Positive test for getPropertyDescriptors(). Each property name listed in properties should be returned exactly once.



testGetDescriptorsArguments
public void testGetDescriptorsArguments()(Code)
Corner cases on getPropertyDescriptors invalid arguments.



testGetIndexedArguments
public void testGetIndexedArguments()(Code)
Corner cases on getIndexedProperty invalid arguments.



testGetIndexedArray
public void testGetIndexedArray()(Code)
Test getting an indexed value out of a multi-dimensional array



testGetIndexedList
public void testGetIndexedList()(Code)
Test getting an indexed value out of List of Lists



testGetIndexedMap
public void testGetIndexedMap()(Code)
Test getting a value out of a mapped Map



testGetIndexedValues
public void testGetIndexedValues()(Code)
Positive and negative tests on getIndexedProperty valid arguments.



testGetMappedArguments
public void testGetMappedArguments()(Code)
Corner cases on getMappedProperty invalid arguments.



testGetMappedArray
public void testGetMappedArray()(Code)
Test getting an indexed value out of a mapped array



testGetMappedList
public void testGetMappedList()(Code)
Test getting an indexed value out of a mapped List



testGetMappedMap
public void testGetMappedMap()(Code)
Test getting a value out of a mapped Map



testGetMappedPeriods
public void testGetMappedPeriods()(Code)
Test getting mapped values with periods in the key.



testGetMappedSlashes
public void testGetMappedSlashes()(Code)
Test getting mapped values with slashes in the key. This is different from periods because slashes are not syntactically significant.



testGetMappedValues
public void testGetMappedValues()(Code)
Positive and negative tests on getMappedProperty valid arguments.



testGetNestedArguments
public void testGetNestedArguments()(Code)
Corner cases on getNestedProperty invalid arguments.



testGetNestedBoolean
public void testGetNestedBoolean()(Code)
Test getNestedProperty on a boolean property.



testGetNestedDouble
public void testGetNestedDouble()(Code)
Test getNestedProperty on a double property.



testGetNestedFloat
public void testGetNestedFloat()(Code)
Test getNestedProperty on a float property.



testGetNestedInt
public void testGetNestedInt()(Code)
Test getNestedProperty on an int property.



testGetNestedLong
public void testGetNestedLong()(Code)
Test getNestedProperty on a long property.



testGetNestedReadOnly
public void testGetNestedReadOnly()(Code)
Test getNestedProperty on a read-only String property.



testGetNestedShort
public void testGetNestedShort()(Code)
Test getNestedProperty on a short property.



testGetNestedString
public void testGetNestedString()(Code)
Test getNestedProperty on a String property.



testGetNestedUnknown
public void testGetNestedUnknown()(Code)
Negative test getNestedProperty on an unknown property.



testGetNestedWriteOnly
public void testGetNestedWriteOnly()(Code)
Test getNestedProperty on a write-only String property.



testGetPropertyType
public void testGetPropertyType()(Code)
Test getPropertyType() on all kinds of properties.



testGetReadMethod
protected void testGetReadMethod(Object bean, String properties, String className)(Code)
Base for testGetReadMethod() series of tests.
Parameters:
  bean - Bean for which to retrieve read methods.
Parameters:
  properties - Property names to search for
Parameters:
  className - Class name where this method should be defined



testGetReadMethodBasic
public void testGetReadMethodBasic()(Code)
Test getting accessible property reader methods for a specified list of properties of our standard test bean.



testGetReadMethodPackageSubclass
public void testGetReadMethodPackageSubclass()(Code)
Test getting accessible property reader methods for a specified list of properties of a package private subclass of our standard test bean.



testGetReadMethodPublicInterface
public void testGetReadMethodPublicInterface()(Code)
Test getting accessible property reader methods for a specified list of properties that are declared either directly or via implemented interfaces.



testGetReadMethodPublicSubclass
public void testGetReadMethodPublicSubclass()(Code)
Test getting accessible property reader methods for a specified list of properties of a public subclass of our standard test bean.



testGetSetInnerBean
public void testGetSetInnerBean() throws Exception(Code)
Text case for setting properties on inner classes



testGetSetParentBean
public void testGetSetParentBean() throws Exception(Code)
Text case for setting properties on parent



testGetSimpleArguments
public void testGetSimpleArguments()(Code)
Corner cases on getSimpleProperty invalid arguments.



testGetSimpleBoolean
public void testGetSimpleBoolean()(Code)
Test getSimpleProperty on a boolean property.



testGetSimpleDouble
public void testGetSimpleDouble()(Code)
Test getSimpleProperty on a double property.



testGetSimpleFloat
public void testGetSimpleFloat()(Code)
Test getSimpleProperty on a float property.



testGetSimpleIndexed
public void testGetSimpleIndexed()(Code)
Negative test getSimpleProperty on an indexed property.



testGetSimpleInt
public void testGetSimpleInt()(Code)
Test getSimpleProperty on an int property.



testGetSimpleLong
public void testGetSimpleLong()(Code)
Test getSimpleProperty on a long property.



testGetSimpleNested
public void testGetSimpleNested()(Code)
Negative test getSimpleProperty on a nested property.



testGetSimpleReadOnly
public void testGetSimpleReadOnly()(Code)
Test getSimpleProperty on a read-only String property.



testGetSimpleShort
public void testGetSimpleShort()(Code)
Test getSimpleProperty on a short property.



testGetSimpleString
public void testGetSimpleString()(Code)
Test getSimpleProperty on a String property.



testGetSimpleUnknown
public void testGetSimpleUnknown()(Code)
Negative test getSimpleProperty on an unknown property.



testGetSimpleWriteOnly
public void testGetSimpleWriteOnly()(Code)
Test getSimpleProperty on a write-only String property.



testGetWriteMethod
protected void testGetWriteMethod(Object bean, String properties, String className)(Code)
Base for testGetWriteMethod() series of tests.
Parameters:
  bean - Bean for which to retrieve write methods.
Parameters:
  properties - Property names to search for
Parameters:
  className - Class name where this method should be defined



testGetWriteMethodBasic
public void testGetWriteMethodBasic()(Code)
Test getting accessible property writer methods for a specified list of properties of our standard test bean.



testGetWriteMethodPackageSubclass
public void testGetWriteMethodPackageSubclass()(Code)
Test getting accessible property writer methods for a specified list of properties of a package private subclass of our standard test bean.



testGetWriteMethodPublicSubclass
public void testGetWriteMethodPublicSubclass()(Code)
Test getting accessible property writer methods for a specified list of properties of a public subclass of our standard test bean.



testIsReadable
public void testIsReadable()(Code)
Test isReadable() method.



testIsWriteable
public void testIsWriteable()(Code)
Test isWriteable() method.



testMapExtensionCustom
public void testMapExtensionCustom() throws Exception(Code)
This tests to see that it is possible to subclass PropertyUtilsBean and change the behaviour of setNestedProperty/getNestedProperty when dealing with objects that implement Map.



testMapExtensionDefault
public void testMapExtensionDefault() throws Exception(Code)
This tests to see that classes that implement Map always have their custom properties ignored.

Note that this behaviour has changed several times over past releases of beanutils, breaking backwards compatibility each time. Here's hoping that the current 1.7.1 release is the last time this behaviour changes!




testMappedPropertyType
public void testMappedPropertyType() throws Exception(Code)
Test the mappedPropertyType of MappedPropertyDescriptor.



testNestedPropertyKeyOrIndexOnBeanImplementingMap
public void testNestedPropertyKeyOrIndexOnBeanImplementingMap() throws Exception(Code)
There is an issue in setNestedProperty/getNestedProperty when the target bean is a map and the name string requests mapped or indexed operations on a field. These are not supported for fields of a Map, but it's an easy mistake to make and this test case ensures that an appropriate exception is thrown when a user does this.

The problem is with passing strings of form "a(b)" or "a[3]" to setNestedProperty or getNestedProperty when the target bean they are applied to implements Map. These strings are actually requesting "the result of calling mapped method a on the target object with a parameter of b" or "the result of calling indexed method a on the target object with a parameter of 3". And these requests are not valid when the target is a Map as a Map only supports calling get(fieldName) or put(fieldName), neither of which can be further indexed with a string or an integer.

However it is likely that some users will assume that "a[3]" when applied to a map will be equivalent to (map.get("a"))[3] with the appropriate typecasting, or for "a(b)" to be equivalent to map.get("a").get("b").

Here we verify that an exception is thrown if the user makes this mistake.




testNestedWithIndex
public void testNestedWithIndex() throws Exception(Code)



testSetIndexedArguments
public void testSetIndexedArguments()(Code)
Corner cases on setIndexedProperty invalid arguments.



testSetIndexedArray
public void testSetIndexedArray()(Code)
Test setting an indexed value out of a multi-dimensional array



testSetIndexedList
public void testSetIndexedList()(Code)
Test setting an indexed value out of List of Lists



testSetIndexedMap
public void testSetIndexedMap()(Code)
Test setting a value out of a mapped Map



testSetIndexedValues
public void testSetIndexedValues()(Code)
Positive and negative tests on setIndexedProperty valid arguments.



testSetMappedArguments
public void testSetMappedArguments()(Code)
Corner cases on getMappedProperty invalid arguments.



testSetMappedArray
public void testSetMappedArray()(Code)
Test setting an indexed value out of a mapped array



testSetMappedList
public void testSetMappedList()(Code)
Test setting an indexed value out of a mapped List



testSetMappedMap
public void testSetMappedMap()(Code)
Test setting a value out of a mapped Map



testSetMappedPeriods
public void testSetMappedPeriods()(Code)
Test setting mapped values with periods in the key.



testSetMappedValues
public void testSetMappedValues()(Code)
Positive and negative tests on setMappedProperty valid arguments.



testSetNestedArguments
public void testSetNestedArguments()(Code)
Corner cases on setNestedProperty invalid arguments.



testSetNestedBoolean
public void testSetNestedBoolean()(Code)
Test setNextedProperty on a boolean property.



testSetNestedDouble
public void testSetNestedDouble()(Code)
Test setNestedProperty on a double property.



testSetNestedFloat
public void testSetNestedFloat()(Code)
Test setNestedProperty on a float property.



testSetNestedInt
public void testSetNestedInt()(Code)
Test setNestedProperty on a int property.



testSetNestedLong
public void testSetNestedLong()(Code)
Test setNestedProperty on a long property.



testSetNestedReadOnly
public void testSetNestedReadOnly()(Code)
Test setNestedProperty on a read-only String property.



testSetNestedShort
public void testSetNestedShort()(Code)
Test setNestedProperty on a short property.



testSetNestedString
public void testSetNestedString()(Code)
Test setNestedProperty on a String property.



testSetNestedUnknown
public void testSetNestedUnknown()(Code)
Test setNestedProperty on an unknown property name.



testSetNestedWriteOnly
public void testSetNestedWriteOnly()(Code)
Test setNestedProperty on a write-only String property.



testSetNoGetter
public void testSetNoGetter() throws Exception(Code)



testSetSimpleArguments
public void testSetSimpleArguments()(Code)
Corner cases on setSimpleProperty invalid arguments.



testSetSimpleBoolean
public void testSetSimpleBoolean()(Code)
Test setSimpleProperty on a boolean property.



testSetSimpleDouble
public void testSetSimpleDouble()(Code)
Test setSimpleProperty on a double property.



testSetSimpleFloat
public void testSetSimpleFloat()(Code)
Test setSimpleProperty on a float property.



testSetSimpleIndexed
public void testSetSimpleIndexed()(Code)
Negative test setSimpleProperty on an indexed property.



testSetSimpleInt
public void testSetSimpleInt()(Code)
Test setSimpleProperty on a int property.



testSetSimpleLong
public void testSetSimpleLong()(Code)
Test setSimpleProperty on a long property.



testSetSimpleNested
public void testSetSimpleNested()(Code)
Negative test setSimpleProperty on a nested property.



testSetSimpleReadOnly
public void testSetSimpleReadOnly()(Code)
Test setSimpleProperty on a read-only String property.



testSetSimpleShort
public void testSetSimpleShort()(Code)
Test setSimpleProperty on a short property.



testSetSimpleString
public void testSetSimpleString()(Code)
Test setSimpleProperty on a String property.



testSetSimpleUnknown
public void testSetSimpleUnknown()(Code)
Test setSimpleProperty on an unknown property name.



testSetSimpleWriteOnly
public void testSetSimpleWriteOnly()(Code)
Test setSimpleProperty on a write-only String property.



testThrowNestedNull
public void testThrowNestedNull() throws Exception(Code)
When a bean has a null property which is reference by the standard access language, this should throw a NestedNullException.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.