db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r219236 - /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfObject.java
Date Fri, 15 Jul 2005 19:32:38 GMT
Author: clr
Date: Fri Jul 15 12:32:36 2005
New Revision: 219236

URL: http://svn.apache.org/viewcvs?rev=219236&view=rev
Log:
JDO-85 provide more information on failure for debugging

Modified:
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfObject.java

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfObject.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfObject.java?rev=219236&r1=219235&r2=219236&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfObject.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfObject.java
Fri Jul 15 12:32:36 2005
@@ -126,15 +126,31 @@
         int i;
         FieldsOfObject pi = (FieldsOfObject) pm.getObjectById(oid, true);
         int n = pi.getLength();
+        StringBuffer buffer = new StringBuffer();
         for( i = 0; i < n; ++i){
             if( !FieldsOfObject.isPersistent[i] ) continue;
             Object val = pi.get(i);
+            if (val == null) {
+                buffer.append("Field ");
+                buffer.append(FieldsOfObject.fieldSpecs[i]);
+                buffer.append(" is null. Expected ");
+                buffer.append(startValue.toString());
+                buffer.append(".\n");
+                continue;
+            }
             if(!val.equals(startValue) ){
-                fail(ASSERTION_FAILED,
-                        "Incorrect value for " + FieldsOfObject.fieldSpecs[i] +
-                        ", expected value " + startValue.toString() +
-                        ", value is " + val.toString());
+                buffer.append("Field ");
+                buffer.append(FieldsOfObject.fieldSpecs[i]);
+                buffer.append(" has wrong value: expected ");
+                buffer.append(startValue.toString());
+                buffer.append(" actual ");
+                buffer.append(val.toString());
+                buffer.append(".\n");
             }
+        }
+        if (buffer.length() > 0) {
+            fail(ASSERTION_FAILED,
+                buffer.toString());
         }
     }
 }



Mime
View raw message