directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1593555 - /directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeBrowseTest.java
Date Fri, 09 May 2014 14:55:11 GMT
Author: elecharny
Date: Fri May  9 14:55:11 2014
New Revision: 1593555

URL: http://svn.apache.org/r1593555
Log:
Added a test

Modified:
    directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeBrowseTest.java

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeBrowseTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeBrowseTest.java?rev=1593555&r1=1593554&r2=1593555&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeBrowseTest.java
(original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeBrowseTest.java
Fri May  9 14:55:11 2014
@@ -892,6 +892,27 @@ public class PersistedBTreeBrowseTest
 
 
     /**
+     * Test the browseFrom method on a btree with a non existing key
+     */
+    @Test
+    public void testBrowseFromBTreeNodesNotExistingKey() throws IOException, BTreeAlreadyManagedException
+    {
+        // Inject some data
+        for ( long i = 0; i <= 1000L; i += 2 )
+        {
+            btree.insert( i, Long.toString( i ) );
+        }
+
+        // Create the cursor
+        TupleCursor<Long, String> cursor = btree.browseFrom( 1500L );
+        
+        assertFalse( cursor.hasNext() );
+        assertTrue( cursor.hasPrev() );
+        assertEquals( 1000L, cursor.prev().getKey().longValue() );
+    }
+
+
+    /**
      * Test the browseFrom method on a btree containing nodes with duplicate values
      */
     @Test



Mime
View raw message