directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1632394 - in /directory/mavibot/trunk/mavibot/src: main/java/org/apache/directory/mavibot/btree/ test/java/org/apache/directory/mavibot/btree/
Date Thu, 16 Oct 2014 17:36:58 GMT
Author: elecharny
Date: Thu Oct 16 17:36:58 2014
New Revision: 1632394

URL: http://svn.apache.org/r1632394
Log:
o Added a getValueComparator() method in Btree
o Renamed the getComparator() method to getKeyComparator()
o Fixed a failing test in PersistedBTreeBuilderTest

Modified:
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractBTree.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractPage.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/BTree.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeBrowseTest.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerTest.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerWithDuplicatesTest.java

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractBTree.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractBTree.java?rev=1632394&r1=1632393&r2=1632394&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractBTree.java
(original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractBTree.java
Thu Oct 16 17:36:58 2014
@@ -93,10 +93,11 @@ import org.apache.directory.mavibot.btre
 
     /** The current revision */
     protected AtomicLong currentRevision = new AtomicLong( 0L );
-    
+
     /** The TransactionManager used for this BTree */
     protected TransactionManager transactionManager;
 
+
     /**
      * Starts a Read Only transaction. If the transaction is not closed, it will be
      * automatically closed after the timeout
@@ -125,7 +126,7 @@ import org.apache.directory.mavibot.btre
         {
             throw new BTreeCreationException( "We don't have a transactionLManager" );
         }
-        
+
         ReadTransaction<K, V> transaction = beginReadTransaction();
 
         if ( transaction == null )
@@ -134,7 +135,7 @@ import org.apache.directory.mavibot.btre
         }
         else
         {
-            ParentPos<K, V>[] stack = (ParentPos<K, V>[]) Array.newInstance(
ParentPos.class, 32 );
+            ParentPos<K, V>[] stack = ( ParentPos<K, V>[] ) Array.newInstance(
ParentPos.class, 32 );
 
             TupleCursor<K, V> cursor = getRootPage().browse( transaction, stack, 0
);
 
@@ -165,7 +166,7 @@ import org.apache.directory.mavibot.btre
         }
         else
         {
-            ParentPos<K, V>[] stack = (ParentPos<K, V>[]) Array.newInstance(
ParentPos.class, 32 );
+            ParentPos<K, V>[] stack = ( ParentPos<K, V>[] ) Array.newInstance(
ParentPos.class, 32 );
 
             // And get the cursor
             TupleCursor<K, V> cursor = getRootPage( transaction.getRevision() ).browse(
transaction, stack, 0 );
@@ -188,13 +189,13 @@ import org.apache.directory.mavibot.btre
 
         ReadTransaction<K, V> transaction = beginReadTransaction();
 
-        ParentPos<K, V>[] stack = (ParentPos<K, V>[]) Array.newInstance( ParentPos.class,
32 );
+        ParentPos<K, V>[] stack = ( ParentPos<K, V>[] ) Array.newInstance( ParentPos.class,
32 );
 
         TupleCursor<K, V> cursor;
         try
         {
             cursor = getRootPage( transaction.getRevision() ).browse( key, transaction, stack,
0 );
-            
+
             return cursor;
         }
         catch ( KeyNotFoundException e )
@@ -223,7 +224,7 @@ import org.apache.directory.mavibot.btre
         }
         else
         {
-            ParentPos<K, V>[] stack = (ParentPos<K, V>[]) Array.newInstance(
ParentPos.class, 32 );
+            ParentPos<K, V>[] stack = ( ParentPos<K, V>[] ) Array.newInstance(
ParentPos.class, 32 );
 
             // And get the cursor
             TupleCursor<K, V> cursor = getRootPage( transaction.getRevision() ).browse(
key, transaction, stack, 0 );
@@ -332,7 +333,7 @@ import org.apache.directory.mavibot.btre
         {
             // We have had an exception, we must rollback the transaction
             transactionManager.rollback();
-            
+
             return null;
         }
     }
@@ -364,15 +365,15 @@ import org.apache.directory.mavibot.btre
         try
         {
             Tuple<K, V> deleted = delete( key, value, currentRevision.get() + 1 );
-            
+
             transactionManager.commit();
-    
+
             return deleted;
         }
         catch ( IOException ioe )
         {
             transactionManager.rollback();
-            
+
             throw ioe;
         }
     }
@@ -418,7 +419,7 @@ import org.apache.directory.mavibot.btre
         {
             transactionManager.beginTransaction();
         }
-        
+
         try
         {
             InsertResult<K, V> result = insert( key, value, -1L );
@@ -431,14 +432,14 @@ import org.apache.directory.mavibot.btre
             {
                 existingValue = ( ( ModifyResult<K, V> ) result ).getModifiedValue();
             }
-            
+
             // Commit now if it's not a sub-btree
             if ( btreeType != BTreeTypeEnum.PERSISTED_SUB )
             {
                 //FIXME when result type is ExistsResult then we should avoid writing the
headers
                 transactionManager.commit();
             }
-    
+
             return existingValue;
         }
         catch ( IOException ioe )
@@ -449,7 +450,7 @@ import org.apache.directory.mavibot.btre
             {
                 transactionManager.rollback();
             }
-            
+
             return null;
         }
         catch ( DuplicateValueNotAllowedException e )
@@ -771,7 +772,7 @@ import org.apache.directory.mavibot.btre
 
         currentRevision.set( revision );
         currentBtreeHeader = btreeHeader;
-        
+
         // And update the newBTreeHeaders map
         if ( btreeHeader.getBtree().getType() != BTreeTypeEnum.PERSISTED_SUB )
         {
@@ -794,7 +795,7 @@ import org.apache.directory.mavibot.btre
 
         currentRevision.set( revision );
         currentBtreeHeader = btreeHeader;
-        
+
         // And update the newBTreeHeaders map
         if ( btreeHeader.getBtree().getType() != BTreeTypeEnum.PERSISTED_SUB )
         {
@@ -907,7 +908,7 @@ import org.apache.directory.mavibot.btre
     /**
      * {@inheritDoc}
      */
-    public Comparator<K> getComparator()
+    public Comparator<K> getKeyComparator()
     {
         return keySerializer.getComparator();
     }
@@ -916,6 +917,15 @@ import org.apache.directory.mavibot.btre
     /**
      * {@inheritDoc}
      */
+    public Comparator<V> getValueComparator()
+    {
+        return valueSerializer.getComparator();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
     public int getWriteBufferSize()
     {
         return writeBufferSize;
@@ -1012,7 +1022,7 @@ import org.apache.directory.mavibot.btre
         {
             throw new BTreeCreationException( "We don't have a Transaction Manager" );
         }
-        
+
         ReadTransaction transaction = beginReadTransaction();
 
         if ( transaction == null )
@@ -1021,7 +1031,7 @@ import org.apache.directory.mavibot.btre
         }
         else
         {
-            ParentPos<K, K>[] stack = (ParentPos<K, K>[]) Array.newInstance(
ParentPos.class, 32 );
+            ParentPos<K, K>[] stack = ( ParentPos<K, K>[] ) Array.newInstance(
ParentPos.class, 32 );
 
             KeyCursor<K> cursor = getRootPage().browseKeys( transaction, stack, 0 );
 
@@ -1032,7 +1042,7 @@ import org.apache.directory.mavibot.btre
         }
     }
 
-    
+
     /**
      * Create a thread that is responsible of cleaning the transactions when
      * they hit the timeout

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractPage.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractPage.java?rev=1632394&r1=1632393&r2=1632394&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractPage.java
(original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractPage.java
Thu Oct 16 17:36:58 2014
@@ -511,7 +511,7 @@ import org.apache.directory.mavibot.btre
             return -1;
         }
 
-        return btree.getComparator().compare( key1, key2 );
+        return btree.getKeyComparator().compare( key1, key2 );
     }
 
 

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/BTree.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/BTree.java?rev=1632394&r1=1632393&r2=1632394&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/BTree.java
(original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/BTree.java
Thu Oct 16 17:36:58 2014
@@ -73,7 +73,7 @@ public interface BTree<K, V>
 
 
     /**
-     * @return the pageSize
+     * @return the number of elements per page
      */
     int getPageSize();
 
@@ -264,11 +264,17 @@ public interface BTree<K, V>
      */
     KeyCursor<K> browseKeys() throws IOException, KeyNotFoundException;
 
-    
+
+    /**
+     * @return the key comparator
+     */
+    Comparator<K> getKeyComparator();
+
+
     /**
-     * @return the comparator
+     * @return the value comparator
      */
-    Comparator<K> getComparator();
+    Comparator<V> getValueComparator();
 
 
     /**

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeBrowseTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeBrowseTest.java?rev=1632394&r1=1632393&r2=1632394&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeBrowseTest.java
(original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeBrowseTest.java
Thu Oct 16 17:36:58 2014
@@ -36,7 +36,6 @@ import org.apache.commons.io.FileUtils;
 import org.apache.directory.mavibot.btree.exception.BTreeAlreadyManagedException;
 import org.apache.directory.mavibot.btree.exception.EndOfFileExceededException;
 import org.apache.directory.mavibot.btree.exception.KeyNotFoundException;
-import org.apache.directory.mavibot.btree.serializer.IntSerializer;
 import org.apache.directory.mavibot.btree.serializer.LongSerializer;
 import org.apache.directory.mavibot.btree.serializer.StringSerializer;
 import org.junit.After;
@@ -98,7 +97,7 @@ public class PersistedBTreeBrowseTest
         {
             FileUtils.deleteDirectory( dataDir );
         }
-        
+
         recordManager1.close();
         assertTrue( recordManager1.isContextOk() );
     }
@@ -416,12 +415,12 @@ public class PersistedBTreeBrowseTest
         assertEquals( "3", tuple.getValue() );
 
         // Now, move to the prev value
-        cursor.prev();
+        tuple = cursor.prev();
         assertEquals( 2L, ( long ) tuple.getKey() );
         assertEquals( "2", tuple.getValue() );
 
         // And to the next value
-        cursor.next();
+        tuple = cursor.next();
         assertEquals( 3L, ( long ) tuple.getKey() );
         assertEquals( "3", tuple.getValue() );
     }
@@ -716,7 +715,8 @@ public class PersistedBTreeBrowseTest
      * stored into a sub btree
      */
     @Test
-    public void testBrowseBTreeLeafNextDupsSubBTree1() throws IOException, BTreeAlreadyManagedException,
KeyNotFoundException
+    public void testBrowseBTreeLeafNextDupsSubBTree1() throws IOException, BTreeAlreadyManagedException,
+        KeyNotFoundException
     {
         // Inject some duplicate data which will be stored into a sub btree
         for ( long i = 1L; i < 32L; i++ )
@@ -748,7 +748,8 @@ public class PersistedBTreeBrowseTest
      * Test the browse methods on a btree containing just a leaf with duplicate values
      */
     @Test
-    public void testBrowseBTreeLeafPrevDupsSubBTree1() throws IOException, BTreeAlreadyManagedException,
KeyNotFoundException
+    public void testBrowseBTreeLeafPrevDupsSubBTree1() throws IOException, BTreeAlreadyManagedException,
+        KeyNotFoundException
     {
         // Inject some duplicate data which will be stored into a sub btree
         for ( long i = 1L; i < 32L; i++ )
@@ -911,7 +912,7 @@ public class PersistedBTreeBrowseTest
 
         // Create the cursor
         TupleCursor<Long, String> cursor = btree.browseFrom( 1500L );
-        
+
         assertFalse( cursor.hasNext() );
         assertTrue( cursor.hasPrev() );
         assertEquals( 1000L, cursor.prev().getKey().longValue() );
@@ -1009,55 +1010,55 @@ public class PersistedBTreeBrowseTest
         }
     }
 
-    
+
     /**
      * Test the TupleCursor.nextKey method on a btree containing nodes
      * with duplicate values.
      */
-   @Test
-   @Ignore
-   public void testNextKeyDups() throws IOException, BTreeAlreadyManagedException, KeyNotFoundException
-   {
-       // Inject some data
-       //for ( long i = 1; i < 3; i++ )
-       {
-           for ( long j = 1; j < 9; j++ )
-           {
-               btree.insert( 1L, Long.toString( j ) );
-           }
-       }
-
-       btree.insert( 1L, "10" );
-
-       // Create the cursor
-       TupleCursor<Long, String> cursor = btree.browse();
-
-       // Move forward
-       cursor.beforeFirst();
-
-       assertFalse( cursor.hasPrevKey() );
-       assertTrue( cursor.hasNextKey() );
-
-       Tuple<Long, String> tuple = cursor.nextKey();
-
-       checkTuple( tuple, 1L, "1" );
-       
-       cursor.beforeFirst();
-       long val = 1L;
-       
-       while ( cursor.hasNext() )
-       {
-           tuple = cursor.next();
-           
-           assertEquals( Long.valueOf( 1L ), tuple.getKey() );
-           assertEquals( Long.toString( val ), tuple.getValue() );
-           
-           val++;
-       }
-       
-       assertFalse( cursor.hasNextKey() );
-       assertFalse( cursor.hasPrevKey() );
-   }
+    @Test
+    @Ignore
+    public void testNextKeyDups() throws IOException, BTreeAlreadyManagedException, KeyNotFoundException
+    {
+        // Inject some data
+        //for ( long i = 1; i < 3; i++ )
+        {
+            for ( long j = 1; j < 9; j++ )
+            {
+                btree.insert( 1L, Long.toString( j ) );
+            }
+        }
+
+        btree.insert( 1L, "10" );
+
+        // Create the cursor
+        TupleCursor<Long, String> cursor = btree.browse();
+
+        // Move forward
+        cursor.beforeFirst();
+
+        assertFalse( cursor.hasPrevKey() );
+        assertTrue( cursor.hasNextKey() );
+
+        Tuple<Long, String> tuple = cursor.nextKey();
+
+        checkTuple( tuple, 1L, "1" );
+
+        cursor.beforeFirst();
+        long val = 1L;
+
+        while ( cursor.hasNext() )
+        {
+            tuple = cursor.next();
+
+            assertEquals( Long.valueOf( 1L ), tuple.getKey() );
+            assertEquals( Long.toString( val ), tuple.getValue() );
+
+            val++;
+        }
+
+        assertFalse( cursor.hasNextKey() );
+        assertFalse( cursor.hasPrevKey() );
+    }
 
 
     /**
@@ -1106,8 +1107,8 @@ public class PersistedBTreeBrowseTest
             }
         }
     }
-    
-    
+
+
     /**
      * Test the overwriting of elements
      */
@@ -1115,14 +1116,14 @@ public class PersistedBTreeBrowseTest
     public void testOverwrite() throws Exception
     {
         btree.setAllowDuplicates( false );
-        
+
         // Adding an element with a null value
         btree.insert( 1L, "1" );
 
         assertTrue( btree.hasKey( 1L ) );
 
         assertEquals( "1", btree.get( 1L ) );
-        
+
         btree.insert( 1L, "10" );
 
         assertTrue( btree.hasKey( 1L ) );
@@ -1131,17 +1132,17 @@ public class PersistedBTreeBrowseTest
         btree.close();
     }
 
-    
+
     @Ignore("test used for debugging")
     @Test
     public void testAdd20Random() throws IOException, BTreeAlreadyManagedException, KeyNotFoundException
     {
-        long [] values = new long[]
-            { 
-                14,  7, 43, 37, 49,  3, 20, 26, 17, 29, 
-                40, 33, 21, 18,  9, 30, 45, 36, 12,  8
-            };
-    
+        long[] values = new long[]
+            {
+                14, 7, 43, 37, 49, 3, 20, 26, 17, 29,
+                40, 33, 21, 18, 9, 30, 45, 36, 12, 8
+        };
+
         btree.setPageSize( 4 );
         // Inject some data
         for ( long value : values )
@@ -1150,13 +1151,12 @@ public class PersistedBTreeBrowseTest
             System.out.println( btree );
         }
 
-
         Map copiedPagesBtree = recordManager1.copiedPageMap;
-        
+
         System.out.println( copiedPagesBtree );
-        
+
         TupleCursor<Long, String> cursor = btree.browse();
-        
+
         while ( cursor.hasNext() )
         {
             System.out.println( cursor.nextKey() );

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=1632394&r1=1632393&r2=1632394&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
Thu Oct 16 17:36:58 2014
@@ -30,9 +30,7 @@ import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
 
@@ -141,7 +139,7 @@ public class RecordManagerTest
         BTree<Long, String> btree1 = recordManager.getManagedTree( "test" );
 
         assertNotNull( btree1 );
-        assertEquals( btree.getComparator().getClass().getName(), btree1.getComparator().getClass().getName()
);
+        assertEquals( btree.getKeyComparator().getClass().getName(), btree1.getKeyComparator().getClass().getName()
);
         assertEquals( btree.getKeySerializer().getClass().getName(), btree1.getKeySerializer().getClass().getName()
);
         assertEquals( btree.getName(), btree1.getName() );
         assertEquals( btree.getNbElems(), btree1.getNbElems() );
@@ -175,7 +173,7 @@ public class RecordManagerTest
         BTree<Long, String> btree1 = recordManager.getManagedTree( "test" );
 
         assertNotNull( btree1 );
-        assertEquals( btree.getComparator().getClass().getName(), btree1.getComparator().getClass().getName()
);
+        assertEquals( btree.getKeyComparator().getClass().getName(), btree1.getKeyComparator().getClass().getName()
);
         assertEquals( btree.getKeySerializer().getClass().getName(), btree1.getKeySerializer().getClass().getName()
);
         assertEquals( btree.getName(), btree1.getName() );
         assertEquals( btree.getNbElems(), btree1.getNbElems() );
@@ -216,7 +214,6 @@ public class RecordManagerTest
             assertEquals( "V" + i, btree.get( i ) );
         }
 
-        
         // Now, try to reload the file back
         openRecordManagerAndBtree();
 
@@ -230,7 +227,7 @@ public class RecordManagerTest
         BTree<Long, String> btree1 = recordManager.getManagedTree( "test" );
 
         assertNotNull( btree1 );
-        assertEquals( btree.getComparator().getClass().getName(), btree1.getComparator().getClass().getName()
);
+        assertEquals( btree.getKeyComparator().getClass().getName(), btree1.getKeyComparator().getClass().getName()
);
         assertEquals( btree.getKeySerializer().getClass().getName(), btree1.getKeySerializer().getClass().getName()
);
         assertEquals( btree.getName(), btree1.getName() );
         assertEquals( btree.getNbElems(), btree1.getNbElems() );
@@ -316,7 +313,7 @@ public class RecordManagerTest
         BTree<Long, String> btree1 = recordManager.getManagedTree( "test" );
 
         assertNotNull( btree1 );
-        assertEquals( btree.getComparator().getClass().getName(), btree1.getComparator().getClass().getName()
);
+        assertEquals( btree.getKeyComparator().getClass().getName(), btree1.getKeyComparator().getClass().getName()
);
         assertEquals( btree.getKeySerializer().getClass().getName(), btree1.getKeySerializer().getClass().getName()
);
         assertEquals( btree.getName(), btree1.getName() );
         assertEquals( btree.getNbElems(), btree1.getNbElems() );
@@ -454,7 +451,7 @@ public class RecordManagerTest
         BTree<Long, String> btree1 = recordManager.getManagedTree( "test" );
 
         assertNotNull( btree1 );
-        assertEquals( btree.getComparator().getClass().getName(), btree1.getComparator().getClass().getName()
);
+        assertEquals( btree.getKeyComparator().getClass().getName(), btree1.getKeyComparator().getClass().getName()
);
         assertEquals( btree.getKeySerializer().getClass().getName(), btree1.getKeySerializer().getClass().getName()
);
         assertEquals( btree.getName(), btree1.getName() );
         assertEquals( btree.getNbElems(), btree1.getNbElems() );
@@ -525,7 +522,7 @@ public class RecordManagerTest
         BTree<Long, String> btree1 = recordManager.getManagedTree( "test" );
 
         assertNotNull( btree1 );
-        assertEquals( btree.getComparator().getClass().getName(), btree1.getComparator().getClass().getName()
);
+        assertEquals( btree.getKeyComparator().getClass().getName(), btree1.getKeyComparator().getClass().getName()
);
         assertEquals( btree.getKeySerializer().getClass().getName(), btree1.getKeySerializer().getClass().getName()
);
         assertEquals( btree.getName(), btree1.getName() );
         assertEquals( btree.getNbElems(), btree1.getNbElems() );
@@ -616,7 +613,7 @@ public class RecordManagerTest
         BTree<Long, String> btree1 = recordManager.getManagedTree( "test" );
 
         assertNotNull( btree1 );
-        assertEquals( btree.getComparator().getClass().getName(), btree1.getComparator().getClass().getName()
);
+        assertEquals( btree.getKeyComparator().getClass().getName(), btree1.getKeyComparator().getClass().getName()
);
         assertEquals( btree.getKeySerializer().getClass().getName(), btree1.getKeySerializer().getClass().getName()
);
         assertEquals( btree.getName(), btree1.getName() );
         assertEquals( btree.getNbElems(), btree1.getNbElems() );
@@ -713,7 +710,7 @@ public class RecordManagerTest
         BTree<Long, String> btree1 = recordManager.getManagedTree( "test" );
 
         assertNotNull( btree1 );
-        assertEquals( btree.getComparator().getClass().getName(), btree1.getComparator().getClass().getName()
);
+        assertEquals( btree.getKeyComparator().getClass().getName(), btree1.getKeyComparator().getClass().getName()
);
         assertEquals( btree.getKeySerializer().getClass().getName(), btree1.getKeySerializer().getClass().getName()
);
         assertEquals( btree.getName(), btree1.getName() );
         assertEquals( btree.getNbElems(), btree1.getNbElems() );
@@ -808,7 +805,7 @@ public class RecordManagerTest
         BTree<Long, String> btree1 = recordManager.getManagedTree( "test" );
 
         assertNotNull( btree1 );
-        assertEquals( btree.getComparator().getClass().getName(), btree1.getComparator().getClass().getName()
);
+        assertEquals( btree.getKeyComparator().getClass().getName(), btree1.getKeyComparator().getClass().getName()
);
         assertEquals( btree.getKeySerializer().getClass().getName(), btree1.getKeySerializer().getClass().getName()
);
         assertEquals( btree.getName(), btree1.getName() );
         assertEquals( btree.getNbElems(), btree1.getNbElems() );
@@ -887,10 +884,10 @@ public class RecordManagerTest
             }
         }
     }
-    
-    
+
+
     @Test
-    public void testAdds() throws IOException, BTreeAlreadyManagedException,KeyNotFoundException
+    public void testAdds() throws IOException, BTreeAlreadyManagedException, KeyNotFoundException
     {
         btree.insert( 1L, "V1" );
         btree.insert( 2L, "V2" );

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerWithDuplicatesTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerWithDuplicatesTest.java?rev=1632394&r1=1632393&r2=1632394&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerWithDuplicatesTest.java
(original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerWithDuplicatesTest.java
Thu Oct 16 17:36:58 2014
@@ -86,7 +86,7 @@ public class RecordManagerWithDuplicates
         {
             FileUtils.deleteDirectory( dataDir );
         }
-        
+
         recordManager.close();
         assertTrue( recordManager.isContextOk() );
     }
@@ -130,7 +130,7 @@ public class RecordManagerWithDuplicates
         BTree<Long, String> btree1 = recordManager.getManagedTree( "test" );
 
         assertNotNull( btree1 );
-        assertEquals( btree.getComparator().getClass().getName(), btree1.getComparator().getClass().getName()
);
+        assertEquals( btree.getKeyComparator().getClass().getName(), btree1.getKeyComparator().getClass().getName()
);
         assertEquals( btree.getKeySerializer().getClass().getName(), btree1.getKeySerializer().getClass().getName()
);
         assertEquals( btree.getName(), btree1.getName() );
         assertEquals( btree.getNbElems(), btree1.getNbElems() );



Mime
View raw message