directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1574367 - in /directory/mavibot/branches/with-txns/mavibot/src: main/java/org/apache/directory/mavibot/btree/ test/java/org/apache/directory/mavibot/btree/
Date Wed, 05 Mar 2014 03:18:05 GMT
Author: elecharny
Date: Wed Mar  5 03:18:05 2014
New Revision: 1574367

URL: http://svn.apache.org/r1574367
Log:
Fixed some failing test, as the brwosefrom() method was not handling absent revisions

Modified:
    directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractBTree.java
    directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/TupleCursor.java
    directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerTest.java

Modified: directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractBTree.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractBTree.java?rev=1574367&r1=1574366&r2=1574367&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractBTree.java
(original)
+++ directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractBTree.java
Wed Mar  5 03:18:05 2014
@@ -198,12 +198,19 @@ import org.apache.directory.mavibot.btre
     {
         ReadTransaction<K, V> transaction = beginReadTransaction( revision );
 
-        ParentPos<K, V>[] stack = (ParentPos<K, V>[]) Array.newInstance( ParentPos.class,
32 );
+        if ( transaction == null )
+        {
+            return new EmptyTupleCursor<K, V>( revision );
+        }
+        else
+        {
+            ParentPos<K, V>[] stack = (ParentPos<K, V>[]) Array.newInstance(
ParentPos.class, 32 );
 
-        // And get the cursor
-        TupleCursor<K, V> cursor = transaction.getRootPage().browse( key, transaction,
stack, 0 );
+            // And get the cursor
+            TupleCursor<K, V> cursor = transaction.getRootPage().browse( key, transaction,
stack, 0 );
 
-        return cursor;
+            return cursor;
+        }
     }
 
 

Modified: directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/TupleCursor.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/TupleCursor.java?rev=1574367&r1=1574366&r2=1574367&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/TupleCursor.java
(original)
+++ directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/TupleCursor.java
Wed Mar  5 03:18:05 2014
@@ -65,6 +65,7 @@ public class TupleCursor<K, V>
     {
     }
 
+
     /**
      * Creates a new instance of Cursor, starting on a page at a given position.
      *

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerTest.java?rev=1574367&r1=1574366&r2=1574367&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerTest.java
(original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerTest.java
Wed Mar  5 03:18:05 2014
@@ -525,10 +525,10 @@ public class RecordManagerTest
 
         // Check that we can read the revision again
         // revision 1
-        checkBTreeRevisionBrowseFrom( btree, rev1, 3L, 3L );
+        checkBTreeRevisionBrowseFrom( btree, rev1, 3L );
 
         // Revision 2
-        checkBTreeRevisionBrowseFrom( btree, rev2, 3L, 3L );
+        checkBTreeRevisionBrowseFrom( btree, rev2, 3L );
 
         // Revision 3
         checkBTreeRevisionBrowseFrom( btree, rev3, 3L, 3L, 5L );



Mime
View raw message