craigmcc 01/07/14 16:54:51
Modified: beanutils/src/test/org/apache/commons/beanutils
BeanUtilsTestCase.java PropertyUtilsTestCase.java
Log:
Update tests from assert() to assertTrue() as introduced in JUnit 3.7,
to avoid future conflict with JDK native assertions.
Revision Changes Path
1.2 +13 -13
jakarta-commons/beanutils/src/test/org/apache/commons/beanutils/BeanUtilsTestCase.java
Index: BeanUtilsTestCase.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/beanutils/src/test/org/apache/commons/beanutils/BeanUtilsTestCase.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- BeanUtilsTestCase.java 2001/04/16 13:28:52 1.1
+++ BeanUtilsTestCase.java 2001/07/14 23:54:50 1.2
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-commons/beanutils/src/test/org/apache/commons/beanutils/BeanUtilsTestCase.java,v
1.1 2001/04/16 13:28:52 geirm Exp $
- * $Revision: 1.1 $
- * $Date: 2001/04/16 13:28:52 $
+ * $Header:
/home/cvs/jakarta-commons/beanutils/src/test/org/apache/commons/beanutils/BeanUtilsTestCase.java,v
1.2 2001/07/14 23:54:50 craigmcc Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/07/14 23:54:50 $
*
* ====================================================================
*
@@ -94,7 +94,7 @@
* </ul>
*
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class BeanUtilsTestCase extends TestCase
@@ -163,13 +163,13 @@
String arr[] = BeanUtils.getArrayProperty( bean, "stringArray");
String comp[] = bean.getStringArray();
- assert("String array length = " + comp.length,
+ assertTrue("String array length = " + comp.length,
( comp.length == arr.length ));
arr = BeanUtils.getArrayProperty( bean, "intArray");
int iarr[] = bean.getIntArray();
- assert("String array length = " + iarr.length,
+ assertTrue("String array length = " + iarr.length,
( iarr.length == arr.length ));
}
catch( IllegalAccessException e)
@@ -197,11 +197,11 @@
{
String val = BeanUtils.getIndexedProperty( bean, "intIndexed[3]");
String comp = String.valueOf( bean.getIntIndexed(3));
- assert("intIndexed[3] == " + comp, val.equals( comp ));
+ assertTrue("intIndexed[3] == " + comp, val.equals( comp ));
val = BeanUtils.getIndexedProperty( bean, "stringIndexed[3]");
comp = bean.getStringIndexed(3);
- assert("stringIndexed[3] == " + comp, val.equals( comp ) );
+ assertTrue("stringIndexed[3] == " + comp, val.equals( comp ) );
}
catch( IllegalAccessException e)
{
@@ -227,12 +227,12 @@
String val = BeanUtils.getIndexedProperty( bean, "intIndexed", 3);
String comp = String.valueOf(bean.getIntIndexed(3));
- assert("intIndexed,3 == " + comp, val.equals( comp ));
+ assertTrue("intIndexed,3 == " + comp, val.equals( comp ));
val = BeanUtils.getIndexedProperty( bean, "stringIndexed",3);
comp = bean.getStringIndexed(3);
- assert("stringIndexed,3 == " + comp , val.equals(comp));
+ assertTrue("stringIndexed,3 == " + comp , val.equals(comp));
}
catch( IllegalAccessException e)
@@ -258,7 +258,7 @@
{
String val = BeanUtils.getNestedProperty( bean,
"nested.stringProperty");
String comp = bean.getNested().getStringProperty();
- assert("nested.StringProperty == " + comp,
+ assertTrue("nested.StringProperty == " + comp,
val.equals( comp ));
}
catch( IllegalAccessException e)
@@ -285,7 +285,7 @@
String val = BeanUtils.getProperty( bean, "nested.intIndexed[2]");
String comp = String.valueOf( bean.getIntIndexed(2) );
- assert("nested.intIndexed[2] == " + comp,
+ assertTrue("nested.intIndexed[2] == " + comp,
val.equals( comp ));
}
catch( IllegalAccessException e)
@@ -312,7 +312,7 @@
String val = BeanUtils.getSimpleProperty( bean, "shortProperty");
String comp = String.valueOf(bean.getShortProperty());
- assert("shortProperty == " + comp,
+ assertTrue("shortProperty == " + comp,
val.equals(comp));
}
catch( IllegalAccessException e)
1.7 +27 -27
jakarta-commons/beanutils/src/test/org/apache/commons/beanutils/PropertyUtilsTestCase.java
Index: PropertyUtilsTestCase.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/beanutils/src/test/org/apache/commons/beanutils/PropertyUtilsTestCase.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- PropertyUtilsTestCase.java 2001/05/20 00:32:24 1.6
+++ PropertyUtilsTestCase.java 2001/07/14 23:54:51 1.7
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-commons/beanutils/src/test/org/apache/commons/beanutils/PropertyUtilsTestCase.java,v
1.6 2001/05/20 00:32:24 craigmcc Exp $
- * $Revision: 1.6 $
- * $Date: 2001/05/20 00:32:24 $
+ * $Header:
/home/cvs/jakarta-commons/beanutils/src/test/org/apache/commons/beanutils/PropertyUtilsTestCase.java,v
1.7 2001/07/14 23:54:51 craigmcc Exp $
+ * $Revision: 1.7 $
+ * $Date: 2001/07/14 23:54:51 $
*
* ====================================================================
*
@@ -91,7 +91,7 @@
* </ul>
*
* @author Craig R. McClanahan
- * @version $Revision: 1.6 $ $Date: 2001/05/20 00:32:24 $
+ * @version $Revision: 1.7 $ $Date: 2001/07/14 23:54:51 $
*/
public class PropertyUtilsTestCase extends TestCase {
@@ -466,8 +466,8 @@
PropertyUtils.getNestedProperty
(bean, "nested.booleanProperty");
assertNotNull("Got a value", value);
- assert("Got correct type", (value instanceof Boolean));
- assert("Got correct value",
+ assertTrue("Got correct type", (value instanceof Boolean));
+ assertTrue("Got correct value",
((Boolean) value).booleanValue() ==
bean.getNested().getBooleanProperty());
} catch (IllegalAccessException e) {
@@ -493,7 +493,7 @@
PropertyUtils.getNestedProperty
(bean, "nested.doubleProperty");
assertNotNull("Got a value", value);
- assert("Got correct type", (value instanceof Double));
+ assertTrue("Got correct type", (value instanceof Double));
assertEquals("Got correct value",
((Double) value).doubleValue(),
bean.getNested().getDoubleProperty(),
@@ -521,7 +521,7 @@
PropertyUtils.getNestedProperty
(bean, "nested.floatProperty");
assertNotNull("Got a value", value);
- assert("Got correct type", (value instanceof Float));
+ assertTrue("Got correct type", (value instanceof Float));
assertEquals("Got correct value",
((Float) value).floatValue(),
bean.getNested().getFloatProperty(),
@@ -549,7 +549,7 @@
PropertyUtils.getNestedProperty
(bean, "nested.intProperty");
assertNotNull("Got a value", value);
- assert("Got correct type", (value instanceof Integer));
+ assertTrue("Got correct type", (value instanceof Integer));
assertEquals("Got correct value",
((Integer) value).intValue(),
bean.getNested().getIntProperty());
@@ -576,7 +576,7 @@
PropertyUtils.getNestedProperty
(bean, "nested.longProperty");
assertNotNull("Got a value", value);
- assert("Got correct type", (value instanceof Long));
+ assertTrue("Got correct type", (value instanceof Long));
assertEquals("Got correct value",
((Long) value).longValue(),
bean.getNested().getLongProperty());
@@ -603,7 +603,7 @@
PropertyUtils.getNestedProperty
(bean, "nested.readOnlyProperty");
assertNotNull("Got a value", value);
- assert("Got correct type", (value instanceof String));
+ assertTrue("Got correct type", (value instanceof String));
assertEquals("Got correct value",
(String) value,
bean.getReadOnlyProperty());
@@ -630,7 +630,7 @@
PropertyUtils.getNestedProperty
(bean, "nested.shortProperty");
assertNotNull("Got a value", value);
- assert("Got correct type", (value instanceof Short));
+ assertTrue("Got correct type", (value instanceof Short));
assertEquals("Got correct value",
((Short) value).shortValue(),
bean.getNested().getShortProperty());
@@ -657,7 +657,7 @@
PropertyUtils.getNestedProperty
(bean, "nested.stringProperty");
assertNotNull("Got a value", value);
- assert("Got correct type", (value instanceof String));
+ assertTrue("Got correct type", (value instanceof String));
assertEquals("Got correct value",
((String) value),
bean.getNested().getStringProperty());
@@ -770,7 +770,7 @@
break;
}
}
- assert("Found foo descriptor", n >= 0);
+ assertTrue("Found foo descriptor", n >= 0);
Method reader = pd[n].getReadMethod();
assertNotNull("Found foo read method", reader);
Object value = null;
@@ -833,8 +833,8 @@
PropertyUtils.getSimpleProperty(bean,
"booleanProperty");
assertNotNull("Got a value", value);
- assert("Got correct type", (value instanceof Boolean));
- assert("Got correct value",
+ assertTrue("Got correct type", (value instanceof Boolean));
+ assertTrue("Got correct value",
((Boolean) value).booleanValue() ==
bean.getBooleanProperty());
} catch (IllegalAccessException e) {
@@ -860,7 +860,7 @@
PropertyUtils.getSimpleProperty(bean,
"doubleProperty");
assertNotNull("Got a value", value);
- assert("Got correct type", (value instanceof Double));
+ assertTrue("Got correct type", (value instanceof Double));
assertEquals("Got correct value",
((Double) value).doubleValue(),
bean.getDoubleProperty(),
@@ -888,7 +888,7 @@
PropertyUtils.getSimpleProperty(bean,
"floatProperty");
assertNotNull("Got a value", value);
- assert("Got correct type", (value instanceof Float));
+ assertTrue("Got correct type", (value instanceof Float));
assertEquals("Got correct value",
((Float) value).floatValue(),
bean.getFloatProperty(),
@@ -939,7 +939,7 @@
PropertyUtils.getSimpleProperty(bean,
"intProperty");
assertNotNull("Got a value", value);
- assert("Got correct type", (value instanceof Integer));
+ assertTrue("Got correct type", (value instanceof Integer));
assertEquals("Got correct value",
((Integer) value).intValue(),
bean.getIntProperty());
@@ -966,7 +966,7 @@
PropertyUtils.getSimpleProperty(bean,
"longProperty");
assertNotNull("Got a value", value);
- assert("Got correct type", (value instanceof Long));
+ assertTrue("Got correct type", (value instanceof Long));
assertEquals("Got correct value",
((Long) value).longValue(),
bean.getLongProperty());
@@ -1016,7 +1016,7 @@
PropertyUtils.getSimpleProperty(bean,
"readOnlyProperty");
assertNotNull("Got a value", value);
- assert("Got correct type", (value instanceof String));
+ assertTrue("Got correct type", (value instanceof String));
assertEquals("Got correct value",
(String) value,
bean.getReadOnlyProperty());
@@ -1043,7 +1043,7 @@
PropertyUtils.getSimpleProperty(bean,
"shortProperty");
assertNotNull("Got a value", value);
- assert("Got correct type", (value instanceof Short));
+ assertTrue("Got correct type", (value instanceof Short));
assertEquals("Got correct value",
((Short) value).shortValue(),
bean.getShortProperty());
@@ -1070,7 +1070,7 @@
PropertyUtils.getSimpleProperty(bean,
"stringProperty");
assertNotNull("Got a value", value);
- assert("Got correct type", (value instanceof String));
+ assertTrue("Got correct type", (value instanceof String));
assertEquals("Got correct value",
(String) value,
bean.getStringProperty());
@@ -1204,7 +1204,7 @@
PropertyUtils.setNestedProperty(bean,
"nested.booleanProperty",
new Boolean(newValue));
- assert("Matched new value",
+ assertTrue("Matched new value",
newValue ==
bean.getNested().getBooleanProperty());
} catch (IllegalAccessException e) {
@@ -1497,7 +1497,7 @@
PropertyUtils.setSimpleProperty(bean,
"booleanProperty",
new Boolean(newValue));
- assert("Matched new value",
+ assertTrue("Matched new value",
newValue ==
bean.getBooleanProperty());
} catch (IllegalAccessException e) {
@@ -1876,7 +1876,7 @@
break;
}
}
- assert("PropertyDescriptor for " + properties[i],
+ assertTrue("PropertyDescriptor for " + properties[i],
n >= 0);
// Locate an accessible property reader method for it
@@ -1934,7 +1934,7 @@
break;
}
}
- assert("PropertyDescriptor for " + properties[i],
+ assertTrue("PropertyDescriptor for " + properties[i],
n >= 0);
// Locate an accessible property reader method for it