You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2015/03/22 12:50:53 UTC

svn commit: r1668354 - /directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerTest.java

Author: elecharny
Date: Sun Mar 22 11:50:52 2015
New Revision: 1668354

URL: http://svn.apache.org/r1668354
Log:
Added an (ignored) test for transactions

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

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerTest.java?rev=1668354&r1=1668353&r2=1668354&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerTest.java (original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerTest.java Sun Mar 22 11:50:52 2015
@@ -890,4 +890,71 @@ public class RecordManagerTest
         btree.insert( 1L, "V1" );
         btree.insert( 2L, "V2" );
     }
+
+
+    @Ignore
+    @Test
+    public void testAddInTxns() throws IOException, BTreeAlreadyManagedException, KeyNotFoundException
+    {
+        /*
+        for ( Long key : recordManager.writeCounter.keySet() )
+        {
+            System.out.println( "Page " + Long.toHexString( key ) + " written " + recordManager.writeCounter.get( key )
+                + " times" );
+        }
+
+        System.out.println( "Test start" );
+        */
+        recordManager.beginTransaction();
+        /*
+        System.out.println( "Before V1" );
+        for ( Long key : recordManager.writeCounter.keySet() )
+        {
+            System.out.println( "Page " + Long.toHexString( key ) + " written " + recordManager.writeCounter.get( key )
+                + " times" );
+        }
+        */
+        btree.insert( 1L, "V1" );
+        /*
+        for ( Long key : recordManager.writeCounter.keySet() )
+        {
+            System.out.println( "Page " + Long.toHexString( key ) + " written " + recordManager.writeCounter.get( key )
+                + " times" );
+        }
+        
+        System.out.println( "After V1" );
+        */
+
+        //System.out.println( "Before V2" );
+        btree.insert( 2L, "V2" );
+        //System.out.println( "After V2" );
+
+        //System.out.println( "Before V3" );
+        btree.insert( 3L, "V3" );
+        /*
+        for ( Long key : recordManager.writeCounter.keySet() )
+        {
+            System.out.println( "Page " + Long.toHexString( key ) + " written " + recordManager.writeCounter.get( key )
+                + " times" );
+        }
+        */
+
+        recordManager.commit();
+
+        /*
+        for ( Long key : recordManager.writeCounter.keySet() )
+        {
+            System.out.println( "Page " + Long.toHexString( key ) + " written " + recordManager.writeCounter.get( key )
+                + " times" );
+        }
+        */
+    }
+
+
+    @Test
+    public void testInspector() throws Exception
+    {
+        MavibotInspector inspector = new MavibotInspector( new File( "/Users/elecharny/Downloads/mavibot.db" ) );
+        inspector.start();
+    }
 }