db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcai...@apache.org
Subject svn commit: r328848 - /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestCollectionCollections.java
Date Thu, 27 Oct 2005 10:25:52 GMT
Author: mcaisse
Date: Thu Oct 27 03:25:41 2005
New Revision: 328848

URL: http://svn.apache.org/viewcvs?rev=328848&view=rev
Log:
JDO-144 Renamed vars; use equals method of expected, not actual

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

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestCollectionCollections.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestCollectionCollections.java?rev=328848&r1=328847&r2=328848&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestCollectionCollections.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestCollectionCollections.java
Thu Oct 27 03:25:41 2005
@@ -140,32 +140,38 @@
                 pm.getObjectById(oid, true);
         int n = pi.getLength();
         for (int i = 0; i < n; ++i) {
-            Collection compareWith = expectedValue.get(i);
-            Collection val = pi.get(i);
-            if (val.size() != compareWith.size()) {
+            Collection expected = expectedValue.get(i);
+            Collection actual = pi.get(i);
+            if (actual.size() != expected.size()) {
                 sbuf.append("\nFor element " + i + ", expected size = " +
-                        compareWith.size() + ", actual size = " + val.size()
+                        expected.size() + ", actual size = " + actual.size()
                         + " . ");
             }
-            else if (! val.equals(compareWith)) {
+            else if (! expected.equals(actual)) {
                 if (TestUtil.getFieldSpecs(CollectionCollections.fieldSpecs[i]
                             ).equals("BigDecimal")) {
-                    List compareWithV = (List)compareWith;
-                    List valV = (List)val;
-                    for (int j = 0; j < val.size(); ++j) {
+            	    if (debug) {
+                	logger.debug("Field is " + i + " Class name is "
+                          +  actual.getClass().getName()
+			  + "   isInstance of Vector is "
+			  + actual.getClass().isInstance((Object)new Vector()));
+		    }
+                    List expectedL = (List)expected;
+                    List actualL = (List)actual;
+                    for (int j = 0; j < actualL.size(); ++j) {
                         BigDecimal bigDecCompareWith =
-                            (BigDecimal)compareWithV.get(j);
-                        Object bigDecVal = valV.get(j);
+                            (BigDecimal)expectedL.get(j);
+                        Object bigDecVal = actualL.get(j);
                         if ((bigDecCompareWith.compareTo(bigDecVal) != 0)) {
                             sbuf.append("\nFor element " + i + "(" + j +
-                                    "), expected = " + compareWith +
-                                    ", actual = " + val + " . ");
+                                    "), expected = " + expected +
+                                    ", actual = " + actualL + " . ");
                         }
                     }
                 }
                 else {
                     sbuf.append("\nFor element " + i + ", expected = " +
-                        compareWith + ", actual = " + val + " . ");
+                        expected + ", actual = " + actual + " . ");
                 }
             }
         }



Mime
View raw message