3030 */
3131public class FluentPropertyBeanIntrospectorTestCase extends TestCase {
3232 public static final class CapsBean {
33- private URI mURI ;
33+ private URI mURI ;
3434
35- public URI getURI () {
36- return mURI ;
37- }
35+ public URI getURI () {
36+ return mURI ;
37+ }
3838
39- public void setURI (final URI theURI ) {
40- mURI = theURI ;
41- }
42- }
39+ public void setURI (final URI theURI ) {
40+ mURI = theURI ;
41+ }
42+ }
4343
4444 /**
45- * Puts all property descriptors into a map so that they can be accessed by
46- * property name.
45+ * Puts all property descriptors into a map so that they can be accessed by property name.
4746 *
4847 * @param descs the array with descriptors
4948 * @return a map with property names as keys
5049 */
51- private static Map <String , PropertyDescriptor > createDescriptorMap (
52- final PropertyDescriptor [] descs ) {
50+ private static Map <String , PropertyDescriptor > createDescriptorMap (final PropertyDescriptor [] descs ) {
5351 final Map <String , PropertyDescriptor > map = new HashMap <>();
5452 for (final PropertyDescriptor pd : descs ) {
5553 map .put (pd .getName (), pd );
@@ -58,15 +56,13 @@ private static Map<String, PropertyDescriptor> createDescriptorMap(
5856 }
5957
6058 /**
61- * Convenience method for obtaining a specific property descriptor and
62- * checking whether it exists.
59+ * Convenience method for obtaining a specific property descriptor and checking whether it exists.
6360 *
6461 * @param props the map with property descriptors
65- * @param name the name of the desired descriptor
62+ * @param name the name of the desired descriptor
6663 * @return the descriptor from the map
6764 */
68- private static PropertyDescriptor fetchDescriptor (
69- final Map <String , PropertyDescriptor > props , final String name ) {
65+ private static PropertyDescriptor fetchDescriptor (final Map <String , PropertyDescriptor > props , final String name ) {
7066 assertTrue ("Property not found: " + name , props .containsKey (name ));
7167 return props .get (name );
7268 }
@@ -90,8 +86,7 @@ public void testIntrospection() throws IntrospectionException {
9086 final PropertyUtilsBean pu = new PropertyUtilsBean ();
9187 final FluentPropertyBeanIntrospector introspector = new FluentPropertyBeanIntrospector ();
9288 pu .addBeanIntrospector (introspector );
93- final Map <String , PropertyDescriptor > props = createDescriptorMap (pu
94- .getPropertyDescriptors (FluentIntrospectionTestBean .class ));
89+ final Map <String , PropertyDescriptor > props = createDescriptorMap (pu .getPropertyDescriptors (FluentIntrospectionTestBean .class ));
9590 PropertyDescriptor pd = fetchDescriptor (props , "name" );
9691 assertNotNull ("No read method for name" , pd .getReadMethod ());
9792 assertNotNull ("No write method for name" , pd .getWriteMethod ());
@@ -100,29 +95,26 @@ public void testIntrospection() throws IntrospectionException {
10095 assertNull ("Read method for fluentProperty" , pd .getReadMethod ());
10196 assertNotNull ("No write method for fluentProperty" , pd .getWriteMethod ());
10297 pd = fetchDescriptor (props , "fluentGetProperty" );
103- assertNotNull ("No read method for fluentGetProperty" ,
104- pd .getReadMethod ());
105- assertNotNull ("No write method for fluentGetProperty" ,
106- pd .getWriteMethod ());
98+ assertNotNull ("No read method for fluentGetProperty" , pd .getReadMethod ());
99+ assertNotNull ("No write method for fluentGetProperty" , pd .getWriteMethod ());
107100 }
108101
109- public void testIntrospectionCaps () throws Exception {
110- final PropertyUtilsBean pu = new PropertyUtilsBean ();
102+ public void testIntrospectionCaps () throws Exception {
103+ final PropertyUtilsBean pu = new PropertyUtilsBean ();
111104
112105 final FluentPropertyBeanIntrospector introspector = new FluentPropertyBeanIntrospector ();
113106
114- pu .addBeanIntrospector (introspector );
107+ pu .addBeanIntrospector (introspector );
115108
116- final Map <String , PropertyDescriptor > props = createDescriptorMap (
117- pu .getPropertyDescriptors (CapsBean .class ));
109+ final Map <String , PropertyDescriptor > props = createDescriptorMap (pu .getPropertyDescriptors (CapsBean .class ));
118110
119- final PropertyDescriptor aDescriptor = fetchDescriptor (props , "URI" );
111+ final PropertyDescriptor aDescriptor = fetchDescriptor (props , "URI" );
120112
121- assertNotNull ("missing property" , aDescriptor );
113+ assertNotNull ("missing property" , aDescriptor );
122114
123- assertNotNull ("No read method for uri" , aDescriptor .getReadMethod ());
124- assertNotNull ("No write method for uri" , aDescriptor .getWriteMethod ());
115+ assertNotNull ("No read method for uri" , aDescriptor .getReadMethod ());
116+ assertNotNull ("No write method for uri" , aDescriptor .getWriteMethod ());
125117
126- assertNull ("Should not find mis-capitalized property" , props .get ("uRI" ));
118+ assertNull ("Should not find mis-capitalized property" , props .get ("uRI" ));
127119 }
128120}
0 commit comments