directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1545999 - /directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeTest.java
Date Wed, 27 Nov 2013 11:26:38 GMT
Author: kayyagari
Date: Wed Nov 27 11:26:37 2013
New Revision: 1545999

URL: http://svn.apache.org/r1545999
Log:
added a test to check the root page count

Modified:
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeTest.java

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeTest.java?rev=1545999&r1=1545998&r2=1545999&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeTest.java
(original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeTest.java
Wed Nov 27 11:26:37 2013
@@ -1938,4 +1938,28 @@ public class InMemoryBTreeTest
         cursor.close();
     }
 
+    
+    @Test
+    public void testCheckRootPageContents() throws Exception
+    {
+        IntSerializer ser = new IntSerializer();
+        BTree<Integer, Integer> btree = new BTree<Integer,Integer>( "master1",
ser, ser );
+        btree.setPageSize( 4 );
+        btree.init();
+
+        for( int i=1; i < 8; i++ )
+        {
+            btree.insert( i, i );
+        }
+
+        System.out.println( btree.rootPage );
+        assertEquals( 1, btree.rootPage.getNbElems() );
+
+        assertEquals( 7, btree.rootPage.findRightMost().getKey().intValue() );
+
+        assertEquals( 1, btree.rootPage.findLeftMost().getKey().intValue() );
+
+        btree.close();
+    }
+
 }



Mime
View raw message