db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcai...@apache.org
Subject svn commit: r332390 - in /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes: TestHashMapStringValueCollections.java TestHashtableStringValueCollections.java TestMapStringValueCollections.java TestTreeMapStringValueCollections.java
Date Thu, 10 Nov 2005 22:31:55 GMT
Author: mcaisse
Date: Thu Nov 10 14:31:54 2005
New Revision: 332390

URL: http://svn.apache.org/viewcvs?rev=332390&view=rev
Log:
JDO-209

Modified:
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestHashMapStringValueCollections.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestHashtableStringValueCollections.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestMapStringValueCollections.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestTreeMapStringValueCollections.java

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestHashMapStringValueCollections.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestHashMapStringValueCollections.java?rev=332390&r1=332389&r2=332390&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestHashMapStringValueCollections.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestHashMapStringValueCollections.java
Thu Nov 10 14:31:54 2005
@@ -16,8 +16,11 @@
  
 package org.apache.jdo.tck.models.fieldtypes;
 
+import java.math.BigDecimal;
+
 import java.util.HashMap;
-import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Set;
 import java.util.Vector;
 
 import javax.jdo.PersistenceManager;
@@ -162,12 +165,32 @@
                 sbuf.append("\nFor element " + i + ", expected size = " +
                         expected.size() + ", actual size = " + actual.size()
                         + " . ");
-                continue;
             }
-            if (! expected.equals(actual)) {
+            else if (! expected.equals(actual)) {
+                if (TestUtil.getFieldSpecsForMap(
+                            HashMapStringValueCollections.fieldSpecs[i]
+                            ).get(1).equals("BigDecimal")) {
+                    Set keys = expected.keySet();
+                    Iterator iter = keys.iterator();
+                    while (iter.hasNext()) {
+                        Object nextKey = iter.next();
+                        BigDecimal expectedMapValue = 
+                                (BigDecimal)expected.get(nextKey);
+                        BigDecimal actualMapValue = 
+                                (BigDecimal)actual.get(nextKey);
+                        if ((expectedMapValue.compareTo(actualMapValue) != 0)) {
+                            sbuf.append("\nFor element " + i + "(" 
+                                    + (String)nextKey +
+                                    "), expected = " + expectedMapValue +
+                                    ", actual = " + actualMapValue + " . ");
+                    }
+                }
+            }
+            else {
                 sbuf.append("\nFor element " + i + ", expected = " +
-                        expected + ", actual = " + actual + " . ");
+                    expected + ", actual = " + actual + " . ");
             }
+          }
         }
         if (sbuf.length() > 0) {
             fail(ASSERTION_FAILED,

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestHashtableStringValueCollections.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestHashtableStringValueCollections.java?rev=332390&r1=332389&r2=332390&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestHashtableStringValueCollections.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestHashtableStringValueCollections.java
Thu Nov 10 14:31:54 2005
@@ -16,7 +16,11 @@
  
 package org.apache.jdo.tck.models.fieldtypes;
 
+import java.math.BigDecimal;
+
 import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Set;
 import java.util.Vector;
 
 import javax.jdo.PersistenceManager;
@@ -160,12 +164,32 @@
                 sbuf.append("\nFor element " + i + ", expected size = " +
                         expected.size() + ", actual size = " + actual.size()
                         + " . ");
-                continue;
             }
-            if (! expected.equals(actual)) {
+            else if (! expected.equals(actual)) {
+                if (TestUtil.getFieldSpecsForMap(
+                            HashtableStringValueCollections.fieldSpecs[i]
+                            ).get(1).equals("BigDecimal")) {
+                    Set keys = expected.keySet();
+                    Iterator iter = keys.iterator();
+                    while (iter.hasNext()) {
+                        Object nextKey = iter.next();
+                        BigDecimal expectedMapValue = 
+                                (BigDecimal)expected.get(nextKey);
+                        BigDecimal actualMapValue = 
+                                (BigDecimal)actual.get(nextKey);
+                        if ((expectedMapValue.compareTo(actualMapValue) != 0)) {
+                            sbuf.append("\nFor element " + i + "(" 
+                                    + (String)nextKey +
+                                    "), expected = " + expectedMapValue +
+                                    ", actual = " + actualMapValue + " . ");
+                    }
+                }
+            }
+            else {
                 sbuf.append("\nFor element " + i + ", expected = " +
-                        expected + ", actual = " + actual + " . ");
+                    expected + ", actual = " + actual + " . ");
             }
+          }
         }
         if (sbuf.length() > 0) {
             fail(ASSERTION_FAILED,

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestMapStringValueCollections.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestMapStringValueCollections.java?rev=332390&r1=332389&r2=332390&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestMapStringValueCollections.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestMapStringValueCollections.java
Thu Nov 10 14:31:54 2005
@@ -16,8 +16,12 @@
  
 package org.apache.jdo.tck.models.fieldtypes;
 
+import java.math.BigDecimal;
+
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.Map;
+import java.util.Set;
 import java.util.Vector;
 
 import javax.jdo.PersistenceManager;
@@ -165,12 +169,32 @@
                 sbuf.append("\nFor element " + i + ", expected size = " +
                         expected.size() + ", actual size = " + actual.size()
                         + " . ");
-                continue;
             }
-            if (! expected.equals(actual)) {
+            else if (! expected.equals(actual)) {
+                if (TestUtil.getFieldSpecsForMap(
+                            MapStringValueCollections.fieldSpecs[i]
+                            ).get(1).equals("BigDecimal")) {
+                    Set keys = expected.keySet();
+                    Iterator iter = keys.iterator();
+                    while (iter.hasNext()) {
+                        Object nextKey = iter.next();
+                        BigDecimal expectedMapValue = 
+                                (BigDecimal)expected.get(nextKey);
+                        BigDecimal actualMapValue = 
+                                (BigDecimal)actual.get(nextKey);
+                        if ((expectedMapValue.compareTo(actualMapValue) != 0)) {
+                            sbuf.append("\nFor element " + i + "(" 
+                                    + (String)nextKey +
+                                    "), expected = " + expectedMapValue +
+                                    ", actual = " + actualMapValue + " . ");
+                    }
+                }
+            }
+            else {
                 sbuf.append("\nFor element " + i + ", expected = " +
-                        expected + ", actual = " + actual + " . ");
+                    expected + ", actual = " + actual + " . ");
             }
+          }
         }
         if (sbuf.length() > 0) {
             fail(ASSERTION_FAILED,

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestTreeMapStringValueCollections.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestTreeMapStringValueCollections.java?rev=332390&r1=332389&r2=332390&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestTreeMapStringValueCollections.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestTreeMapStringValueCollections.java
Thu Nov 10 14:31:54 2005
@@ -16,6 +16,10 @@
  
 package org.apache.jdo.tck.models.fieldtypes;
 
+import java.math.BigDecimal;
+
+import java.util.Iterator;
+import java.util.Set;
 import java.util.TreeMap;
 import java.util.Vector;
 
@@ -158,12 +162,32 @@
                 sbuf.append("\nFor element " + i + ", expected size = " +
                         expected.size() + ", actual size = " + actual.size()
                         + " . ");
-                continue;
             }
-            if (! expected.equals(actual)) {
+            else if (! expected.equals(actual)) {
+                if (TestUtil.getFieldSpecsForMap(
+                            TreeMapStringValueCollections.fieldSpecs[i]
+                            ).get(1).equals("BigDecimal")) {
+                    Set keys = expected.keySet();
+                    Iterator iter = keys.iterator();
+                    while (iter.hasNext()) {
+                        Object nextKey = iter.next();
+                        BigDecimal expectedMapValue = 
+                                (BigDecimal)expected.get(nextKey);
+                        BigDecimal actualMapValue = 
+                                (BigDecimal)actual.get(nextKey);
+                        if ((expectedMapValue.compareTo(actualMapValue) != 0)) {
+                            sbuf.append("\nFor element " + i + "(" 
+                                    + (String)nextKey +
+                                    "), expected = " + expectedMapValue +
+                                    ", actual = " + actualMapValue + " . ");
+                    }
+                }
+            }
+            else {
                 sbuf.append("\nFor element " + i + ", expected = " +
-                        expected + ", actual = " + actual + " . ");
+                    expected + ", actual = " + actual + " . ");
             }
+          }
         }
         if (sbuf.length() > 0) {
             fail(ASSERTION_FAILED,



Mime
View raw message