You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2014/10/15 22:15:22 UTC
svn commit: r1632171 [15/20] - in /commons/proper/beanutils/trunk/src:
main/java/org/apache/commons/beanutils/
main/java/org/apache/commons/beanutils/converters/
main/java/org/apache/commons/beanutils/expression/
main/java/org/apache/commons/beanutils/...
Modified: commons/proper/beanutils/trunk/src/test/java/org/apache/commons/beanutils/PropertyUtilsTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/beanutils/trunk/src/test/java/org/apache/commons/beanutils/PropertyUtilsTestCase.java?rev=1632171&r1=1632170&r2=1632171&view=diff
==============================================================================
--- commons/proper/beanutils/trunk/src/test/java/org/apache/commons/beanutils/PropertyUtilsTestCase.java (original)
+++ commons/proper/beanutils/trunk/src/test/java/org/apache/commons/beanutils/PropertyUtilsTestCase.java Wed Oct 15 20:15:17 2014
@@ -188,7 +188,7 @@ public class PropertyUtilsTestCase exten
*
* @param name Name of the test case
*/
- public PropertyUtilsTestCase(String name) {
+ public PropertyUtilsTestCase(final String name) {
super(name);
@@ -210,13 +210,13 @@ public class PropertyUtilsTestCase exten
beanPrivateSubclass = PrivateBeanFactory.createSubclass();
beanPublicSubclass = new TestBeanPublicSubclass();
- DynaProperty[] properties = new DynaProperty[] {
+ final DynaProperty[] properties = new DynaProperty[] {
new DynaProperty("stringProperty", String.class),
new DynaProperty("nestedBean", TestBean.class),
new DynaProperty("nullDynaBean", DynaBean.class)
};
- BasicDynaClass dynaClass = new BasicDynaClass("nestedDynaBean", BasicDynaBean.class, properties);
- BasicDynaBean nestedDynaBean = new BasicDynaBean(dynaClass);
+ final BasicDynaClass dynaClass = new BasicDynaClass("nestedDynaBean", BasicDynaBean.class, properties);
+ final BasicDynaBean nestedDynaBean = new BasicDynaBean(dynaClass);
nestedDynaBean.set("nestedBean", bean);
bean.setNestedDynaBean(nestedDynaBean);
PropertyUtils.clearDescriptors();
@@ -258,7 +258,7 @@ public class PropertyUtilsTestCase exten
*/
public void testCopyPropertiesMap() {
- Map<String, Object> map = new HashMap<String, Object>();
+ final Map<String, Object> map = new HashMap<String, Object>();
map.put("booleanProperty", Boolean.FALSE);
map.put("doubleProperty", new Double(333.0));
map.put("dupProperty", new String[] { "New 0", "New 1", "New 2" });
@@ -271,7 +271,7 @@ public class PropertyUtilsTestCase exten
try {
PropertyUtils.copyProperties(bean, map);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t.toString());
}
@@ -292,13 +292,13 @@ public class PropertyUtilsTestCase exten
bean.getStringProperty());
// Indexed Properties
- String dupProperty[] = bean.getDupProperty();
+ final String dupProperty[] = bean.getDupProperty();
assertNotNull("dupProperty present", dupProperty);
assertEquals("dupProperty length", 3, dupProperty.length);
assertEquals("dupProperty[0]", "New 0", dupProperty[0]);
assertEquals("dupProperty[1]", "New 1", dupProperty[1]);
assertEquals("dupProperty[2]", "New 2", dupProperty[2]);
- int intArray[] = bean.getIntArray();
+ final int intArray[] = bean.getIntArray();
assertNotNull("intArray present", intArray);
assertEquals("intArray length", 3, intArray.length);
assertEquals("intArray[0]", 0, intArray[0]);
@@ -316,7 +316,7 @@ public class PropertyUtilsTestCase exten
Map<String, Object> map = null;
try {
map = PropertyUtils.describe(bean);
- } catch (Exception e) {
+ } catch (final Exception e) {
fail("Threw exception " + e);
}
@@ -356,18 +356,18 @@ public class PropertyUtilsTestCase exten
try {
PropertyUtils.getPropertyDescriptor(null, "stringProperty");
fail("Should throw IllegalArgumentException 1");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 1");
}
try {
PropertyUtils.getPropertyDescriptor(bean, null);
fail("Should throw IllegalArgumentException 2");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 2");
}
@@ -432,7 +432,7 @@ public class PropertyUtilsTestCase exten
*/
public void testGetDescriptorInvalidBoolean() throws Exception {
- PropertyDescriptor pd =
+ final PropertyDescriptor pd =
PropertyUtils.getPropertyDescriptor(bean, "invalidBoolean");
assertNotNull("invalidBoolean is a property", pd);
assertNotNull("invalidBoolean has a getter method",
@@ -463,7 +463,7 @@ public class PropertyUtilsTestCase exten
bean.getMappedIntProperty("xyz"); // initializes mappedIntProperty
PropertyDescriptor desc;
- Integer testIntegerValue = new Integer(1234);
+ final Integer testIntegerValue = new Integer(1234);
bean.setMappedIntProperty("key.with.a.dot", testIntegerValue.intValue());
assertEquals("Can retrieve directly",
@@ -475,7 +475,7 @@ public class PropertyUtilsTestCase exten
assertEquals("Check descriptor type (A)",
Integer.TYPE,
((MappedPropertyDescriptor)desc).getMappedPropertyType());
- } catch (Exception e) {
+ } catch (final Exception e) {
fail("Threw exception (A): " + e);
}
@@ -489,7 +489,7 @@ public class PropertyUtilsTestCase exten
assertEquals("Check descriptor type (B)",
Integer.TYPE,
desc.getPropertyType());
- } catch (Exception e) {
+ } catch (final Exception e) {
fail("Threw exception (B): " + e);
}
}
@@ -569,12 +569,12 @@ public class PropertyUtilsTestCase exten
*/
public void testGetDescriptors() {
- PropertyDescriptor pd[] =
+ final PropertyDescriptor pd[] =
PropertyUtils.getPropertyDescriptors(bean);
assertNotNull("Got descriptors", pd);
- int count[] = new int[properties.length];
+ final int count[] = new int[properties.length];
for (int i = 0; i < pd.length; i++) {
- String name = pd[i].getName();
+ final String name = pd[i].getName();
for (int j = 0; j < properties.length; j++) {
if (name.equals(properties[j])) {
count[j]++;
@@ -600,9 +600,9 @@ public class PropertyUtilsTestCase exten
try {
PropertyUtils.getPropertyDescriptors(null);
fail("Should throw IllegalArgumentException");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException");
}
@@ -619,18 +619,18 @@ public class PropertyUtilsTestCase exten
try {
PropertyUtils.getIndexedProperty(null, "intArray", 0);
fail("Should throw IllegalArgumentException 1");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 1");
}
try {
PropertyUtils.getIndexedProperty(bean, null, 0);
fail("Should throw IllegalArgumentException 2");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 2");
}
@@ -640,27 +640,27 @@ public class PropertyUtilsTestCase exten
PropertyUtils.getIndexedProperty(null,
"intArray[0]");
fail("Should throw IllegalArgumentException 3");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 3");
}
try {
PropertyUtils.getIndexedProperty(bean, "[0]");
fail("Should throw NoSuchMethodException 4");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of NoSuchMethodException 4");
}
try {
PropertyUtils.getIndexedProperty(bean, "intArray");
fail("Should throw IllegalArgumentException 5");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 5");
}
@@ -669,18 +669,18 @@ public class PropertyUtilsTestCase exten
try {
PropertyUtils.getIndexedProperty(null, "intIndexed", 0);
fail("Should throw IllegalArgumentException 1");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 1");
}
try {
PropertyUtils.getIndexedProperty(bean, null, 0);
fail("Should throw IllegalArgumentException 2");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 2");
}
@@ -690,27 +690,27 @@ public class PropertyUtilsTestCase exten
PropertyUtils.getIndexedProperty(null,
"intIndexed[0]");
fail("Should throw IllegalArgumentException 3");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 3");
}
try {
PropertyUtils.getIndexedProperty(bean, "[0]");
fail("Should throw NoSuchMethodException 4");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of NoSuchMethodException 4");
}
try {
PropertyUtils.getIndexedProperty(bean, "intIndexed");
fail("Should throw IllegalArgumentException 5");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 5");
}
@@ -737,7 +737,7 @@ public class PropertyUtilsTestCase exten
assertEquals("dupProperty returned correct " + i,
"Dup " + i,
(String) value);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("dupProperty " + i + " threw " + t);
}
@@ -749,7 +749,7 @@ public class PropertyUtilsTestCase exten
value instanceof Integer);
assertEquals("intArray returned correct " + i, i * 10,
((Integer) value).intValue());
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("intArray " + i + " threw " + t);
}
@@ -761,7 +761,7 @@ public class PropertyUtilsTestCase exten
value instanceof Integer);
assertEquals("intIndexed returned correct " + i, i * 10,
((Integer) value).intValue());
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("intIndexed " + i + " threw " + t);
}
@@ -773,7 +773,7 @@ public class PropertyUtilsTestCase exten
value instanceof String);
assertEquals("listIndexed returned correct " + i,
"String " + i, (String) value);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("listIndexed " + i + " threw " + t);
}
@@ -785,7 +785,7 @@ public class PropertyUtilsTestCase exten
value instanceof String);
assertEquals("stringArray returned correct " + i,
"String " + i, (String) value);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("stringArray " + i + " threw " + t);
}
@@ -797,7 +797,7 @@ public class PropertyUtilsTestCase exten
value instanceof String);
assertEquals("stringIndexed returned correct " + i,
"String " + i, (String) value);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("stringIndexed " + i + " threw " + t);
}
@@ -816,7 +816,7 @@ public class PropertyUtilsTestCase exten
assertEquals("dupProperty returned correct " + i,
"Dup " + i,
(String) value);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("dupProperty " + i + " threw " + t);
}
@@ -829,7 +829,7 @@ public class PropertyUtilsTestCase exten
value instanceof Integer);
assertEquals("intArray returned correct " + i, i * 10,
((Integer) value).intValue());
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("intArray " + i + " threw " + t);
}
@@ -842,7 +842,7 @@ public class PropertyUtilsTestCase exten
value instanceof Integer);
assertEquals("intIndexed returned correct " + i, i * 10,
((Integer) value).intValue());
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("intIndexed " + i + " threw " + t);
}
@@ -855,7 +855,7 @@ public class PropertyUtilsTestCase exten
value instanceof String);
assertEquals("listIndexed returned correct " + i,
"String " + i, (String) value);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("listIndexed " + i + " threw " + t);
}
@@ -868,7 +868,7 @@ public class PropertyUtilsTestCase exten
value instanceof String);
assertEquals("stringArray returned correct " + i,
"String " + i, (String) value);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("stringArray " + i + " threw " + t);
}
@@ -881,7 +881,7 @@ public class PropertyUtilsTestCase exten
value instanceof String);
assertEquals("stringIndexed returned correct " + i,
"String " + i, (String) value);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("stringIndexed " + i + " threw " + t);
}
@@ -894,9 +894,9 @@ public class PropertyUtilsTestCase exten
PropertyUtils.getIndexedProperty(bean,
"dupProperty", -1);
fail("Should have thrown ArrayIndexOutOfBoundsException");
- } catch (ArrayIndexOutOfBoundsException t) {
+ } catch (final ArrayIndexOutOfBoundsException t) {
// Expected results
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of ArrayIndexOutOfBoundsException");
}
@@ -905,9 +905,9 @@ public class PropertyUtilsTestCase exten
PropertyUtils.getIndexedProperty(bean,
"dupProperty", 5);
fail("Should have thrown ArrayIndexOutOfBoundsException");
- } catch (ArrayIndexOutOfBoundsException t) {
+ } catch (final ArrayIndexOutOfBoundsException t) {
// Expected results
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of ArrayIndexOutOfBoundsException");
}
@@ -916,9 +916,9 @@ public class PropertyUtilsTestCase exten
PropertyUtils.getIndexedProperty(bean,
"intArray", -1);
fail("Should have thrown ArrayIndexOutOfBoundsException");
- } catch (ArrayIndexOutOfBoundsException t) {
+ } catch (final ArrayIndexOutOfBoundsException t) {
// Expected results
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of ArrayIndexOutOfBoundsException");
}
@@ -927,9 +927,9 @@ public class PropertyUtilsTestCase exten
PropertyUtils.getIndexedProperty(bean,
"intArray", 5);
fail("Should have thrown ArrayIndexOutOfBoundsException");
- } catch (ArrayIndexOutOfBoundsException t) {
+ } catch (final ArrayIndexOutOfBoundsException t) {
// Expected results
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of ArrayIndexOutOfBoundsException");
}
@@ -938,9 +938,9 @@ public class PropertyUtilsTestCase exten
PropertyUtils.getIndexedProperty(bean,
"intIndexed", -1);
fail("Should have thrown ArrayIndexOutOfBoundsException");
- } catch (ArrayIndexOutOfBoundsException t) {
+ } catch (final ArrayIndexOutOfBoundsException t) {
// Expected results
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of ArrayIndexOutOfBoundsException");
}
@@ -949,9 +949,9 @@ public class PropertyUtilsTestCase exten
PropertyUtils.getIndexedProperty(bean,
"intIndexed", 5);
fail("Should have thrown ArrayIndexOutOfBoundsException");
- } catch (ArrayIndexOutOfBoundsException t) {
+ } catch (final ArrayIndexOutOfBoundsException t) {
// Expected results
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of ArrayIndexOutOfBoundsException");
}
@@ -960,9 +960,9 @@ public class PropertyUtilsTestCase exten
PropertyUtils.getIndexedProperty(bean,
"listIndexed", -1);
fail("Should have thrown IndexOutOfBoundsException");
- } catch (IndexOutOfBoundsException t) {
+ } catch (final IndexOutOfBoundsException t) {
// Expected results
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IndexOutOfBoundsException");
}
@@ -971,9 +971,9 @@ public class PropertyUtilsTestCase exten
PropertyUtils.getIndexedProperty(bean,
"listIndexed", 5);
fail("Should have thrown IndexOutOfBoundsException");
- } catch (IndexOutOfBoundsException t) {
+ } catch (final IndexOutOfBoundsException t) {
// Expected results
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IndexOutOfBoundsException");
}
@@ -982,9 +982,9 @@ public class PropertyUtilsTestCase exten
PropertyUtils.getIndexedProperty(bean,
"stringArray", -1);
fail("Should have thrown ArrayIndexOutOfBoundsException");
- } catch (ArrayIndexOutOfBoundsException t) {
+ } catch (final ArrayIndexOutOfBoundsException t) {
// Expected results
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of ArrayIndexOutOfBoundsException");
}
@@ -993,9 +993,9 @@ public class PropertyUtilsTestCase exten
PropertyUtils.getIndexedProperty(bean,
"stringArray", 5);
fail("Should have thrown ArrayIndexOutOfBoundsException");
- } catch (ArrayIndexOutOfBoundsException t) {
+ } catch (final ArrayIndexOutOfBoundsException t) {
// Expected results
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of ArrayIndexOutOfBoundsException");
}
@@ -1004,9 +1004,9 @@ public class PropertyUtilsTestCase exten
PropertyUtils.getIndexedProperty(bean,
"stringIndexed", -1);
fail("Should have thrown ArrayIndexOutOfBoundsException");
- } catch (ArrayIndexOutOfBoundsException t) {
+ } catch (final ArrayIndexOutOfBoundsException t) {
// Expected results
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of ArrayIndexOutOfBoundsException");
}
@@ -1015,9 +1015,9 @@ public class PropertyUtilsTestCase exten
PropertyUtils.getIndexedProperty(bean,
"stringIndexed", 5);
fail("Should have thrown ArrayIndexOutOfBoundsException");
- } catch (ArrayIndexOutOfBoundsException t) {
+ } catch (final ArrayIndexOutOfBoundsException t) {
// Expected results
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of ArrayIndexOutOfBoundsException");
}
@@ -1028,10 +1028,10 @@ public class PropertyUtilsTestCase exten
* Test getting an indexed value out of a multi-dimensional array
*/
public void testGetIndexedArray() {
- String[] firstArray = new String[] {"FIRST-1", "FIRST-2", "FIRST-3"};
- String[] secondArray = new String[] {"SECOND-1", "SECOND-2", "SECOND-3", "SECOND-4"};
- String[][] mainArray = {firstArray, secondArray};
- TestBean bean = new TestBean(mainArray);
+ final String[] firstArray = new String[] {"FIRST-1", "FIRST-2", "FIRST-3"};
+ final String[] secondArray = new String[] {"SECOND-1", "SECOND-2", "SECOND-3", "SECOND-4"};
+ final String[][] mainArray = {firstArray, secondArray};
+ final TestBean bean = new TestBean(mainArray);
try {
assertEquals("firstArray[0]", firstArray[0], PropertyUtils.getProperty(bean, "string2dArray[0][0]"));
assertEquals("firstArray[1]", firstArray[1], PropertyUtils.getProperty(bean, "string2dArray[0][1]"));
@@ -1040,7 +1040,7 @@ public class PropertyUtilsTestCase exten
assertEquals("secondArray[1]", secondArray[1], PropertyUtils.getProperty(bean, "string2dArray[1][1]"));
assertEquals("secondArray[2]", secondArray[2], PropertyUtils.getProperty(bean, "string2dArray[1][2]"));
assertEquals("secondArray[3]", secondArray[3], PropertyUtils.getProperty(bean, "string2dArray[1][3]"));
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + "");
}
}
@@ -1049,12 +1049,12 @@ public class PropertyUtilsTestCase exten
* Test getting an indexed value out of List of Lists
*/
public void testGetIndexedList() {
- String[] firstArray = new String[] {"FIRST-1", "FIRST-2", "FIRST-3"};
- String[] secondArray = new String[] {"SECOND-1", "SECOND-2", "SECOND-3", "SECOND-4"};
- List<Object> mainList = new ArrayList<Object>();
+ final String[] firstArray = new String[] {"FIRST-1", "FIRST-2", "FIRST-3"};
+ final String[] secondArray = new String[] {"SECOND-1", "SECOND-2", "SECOND-3", "SECOND-4"};
+ final List<Object> mainList = new ArrayList<Object>();
mainList.add(Arrays.asList(firstArray));
mainList.add(Arrays.asList(secondArray));
- TestBean bean = new TestBean(mainList);
+ final TestBean bean = new TestBean(mainList);
try {
assertEquals("firstArray[0]", firstArray[0], PropertyUtils.getProperty(bean, "listIndexed[0][0]"));
assertEquals("firstArray[1]", firstArray[1], PropertyUtils.getProperty(bean, "listIndexed[0][1]"));
@@ -1063,7 +1063,7 @@ public class PropertyUtilsTestCase exten
assertEquals("secondArray[1]", secondArray[1], PropertyUtils.getProperty(bean, "listIndexed[1][1]"));
assertEquals("secondArray[2]", secondArray[2], PropertyUtils.getProperty(bean, "listIndexed[1][2]"));
assertEquals("secondArray[3]", secondArray[3], PropertyUtils.getProperty(bean, "listIndexed[1][3]"));
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + "");
}
}
@@ -1072,23 +1072,23 @@ public class PropertyUtilsTestCase exten
* Test getting a value out of a mapped Map
*/
public void testGetIndexedMap() {
- Map<String, Object> firstMap = new HashMap<String, Object>();
+ final Map<String, Object> firstMap = new HashMap<String, Object>();
firstMap.put("FIRST-KEY-1", "FIRST-VALUE-1");
firstMap.put("FIRST-KEY-2", "FIRST-VALUE-2");
- Map<String, Object> secondMap = new HashMap<String, Object>();
+ final Map<String, Object> secondMap = new HashMap<String, Object>();
secondMap.put("SECOND-KEY-1", "SECOND-VALUE-1");
secondMap.put("SECOND-KEY-2", "SECOND-VALUE-2");
- List<Object> mainList = new ArrayList<Object>();
+ final List<Object> mainList = new ArrayList<Object>();
mainList.add(firstMap);
mainList.add(secondMap);
- TestBean bean = new TestBean(mainList);
+ final TestBean bean = new TestBean(mainList);
try {
assertEquals("listIndexed[0](FIRST-KEY-1)", "FIRST-VALUE-1", PropertyUtils.getProperty(bean, "listIndexed[0](FIRST-KEY-1)"));
assertEquals("listIndexed[0](FIRST-KEY-2)", "FIRST-VALUE-2", PropertyUtils.getProperty(bean, "listIndexed[0](FIRST-KEY-2)"));
assertEquals("listIndexed[1](SECOND-KEY-1)", "SECOND-VALUE-1", PropertyUtils.getProperty(bean, "listIndexed[1](SECOND-KEY-1)"));
assertEquals("listIndexed[1](SECOND-KEY-2)", "SECOND-VALUE-2", PropertyUtils.getProperty(bean, "listIndexed[1](SECOND-KEY-2)"));
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + "");
}
}
@@ -1104,27 +1104,27 @@ public class PropertyUtilsTestCase exten
PropertyUtils.getMappedProperty(null, "mappedProperty",
"First Key");
fail("Should throw IllegalArgumentException 1");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 1");
}
try {
PropertyUtils.getMappedProperty(bean, null, "First Key");
fail("Should throw IllegalArgumentException 2");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 2");
}
try {
PropertyUtils.getMappedProperty(bean, "mappedProperty", null);
fail("Should throw IllegalArgumentException 3");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 3");
}
@@ -1134,27 +1134,27 @@ public class PropertyUtilsTestCase exten
PropertyUtils.getMappedProperty(null,
"mappedProperty(First Key)");
fail("Should throw IllegalArgumentException 4");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 4");
}
try {
PropertyUtils.getMappedProperty(bean, "(Second Key)");
fail("Should throw IllegalArgumentException 5");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of NoSuchMethodException 5");
}
try {
PropertyUtils.getMappedProperty(bean, "mappedProperty");
fail("Should throw IllegalArgumentException 6");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 6");
}
@@ -1164,14 +1164,14 @@ public class PropertyUtilsTestCase exten
* Test getting an indexed value out of a mapped array
*/
public void testGetMappedArray() {
- TestBean bean = new TestBean();
- String[] array = new String[] {"abc", "def", "ghi"};
+ final TestBean bean = new TestBean();
+ final String[] array = new String[] {"abc", "def", "ghi"};
bean.getMapProperty().put("mappedArray", array);
try {
assertEquals("abc", PropertyUtils.getProperty(bean, "mapProperty(mappedArray)[0]"));
assertEquals("def", PropertyUtils.getProperty(bean, "mapProperty(mappedArray)[1]"));
assertEquals("ghi", PropertyUtils.getProperty(bean, "mapProperty(mappedArray)[2]"));
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + "");
}
}
@@ -1180,8 +1180,8 @@ public class PropertyUtilsTestCase exten
* Test getting an indexed value out of a mapped List
*/
public void testGetMappedList() {
- TestBean bean = new TestBean();
- List<Object> list = new ArrayList<Object>();
+ final TestBean bean = new TestBean();
+ final List<Object> list = new ArrayList<Object>();
list.add("klm");
list.add("nop");
list.add("qrs");
@@ -1190,7 +1190,7 @@ public class PropertyUtilsTestCase exten
assertEquals("klm", PropertyUtils.getProperty(bean, "mapProperty(mappedList)[0]"));
assertEquals("nop", PropertyUtils.getProperty(bean, "mapProperty(mappedList)[1]"));
assertEquals("qrs", PropertyUtils.getProperty(bean, "mapProperty(mappedList)[2]"));
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + "");
}
}
@@ -1199,8 +1199,8 @@ public class PropertyUtilsTestCase exten
* Test getting a value out of a mapped Map
*/
public void testGetMappedMap() {
- TestBean bean = new TestBean();
- Map<String, Object> map = new HashMap<String, Object>();
+ final TestBean bean = new TestBean();
+ final Map<String, Object> map = new HashMap<String, Object>();
map.put("sub-key-1", "sub-value-1");
map.put("sub-key-2", "sub-value-2");
map.put("sub-key-3", "sub-value-3");
@@ -1209,7 +1209,7 @@ public class PropertyUtilsTestCase exten
assertEquals("sub-value-1", PropertyUtils.getProperty(bean, "mapProperty(mappedMap)(sub-key-1)"));
assertEquals("sub-value-2", PropertyUtils.getProperty(bean, "mapProperty(mappedMap)(sub-key-2)"));
assertEquals("sub-value-3", PropertyUtils.getProperty(bean, "mapProperty(mappedMap)(sub-key-3)"));
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + "");
}
}
@@ -1228,7 +1228,7 @@ public class PropertyUtilsTestCase exten
"Special Value",
PropertyUtils.getMappedProperty
(bean, "mappedProperty", "key.with.a.dot"));
- } catch (Exception e) {
+ } catch (final Exception e) {
fail("Thew exception: " + e);
}
try {
@@ -1236,7 +1236,7 @@ public class PropertyUtilsTestCase exten
"Special Value",
PropertyUtils.getNestedProperty
(bean, "mappedProperty(key.with.a.dot)"));
- } catch (Exception e) {
+ } catch (final Exception e) {
fail("Thew exception: " + e);
}
@@ -1249,7 +1249,7 @@ public class PropertyUtilsTestCase exten
PropertyUtils.getNestedProperty
(bean,
"mappedObjects(nested.property).stringProperty"));
- } catch (Exception e) {
+ } catch (final Exception e) {
fail("Thew exception: " + e);
}
@@ -1259,7 +1259,7 @@ public class PropertyUtilsTestCase exten
"Mapped Value",
PropertyUtils.getNestedProperty(
bean,"mappedNested.value(Mapped Key)"));
- } catch (Exception e)
+ } catch (final Exception e)
{
fail("Thew exception: " + e);
}
@@ -1281,7 +1281,7 @@ public class PropertyUtilsTestCase exten
"Special Value",
PropertyUtils.getMappedProperty
(bean, "mappedProperty", "key/with/a/slash"));
- } catch (Exception e) {
+ } catch (final Exception e) {
fail("Thew exception: " + e);
}
try {
@@ -1289,7 +1289,7 @@ public class PropertyUtilsTestCase exten
"Special Value",
PropertyUtils.getNestedProperty
(bean, "mappedProperty(key/with/a/slash)"));
- } catch (Exception e) {
+ } catch (final Exception e) {
fail("Thew exception: " + e);
}
@@ -1302,7 +1302,7 @@ public class PropertyUtilsTestCase exten
PropertyUtils.getNestedProperty
(bean,
"mappedObjects(nested/property).stringProperty"));
- } catch (Exception e) {
+ } catch (final Exception e) {
fail("Thew exception: " + e);
}
@@ -1322,7 +1322,7 @@ public class PropertyUtilsTestCase exten
value = PropertyUtils.getMappedProperty(bean, "mappedProperty",
"First Key");
assertEquals("Can find first value", "First Value", value);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Finding first value threw " + t);
}
@@ -1330,7 +1330,7 @@ public class PropertyUtilsTestCase exten
value = PropertyUtils.getMappedProperty(bean, "mappedProperty",
"Second Key");
assertEquals("Can find second value", "Second Value", value);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Finding second value threw " + t);
}
@@ -1338,7 +1338,7 @@ public class PropertyUtilsTestCase exten
value = PropertyUtils.getMappedProperty(bean, "mappedProperty",
"Third Key");
assertNull("Can not find third value", value);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Finding third value threw " + t);
}
@@ -1349,7 +1349,7 @@ public class PropertyUtilsTestCase exten
PropertyUtils.getMappedProperty(bean,
"mappedProperty(First Key)");
assertEquals("Can find first value", "First Value", value);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Finding first value threw " + t);
}
@@ -1358,7 +1358,7 @@ public class PropertyUtilsTestCase exten
PropertyUtils.getMappedProperty(bean,
"mappedProperty(Second Key)");
assertEquals("Can find second value", "Second Value", value);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Finding second value threw " + t);
}
@@ -1367,7 +1367,7 @@ public class PropertyUtilsTestCase exten
PropertyUtils.getMappedProperty(bean,
"mappedProperty(Third Key)");
assertNull("Can not find third value", value);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Finding third value threw " + t);
}
@@ -1378,7 +1378,7 @@ public class PropertyUtilsTestCase exten
PropertyUtils.getNestedProperty(bean,
"mapProperty.First Key");
assertEquals("Can find first value", "First Value", value);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Finding first value threw " + t);
}
@@ -1387,7 +1387,7 @@ public class PropertyUtilsTestCase exten
PropertyUtils.getNestedProperty(bean,
"mapProperty.Second Key");
assertEquals("Can find second value", "Second Value", value);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Finding second value threw " + t);
}
@@ -1396,7 +1396,7 @@ public class PropertyUtilsTestCase exten
PropertyUtils.getNestedProperty(bean,
"mapProperty.Third Key");
assertNull("Can not find third value", value);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Finding third value threw " + t);
}
@@ -1411,18 +1411,18 @@ public class PropertyUtilsTestCase exten
try {
PropertyUtils.getNestedProperty(null, "stringProperty");
fail("Should throw IllegalArgumentException 1");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 1");
}
try {
PropertyUtils.getNestedProperty(bean, null);
fail("Should throw IllegalArgumentException 2");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 2");
}
@@ -1435,7 +1435,7 @@ public class PropertyUtilsTestCase exten
public void testGetNestedBoolean() {
try {
- Object value =
+ final Object value =
PropertyUtils.getNestedProperty
(bean, "nested.booleanProperty");
assertNotNull("Got a value", value);
@@ -1443,13 +1443,13 @@ public class PropertyUtilsTestCase exten
assertTrue("Got correct value",
((Boolean) value).booleanValue() ==
bean.getNested().getBooleanProperty());
- } catch (IllegalAccessException e) {
+ } catch (final IllegalAccessException e) {
fail("IllegalAccessException");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
fail("IllegalArgumentException");
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
fail("InvocationTargetException");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
fail("NoSuchMethodException");
}
@@ -1462,7 +1462,7 @@ public class PropertyUtilsTestCase exten
public void testGetNestedDouble() {
try {
- Object value =
+ final Object value =
PropertyUtils.getNestedProperty
(bean, "nested.doubleProperty");
assertNotNull("Got a value", value);
@@ -1471,13 +1471,13 @@ public class PropertyUtilsTestCase exten
((Double) value).doubleValue(),
bean.getNested().getDoubleProperty(),
0.005);
- } catch (IllegalAccessException e) {
+ } catch (final IllegalAccessException e) {
fail("IllegalAccessException");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
fail("IllegalArgumentException");
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
fail("InvocationTargetException");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
fail("NoSuchMethodException");
}
@@ -1490,7 +1490,7 @@ public class PropertyUtilsTestCase exten
public void testGetNestedFloat() {
try {
- Object value =
+ final Object value =
PropertyUtils.getNestedProperty
(bean, "nested.floatProperty");
assertNotNull("Got a value", value);
@@ -1499,13 +1499,13 @@ public class PropertyUtilsTestCase exten
((Float) value).floatValue(),
bean.getNested().getFloatProperty(),
(float) 0.005);
- } catch (IllegalAccessException e) {
+ } catch (final IllegalAccessException e) {
fail("IllegalAccessException");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
fail("IllegalArgumentException");
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
fail("InvocationTargetException");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
fail("NoSuchMethodException");
}
@@ -1518,7 +1518,7 @@ public class PropertyUtilsTestCase exten
public void testGetNestedInt() {
try {
- Object value =
+ final Object value =
PropertyUtils.getNestedProperty
(bean, "nested.intProperty");
assertNotNull("Got a value", value);
@@ -1526,13 +1526,13 @@ public class PropertyUtilsTestCase exten
assertEquals("Got correct value",
((Integer) value).intValue(),
bean.getNested().getIntProperty());
- } catch (IllegalAccessException e) {
+ } catch (final IllegalAccessException e) {
fail("IllegalAccessException");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
fail("IllegalArgumentException");
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
fail("InvocationTargetException");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
fail("NoSuchMethodException");
}
@@ -1545,7 +1545,7 @@ public class PropertyUtilsTestCase exten
public void testGetNestedLong() {
try {
- Object value =
+ final Object value =
PropertyUtils.getNestedProperty
(bean, "nested.longProperty");
assertNotNull("Got a value", value);
@@ -1553,13 +1553,13 @@ public class PropertyUtilsTestCase exten
assertEquals("Got correct value",
((Long) value).longValue(),
bean.getNested().getLongProperty());
- } catch (IllegalAccessException e) {
+ } catch (final IllegalAccessException e) {
fail("IllegalAccessException");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
fail("IllegalArgumentException");
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
fail("InvocationTargetException");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
fail("NoSuchMethodException");
}
@@ -1572,7 +1572,7 @@ public class PropertyUtilsTestCase exten
public void testGetNestedReadOnly() {
try {
- Object value =
+ final Object value =
PropertyUtils.getNestedProperty
(bean, "nested.readOnlyProperty");
assertNotNull("Got a value", value);
@@ -1580,13 +1580,13 @@ public class PropertyUtilsTestCase exten
assertEquals("Got correct value",
(String) value,
bean.getReadOnlyProperty());
- } catch (IllegalAccessException e) {
+ } catch (final IllegalAccessException e) {
fail("IllegalAccessException");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
fail("IllegalArgumentException");
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
fail("InvocationTargetException");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
fail("NoSuchMethodException");
}
@@ -1599,7 +1599,7 @@ public class PropertyUtilsTestCase exten
public void testGetNestedShort() {
try {
- Object value =
+ final Object value =
PropertyUtils.getNestedProperty
(bean, "nested.shortProperty");
assertNotNull("Got a value", value);
@@ -1607,13 +1607,13 @@ public class PropertyUtilsTestCase exten
assertEquals("Got correct value",
((Short) value).shortValue(),
bean.getNested().getShortProperty());
- } catch (IllegalAccessException e) {
+ } catch (final IllegalAccessException e) {
fail("IllegalAccessException");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
fail("IllegalArgumentException");
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
fail("InvocationTargetException");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
fail("NoSuchMethodException");
}
@@ -1626,7 +1626,7 @@ public class PropertyUtilsTestCase exten
public void testGetNestedString() {
try {
- Object value =
+ final Object value =
PropertyUtils.getNestedProperty
(bean, "nested.stringProperty");
assertNotNull("Got a value", value);
@@ -1634,13 +1634,13 @@ public class PropertyUtilsTestCase exten
assertEquals("Got correct value",
((String) value),
bean.getNested().getStringProperty());
- } catch (IllegalAccessException e) {
+ } catch (final IllegalAccessException e) {
fail("IllegalAccessException");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
fail("IllegalArgumentException");
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
fail("InvocationTargetException");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
fail("NoSuchMethodException");
}
@@ -1655,13 +1655,13 @@ public class PropertyUtilsTestCase exten
try {
PropertyUtils.getNestedProperty(bean, "nested.unknown");
fail("Should have thrown NoSuchMethodException");
- } catch (IllegalAccessException e) {
+ } catch (final IllegalAccessException e) {
fail("IllegalAccessException");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
fail("IllegalArgumentException");
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
fail("InvocationTargetException");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
// Correct result for this test
}
@@ -1672,7 +1672,7 @@ public class PropertyUtilsTestCase exten
* this should throw a NestedNullException.
*/
public void testThrowNestedNull() throws Exception {
- NestedTestBean nestedBean = new NestedTestBean("base");
+ final NestedTestBean nestedBean = new NestedTestBean("base");
// don't init!
try {
@@ -1680,7 +1680,7 @@ public class PropertyUtilsTestCase exten
nestedBean,
"simpleBeanProperty.indexedProperty[0]");
fail("NestedNullException not thrown");
- } catch (NestedNullException e) {
+ } catch (final NestedNullException e) {
// that's what we wanted!
}
}
@@ -1693,13 +1693,13 @@ public class PropertyUtilsTestCase exten
try {
PropertyUtils.getNestedProperty(bean, "writeOnlyProperty");
fail("Should have thrown NoSuchMethodException");
- } catch (IllegalAccessException e) {
+ } catch (final IllegalAccessException e) {
fail("IllegalAccessException");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
fail("IllegalArgumentException");
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
fail("InvocationTargetException");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
// Correct result for this test
}
@@ -1712,8 +1712,8 @@ public class PropertyUtilsTestCase exten
public void testGetPropertyType() {
Class<?> clazz = null;
- int intArray[] = new int[0];
- String stringArray[] = new String[0];
+ final int intArray[] = new int[0];
+ final String stringArray[] = new String[0];
try {
@@ -1811,11 +1811,11 @@ public class PropertyUtilsTestCase exten
try {
clazz = PropertyUtils.getPropertyType(bean, "nestedDynaBean.nullDynaBean.foo");
fail("Expected NestedNullException for nestedDynaBean.nullDynaBean.foo");
- } catch (NestedNullException e) {
+ } catch (final NestedNullException e) {
// expected
}
- } catch (Exception e) {
+ } catch (final Exception e) {
fail("Exception: " + e.getMessage());
}
@@ -1827,7 +1827,7 @@ public class PropertyUtilsTestCase exten
*/
public void testGetPublicSubBean_of_PackageBean() {
- PublicSubBean bean = new PublicSubBean();
+ final PublicSubBean bean = new PublicSubBean();
bean.setFoo("foo-start");
bean.setBar("bar-start");
Object result = null;
@@ -1835,7 +1835,7 @@ public class PropertyUtilsTestCase exten
// Get Foo
try {
result = PropertyUtils.getProperty(bean, "foo");
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("getProperty(foo) threw " + t);
}
assertEquals("foo property", "foo-start", result);
@@ -1843,7 +1843,7 @@ public class PropertyUtilsTestCase exten
// Get Bar
try {
result = PropertyUtils.getProperty(bean, "bar");
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("getProperty(bar) threw " + t);
}
assertEquals("bar property", "bar-start", result);
@@ -1901,7 +1901,7 @@ public class PropertyUtilsTestCase exten
// Property "foo" is not accessible because the underlying
// class has package scope
- PropertyDescriptor pd[] =
+ final PropertyDescriptor pd[] =
PropertyUtils.getPropertyDescriptors(beanPrivate);
int n = -1;
for (int i = 0; i < pd.length; i++) {
@@ -1911,14 +1911,14 @@ public class PropertyUtilsTestCase exten
}
}
assertTrue("Found foo descriptor", n >= 0);
- Method reader = pd[n].getReadMethod();
+ final Method reader = pd[n].getReadMethod();
assertNotNull("Found foo read method", reader);
try {
reader.invoke(beanPrivate, (Object[]) new Class<?>[0]);
fail("Foo reader did throw IllegalAccessException");
- } catch (IllegalAccessException e) {
+ } catch (final IllegalAccessException e) {
// Expected result for this test
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Invoke foo reader: " + t);
}
@@ -1944,18 +1944,18 @@ public class PropertyUtilsTestCase exten
try {
PropertyUtils.getSimpleProperty(null, "stringProperty");
fail("Should throw IllegalArgumentException 1");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 1");
}
try {
PropertyUtils.getSimpleProperty(bean, null);
fail("Should throw IllegalArgumentException 2");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 2");
}
@@ -1968,7 +1968,7 @@ public class PropertyUtilsTestCase exten
public void testGetSimpleBoolean() {
try {
- Object value =
+ final Object value =
PropertyUtils.getSimpleProperty(bean,
"booleanProperty");
assertNotNull("Got a value", value);
@@ -1976,13 +1976,13 @@ public class PropertyUtilsTestCase exten
assertTrue("Got correct value",
((Boolean) value).booleanValue() ==
bean.getBooleanProperty());
- } catch (IllegalAccessException e) {
+ } catch (final IllegalAccessException e) {
fail("IllegalAccessException");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
fail("IllegalArgumentException");
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
fail("InvocationTargetException");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
fail("NoSuchMethodException");
}
@@ -1995,7 +1995,7 @@ public class PropertyUtilsTestCase exten
public void testGetSimpleDouble() {
try {
- Object value =
+ final Object value =
PropertyUtils.getSimpleProperty(bean,
"doubleProperty");
assertNotNull("Got a value", value);
@@ -2003,13 +2003,13 @@ public class PropertyUtilsTestCase exten
assertEquals("Got correct value",
((Double) value).doubleValue(),
bean.getDoubleProperty(), 0.005);
- } catch (IllegalAccessException e) {
+ } catch (final IllegalAccessException e) {
fail("IllegalAccessException");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
fail("IllegalArgumentException");
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
fail("InvocationTargetException");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
fail("NoSuchMethodException");
}
@@ -2022,7 +2022,7 @@ public class PropertyUtilsTestCase exten
public void testGetSimpleFloat() {
try {
- Object value =
+ final Object value =
PropertyUtils.getSimpleProperty(bean,
"floatProperty");
assertNotNull("Got a value", value);
@@ -2031,13 +2031,13 @@ public class PropertyUtilsTestCase exten
((Float) value).floatValue(),
bean.getFloatProperty(),
(float) 0.005);
- } catch (IllegalAccessException e) {
+ } catch (final IllegalAccessException e) {
fail("IllegalAccessException");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
fail("IllegalArgumentException");
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
fail("InvocationTargetException");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
fail("NoSuchMethodException");
}
@@ -2053,13 +2053,13 @@ public class PropertyUtilsTestCase exten
PropertyUtils.getSimpleProperty(bean,
"intIndexed[0]");
fail("Should have thrown IllegalArgumentException");
- } catch (IllegalAccessException e) {
+ } catch (final IllegalAccessException e) {
fail("IllegalAccessException");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Correct result for this test
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
fail("InvocationTargetException");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
fail("NoSuchMethodException");
}
@@ -2072,7 +2072,7 @@ public class PropertyUtilsTestCase exten
public void testGetSimpleInt() {
try {
- Object value =
+ final Object value =
PropertyUtils.getSimpleProperty(bean,
"intProperty");
assertNotNull("Got a value", value);
@@ -2080,13 +2080,13 @@ public class PropertyUtilsTestCase exten
assertEquals("Got correct value",
((Integer) value).intValue(),
bean.getIntProperty());
- } catch (IllegalAccessException e) {
+ } catch (final IllegalAccessException e) {
fail("IllegalAccessException");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
fail("IllegalArgumentException");
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
fail("InvocationTargetException");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
fail("NoSuchMethodException");
}
@@ -2099,7 +2099,7 @@ public class PropertyUtilsTestCase exten
public void testGetSimpleLong() {
try {
- Object value =
+ final Object value =
PropertyUtils.getSimpleProperty(bean,
"longProperty");
assertNotNull("Got a value", value);
@@ -2107,13 +2107,13 @@ public class PropertyUtilsTestCase exten
assertEquals("Got correct value",
((Long) value).longValue(),
bean.getLongProperty());
- } catch (IllegalAccessException e) {
+ } catch (final IllegalAccessException e) {
fail("IllegalAccessException");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
fail("IllegalArgumentException");
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
fail("InvocationTargetException");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
fail("NoSuchMethodException");
}
@@ -2129,13 +2129,13 @@ public class PropertyUtilsTestCase exten
PropertyUtils.getSimpleProperty(bean,
"nested.stringProperty");
fail("Should have thrown IllegaArgumentException");
- } catch (IllegalAccessException e) {
+ } catch (final IllegalAccessException e) {
fail("IllegalAccessException");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Correct result for this test
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
fail("InvocationTargetException");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
fail("NoSuchMethodException");
}
@@ -2148,7 +2148,7 @@ public class PropertyUtilsTestCase exten
public void testGetSimpleReadOnly() {
try {
- Object value =
+ final Object value =
PropertyUtils.getSimpleProperty(bean,
"readOnlyProperty");
assertNotNull("Got a value", value);
@@ -2156,13 +2156,13 @@ public class PropertyUtilsTestCase exten
assertEquals("Got correct value",
(String) value,
bean.getReadOnlyProperty());
- } catch (IllegalAccessException e) {
+ } catch (final IllegalAccessException e) {
fail("IllegalAccessException");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
fail("IllegalArgumentException");
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
fail("InvocationTargetException");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
fail("NoSuchMethodException");
}
@@ -2175,7 +2175,7 @@ public class PropertyUtilsTestCase exten
public void testGetSimpleShort() {
try {
- Object value =
+ final Object value =
PropertyUtils.getSimpleProperty(bean,
"shortProperty");
assertNotNull("Got a value", value);
@@ -2183,13 +2183,13 @@ public class PropertyUtilsTestCase exten
assertEquals("Got correct value",
((Short) value).shortValue(),
bean.getShortProperty());
- } catch (IllegalAccessException e) {
+ } catch (final IllegalAccessException e) {
fail("IllegalAccessException");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
fail("IllegalArgumentException");
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
fail("InvocationTargetException");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
fail("NoSuchMethodException");
}
@@ -2202,7 +2202,7 @@ public class PropertyUtilsTestCase exten
public void testGetSimpleString() {
try {
- Object value =
+ final Object value =
PropertyUtils.getSimpleProperty(bean,
"stringProperty");
assertNotNull("Got a value", value);
@@ -2210,13 +2210,13 @@ public class PropertyUtilsTestCase exten
assertEquals("Got correct value",
(String) value,
bean.getStringProperty());
- } catch (IllegalAccessException e) {
+ } catch (final IllegalAccessException e) {
fail("IllegalAccessException");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
fail("IllegalArgumentException");
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
fail("InvocationTargetException");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
fail("NoSuchMethodException");
}
@@ -2231,13 +2231,13 @@ public class PropertyUtilsTestCase exten
try {
PropertyUtils.getSimpleProperty(bean, "unknown");
fail("Should have thrown NoSuchMethodException");
- } catch (IllegalAccessException e) {
+ } catch (final IllegalAccessException e) {
fail("IllegalAccessException");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
fail("IllegalArgumentException");
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
fail("InvocationTargetException");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
// Correct result for this test
assertEquals("Unknown property 'unknown' on class '" +
bean.getClass() + "'", e.getMessage() );
@@ -2254,13 +2254,13 @@ public class PropertyUtilsTestCase exten
try {
PropertyUtils.getSimpleProperty(bean, "writeOnlyProperty");
fail("Should have thrown NoSuchMethodException");
- } catch (IllegalAccessException e) {
+ } catch (final IllegalAccessException e) {
fail("IllegalAccessException");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
fail("IllegalArgumentException");
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
fail("InvocationTargetException");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
// Correct result for this test
assertEquals("Property 'writeOnlyProperty' has no getter method in class '" +
bean.getClass() + "'", e.getMessage() );
@@ -2310,61 +2310,61 @@ public class PropertyUtilsTestCase exten
try {
property = "stringProperty";
assertTrue("Property " + property +" isReadable expeced TRUE", PropertyUtils.isReadable(bean, property));
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Property " + property +" isReadable Threw exception: " + t);
}
try {
property = "stringIndexed";
assertTrue("Property " + property +" isReadable expeced TRUE", PropertyUtils.isReadable(bean, property));
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Property " + property +" isReadable Threw exception: " + t);
}
try {
property = "mappedProperty";
assertTrue("Property " + property +" isReadable expeced TRUE", PropertyUtils.isReadable(bean, property));
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Property " + property +" isReadable Threw exception: " + t);
}
try {
property = "nestedDynaBean";
assertTrue("Property " + property +" isReadable expeced TRUE", PropertyUtils.isReadable(bean, property));
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Property " + property +" isReadable Threw exception: " + t);
}
try {
property = "nestedDynaBean.stringProperty";
assertTrue("Property " + property +" isReadable expeced TRUE", PropertyUtils.isReadable(bean, property));
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Property " + property +" isReadable Threw exception: " + t);
}
try {
property = "nestedDynaBean.nestedBean";
assertTrue("Property " + property +" isReadable expeced TRUE", PropertyUtils.isReadable(bean, property));
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Property " + property +" isReadable Threw exception: " + t);
}
try {
property = "nestedDynaBean.nestedBean.nestedDynaBean";
assertTrue("Property " + property +" isReadable expeced TRUE", PropertyUtils.isReadable(bean, property));
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Property " + property +" isReadable Threw exception: " + t);
}
try {
property = "nestedDynaBean.nestedBean.nestedDynaBean.stringProperty";
assertTrue("Property " + property +" isReadable expeced TRUE", PropertyUtils.isReadable(bean, property));
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Property " + property +" isReadable Threw exception: " + t);
}
try {
property = "nestedDynaBean.nullDynaBean";
assertTrue("Property " + property +" isReadable expeced TRUE", PropertyUtils.isReadable(bean, property));
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Property " + property +" isReadable Threw exception: " + t);
}
@@ -2372,9 +2372,9 @@ public class PropertyUtilsTestCase exten
property = "nestedDynaBean.nullDynaBean.foo";
assertTrue("Property " + property +" isReadable expeced TRUE", PropertyUtils.isReadable(bean, property));
fail("Property " + property +" isReadable expected NestedNullException");
- } catch (NestedNullException e) {
+ } catch (final NestedNullException e) {
// expected result
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Property " + property +" isReadable Threw exception: " + t);
}
}
@@ -2387,33 +2387,33 @@ public class PropertyUtilsTestCase exten
try {
property = "stringProperty";
assertTrue("Property " + property +" isWriteable expeced TRUE", PropertyUtils.isWriteable(bean, property));
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Property " + property +" isWriteable Threw exception: " + t);
}
try {
property = "stringIndexed";
assertTrue("Property " + property +" isWriteable expeced TRUE", PropertyUtils.isWriteable(bean, property));
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Property " + property +" isWriteable Threw exception: " + t);
}
try {
property = "mappedProperty";
assertTrue("Property " + property +" isWriteable expeced TRUE", PropertyUtils.isWriteable(bean, property));
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Property " + property +" isWriteable Threw exception: " + t);
}
try {
property = "nestedDynaBean";
assertTrue("Property " + property +" isWriteable expeced TRUE", PropertyUtils.isWriteable(bean, property));
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Property " + property +" isWriteable Threw exception: " + t);
}
try {
property = "nestedDynaBean.stringProperty";
assertTrue("Property " + property +" isWriteable expeced TRUE", PropertyUtils.isWriteable(bean, property));
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
fail("Property " + property +" isWriteable Threw exception: " + t);
}
@@ -2421,28 +2421,28 @@ public class PropertyUtilsTestCase exten
try {
property = "nestedDynaBean.nestedBean";
assertTrue("Property " + property +" isWriteable expeced TRUE", PropertyUtils.isWriteable(bean, property));
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Property " + property +" isWriteable Threw exception: " + t);
}
try {
property = "nestedDynaBean.nestedBean.nestedDynaBean";
assertTrue("Property " + property +" isWriteable expeced TRUE", PropertyUtils.isWriteable(bean, property));
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Property " + property +" isWriteable Threw exception: " + t);
}
try {
property = "nestedDynaBean.nestedBean.nestedDynaBean.stringProperty";
assertTrue("Property " + property +" isWriteable expeced TRUE", PropertyUtils.isWriteable(bean, property));
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Property " + property +" isWriteable Threw exception: " + t);
}
try {
property = "nestedDynaBean.nullDynaBean";
assertTrue("Property " + property +" isWriteable expeced TRUE", PropertyUtils.isWriteable(bean, property));
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Property " + property +" isWriteable Threw exception: " + t);
}
@@ -2450,9 +2450,9 @@ public class PropertyUtilsTestCase exten
property = "nestedDynaBean.nullDynaBean.foo";
assertTrue("Property " + property +" isWriteable expeced TRUE", PropertyUtils.isWriteable(bean, property));
fail("Property " + property +" isWriteable expected NestedNullException");
- } catch (NestedNullException e) {
+ } catch (final NestedNullException e) {
// expected result
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Property " + property +" isWriteable Threw exception: " + t);
}
}
@@ -2491,9 +2491,9 @@ public class PropertyUtilsTestCase exten
PropertyUtils.setIndexedProperty(null, "intArray", 0,
new Integer(1));
fail("Should throw IllegalArgumentException 1");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 1");
}
@@ -2501,9 +2501,9 @@ public class PropertyUtilsTestCase exten
PropertyUtils.setIndexedProperty(bean, null, 0,
new Integer(1));
fail("Should throw IllegalArgumentException 2");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 2");
}
@@ -2514,9 +2514,9 @@ public class PropertyUtilsTestCase exten
"intArray[0]",
new Integer(1));
fail("Should throw IllegalArgumentException 3");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 3");
}
@@ -2524,9 +2524,9 @@ public class PropertyUtilsTestCase exten
PropertyUtils.setIndexedProperty(bean, "[0]",
new Integer(1));
fail("Should throw NoSuchMethodException 4");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of NoSuchMethodException 4");
}
@@ -2534,9 +2534,9 @@ public class PropertyUtilsTestCase exten
PropertyUtils.setIndexedProperty(bean, "intArray",
new Integer(1));
fail("Should throw IllegalArgumentException 5");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 5");
}
@@ -2546,9 +2546,9 @@ public class PropertyUtilsTestCase exten
PropertyUtils.setIndexedProperty(null, "intIndexed", 0,
new Integer(1));
fail("Should throw IllegalArgumentException 1");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 1");
}
@@ -2556,9 +2556,9 @@ public class PropertyUtilsTestCase exten
PropertyUtils.setIndexedProperty(bean, null, 0,
new Integer(1));
fail("Should throw IllegalArgumentException 2");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 2");
}
@@ -2569,9 +2569,9 @@ public class PropertyUtilsTestCase exten
"intIndexed[0]",
new Integer(1));
fail("Should throw IllegalArgumentException 3");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 3");
}
@@ -2579,9 +2579,9 @@ public class PropertyUtilsTestCase exten
PropertyUtils.setIndexedProperty(bean, "[0]",
new Integer(1));
fail("Should throw NoSuchMethodException 4");
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of NoSuchMethodException 4");
}
@@ -2589,9 +2589,9 @@ public class PropertyUtilsTestCase exten
PropertyUtils.setIndexedProperty(bean, "intIndexed",
new Integer(1));
fail("Should throw IllegalArgumentException 5");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// Expected response
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + " instead of IllegalArgumentException 5");
}
@@ -2601,14 +2601,14 @@ public class PropertyUtilsTestCase exten
* Test setting an indexed value out of a multi-dimensional array
*/
public void testSetIndexedArray() {
- String[] firstArray = new String[] {"FIRST-1", "FIRST-2", "FIRST-3"};
- String[] secondArray = new String[] {"SECOND-1", "SECOND-2", "SECOND-3", "SECOND-4"};
- String[][] mainArray = {firstArray, secondArray};
- TestBean bean = new TestBean(mainArray);
+ final String[] firstArray = new String[] {"FIRST-1", "FIRST-2", "FIRST-3"};
+ final String[] secondArray = new String[] {"SECOND-1", "SECOND-2", "SECOND-3", "SECOND-4"};
+ final String[][] mainArray = {firstArray, secondArray};
+ final TestBean bean = new TestBean(mainArray);
assertEquals("BEFORE", "SECOND-3", bean.getString2dArray(1)[2]);
try {
PropertyUtils.setProperty(bean, "string2dArray[1][2]", "SECOND-3-UPDATED");
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + "");
}
assertEquals("AFTER", "SECOND-3-UPDATED", bean.getString2dArray(1)[2]);
@@ -2618,16 +2618,16 @@ public class PropertyUtilsTestCase exten
* Test setting an indexed value out of List of Lists
*/
public void testSetIndexedList() {
- String[] firstArray = new String[] {"FIRST-1", "FIRST-2", "FIRST-3"};
- String[] secondArray = new String[] {"SECOND-1", "SECOND-2", "SECOND-3", "SECOND-4"};
- List<Object> mainList = new ArrayList<Object>();
+ final String[] firstArray = new String[] {"FIRST-1", "FIRST-2", "FIRST-3"};
+ final String[] secondArray = new String[] {"SECOND-1", "SECOND-2", "SECOND-3", "SECOND-4"};
+ final List<Object> mainList = new ArrayList<Object>();
mainList.add(Arrays.asList(firstArray));
mainList.add(Arrays.asList(secondArray));
- TestBean bean = new TestBean(mainList);
+ final TestBean bean = new TestBean(mainList);
assertEquals("BEFORE", "SECOND-4", ((List<?>)bean.getListIndexed().get(1)).get(3));
try {
PropertyUtils.setProperty(bean, "listIndexed[1][3]", "SECOND-4-UPDATED");
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + "");
}
assertEquals("AFTER", "SECOND-4-UPDATED", ((List<?>)bean.getListIndexed().get(1)).get(3));
@@ -2637,24 +2637,24 @@ public class PropertyUtilsTestCase exten
* Test setting a value out of a mapped Map
*/
public void testSetIndexedMap() {
- Map<String, Object> firstMap = new HashMap<String, Object>();
+ final Map<String, Object> firstMap = new HashMap<String, Object>();
firstMap.put("FIRST-KEY-1", "FIRST-VALUE-1");
firstMap.put("FIRST-KEY-2", "FIRST-VALUE-2");
- Map<String, Object> secondMap = new HashMap<String, Object>();
+ final Map<String, Object> secondMap = new HashMap<String, Object>();
secondMap.put("SECOND-KEY-1", "SECOND-VALUE-1");
secondMap.put("SECOND-KEY-2", "SECOND-VALUE-2");
- List<Object> mainList = new ArrayList<Object>();
+ final List<Object> mainList = new ArrayList<Object>();
mainList.add(firstMap);
mainList.add(secondMap);
- TestBean bean = new TestBean(mainList);
+ final TestBean bean = new TestBean(mainList);
assertEquals("BEFORE", null, ((Map<?, ?>)bean.getListIndexed().get(0)).get("FIRST-NEW-KEY"));
assertEquals("BEFORE", "SECOND-VALUE-1", ((Map<?, ?>)bean.getListIndexed().get(1)).get("SECOND-KEY-1"));
try {
PropertyUtils.setProperty(bean, "listIndexed[0](FIRST-NEW-KEY)", "FIRST-NEW-VALUE");
PropertyUtils.setProperty(bean, "listIndexed[1](SECOND-KEY-1)", "SECOND-VALUE-1-UPDATED");
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t + "");
}
assertEquals("BEFORE", "FIRST-NEW-VALUE", ((Map<?, ?>)bean.getListIndexed().get(0)).get("FIRST-NEW-KEY"));
@@ -2683,7 +2683,7 @@ public class PropertyUtilsTestCase exten
value instanceof String);
assertEquals("Returned correct new value 0", "New 0",
(String) value);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t);
}
@@ -2699,7 +2699,7 @@ public class PropertyUtilsTestCase exten
value instanceof Integer);
assertEquals("Returned correct new value 0", 1,
((Integer) value).intValue());
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t);
}
@@ -2715,7 +2715,7 @@ public class PropertyUtilsTestCase exten
value instanceof Integer);
assertEquals("Returned correct new value 1", 11,
((Integer) value).intValue());
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t);
}
@@ -2731,7 +2731,7 @@ public class PropertyUtilsTestCase exten
value instanceof String);
assertEquals("Returned correct new value 2", "New Value 2",
(String) value);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t);
}
@@ -2747,7 +2747,7 @@ public class PropertyUtilsTestCase exten
value instanceof String);
assertEquals("Returned correct new value 2", "New Value 2",
(String) value);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t);
}
@@ -2763,7 +2763,7 @@ public class PropertyUtilsTestCase exten
value instanceof String);
assertEquals("Returned correct new value 3", "New Value 3",
(String) value);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t);
}
@@ -2781,7 +2781,7 @@ public class PropertyUtilsTestCase exten
value instanceof String);
assertEquals("Returned correct new value 4", "New 4",
(String) value);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t);
}
@@ -2797,7 +2797,7 @@ public class PropertyUtilsTestCase exten
value instanceof Integer);
assertEquals("Returned correct new value 4", 1,
((Integer) value).intValue());
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t);
}
@@ -2813,7 +2813,7 @@ public class PropertyUtilsTestCase exten
value instanceof Integer);
assertEquals("Returned correct new value 5", 11,
((Integer) value).intValue());
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t);
}
@@ -2829,7 +2829,7 @@ public class PropertyUtilsTestCase exten
value instanceof String);
assertEquals("Returned correct new value 6", "New Value 2",
(String) value);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t);
}
@@ -2845,7 +2845,7 @@ public class PropertyUtilsTestCase exten
value instanceof String);
assertEquals("Returned correct new value 6", "New Value 2",
(String) value);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw " + t);
}
[... 1415 lines stripped ...]