directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1566659 [6/6] - in /directory/mavibot/branches/with-txns/mavibot: img/ src/main/java/org/apache/directory/mavibot/btree/ src/main/java/org/apache/directory/mavibot/btree/comparator/ src/main/java/org/apache/directory/mavibot/btree/exceptio...
Date Mon, 10 Feb 2014 15:35:20 GMT
Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/MultiThreadedInMemoryBtreeTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/MultiThreadedInMemoryBtreeTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/MultiThreadedInMemoryBtreeTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/MultiThreadedInMemoryBtreeTest.java Mon Feb 10 15:35:18 2014
@@ -21,15 +21,12 @@ package org.apache.directory.mavibot.btr
 
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
 
 import java.io.IOException;
 import java.util.Random;
 import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicBoolean;
 
-import org.apache.directory.mavibot.btree.BTree;
-import org.apache.directory.mavibot.btree.Tuple;
-import org.apache.directory.mavibot.btree.TupleCursor;
 import org.apache.directory.mavibot.btree.exception.KeyNotFoundException;
 import org.apache.directory.mavibot.btree.serializer.LongSerializer;
 import org.apache.directory.mavibot.btree.serializer.StringSerializer;
@@ -40,7 +37,7 @@ import org.junit.Test;
 
 /**
  * A class to test multi-threaded operations on the btree
- *  
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class MultiThreadedInMemoryBtreeTest
@@ -56,7 +53,7 @@ public class MultiThreadedInMemoryBtreeT
     @BeforeClass
     public static void setup() throws IOException
     {
-        btree = BTreeFactory.createInMemoryBTree( "test", new LongSerializer(), new StringSerializer() );
+        btree = BTreeFactory.createInMemoryBTree( "test", LongSerializer.INSTANCE, StringSerializer.INSTANCE );
     }
 
 
@@ -110,7 +107,7 @@ public class MultiThreadedInMemoryBtreeT
 
     /**
      * Browse the btree in its current revision, reading all of its elements
-     * @return The number of read elements 
+     * @return The number of read elements
      * @throws IOException If the browse failed
      */
     private int testBrowse() throws IOException
@@ -140,7 +137,7 @@ public class MultiThreadedInMemoryBtreeT
     /**
      * Check that we can read the btree while it is being modified. We will start
      * 100 readers for one writer.
-     * 
+     *
      * @throws InterruptedException If the btree access failed.
      */
     @Test
@@ -217,42 +214,61 @@ public class MultiThreadedInMemoryBtreeT
     {
         int nbThreads = 100;
         final CountDownLatch latch = new CountDownLatch( nbThreads );
+        final AtomicBoolean error = new AtomicBoolean(false);
 
         //Thread.sleep( 60000L );
 
         long t0 = System.currentTimeMillis();
 
-        for ( int i = 0; i < nbThreads; i++ )
+        class MyThread extends Thread
         {
-            final long prefix = i;
-            Thread test = new Thread()
+            private int prefix = 0;
+
+            public void run()
             {
-                public void run()
+                try
                 {
-                    try
+                    // Inject 1000 elements
+                    for ( int j = 0; j < 1000; j++ )
                     {
-                        // Inject 1000 elements
-                        for ( int j = 0; j < 1000; j++ )
+                        long value = prefix * 1000 + j;
+                        String valStr = Long.toString( value );
+                        //System.out.println( "---------------------------Inserting " + valStr + " for Thread " + Thread.currentThread().getName() );
+                        btree.insert( value, valStr );
+
+                        if ( j % 10 == 0 )
                         {
-                            long value = prefix * 1000 + j;
-                            btree.insert( value, Long.toString( value ) );
+                            long res = checkBtree( prefix, 1000, j );
 
-                            /*
-                            if ( j % 10000 == 0 )
+                            if ( res != -1L )
                             {
-                                System.out.println( "Thread " + Thread.currentThread().getName() + " flushed " + j
-                                    + " elements" );
+                                //retry
+                                System.out.println( "Failure to retrieve " + j );
+                                latch.countDown();
+                                error.set( true );
+                                return;
                             }
-                            */
                         }
-
-                        latch.countDown();
-                    }
-                    catch ( Exception e )
-                    {
                     }
+
+                    latch.countDown();
                 }
-            };
+                catch ( Exception e )
+                {
+                    e.printStackTrace();
+                    System.out.println( e.getMessage() );
+                }
+            }
+
+            public MyThread( int prefix )
+            {
+                this.prefix = prefix;
+            }
+        }
+
+        for ( int i = 0; i < nbThreads; i++ )
+        {
+            MyThread test = new MyThread( i );
 
             // Start each reader
             test.start();
@@ -261,22 +277,65 @@ public class MultiThreadedInMemoryBtreeT
         // Wait for all the readers to be done
         latch.await();
 
+        if ( error.get() )
+        {
+            System.out.println( "ERROR -----------------" );
+            return;
+        }
+
         long t1 = System.currentTimeMillis();
 
         // Check that the tree contains all the values
+        assertEquals( -1L, checkBtree( 1000, nbThreads ) );
+
+        System.out.println( " Time to create 1M entries : "
+            + ( ( t1 - t0 ) ) + " milliseconds" );
+    }
+
+
+    private long checkBtree( int prefix, int nbElems, int currentElem ) throws IOException
+    {
+        long i = 0L;
+
         try
         {
-            for ( long i = 0L; i < 10000L; i++ )
+            for ( i = 0L; i < currentElem; i++ )
             {
-                assertEquals( Long.toString( i ), btree.get( i ) );
+                long key = prefix * nbElems + i;
+                assertEquals( Long.toString( key ), btree.get( key ) );
             }
+
+            return -1L;
         }
         catch ( KeyNotFoundException knfe )
         {
-            fail();
+            System.out.println( "cannot find " + ( prefix * nbElems + i ) );
+            return i;
         }
+    }
 
-        System.out.println( " Time to create 1M entries : "
-            + ( ( t1 - t0 ) / 1000 ) + " seconds" );
+
+    private long checkBtree( int nbElems, int nbThreads ) throws IOException
+    {
+        long i = 0L;
+
+        try
+        {
+            for ( long j = 0; j < nbThreads; j++ )
+            {
+                for ( i = 0L; i < nbElems; i++ )
+                {
+                    long key = j * nbElems + i;
+                    assertEquals( Long.toString( key ), btree.get( key ) );
+                }
+            }
+
+            return -1L;
+        }
+        catch ( KeyNotFoundException knfe )
+        {
+            System.out.println( "cannot find " + i );
+            return i;
+        }
     }
 }

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=1566659&r1=1566658&r2=1566659&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 Mon Feb 10 15:35:18 2014
@@ -32,10 +32,6 @@ import java.util.NoSuchElementException;
 import java.util.UUID;
 
 import org.apache.commons.io.FileUtils;
-import org.apache.directory.mavibot.btree.BTree;
-import org.apache.directory.mavibot.btree.RecordManager;
-import org.apache.directory.mavibot.btree.Tuple;
-import org.apache.directory.mavibot.btree.TupleCursor;
 import org.apache.directory.mavibot.btree.exception.BTreeAlreadyManagedException;
 import org.apache.directory.mavibot.btree.exception.EndOfFileExceededException;
 import org.apache.directory.mavibot.btree.serializer.LongSerializer;
@@ -49,7 +45,7 @@ import org.junit.rules.TemporaryFolder;
 
 /**
  * Tests the browse methods on a managed BTree
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class PersistedBTreeBrowseTest
@@ -77,7 +73,7 @@ public class PersistedBTreeBrowseTest
         try
         {
             // Create a new BTree which allows duplicate values
-            btree = recordManager1.addBTree( "test", new LongSerializer(), new StringSerializer(), true );
+            btree = recordManager1.addBTree( "test", LongSerializer.INSTANCE, StringSerializer.INSTANCE, true );
         }
         catch ( Exception e )
         {
@@ -196,7 +192,7 @@ public class PersistedBTreeBrowseTest
     // The Browse tests
     //----------------------------------------------------------------------------------------
     /**
-     * Test the browse methods on an empty btree  
+     * Test the browse methods on an empty btree
      */
     @Test
     public void testBrowseEmptyBTree() throws IOException, BTreeAlreadyManagedException
@@ -936,7 +932,7 @@ public class PersistedBTreeBrowseTest
     // The TupleCursor.moveToNext/PrevNonDuplicateKey method tests
     //----------------------------------------------------------------------------------------
     /**
-      * Test the TupleCursor.nextKey method on a btree containing nodes 
+      * Test the TupleCursor.nextKey method on a btree containing nodes
       * with duplicate values.
       */
     @Test
@@ -985,7 +981,7 @@ public class PersistedBTreeBrowseTest
 
 
     /**
-     * Test the TupleCursor.moveToPrevNonDuplicateKey method on a btree containing nodes 
+     * Test the TupleCursor.moveToPrevNonDuplicateKey method on a btree containing nodes
      * with duplicate values.
      */
     @Test

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeBuilderTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeBuilderTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeBuilderTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeBuilderTest.java Mon Feb 10 15:35:18 2014
@@ -27,11 +27,6 @@ import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.directory.mavibot.btree.BTree;
-import org.apache.directory.mavibot.btree.PersistedBTreeBuilder;
-import org.apache.directory.mavibot.btree.RecordManager;
-import org.apache.directory.mavibot.btree.Tuple;
-import org.apache.directory.mavibot.btree.TupleCursor;
 import org.apache.directory.mavibot.btree.serializer.IntSerializer;
 import org.junit.Test;
 
@@ -60,7 +55,7 @@ public class PersistedBTreeBuilderTest
 
         RecordManager rm = new RecordManager( file.getAbsolutePath() );
 
-        IntSerializer ser = new IntSerializer();
+        IntSerializer ser = IntSerializer.INSTANCE;
         PersistedBTreeBuilder<Integer, Integer> bb = new PersistedBTreeBuilder<Integer, Integer>( rm, "master", 4, ser,
             ser );
 

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeDuplicateKeyTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeDuplicateKeyTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeDuplicateKeyTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeDuplicateKeyTest.java Mon Feb 10 15:35:18 2014
@@ -72,7 +72,7 @@ public class PersistedBTreeDuplicateKeyT
         try
         {
             // Create a new BTree
-            btree = recordManager1.addBTree( "test", new LongSerializer(), new StringSerializer(),
+            btree = recordManager1.addBTree( "test", LongSerializer.INSTANCE, StringSerializer.INSTANCE,
                 BTree.ALLOW_DUPLICATES );
         }
         catch ( Exception e )
@@ -143,7 +143,7 @@ public class PersistedBTreeDuplicateKeyT
     @Test
     public void testBrowseEmptyTree() throws IOException
     {
-        IntSerializer serializer = new IntSerializer();
+        IntSerializer serializer = IntSerializer.INSTANCE;
 
         BTree<Integer, Integer> btree = BTreeFactory.createPersistedBTree( "master", serializer, serializer );
 
@@ -792,8 +792,8 @@ public class PersistedBTreeDuplicateKeyT
     @Test(expected = DuplicateValueNotAllowedException.class)
     public void testBTreeForbidDups() throws IOException, BTreeAlreadyManagedException
     {
-        BTree<Long, String> singleValueBtree = recordManager1.addBTree( "test2", new LongSerializer(),
-            new StringSerializer(), BTree.FORBID_DUPLICATES );
+        BTree<Long, String> singleValueBtree = recordManager1.addBTree( "test2", LongSerializer.INSTANCE,
+            StringSerializer.INSTANCE, BTree.FORBID_DUPLICATES );
 
         for ( long i = 0; i < 64; i++ )
         {

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeTransactionTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeTransactionTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeTransactionTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeTransactionTest.java Mon Feb 10 15:35:18 2014
@@ -59,8 +59,8 @@ public class PersistedBTreeTransactionTe
         try
         {
             // Create a new BTree with transaction and another one without
-            btreeWithTransactions = recordManagerTxn.addBTree( "testWithTxn", new LongSerializer(), new StringSerializer(), false );
-            btreeNoTransactions = recordManagerNoTxn.addBTree( "testNoTxn", new LongSerializer(), new StringSerializer(), false );
+            btreeWithTransactions = recordManagerTxn.addBTree( "testWithTxn", LongSerializer.INSTANCE, StringSerializer.INSTANCE, false );
+            btreeNoTransactions = recordManagerNoTxn.addBTree( "testNoTxn", LongSerializer.INSTANCE, StringSerializer.INSTANCE, false );
         }
         catch ( Exception e )
         {

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedStoreTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedStoreTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedStoreTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedStoreTest.java Mon Feb 10 15:35:18 2014
@@ -325,15 +325,15 @@ public class PersistedStoreTest
         storeMethod.setAccessible( true );
 
         // Allocate some Pages
-        PageIO[] pageIos = new PageIO[4];
+        PageIO[] pageIos = new PageIO[3];
         pageIos[0] = new PageIO();
         pageIos[0].setData( ByteBuffer.allocate( recordManager.getPageSize() ) );
         pageIos[1] = new PageIO();
         pageIos[1].setData( ByteBuffer.allocate( recordManager.getPageSize() ) );
         pageIos[2] = new PageIO();
         pageIos[2].setData( ByteBuffer.allocate( recordManager.getPageSize() ) );
-        pageIos[3] = new PageIO();
-        pageIos[3].setData( ByteBuffer.allocate( recordManager.getPageSize() ) );
+//        pageIos[3] = new PageIO();
+//        pageIos[3].setData( ByteBuffer.allocate( recordManager.getPageSize() ) );
 
         // We start with 4 bytes
         byte[] bytes = new byte[]
@@ -396,10 +396,10 @@ public class PersistedStoreTest
         }
 
         // Write the bytes over 2 pages
-        position = ( Long ) storeMethod.invoke( recordManager, 15L, bytes, pageIos );
+        position = ( Long ) storeMethod.invoke( recordManager, 47L, bytes, pageIos );
 
-        assertEquals( 35, position );
-        pos = 27;
+        assertEquals( 67, position );
+        pos = 59;
         // The byte length
         assertEquals( 0x00, pageIos[0].getData().get( pos++ ) );
         assertEquals( 0x00, pageIos[0].getData().get( pos++ ) );
@@ -418,25 +418,25 @@ public class PersistedStoreTest
         }
 
         // Write the bytes over 4 pages
-        bytes = new byte[80];
+        bytes = new byte[112];
 
-        for ( int i = 0; i < 80; i++ )
+        for ( int i = 0; i < 112; i++ )
         {
             bytes[i] = ( byte ) ( i + 1 );
         }
 
         position = ( Long ) storeMethod.invoke( recordManager, 2L, bytes, pageIos );
 
-        assertEquals( 86, position );
+        assertEquals( 118, position );
         pos = 14;
         // The byte length
         assertEquals( 0x00, pageIos[0].getData().get( pos++ ) );
         assertEquals( 0x00, pageIos[0].getData().get( pos++ ) );
         assertEquals( 0x00, pageIos[0].getData().get( pos++ ) );
-        assertEquals( 0x50, pageIos[0].getData().get( pos++ ) );
+        assertEquals( 0x70, pageIos[0].getData().get( pos++ ) );
 
         // The data in the first page
-        for ( int i = 0; i < 14; i++ )
+        for ( int i = 0; i < 46; i++ )
         {
             assertEquals( ( byte ) ( i + 1 ), pageIos[0].getData().get( pos++ ) );
         }
@@ -444,7 +444,7 @@ public class PersistedStoreTest
         // The data in the second page
         pos = 8;
 
-        for ( int i = 14; i < 38; i++ )
+        for ( int i = 46; i < 102; i++ )
         {
             assertEquals( ( byte ) ( i + 1 ), pageIos[1].getData().get( pos++ ) );
         }
@@ -452,19 +452,11 @@ public class PersistedStoreTest
         // The data in the third page
         pos = 8;
 
-        for ( int i = 38; i < 62; i++ )
+        for ( int i = 102; i < 112; i++ )
         {
             assertEquals( ( byte ) ( i + 1 ), pageIos[2].getData().get( pos++ ) );
         }
 
-        // The data in the forth page
-        pos = 8;
-
-        for ( int i = 62; i < 80; i++ )
-        {
-            assertEquals( ( byte ) ( i + 1 ), pageIos[3].getData().get( pos++ ) );
-        }
-
         recordManager.close();
     }
 }

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerFreePageTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerFreePageTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerFreePageTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerFreePageTest.java Mon Feb 10 15:35:18 2014
@@ -28,10 +28,6 @@ import java.io.IOException;
 import java.util.Set;
 
 import org.apache.commons.io.FileUtils;
-import org.apache.directory.mavibot.btree.BTree;
-import org.apache.directory.mavibot.btree.RecordManager;
-import org.apache.directory.mavibot.btree.Tuple;
-import org.apache.directory.mavibot.btree.TupleCursor;
 import org.apache.directory.mavibot.btree.exception.BTreeAlreadyManagedException;
 import org.apache.directory.mavibot.btree.serializer.LongSerializer;
 import org.apache.directory.mavibot.btree.serializer.StringSerializer;
@@ -42,7 +38,7 @@ import org.junit.Test;
 
 /**
  * test the RecordManager's free page management
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class RecordManagerFreePageTest
@@ -71,7 +67,7 @@ public class RecordManagerFreePageTest
         try
         {
             // Create a new BTree
-            btree = recordManager1.addBTree( "test", new LongSerializer(), new StringSerializer(), false );
+            btree = recordManager1.addBTree( "test", LongSerializer.INSTANCE, StringSerializer.INSTANCE, false );
         }
         catch ( Exception e )
         {
@@ -120,11 +116,11 @@ public class RecordManagerFreePageTest
         }
     }
 
-    private int nbElems = 100000;
+    private int nbElems = 10000;
 
 
     /**
-     * Test the creation of a RecordManager, and that we can read it back.  
+     * Test the creation of a RecordManager, and that we can read it back.
      */
     @Test
     public void testRecordManager() throws IOException, BTreeAlreadyManagedException
@@ -144,6 +140,7 @@ public class RecordManagerFreePageTest
 
         for ( int i = 0; i < nbElems; i++ )
         {
+            System.out.println( i );
             Long key = ( long ) i;
             String value = Long.toString( key );
 

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerPrivateMethodTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerPrivateMethodTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerPrivateMethodTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerPrivateMethodTest.java Mon Feb 10 15:35:18 2014
@@ -28,9 +28,6 @@ import java.lang.reflect.InvocationTarge
 import java.lang.reflect.Method;
 import java.util.UUID;
 
-import org.apache.directory.mavibot.btree.BTree;
-import org.apache.directory.mavibot.btree.PageIO;
-import org.apache.directory.mavibot.btree.RecordManager;
 import org.apache.directory.mavibot.btree.serializer.LongSerializer;
 import org.apache.directory.mavibot.btree.serializer.StringSerializer;
 import org.junit.After;
@@ -42,7 +39,7 @@ import org.junit.rules.TemporaryFolder;
 
 /**
  * Test some of the RecordManager prvate methods
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class RecordManagerPrivateMethodTest
@@ -62,11 +59,13 @@ public class RecordManagerPrivateMethodT
     {
         dataDir = tempFolder.newFolder( UUID.randomUUID().toString() );
 
+        System.out.println( dataDir + "/mavibot.db" );
+
         // Now, try to reload the file back
         recordManager = new RecordManager( dataDir.getAbsolutePath(), 32 );
 
         // Create a new BTree
-        btree = recordManager.addBTree( "test", new LongSerializer(), new StringSerializer(), false );
+        btree = recordManager.addBTree( "test", LongSerializer.INSTANCE, StringSerializer.INSTANCE, false );
     }
 
 
@@ -91,19 +90,19 @@ public class RecordManagerPrivateMethodT
 
         assertEquals( 0, pages.length );
 
-        for ( int i = 1; i < 20; i++ )
+        for ( int i = 1; i <= 52; i++ )
         {
             pages = ( org.apache.directory.mavibot.btree.PageIO[] ) getFreePageIOsMethod.invoke( recordManager, i );
             assertEquals( 1, pages.length );
         }
 
-        for ( int i = 21; i < 44; i++ )
+        for ( int i = 53; i <= 108; i++ )
         {
             pages = ( org.apache.directory.mavibot.btree.PageIO[] ) getFreePageIOsMethod.invoke( recordManager, i );
             assertEquals( 2, pages.length );
         }
 
-        for ( int i = 45; i < 68; i++ )
+        for ( int i = 109; i <= 164; i++ )
         {
             pages = ( org.apache.directory.mavibot.btree.PageIO[] ) getFreePageIOsMethod.invoke( recordManager, i );
             assertEquals( 3, pages.length );
@@ -125,17 +124,17 @@ public class RecordManagerPrivateMethodT
 
         assertEquals( 0, ( ( Integer ) computeNbPagesMethod.invoke( recordManager, 0 ) ).intValue() );
 
-        for ( int i = 1; i < 21; i++ )
+        for ( int i = 1; i < 53; i++ )
         {
             assertEquals( 1, ( ( Integer ) computeNbPagesMethod.invoke( recordManager, i ) ).intValue() );
         }
 
-        for ( int i = 21; i < 45; i++ )
+        for ( int i = 53; i < 109; i++ )
         {
             assertEquals( 2, ( ( Integer ) computeNbPagesMethod.invoke( recordManager, i ) ).intValue() );
         }
 
-        for ( int i = 45; i < 68; i++ )
+        for ( int i = 109; i < 164; i++ )
         {
             assertEquals( 3, ( ( Integer ) computeNbPagesMethod.invoke( recordManager, i ) ).intValue() );
         }

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=1566659&r1=1566658&r2=1566659&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 Mon Feb 10 15:35:18 2014
@@ -35,11 +35,6 @@ import java.util.Set;
 import java.util.UUID;
 
 import org.apache.commons.io.FileUtils;
-import org.apache.directory.mavibot.btree.BTree;
-import org.apache.directory.mavibot.btree.RecordManager;
-import org.apache.directory.mavibot.btree.Tuple;
-import org.apache.directory.mavibot.btree.TupleCursor;
-import org.apache.directory.mavibot.btree.ValueCursor;
 import org.apache.directory.mavibot.btree.exception.BTreeAlreadyManagedException;
 import org.apache.directory.mavibot.btree.exception.KeyNotFoundException;
 import org.apache.directory.mavibot.btree.serializer.LongSerializer;
@@ -54,7 +49,7 @@ import org.junit.rules.TemporaryFolder;
 
 /**
  * test the RecordManager
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class RecordManagerTest
@@ -74,12 +69,14 @@ public class RecordManagerTest
     {
         dataDir = tempFolder.newFolder( UUID.randomUUID().toString() );
 
+        System.out.println( dataDir + "/mavibot.db" );
+
         openRecordManagerAndBtree();
 
         try
         {
             // Create a new BTree
-            btree = recordManager.addBTree( "test", new LongSerializer(), new StringSerializer(), false );
+            btree = recordManager.addBTree( "test", LongSerializer.INSTANCE, StringSerializer.INSTANCE, false );
         }
         catch ( Exception e )
         {
@@ -126,7 +123,7 @@ public class RecordManagerTest
 
 
     /**
-     * Test the creation of a RecordManager, and that we can read it back.  
+     * Test the creation of a RecordManager, and that we can read it back.
      */
     @Test
     public void testRecordManager() throws IOException, BTreeAlreadyManagedException
@@ -397,7 +394,7 @@ public class RecordManagerTest
 
 
     /**
-     * Test the creation of a RecordManager with a BTree containing data, where we keep the revisions, 
+     * Test the creation of a RecordManager with a BTree containing data, where we keep the revisions,
      * and browse the BTree.
      */
     @Test
@@ -468,7 +465,7 @@ public class RecordManagerTest
 
 
     /**
-     * Test the creation of a RecordManager with a BTree containing data, where we keep the revision, and 
+     * Test the creation of a RecordManager with a BTree containing data, where we keep the revision, and
      * we browse from a key
      */
     @Test
@@ -848,8 +845,8 @@ public class RecordManagerTest
         String[] testValues = new String[]
             { "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0A", "0B", "0C", "0D", "0E", "0F", "10" };
 
-        BTree<Long, String> dupsTree = BTreeFactory.createPersistedBTree( name, new LongSerializer(),
-            new StringSerializer(), pageSize, true );
+        BTree<Long, String> dupsTree = BTreeFactory.createPersistedBTree( name, LongSerializer.INSTANCE,
+            StringSerializer.INSTANCE, pageSize, true );
 
         recordManager.manage( dupsTree );
 

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerWithDuplicatesTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerWithDuplicatesTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerWithDuplicatesTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerWithDuplicatesTest.java Mon Feb 10 15:35:18 2014
@@ -30,8 +30,6 @@ import java.util.Set;
 import java.util.UUID;
 
 import org.apache.commons.io.FileUtils;
-import org.apache.directory.mavibot.btree.BTree;
-import org.apache.directory.mavibot.btree.RecordManager;
 import org.apache.directory.mavibot.btree.exception.BTreeAlreadyManagedException;
 import org.apache.directory.mavibot.btree.exception.KeyNotFoundException;
 import org.apache.directory.mavibot.btree.serializer.LongSerializer;
@@ -45,7 +43,7 @@ import org.junit.rules.TemporaryFolder;
 
 /**
  * test the RecordManager whith duplicate values
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class RecordManagerWithDuplicatesTest
@@ -70,7 +68,7 @@ public class RecordManagerWithDuplicates
         try
         {
             // Create a new BTree which allows duplicate values
-            btree = recordManager.addBTree( "test", new LongSerializer(), new StringSerializer(), true );
+            btree = recordManager.addBTree( "test", LongSerializer.INSTANCE, StringSerializer.INSTANCE, true );
         }
         catch ( Exception e )
         {
@@ -114,7 +112,7 @@ public class RecordManagerWithDuplicates
 
 
     /**
-     * Test the creation of a RecordManager, and that we can read it back.  
+     * Test the creation of a RecordManager, and that we can read it back.
      */
     @Test
     public void testRecordManager() throws IOException, BTreeAlreadyManagedException

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/RevisionNameComparatorTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/RevisionNameComparatorTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/RevisionNameComparatorTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/RevisionNameComparatorTest.java Mon Feb 10 15:35:18 2014
@@ -22,14 +22,12 @@ package org.apache.directory.mavibot.btr
 
 import static org.junit.Assert.assertEquals;
 
-import org.apache.directory.mavibot.btree.RevisionName;
-import org.apache.directory.mavibot.btree.RevisionNameComparator;
 import org.junit.Test;
 
 
 /**
  * Test the RevisionNameComparator class
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class RevisionNameComparatorTest
@@ -37,7 +35,7 @@ public class RevisionNameComparatorTest
     @Test
     public void testRevisionNameComparator()
     {
-        RevisionNameComparator comparator = new RevisionNameComparator();
+        RevisionNameComparator comparator = RevisionNameComparator.INSTANCE;
 
         assertEquals( 0, comparator.compare( null, null ) );
         assertEquals( 0, comparator.compare( new RevisionName( 0L, "test" ), new RevisionName( 0L, "test" ) ) );

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/RevisionNameSerializerTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/RevisionNameSerializerTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/RevisionNameSerializerTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/RevisionNameSerializerTest.java Mon Feb 10 15:35:18 2014
@@ -26,8 +26,6 @@ import static org.junit.Assert.fail;
 
 import java.io.IOException;
 
-import org.apache.directory.mavibot.btree.RevisionName;
-import org.apache.directory.mavibot.btree.RevisionNameSerializer;
 import org.apache.directory.mavibot.btree.serializer.BufferHandler;
 import org.apache.directory.mavibot.btree.serializer.LongSerializer;
 import org.apache.directory.mavibot.btree.serializer.StringSerializer;
@@ -36,12 +34,12 @@ import org.junit.Test;
 
 /**
  * Test the RevisionNameSerializer class
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class RevisionNameSerializerTest
 {
-    private static RevisionNameSerializer serializer = new RevisionNameSerializer();
+    private static RevisionNameSerializer serializer = RevisionNameSerializer.INSTANCE;
 
 
     @Test

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/BooleanArrayComparatorTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/BooleanArrayComparatorTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/BooleanArrayComparatorTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/BooleanArrayComparatorTest.java Mon Feb 10 15:35:18 2014
@@ -27,7 +27,7 @@ import org.junit.Test;
 
 /**
  * Test the BooleanArrayComparator class
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class BooleanArrayComparatorTest
@@ -35,7 +35,7 @@ public class BooleanArrayComparatorTest
     @Test
     public void testBooleanArrayComparator()
     {
-        BooleanArrayComparator comparator = new BooleanArrayComparator();
+        BooleanArrayComparator comparator = BooleanArrayComparator.INSTANCE;
 
         assertEquals( 0, comparator.compare( null, null ) );
 

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/BooleanComparatorTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/BooleanComparatorTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/BooleanComparatorTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/BooleanComparatorTest.java Mon Feb 10 15:35:18 2014
@@ -27,7 +27,7 @@ import org.junit.Test;
 
 /**
  * Test the BooleanComparator class
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class BooleanComparatorTest
@@ -35,7 +35,7 @@ public class BooleanComparatorTest
     @Test
     public void testBooleanComparator()
     {
-        BooleanComparator comparator = new BooleanComparator();
+        BooleanComparator comparator = BooleanComparator.INSTANCE;
 
         assertEquals( 0, comparator.compare( null, null ) );
         assertEquals( 0, comparator.compare( true, true ) );

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/ByteArrayComparatorTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/ByteArrayComparatorTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/ByteArrayComparatorTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/ByteArrayComparatorTest.java Mon Feb 10 15:35:18 2014
@@ -27,7 +27,7 @@ import org.junit.Test;
 
 /**
  * Test the ByteArrayComparator class
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class ByteArrayComparatorTest
@@ -35,7 +35,7 @@ public class ByteArrayComparatorTest
     @Test
     public void testByteArrayComparator()
     {
-        ByteArrayComparator comparator = new ByteArrayComparator();
+        ByteArrayComparator comparator = ByteArrayComparator.INSTANCE;
 
         // Check equality
         assertEquals( 0, comparator.compare( null, null ) );

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/ByteComparatorTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/ByteComparatorTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/ByteComparatorTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/ByteComparatorTest.java Mon Feb 10 15:35:18 2014
@@ -27,7 +27,7 @@ import org.junit.Test;
 
 /**
  * Test the ByteComparator class
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class ByteComparatorTest
@@ -35,7 +35,7 @@ public class ByteComparatorTest
     @Test
     public void testByteComparator()
     {
-        ByteComparator comparator = new ByteComparator();
+        ByteComparator comparator = ByteComparator.INSTANCE;
 
         assertEquals( 0, comparator.compare( null, null ) );
         assertEquals( 0, comparator.compare( ( byte ) 0x00, ( byte ) 0x00 ) );

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/CharArrayComparatorTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/CharArrayComparatorTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/CharArrayComparatorTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/CharArrayComparatorTest.java Mon Feb 10 15:35:18 2014
@@ -27,7 +27,7 @@ import org.junit.Test;
 
 /**
  * Test the CharArrayComparator class
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class CharArrayComparatorTest
@@ -35,7 +35,7 @@ public class CharArrayComparatorTest
     @Test
     public void testCharArrayComparator()
     {
-        CharArrayComparator comparator = new CharArrayComparator();
+        CharArrayComparator comparator = CharArrayComparator.INSTANCE;
 
         // Check equality
         assertEquals( 0, comparator.compare( null, null ) );

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/CharComparatorTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/CharComparatorTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/CharComparatorTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/CharComparatorTest.java Mon Feb 10 15:35:18 2014
@@ -27,7 +27,7 @@ import org.junit.Test;
 
 /**
  * Test the CharComparator class
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class CharComparatorTest
@@ -35,7 +35,7 @@ public class CharComparatorTest
     @Test
     public void testCharComparator()
     {
-        CharComparator comparator = new CharComparator();
+        CharComparator comparator = CharComparator.INSTANCE;
 
         assertEquals( 0, comparator.compare( null, null ) );
         assertEquals( 0, comparator.compare( 'a', 'a' ) );

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/IntArrayComparatorTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/IntArrayComparatorTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/IntArrayComparatorTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/IntArrayComparatorTest.java Mon Feb 10 15:35:18 2014
@@ -27,7 +27,7 @@ import org.junit.Test;
 
 /**
  * Test the IntArrayComparator class
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class IntArrayComparatorTest
@@ -35,7 +35,7 @@ public class IntArrayComparatorTest
     @Test
     public void testIntArrayComparator()
     {
-        IntArrayComparator comparator = new IntArrayComparator();
+        IntArrayComparator comparator = IntArrayComparator.INSTANCE;
 
         // Check equality
         assertEquals( 0, comparator.compare( null, null ) );

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/IntComparatorTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/IntComparatorTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/IntComparatorTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/IntComparatorTest.java Mon Feb 10 15:35:18 2014
@@ -27,7 +27,7 @@ import org.junit.Test;
 
 /**
  * Test the IntComparator class
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class IntComparatorTest
@@ -35,7 +35,7 @@ public class IntComparatorTest
     @Test
     public void testIntComparator()
     {
-        IntComparator comparator = new IntComparator();
+        IntComparator comparator = IntComparator.INSTANCE;
 
         assertEquals( 0, comparator.compare( null, null ) );
         assertEquals( 0, comparator.compare( 1, 1 ) );

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/LongArrayComparatorTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/LongArrayComparatorTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/LongArrayComparatorTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/LongArrayComparatorTest.java Mon Feb 10 15:35:18 2014
@@ -27,7 +27,7 @@ import org.junit.Test;
 
 /**
  * Test the LongArrayComparator class
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class LongArrayComparatorTest
@@ -35,7 +35,7 @@ public class LongArrayComparatorTest
     @Test
     public void testLongArrayComparator()
     {
-        LongArrayComparator comparator = new LongArrayComparator();
+        LongArrayComparator comparator = LongArrayComparator.INSTANCE;
 
         // Check equality
         assertEquals( 0, comparator.compare( null, null ) );

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/LongComparatorTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/LongComparatorTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/LongComparatorTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/LongComparatorTest.java Mon Feb 10 15:35:18 2014
@@ -27,7 +27,7 @@ import org.junit.Test;
 
 /**
  * Test the LongComparator class
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class LongComparatorTest
@@ -35,7 +35,7 @@ public class LongComparatorTest
     @Test
     public void testLongComparator()
     {
-        LongComparator comparator = new LongComparator();
+        LongComparator comparator = LongComparator.INSTANCE;
 
         assertEquals( 0, comparator.compare( null, null ) );
         assertEquals( 0, comparator.compare( 1L, 1L ) );

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/ShortArrayComparatorTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/ShortArrayComparatorTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/ShortArrayComparatorTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/ShortArrayComparatorTest.java Mon Feb 10 15:35:18 2014
@@ -27,7 +27,7 @@ import org.junit.Test;
 
 /**
  * Test the ShortArrayComparator class
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class ShortArrayComparatorTest
@@ -35,7 +35,7 @@ public class ShortArrayComparatorTest
     @Test
     public void testShortArrayComparator()
     {
-        ShortArrayComparator comparator = new ShortArrayComparator();
+        ShortArrayComparator comparator = ShortArrayComparator.INSTANCE;
 
         // Check equality
         assertEquals( 0, comparator.compare( null, null ) );

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/ShortComparatorTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/ShortComparatorTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/ShortComparatorTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/ShortComparatorTest.java Mon Feb 10 15:35:18 2014
@@ -27,7 +27,7 @@ import org.junit.Test;
 
 /**
  * Test the ShortComparator class
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class ShortComparatorTest
@@ -35,7 +35,7 @@ public class ShortComparatorTest
     @Test
     public void testShortComparator()
     {
-        ShortComparator comparator = new ShortComparator();
+        ShortComparator comparator = ShortComparator.INSTANCE;
 
         assertEquals( 0, comparator.compare( null, null ) );
         assertEquals( 0, comparator.compare( ( short ) 1, ( short ) 1 ) );

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/StringComparatorTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/StringComparatorTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/StringComparatorTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/comparator/StringComparatorTest.java Mon Feb 10 15:35:18 2014
@@ -27,7 +27,7 @@ import org.junit.Test;
 
 /**
  * Test the StringComparator class
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class StringComparatorTest
@@ -35,7 +35,7 @@ public class StringComparatorTest
     @Test
     public void testStringComparator()
     {
-        StringComparator comparator = new StringComparator();
+        StringComparator comparator = StringComparator.INSTANCE;
 
         assertEquals( 0, comparator.compare( null, null ) );
         assertEquals( 0, comparator.compare( "", "" ) );

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/BooleanSerializerTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/BooleanSerializerTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/BooleanSerializerTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/BooleanSerializerTest.java Mon Feb 10 15:35:18 2014
@@ -29,12 +29,12 @@ import org.junit.Test;
 
 /**
  * Test the BooleanSerializer class
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class BooleanSerializerTest
 {
-    private static BooleanSerializer serializer = new BooleanSerializer();
+    private static BooleanSerializer serializer = BooleanSerializer.INSTANCE;
 
 
     @Test

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/ByteArraySerializerTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/ByteArraySerializerTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/ByteArraySerializerTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/ByteArraySerializerTest.java Mon Feb 10 15:35:18 2014
@@ -31,12 +31,12 @@ import org.junit.Test;
 
 /**
  * Test the BytesSerializer class
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class ByteArraySerializerTest
 {
-    private static ByteArraySerializer serializer = new ByteArraySerializer();
+    private static ByteArraySerializer serializer = ByteArraySerializer.INSTANCE;
 
 
     @Test

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/ByteSerializerTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/ByteSerializerTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/ByteSerializerTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/ByteSerializerTest.java Mon Feb 10 15:35:18 2014
@@ -29,12 +29,12 @@ import org.junit.Test;
 
 /**
  * Test the ByteSerializer class
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class ByteSerializerTest
 {
-    private static ByteSerializer serializer = new ByteSerializer();
+    private static ByteSerializer serializer = ByteSerializer.INSTANCE;
 
 
     @Test

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/CharSerializerTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/CharSerializerTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/CharSerializerTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/CharSerializerTest.java Mon Feb 10 15:35:18 2014
@@ -29,12 +29,12 @@ import org.junit.Test;
 
 /**
  * Test the CharSerializer class
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class CharSerializerTest
 {
-    private static CharSerializer serializer = new CharSerializer();
+    private static CharSerializer serializer = CharSerializer.INSTANCE;
 
 
     @Test

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/IntSerializerTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/IntSerializerTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/IntSerializerTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/IntSerializerTest.java Mon Feb 10 15:35:18 2014
@@ -29,12 +29,12 @@ import org.junit.Test;
 
 /**
  * Test the IntSerializer class
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class IntSerializerTest
 {
-    private static IntSerializer serializer = new IntSerializer();
+    private static IntSerializer serializer = IntSerializer.INSTANCE;
 
 
     @Test

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/LongSerializerTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/LongSerializerTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/LongSerializerTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/LongSerializerTest.java Mon Feb 10 15:35:18 2014
@@ -29,14 +29,11 @@ import org.junit.Test;
 
 /**
  * Test the LongSerializer class
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class LongSerializerTest
 {
-    private static LongSerializer serializer = new LongSerializer();
-
-
     @Test
     public void testLongSerializer() throws IOException
     {
@@ -52,7 +49,7 @@ public class LongSerializerTest
         assertEquals( ( byte ) 0x00, result[1] );
         assertEquals( ( byte ) 0x00, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
+        assertEquals( value, LongSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).longValue() );
 
         // ------------------------------------------------------------------
         value = 0x0000000000000001L;
@@ -67,7 +64,7 @@ public class LongSerializerTest
         assertEquals( ( byte ) 0x00, result[1] );
         assertEquals( ( byte ) 0x00, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
+        assertEquals( value, LongSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).longValue() );
 
         // ------------------------------------------------------------------
         value = 0x00000000000000FFL;
@@ -82,7 +79,7 @@ public class LongSerializerTest
         assertEquals( ( byte ) 0x00, result[1] );
         assertEquals( ( byte ) 0x00, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
+        assertEquals( value, LongSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).longValue() );
 
         // ------------------------------------------------------------------
         value = 0x0000000000000100L;
@@ -97,7 +94,7 @@ public class LongSerializerTest
         assertEquals( ( byte ) 0x00, result[1] );
         assertEquals( ( byte ) 0x00, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
+        assertEquals( value, LongSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).longValue() );
 
         // ------------------------------------------------------------------
         value = 0x000000000000FFFFL;
@@ -112,7 +109,7 @@ public class LongSerializerTest
         assertEquals( ( byte ) 0x00, result[1] );
         assertEquals( ( byte ) 0x00, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
+        assertEquals( value, LongSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).longValue() );
 
         // ------------------------------------------------------------------
         value = 0x0000000000010000L;
@@ -127,7 +124,7 @@ public class LongSerializerTest
         assertEquals( ( byte ) 0x00, result[1] );
         assertEquals( ( byte ) 0x00, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
+        assertEquals( value, LongSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).longValue() );
 
         // ------------------------------------------------------------------
         value = 0x0000000000FFFFFFL;
@@ -142,7 +139,7 @@ public class LongSerializerTest
         assertEquals( ( byte ) 0x00, result[1] );
         assertEquals( ( byte ) 0x00, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
+        assertEquals( value, LongSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).longValue() );
 
         // ------------------------------------------------------------------
         value = 0x0000000001000000L;
@@ -157,7 +154,7 @@ public class LongSerializerTest
         assertEquals( ( byte ) 0x00, result[1] );
         assertEquals( ( byte ) 0x00, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
+        assertEquals( value, LongSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).longValue() );
 
         // ------------------------------------------------------------------
         value = 0x000000007FFFFFFFL;
@@ -172,7 +169,7 @@ public class LongSerializerTest
         assertEquals( ( byte ) 0x00, result[1] );
         assertEquals( ( byte ) 0x00, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
+        assertEquals( value, LongSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).longValue() );
 
         // ------------------------------------------------------------------
         value = 0x0000000080000000L;
@@ -187,7 +184,7 @@ public class LongSerializerTest
         assertEquals( ( byte ) 0x00, result[1] );
         assertEquals( ( byte ) 0x00, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
+        assertEquals( value, LongSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).longValue() );
 
         // ------------------------------------------------------------------
         value = 0x00000000FFFFFFFFL;
@@ -202,7 +199,7 @@ public class LongSerializerTest
         assertEquals( ( byte ) 0x00, result[1] );
         assertEquals( ( byte ) 0x00, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
+        assertEquals( value, LongSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).longValue() );
 
         // ------------------------------------------------------------------
         value = 0x0000000100000000L;
@@ -217,7 +214,7 @@ public class LongSerializerTest
         assertEquals( ( byte ) 0x00, result[1] );
         assertEquals( ( byte ) 0x00, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
+        assertEquals( value, LongSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).longValue() );
 
         // ------------------------------------------------------------------
         value = 0x000000FFFFFFFFFFL;
@@ -232,7 +229,7 @@ public class LongSerializerTest
         assertEquals( ( byte ) 0x00, result[1] );
         assertEquals( ( byte ) 0x00, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
+        assertEquals( value, LongSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).longValue() );
 
         // ------------------------------------------------------------------
         value = 0x0000010000000000L;
@@ -247,7 +244,7 @@ public class LongSerializerTest
         assertEquals( ( byte ) 0x00, result[1] );
         assertEquals( ( byte ) 0x00, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
+        assertEquals( value, LongSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).longValue() );
 
         // ------------------------------------------------------------------
         value = 0x0000FFFFFFFFFFFFL;
@@ -262,7 +259,7 @@ public class LongSerializerTest
         assertEquals( ( byte ) 0x00, result[1] );
         assertEquals( ( byte ) 0x00, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
+        assertEquals( value, LongSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).longValue() );
 
         // ------------------------------------------------------------------
         value = 0x0001000000000000L;
@@ -277,7 +274,7 @@ public class LongSerializerTest
         assertEquals( ( byte ) 0x01, result[1] );
         assertEquals( ( byte ) 0x00, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
+        assertEquals( value, LongSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).longValue() );
 
         // ------------------------------------------------------------------
         value = 0x00FFFFFFFFFFFFFFL;
@@ -292,7 +289,7 @@ public class LongSerializerTest
         assertEquals( ( byte ) 0xFF, result[1] );
         assertEquals( ( byte ) 0x00, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
+        assertEquals( value, LongSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).longValue() );
 
         // ------------------------------------------------------------------
         value = 0x0100000000000000L;
@@ -307,7 +304,7 @@ public class LongSerializerTest
         assertEquals( ( byte ) 0x00, result[1] );
         assertEquals( ( byte ) 0x01, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
+        assertEquals( value, LongSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).longValue() );
 
         // ------------------------------------------------------------------
         value = 0x7FFFFFFFFFFFFFFFL;
@@ -322,7 +319,7 @@ public class LongSerializerTest
         assertEquals( ( byte ) 0xFF, result[1] );
         assertEquals( ( byte ) 0x7F, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
+        assertEquals( value, LongSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).longValue() );
 
         // ------------------------------------------------------------------
         value = 0x8000000000000000L;
@@ -337,7 +334,7 @@ public class LongSerializerTest
         assertEquals( ( byte ) 0x00, result[1] );
         assertEquals( ( byte ) 0x80, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
+        assertEquals( value, LongSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).longValue() );
 
         // ------------------------------------------------------------------
         value = 0xFFFFFFFFFFFFFFFFL;
@@ -352,6 +349,6 @@ public class LongSerializerTest
         assertEquals( ( byte ) 0xFF, result[1] );
         assertEquals( ( byte ) 0xFF, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
+        assertEquals( value, LongSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).longValue() );
     }
 }

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/ShortSerializerTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/ShortSerializerTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/ShortSerializerTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/ShortSerializerTest.java Mon Feb 10 15:35:18 2014
@@ -29,14 +29,11 @@ import org.junit.Test;
 
 /**
  * Test the ShortSerializer class
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class ShortSerializerTest
 {
-    private static ShortSerializer serializer = new ShortSerializer();
-
-
     @Test
     public void testShortSerializer() throws IOException
     {
@@ -46,7 +43,7 @@ public class ShortSerializerTest
         assertEquals( ( byte ) 0x00, result[1] );
         assertEquals( ( byte ) 0x00, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).shortValue() );
+        assertEquals( value, ShortSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).shortValue() );
 
         // ------------------------------------------------------------------
         value = 0x0001;
@@ -55,7 +52,7 @@ public class ShortSerializerTest
         assertEquals( ( byte ) 0x01, result[1] );
         assertEquals( ( byte ) 0x00, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).shortValue() );
+        assertEquals( value, ShortSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).shortValue() );
 
         // ------------------------------------------------------------------
         value = 0x00FF;
@@ -64,7 +61,7 @@ public class ShortSerializerTest
         assertEquals( ( byte ) 0xFF, result[1] );
         assertEquals( ( byte ) 0x00, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).shortValue() );
+        assertEquals( value, ShortSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).shortValue() );
 
         // ------------------------------------------------------------------
         value = 0x0100;
@@ -73,7 +70,7 @@ public class ShortSerializerTest
         assertEquals( ( byte ) 0x00, result[1] );
         assertEquals( ( byte ) 0x01, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).shortValue() );
+        assertEquals( value, ShortSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).shortValue() );
 
         // ------------------------------------------------------------------
         value = 0x7FFF;
@@ -82,7 +79,7 @@ public class ShortSerializerTest
         assertEquals( ( byte ) 0xFF, result[1] );
         assertEquals( ( byte ) 0x7F, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).shortValue() );
+        assertEquals( value, ShortSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).shortValue() );
 
         // ------------------------------------------------------------------
         value = ( short ) 0x8000;
@@ -91,7 +88,7 @@ public class ShortSerializerTest
         assertEquals( ( byte ) 0x00, result[1] );
         assertEquals( ( byte ) 0x80, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).shortValue() );
+        assertEquals( value, ShortSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).shortValue() );
 
         // ------------------------------------------------------------------
         value = ( short ) 0xFFFF;
@@ -100,6 +97,6 @@ public class ShortSerializerTest
         assertEquals( ( byte ) 0xFF, result[1] );
         assertEquals( ( byte ) 0xFF, result[0] );
 
-        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).shortValue() );
+        assertEquals( value, ShortSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).shortValue() );
     }
 }

Modified: directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/StringSerializerTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/StringSerializerTest.java?rev=1566659&r1=1566658&r2=1566659&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/StringSerializerTest.java (original)
+++ directory/mavibot/branches/with-txns/mavibot/src/test/java/org/apache/directory/mavibot/btree/serializer/StringSerializerTest.java Mon Feb 10 15:35:18 2014
@@ -29,12 +29,12 @@ import org.junit.Test;
 
 /**
  * Test the StringSerializer class
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class StringSerializerTest
 {
-    private static StringSerializer serializer = new StringSerializer();
+    private static StringSerializer serializer = StringSerializer.INSTANCE;
 
 
     @Test



Mime
View raw message