jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1330326 - /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateTest.java
Date Wed, 25 Apr 2012 15:01:27 GMT
Author: mduerig
Date: Wed Apr 25 15:01:26 2012
New Revision: 1330326

URL: http://svn.apache.org/viewvc?rev=1330326&view=rev
Log:
fixed broken test: don't rely on child node ordering

Modified:
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateTest.java?rev=1330326&r1=1330325&r2=1330326&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateTest.java
Wed Apr 25 15:01:26 2012
@@ -100,11 +100,15 @@ public class KernelNodeStateTest extends
     @Test
     public void testGetChildNodeEntriesWithOffset() {
         List<String> names = new ArrayList<String>();
+        for (ChildNodeEntry entry : state.getChildNodeEntries(0, 1)) {
+            names.add(entry.getName());
+        }
+
         for (ChildNodeEntry entry : state.getChildNodeEntries(1, -1)) {
             names.add(entry.getName());
         }
         Collections.sort(names);
-        assertEquals(Arrays.asList("y", "z"), names);
+        assertEquals(Arrays.asList("x", "y", "z"), names);
 
         // Offset beyond the range
         assertFalse(state.getChildNodeEntries(3, -1).iterator().hasNext());
@@ -116,8 +120,11 @@ public class KernelNodeStateTest extends
         for (ChildNodeEntry entry : state.getChildNodeEntries(0, 2)) {
             names.add(entry.getName());
         }
+        for (ChildNodeEntry entry : state.getChildNodeEntries(2, -1)) {
+            names.add(entry.getName());
+        }
         Collections.sort(names);
-        assertEquals(Arrays.asList("x", "y"), names);
+        assertEquals(Arrays.asList("x", "y", "z"), names);
 
         // Zero count
         assertFalse(state.getChildNodeEntries(0, 0).iterator().hasNext());



Mime
View raw message