You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by tn...@apache.org on 2013/04/21 19:47:50 UTC

svn commit: r1470322 - in /commons/proper/collections/trunk/src: changes/ test/java/org/apache/commons/collections4/bidimap/ test/java/org/apache/commons/collections4/map/

Author: tn
Date: Sun Apr 21 17:47:50 2013
New Revision: 1470322

URL: http://svn.apache.org/r1470322
Log:
[COLLECTIONS-445] Ignore several failing tests when executing with IBM J9 VM 1.6.x due to a faulty TreeMap implementation.

Modified:
    commons/proper/collections/trunk/src/changes/changes.xml
    commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap2Test.java
    commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/bidimap/DualTreeBidiMapTest.java
    commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java
    commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/TransformedSortedMapTest.java

Modified: commons/proper/collections/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/changes/changes.xml?rev=1470322&r1=1470321&r2=1470322&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/changes/changes.xml (original)
+++ commons/proper/collections/trunk/src/changes/changes.xml Sun Apr 21 17:47:50 2013
@@ -22,6 +22,10 @@
   <body>
 
   <release version="4.0" date="TBA" description="Next release">
+    <action issue="COLLECTIONS-445" dev="tn" type="fix">
+      Adapt and/or ignore several unit tests when run on a IBM J9 VM (specification version 1.6.0)
+      due to a faulty "java.util.TreeMap" implementation.
+    </action>
     <action issue="COLLECTIONS-422" dev="tn" type="add" due-to="Benoit Corne">
       Added method "CollectionUtils#permutations(Collection)" and class "PermutationIterator"
       to generate unordered permutations of a collection.

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap2Test.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap2Test.java?rev=1470322&r1=1470321&r2=1470322&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap2Test.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap2Test.java Sun Apr 21 17:47:50 2013
@@ -154,9 +154,36 @@ public class DualTreeBidiMap2Test<K exte
      */
     @Override
     public String[] ignoredTests() {
-        return new String[] {"DualTreeBidiMap2Test.bulkTestInverseMap.bulkTestInverseMap"};
+        String recursiveTest = "DualTreeBidiMap2Test.bulkTestInverseMap.bulkTestInverseMap";
+
+        // there are several bugs in the following JVM:
+        // IBM J9 VM build 2.4, JRE 1.6.0 IBM J9 2.4 Linux x86-32 jvmxi3260sr12-20121024_126067
+        // thus disabling tests related to these bugs
+        
+        final String vmName = System.getProperty("java.vm.name");
+        final String version = System.getProperty("java.version");
+        
+        if (vmName == null || version == null) {
+            return new String[] { recursiveTest };
+        }
+
+        if (vmName.equals("IBM J9 VM") && version.equals("1.6.0")) {
+            final String preSub = "DualTreeBidiMap2Test.bulkTestSubMap.bulkTestMap";
+            final String preTail = "DualTreeBidiMap2Test.bulkTestTailMap.bulkTestMap";
+            return new String[] {
+                    recursiveTest,
+                    preSub + "EntrySet.testCollectionIteratorRemove",
+                    preSub + "Values.testCollectionIteratorRemove",
+                    preTail + "Values.testCollectionClear",
+                    preTail + "Values.testCollectionRemoveAll",
+                    preTail + "Values.testCollectionRetainAll"
+            };
+        } else {
+            return new String[] { recursiveTest };
+        }
     }
 
+
 //    public void testCreate() throws Exception {
 //        resetEmpty();
 //        writeExternalFormToDisk((java.io.Serializable) map, "src/test/resources/data/test/DualTreeBidiMap.emptyCollection.version4.Test2.obj");

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/bidimap/DualTreeBidiMapTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/bidimap/DualTreeBidiMapTest.java?rev=1470322&r1=1470321&r2=1470322&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/bidimap/DualTreeBidiMapTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/bidimap/DualTreeBidiMapTest.java Sun Apr 21 17:47:50 2013
@@ -49,9 +49,35 @@ public class DualTreeBidiMapTest<K exten
      */
     @Override
     public String[] ignoredTests() {
-        return new String[] {"DualTreeBidiMapTest.bulkTestInverseMap.bulkTestInverseMap"};
+        String recursiveTest = "DualTreeBidiMapTest.bulkTestInverseMap.bulkTestInverseMap";
+
+        // there are several bugs in the following JVM:
+        // IBM J9 VM build 2.4, JRE 1.6.0 IBM J9 2.4 Linux x86-32 jvmxi3260sr12-20121024_126067
+        // thus disabling tests related to these bugs
+        
+        final String vmName = System.getProperty("java.vm.name");
+        final String version = System.getProperty("java.version");
+        
+        if (vmName == null || version == null) {
+            return new String[] { recursiveTest };
+        }
+
+        if (vmName.equals("IBM J9 VM") && version.equals("1.6.0")) {
+            final String preSub = "DualTreeBidiMapTest.bulkTestSubMap.bulkTestMap";
+            final String preTail = "DualTreeBidiMapTest.bulkTestTailMap.bulkTestMap";
+            return new String[] {
+                    recursiveTest,
+                    preSub + "EntrySet.testCollectionIteratorRemove",
+                    preSub + "Values.testCollectionIteratorRemove",
+                    preTail + "Values.testCollectionClear",
+                    preTail + "Values.testCollectionRemoveAll",
+                    preTail + "Values.testCollectionRetainAll"
+            };
+        } else {
+            return new String[] { recursiveTest };
+        }
     }
-    
+
 //    public void testCreate() throws Exception {
 //        resetEmpty();
 //        writeExternalFormToDisk((java.io.Serializable) map, "src/test/resources/data/test/DualTreeBidiMap.emptyCollection.version4.obj");

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java?rev=1470322&r1=1470321&r2=1470322&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java Sun Apr 21 17:47:50 2013
@@ -2001,7 +2001,7 @@ public abstract class AbstractMapTest<K,
         
         // bug in IBM JDK: IBM J9 VM build 2.4, JRE 1.6.0 IBM J9 2.4 Linux x86-32 jvmxi3260sr12-20121024_126067
         // a call to values() on an empty map retrieved via TreeMap#headMap or tailMap
-        // will render the values view unusable: resulting in NullPointExceptions or missing values
+        // will render the values view unusable: resulting in NullPointerExceptions or missing values
         // it will also not recover, as the value view is cached internally
         values = getMap().values();
         

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/TransformedSortedMapTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/TransformedSortedMapTest.java?rev=1470322&r1=1470321&r2=1470322&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/TransformedSortedMapTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/TransformedSortedMapTest.java Sun Apr 21 17:47:50 2013
@@ -46,6 +46,35 @@ public class TransformedSortedMapTest<K,
         return BulkTest.makeSuite(TransformedSortedMapTest.class);
     }
 
+    @Override
+    public String[] ignoredTests() {
+        // there are several bugs in the following JVM:
+        // IBM J9 VM build 2.4, JRE 1.6.0 IBM J9 2.4 Linux x86-32 jvmxi3260sr12-20121024_126067
+        // thus disabling tests related to these bugs
+        
+        final String vmName = System.getProperty("java.vm.name");
+        final String version = System.getProperty("java.version");
+        
+        if (vmName == null || version == null) {
+            return null;
+        }
+
+        if (vmName.equals("IBM J9 VM") && version.equals("1.6.0")) {
+            final String preSubMap = "TransformedSortedMapTest.bulkTestSubMap.bulkTestMap";
+            final String preTailMap = "TransformedSortedMapTest.bulkTestTailMap.bulkTestMap";
+            return new String[] {
+                    preSubMap + "EntrySet.testCollectionIteratorRemove",
+                    preSubMap + "KeySet.testCollectionRemove",
+                    preSubMap + "Values.testCollectionIteratorRemove",
+                    preTailMap + "Values.testCollectionClear",
+                    preTailMap + "Values.testCollectionRemoveAll",
+                    preTailMap + "Values.testCollectionRetainAll"
+            };
+        } else {
+            return null;
+        }
+    }
+
     //-----------------------------------------------------------------------
     @Override
     @SuppressWarnings("unchecked")