jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1573520 - /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/MergeSortedIteratorsTest.java
Date Mon, 03 Mar 2014 11:01:27 GMT
Author: mreutegg
Date: Mon Mar  3 11:01:26 2014
New Revision: 1573520

URL: http://svn.apache.org/r1573520
Log:
OAK-1479: Failing test for MergeSortedIterators

The IllegalStateException is expected. Client code was wrong. See fix in OAK-1233.

Modified:
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/MergeSortedIteratorsTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/MergeSortedIteratorsTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/MergeSortedIteratorsTest.java?rev=1573520&r1=1573519&r2=1573520&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/MergeSortedIteratorsTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/MergeSortedIteratorsTest.java
Mon Mar  3 11:01:26 2014
@@ -21,15 +21,12 @@ import java.util.Comparator;
 import java.util.Iterator;
 import java.util.List;
 
-import com.google.common.collect.Ordering;
 import org.apache.jackrabbit.oak.plugins.document.Revision;
 import org.apache.jackrabbit.oak.plugins.document.StableRevisionComparator;
-import org.junit.Ignore;
 import org.junit.Test;
 
 import com.google.common.collect.Lists;
 
-import static com.mongodb.util.MyAsserts.assertTrue;
 import static junit.framework.Assert.assertEquals;
 
 /**
@@ -49,9 +46,11 @@ public class MergeSortedIteratorsTest {
         assertEquals(list(1, 2, 3, 4, 5, 6), sort(list(1, 5), list(2, 4), list(3, 6)));
     }
 
-    @Ignore("OAK-1479")
-    @Test
-    public void testData(){
+    /**
+     * See OAK-1233 and OAK-1479
+     */
+    @Test(expected = IllegalStateException.class)
+    public void testData() {
         List<Iterator<Revision>> iterators = prepareData();
         final Iterator<Iterator<Revision>> it = iterators.iterator();
         final Comparator<Revision> comp = StableRevisionComparator.REVERSE;
@@ -61,11 +60,9 @@ public class MergeSortedIteratorsTest {
                 return it.hasNext() ? it.next() : null;
             }
         };
-        List<Revision> sorted = new ArrayList<Revision>();
         while (sort.hasNext()) {
-            sorted.add(sort.next());
+            sort.next();
         }
-        assertTrue(Ordering.from(comp).reverse().isOrdered(sorted));
     }
 
     private List<Integer> sort(List<Integer>... lists) {



Mime
View raw message