directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1378574 [6/6] - in /directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src: main/java/org/apache/directory/server/core/partition/impl/avl/ main/java/org/apache/directory/server/core/partition/impl/btree/ main/java/org/apache/director...
Date Wed, 29 Aug 2012 14:23:11 GMT
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java?rev=1378574&r1=1378573&r2=1378574&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java Wed Aug 29 14:23:08 2012
@@ -26,6 +26,7 @@ import static org.junit.Assert.assertTru
 import static org.junit.Assert.fail;
 
 import java.io.File;
+import java.util.UUID;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.directory.server.core.api.partition.Partition;
@@ -46,6 +47,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.schemaextractor.impl.DefaultSchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schemaloader.LdifSchemaLoader;
 import org.apache.directory.shared.ldap.schemamanager.impl.DefaultSchemaManager;
+import org.apache.directory.shared.util.Strings;
 import org.apache.directory.shared.util.exception.Exceptions;
 import org.junit.After;
 import org.junit.Before;
@@ -65,7 +67,7 @@ public class SubstringTest
     private static final Logger LOG = LoggerFactory.getLogger( SubstringTest.class.getSimpleName() );
 
     File wkdir;
-    Store<Entry, Long> store;
+    Store<Entry> store;
     static SchemaManager schemaManager = null;
 
 
@@ -155,8 +157,8 @@ public class SubstringTest
     public void testIndexedCnStartsWithJ() throws Exception
     {
         SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "cn" ), "j", null );
-        SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        SubstringCursor<Long> cursor = new SubstringCursor<Long>( store, evaluator );
+        SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager );
+        SubstringCursor cursor = new SubstringCursor( store, evaluator );
 
         assertEquals( node, evaluator.getExpression() );
 
@@ -164,29 +166,29 @@ public class SubstringTest
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 8, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 8 ), cursor.get().getId() );
         assertEquals( "jack daniels", cursor.get().getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 5 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 11, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 11 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
@@ -198,33 +200,33 @@ public class SubstringTest
 
         // ---------- test first ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.first();
 
         assertTrue( cursor.available() );
-        assertEquals( 8, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 8 ), cursor.get().getId() );
         assertEquals( "jack daniels", cursor.get().getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 5 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 11, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 11 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
@@ -233,35 +235,35 @@ public class SubstringTest
 
         // ---------- test afterLast ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.afterLast();
         assertFalse( cursor.available() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 11, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 11 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 5 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 8, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 8 ), cursor.get().getId() );
         assertEquals( "jack daniels", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
@@ -270,33 +272,33 @@ public class SubstringTest
 
         // ---------- test last ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.last();
         assertTrue( cursor.available() );
 
-        assertEquals( 11, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 11 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 5 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 8, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 8 ), cursor.get().getId() );
         assertEquals( "jack daniels", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
@@ -309,8 +311,8 @@ public class SubstringTest
     public void testIndexedCnStartsWithJim() throws Exception
     {
         SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "cn" ), "jim", null );
-        SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        SubstringCursor<Long> cursor = new SubstringCursor<Long>( store, evaluator );
+        SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager );
+        SubstringCursor cursor = new SubstringCursor( store, evaluator );
 
         assertEquals( node, evaluator.getExpression() );
 
@@ -318,15 +320,15 @@ public class SubstringTest
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
@@ -335,19 +337,19 @@ public class SubstringTest
 
         // ---------- test first ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.first();
 
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
@@ -356,21 +358,21 @@ public class SubstringTest
 
         // ---------- test afterLast ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.afterLast();
         assertFalse( cursor.available() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
@@ -379,19 +381,19 @@ public class SubstringTest
 
         // ---------- test last ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.last();
         assertTrue( cursor.available() );
 
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
@@ -404,8 +406,8 @@ public class SubstringTest
     public void testIndexedCnEndsWithBean() throws Exception
     {
         SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "cn" ), null, "bean" );
-        SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        SubstringCursor<Long> cursor = new SubstringCursor<Long>( store, evaluator );
+        SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager );
+        SubstringCursor cursor = new SubstringCursor( store, evaluator );
 
         assertEquals( node, evaluator.getExpression() );
 
@@ -413,37 +415,37 @@ public class SubstringTest
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
-        
+
         cursor.close();
 
         // ---------- test first ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.first();
 
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
@@ -452,21 +454,21 @@ public class SubstringTest
 
         // ---------- test afterLast ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.afterLast();
         assertFalse( cursor.available() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
@@ -475,19 +477,19 @@ public class SubstringTest
 
         // ---------- test last ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.last();
         assertTrue( cursor.available() );
 
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
@@ -500,8 +502,8 @@ public class SubstringTest
     public void testNonIndexedSnStartsWithB() throws Exception
     {
         SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "sn" ), "b", null );
-        SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        SubstringCursor<Long> cursor = new SubstringCursor<Long>( store, evaluator );
+        SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager );
+        SubstringCursor cursor = new SubstringCursor( store, evaluator );
 
         assertEquals( node, evaluator.getExpression() );
 
@@ -509,7 +511,7 @@ public class SubstringTest
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "bean", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
@@ -518,11 +520,11 @@ public class SubstringTest
 
         // ---------- test first ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.first();
 
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "bean", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
@@ -531,13 +533,13 @@ public class SubstringTest
 
         // ---------- test afterLast ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.afterLast();
         assertFalse( cursor.available() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "bean", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
@@ -546,12 +548,12 @@ public class SubstringTest
 
         // ---------- test last ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.last();
         assertTrue( cursor.available() );
 
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "bean", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
@@ -564,8 +566,8 @@ public class SubstringTest
     public void testIndexedSnEndsWithEr() throws Exception
     {
         SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "sn" ), null, "er" );
-        SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        SubstringCursor<Long> cursor = new SubstringCursor<Long>( store, evaluator );
+        SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager );
+        SubstringCursor cursor = new SubstringCursor( store, evaluator );
 
         assertEquals( node, evaluator.getExpression() );
 
@@ -573,7 +575,7 @@ public class SubstringTest
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 5 ), cursor.get().getId() );
         assertEquals( "walker", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
@@ -582,11 +584,11 @@ public class SubstringTest
 
         // ---------- test first ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.first();
 
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 5 ), cursor.get().getId() );
         assertEquals( "walker", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
@@ -595,13 +597,13 @@ public class SubstringTest
 
         // ---------- test afterLast ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.afterLast();
         assertFalse( cursor.available() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 5 ), cursor.get().getId() );
         assertEquals( "walker", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
@@ -610,12 +612,12 @@ public class SubstringTest
 
         // ---------- test last ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.last();
         assertTrue( cursor.available() );
 
         assertTrue( cursor.available() );
-        assertEquals( 5L, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 5L ), cursor.get().getId() );
         assertEquals( "walker", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
@@ -628,50 +630,50 @@ public class SubstringTest
     public void testNonIndexedAttributes() throws Exception
     {
         SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "sn" ), "walk", null );
-        SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        ForwardIndexEntry<String, Long> indexEntry = new ForwardIndexEntry<String, Long>();
-        indexEntry.setId( 5L );
+        SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager );
+        ForwardIndexEntry<String, UUID> indexEntry = new ForwardIndexEntry<String, UUID>();
+        indexEntry.setId( Strings.getUUID( 5L ) );
         assertTrue( evaluator.evaluate( indexEntry ) );
-        indexEntry.setId( 3L );
+        indexEntry.setId( Strings.getUUID( 3L ) );
         indexEntry.setEntry( null );
         assertFalse( evaluator.evaluate( indexEntry ) );
-        indexEntry.setId( 6L );
+        indexEntry.setId( Strings.getUUID( 6L ) );
         indexEntry.setEntry( null );
         assertFalse( evaluator.evaluate( indexEntry ) );
 
         node = new SubstringNode( schemaManager.getAttributeType( "sn" ), "wa", null );
-        evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        indexEntry = new ForwardIndexEntry<String, Long>();
-        indexEntry.setId( 5L );
-        indexEntry.setEntry( store.lookup( 5L ) );
+        evaluator = new SubstringEvaluator( node, store, schemaManager );
+        indexEntry = new ForwardIndexEntry<String, UUID>();
+        indexEntry.setId( Strings.getUUID( 5L ) );
+        indexEntry.setEntry( store.lookup( Strings.getUUID( 5L ) ) );
         assertTrue( evaluator.evaluate( indexEntry ) );
 
         node = new SubstringNode( schemaManager.getAttributeType( "searchGuide" ), "j", null );
-        evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        indexEntry = new ForwardIndexEntry<String, Long>();
-        indexEntry.setId( 6L );
-        indexEntry.setEntry( store.lookup( 6L ) );
+        evaluator = new SubstringEvaluator( node, store, schemaManager );
+        indexEntry = new ForwardIndexEntry<String, UUID>();
+        indexEntry.setId( Strings.getUUID( 6L ) );
+        indexEntry.setEntry( store.lookup( Strings.getUUID( 6L ) ) );
         assertFalse( evaluator.evaluate( indexEntry ) );
 
         node = new SubstringNode( schemaManager.getAttributeType( "st" ), "j", null );
-        evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        indexEntry = new ForwardIndexEntry<String, Long>();
-        indexEntry.setId( 6L );
-        indexEntry.setEntry( store.lookup( 6L ) );
+        evaluator = new SubstringEvaluator( node, store, schemaManager );
+        indexEntry = new ForwardIndexEntry<String, UUID>();
+        indexEntry.setId( Strings.getUUID( 6L ) );
+        indexEntry.setEntry( store.lookup( Strings.getUUID( 6L ) ) );
         assertFalse( evaluator.evaluate( indexEntry ) );
 
         node = new SubstringNode( schemaManager.getAttributeType( "name" ), "j", null );
-        evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        indexEntry = new ForwardIndexEntry<String, Long>();
-        indexEntry.setId( 6L );
-        indexEntry.setEntry( store.lookup( 6L ) );
+        evaluator = new SubstringEvaluator( node, store, schemaManager );
+        indexEntry = new ForwardIndexEntry<String, UUID>();
+        indexEntry.setId( Strings.getUUID( 6L ) );
+        indexEntry.setEntry( store.lookup( Strings.getUUID( 6L ) ) );
         assertTrue( evaluator.evaluate( indexEntry ) );
 
         node = new SubstringNode( schemaManager.getAttributeType( "name" ), "s", null );
-        evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        indexEntry = new ForwardIndexEntry<String, Long>();
-        indexEntry.setId( 6L );
-        indexEntry.setEntry( store.lookup( 6L ) );
+        evaluator = new SubstringEvaluator( node, store, schemaManager );
+        indexEntry = new ForwardIndexEntry<String, UUID>();
+        indexEntry.setId( Strings.getUUID( 6L ) );
+        indexEntry.setEntry( store.lookup( Strings.getUUID( 6L ) ) );
         assertTrue( evaluator.evaluate( indexEntry ) );
     }
 
@@ -680,26 +682,26 @@ public class SubstringTest
     public void testEvaluatorIndexed() throws Exception
     {
         SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "cn" ), "jim", null );
-        SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        ForwardIndexEntry<String, Long> indexEntry = new ForwardIndexEntry<String, Long>();
-        indexEntry.setId( 6L );
+        SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager );
+        ForwardIndexEntry<String, UUID> indexEntry = new ForwardIndexEntry<String, UUID>();
+        indexEntry.setId( Strings.getUUID( 6L ) );
         assertTrue( evaluator.evaluate( indexEntry ) );
-        indexEntry.setId( 3L );
+        indexEntry.setId( Strings.getUUID( 3L ) );
         indexEntry.setEntry( null );
         assertFalse( evaluator.evaluate( indexEntry ) );
 
         node = new SubstringNode( schemaManager.getAttributeType( "cn" ), "j", null );
-        evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        indexEntry = new ForwardIndexEntry<String, Long>();
-        indexEntry.setId( 6L );
-        indexEntry.setEntry( store.lookup( 6L ) );
+        evaluator = new SubstringEvaluator( node, store, schemaManager );
+        indexEntry = new ForwardIndexEntry<String, UUID>();
+        indexEntry.setId( Strings.getUUID( 6L ) );
+        indexEntry.setEntry( store.lookup( Strings.getUUID( 6L ) ) );
         assertTrue( evaluator.evaluate( indexEntry ) );
 
         node = new SubstringNode( schemaManager.getAttributeType( "cn" ), "s", null );
-        evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        indexEntry = new ForwardIndexEntry<String, Long>();
-        indexEntry.setId( 6L );
-        indexEntry.setEntry( store.lookup( 6L ) );
+        evaluator = new SubstringEvaluator( node, store, schemaManager );
+        indexEntry = new ForwardIndexEntry<String, UUID>();
+        indexEntry.setId( Strings.getUUID( 6L ) );
+        indexEntry.setEntry( store.lookup( Strings.getUUID( 6L ) ) );
         assertFalse( evaluator.evaluate( indexEntry ) );
     }
 
@@ -713,13 +715,13 @@ public class SubstringTest
     @Test(expected = InvalidCursorPositionException.class)
     public void testInvalidCursorPositionException() throws Exception
     {
-        SubstringCursor<Long> cursor = null;
-    
+        SubstringCursor cursor = null;
+
         try
         {
             SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "sn" ), "b", null );
-            SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-            cursor = new SubstringCursor<Long>( store, evaluator );
+            SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager );
+            cursor = new SubstringCursor( store, evaluator );
             cursor.get();
         }
         finally
@@ -732,13 +734,13 @@ public class SubstringTest
     @Test(expected = InvalidCursorPositionException.class)
     public void testInvalidCursorPositionException2() throws Exception
     {
-        SubstringCursor<Long> cursor = null;
-        
+        SubstringCursor cursor = null;
+
         try
         {
             SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "cn" ), "j", null );
-            SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-            cursor = new SubstringCursor<Long>( store, evaluator );
+            SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager );
+            cursor = new SubstringCursor( store, evaluator );
             cursor.get();
         }
         finally
@@ -751,16 +753,16 @@ public class SubstringTest
     @Test(expected = UnsupportedOperationException.class)
     public void testUnsupportBeforeWithoutIndex() throws Exception
     {
-        SubstringCursor<Long> cursor = null;
-        
+        SubstringCursor cursor = null;
+
         try
         {
             SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "sn" ), "j", null );
-            SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-            cursor = new SubstringCursor<Long>( store, evaluator );
-    
+            SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager );
+            cursor = new SubstringCursor( store, evaluator );
+
             // test before()
-            ForwardIndexEntry<String, Long> entry = new ForwardIndexEntry<String, Long>();
+            ForwardIndexEntry<String, UUID> entry = new ForwardIndexEntry<String, UUID>();
             entry.setKey( SchemaConstants.SN_AT_OID );
             cursor.before( entry );
         }
@@ -774,16 +776,16 @@ public class SubstringTest
     @Test(expected = UnsupportedOperationException.class)
     public void testUnsupportAfterWithoutIndex() throws Exception
     {
-        SubstringCursor<Long> cursor = null;
-        
+        SubstringCursor cursor = null;
+
         try
         {
             SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "sn" ), "j", null );
-            SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-            cursor = new SubstringCursor<Long>( store, evaluator );
-    
+            SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager );
+            cursor = new SubstringCursor( store, evaluator );
+
             // test before()
-            ForwardIndexEntry<String, Long> entry = new ForwardIndexEntry<String, Long>();
+            ForwardIndexEntry<String, UUID> entry = new ForwardIndexEntry<String, UUID>();
             entry.setKey( SchemaConstants.SN_AT_OID );
             cursor.after( entry );
         }

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java?rev=1378574&r1=1378573&r2=1378574&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java Wed Aug 29 14:23:08 2012
@@ -34,7 +34,6 @@ import org.apache.commons.io.FileUtils;
 import org.apache.directory.server.core.api.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.api.partition.Partition;
 import org.apache.directory.server.core.partition.impl.avl.AvlPartition;
-import org.apache.directory.server.core.partition.impl.btree.AbstractBTreePartition;
 import org.apache.directory.server.xdbm.ForwardIndexEntry;
 import org.apache.directory.server.xdbm.IndexEntry;
 import org.apache.directory.server.xdbm.Store;
@@ -56,6 +55,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.schemaextractor.impl.DefaultSchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schemaloader.LdifSchemaLoader;
 import org.apache.directory.shared.ldap.schemamanager.impl.DefaultSchemaManager;
+import org.apache.directory.shared.util.Strings;
 import org.apache.directory.shared.util.exception.Exceptions;
 import org.junit.After;
 import org.junit.Before;
@@ -75,7 +75,7 @@ public class SubtreeScopeTest
     public static final Logger LOG = LoggerFactory.getLogger( SubtreeScopeTest.class );
 
     File wkdir;
-    Store<Entry, Long> store;
+    Store<Entry> store;
     static SchemaManager schemaManager = null;
 
 
@@ -163,42 +163,53 @@ public class SubtreeScopeTest
     @Test
     public void testCursorNoDeref() throws Exception
     {
-        Dn dn = new Dn( SchemaConstants.OU_AT_OID + "=board of directors," + SchemaConstants.O_AT_OID + "=good times co." );
-        long baseId = store.getEntryId( dn );
+        Dn dn = new Dn( SchemaConstants.OU_AT_OID + "=board of directors," + SchemaConstants.O_AT_OID
+            + "=good times co." );
+        UUID baseId = store.getEntryId( dn );
 
-        ScopeNode<Long> node = new ScopeNode<Long>( AliasDerefMode.NEVER_DEREF_ALIASES, dn, baseId, 
+        ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES, dn, baseId,
             SearchScope.SUBTREE );
-        SubtreeScopeEvaluator<Entry, Long> evaluator = new SubtreeScopeEvaluator<Entry, Long>( store, node );
-        SubtreeScopeCursor<Long> cursor = new SubtreeScopeCursor<Long>( store, evaluator );
+        SubtreeScopeEvaluator<Entry> evaluator = new SubtreeScopeEvaluator<Entry>( store, node );
+        SubtreeScopeCursor cursor = new SubtreeScopeCursor( store, evaluator );
+
+        UUID[] expected = new UUID[]
+            {
+                Strings.getUUID( 3L ),
+                Strings.getUUID( 3L ),
+                Strings.getUUID( 7L ),
+                Strings.getUUID( 3L ),
+                Strings.getUUID( 9L ),
+                Strings.getUUID( 3L ),
+                Strings.getUUID( 10L ),
+                Strings.getUUID( 3L ),
+        };
 
-        long[] expected = new long[]{ 3L, 3L, 7L, 3L, 9L, 3L, 10L, 3L };
-        
         // --------- Test beforeFirst() ---------
         //( ( AbstractBTreePartition<Long> ) ((Partition)store) ).dumpRdnIdx( 0L, "" );
-        
-        IndexEntry<Long, Long> indexEntry = null;
-        
+
+        IndexEntry<UUID, UUID> indexEntry = null;
+
         cursor.beforeFirst();
         assertFalse( cursor.available() );
 
         int pos = 0;
-        
+
         while ( cursor.next() )
         {
             assertTrue( cursor.available() );
             indexEntry = cursor.get();
-            
+
             assertNotNull( indexEntry );
-            assertEquals( expected[pos++], (long)indexEntry.getId() );
-            assertEquals( expected[pos++], (long)indexEntry.getKey() );
+            assertEquals( expected[pos++], indexEntry.getId() );
+            assertEquals( expected[pos++], indexEntry.getKey() );
         }
-        
+
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
         cursor.close();
 
         // --------- Test first() ---------
-        cursor = new SubtreeScopeCursor<Long>( store, evaluator );
+        cursor = new SubtreeScopeCursor( store, evaluator );
         assertFalse( cursor.available() );
         cursor.first();
         pos = 2;
@@ -207,19 +218,19 @@ public class SubtreeScopeTest
         {
             assertTrue( cursor.available() );
             indexEntry = cursor.get();
-            
+
             assertNotNull( indexEntry );
-            assertEquals( expected[pos++], (long)indexEntry.getId() );
-            assertEquals( expected[pos++], (long)indexEntry.getKey() );
+            assertEquals( expected[pos++], indexEntry.getId() );
+            assertEquals( expected[pos++], indexEntry.getKey() );
         }
-        
+
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
         cursor.close();
 
         // --------- Test afterLast() ---------
-        cursor = new SubtreeScopeCursor<Long>( store, evaluator );
-        
+        cursor = new SubtreeScopeCursor( store, evaluator );
+
         try
         {
             cursor.afterLast();
@@ -233,7 +244,7 @@ public class SubtreeScopeTest
 
         // --------- Test last() ---------
 
-        cursor = new SubtreeScopeCursor<Long>( store, evaluator );
+        cursor = new SubtreeScopeCursor( store, evaluator );
 
         try
         {
@@ -249,7 +260,7 @@ public class SubtreeScopeTest
 
         // --------- Test previous() before positioning ---------
 
-        cursor = new SubtreeScopeCursor<Long>( store, evaluator );
+        cursor = new SubtreeScopeCursor( store, evaluator );
 
         try
         {
@@ -270,11 +281,11 @@ public class SubtreeScopeTest
     {
         Dn dn = new Dn( SchemaConstants.OU_AT_OID
             + "=board of directors," + SchemaConstants.O_AT_OID + "=good times co." );
-        long baseId = store.getEntryId( dn );
+        UUID baseId = store.getEntryId( dn );
 
-        ScopeNode<Long> node = new ScopeNode<Long>( AliasDerefMode.DEREF_IN_SEARCHING, dn, baseId, SearchScope.SUBTREE );
-        SubtreeScopeEvaluator<Entry, Long> evaluator = new SubtreeScopeEvaluator<Entry, Long>( store, node );
-        SubtreeScopeCursor<Long> cursor = new SubtreeScopeCursor<Long>( store, evaluator );
+        ScopeNode node = new ScopeNode( AliasDerefMode.DEREF_IN_SEARCHING, dn, baseId, SearchScope.SUBTREE );
+        SubtreeScopeEvaluator<Entry> evaluator = new SubtreeScopeEvaluator<Entry>( store, node );
+        SubtreeScopeCursor cursor = new SubtreeScopeCursor( store, evaluator );
 
         // --------- Test beforeFirst() ---------
 
@@ -283,24 +294,24 @@ public class SubtreeScopeTest
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        IndexEntry<Long, Long> indexEntry = cursor.get();
+        IndexEntry<UUID, UUID> indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 3L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 7L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 6L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -308,29 +319,29 @@ public class SubtreeScopeTest
 
         // --------- Test first() ---------
 
-        cursor = new SubtreeScopeCursor<Long>( store, evaluator );
+        cursor = new SubtreeScopeCursor( store, evaluator );
         assertFalse( cursor.available() );
         cursor.first();
 
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 3L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 7L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 6L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -338,7 +349,7 @@ public class SubtreeScopeTest
 
         // --------- Test afterLast() ---------
         /*
-        cursor = new SubtreeScopeCursor<Long>( store, evaluator );
+        cursor = new SubtreeScopeCursor( store, evaluator );
         cursor.afterLast();
         assertFalse( cursor.available() );
 
@@ -346,22 +357,22 @@ public class SubtreeScopeTest
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 6L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 7L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 3L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -370,60 +381,60 @@ public class SubtreeScopeTest
 
         // --------- Test last() ---------
         /*
-        cursor = new SubtreeScopeCursor<Long>( store, evaluator );
+        cursor = new SubtreeScopeCursor( store, evaluator );
         assertFalse( cursor.available() );
         cursor.last();
 
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 6L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 7L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 3L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
         cursor.close();
         */
-        
+
         // --------- Test previous() before positioning ---------
         /*
-        cursor = new SubtreeScopeCursor<Long>( store, evaluator );
+        cursor = new SubtreeScopeCursor( store, evaluator );
         assertFalse( cursor.available() );
         cursor.previous();
 
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 6L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 7L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 3L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -431,29 +442,29 @@ public class SubtreeScopeTest
         */
         // --------- Test next() before positioning ---------
 
-        cursor = new SubtreeScopeCursor<Long>( store, evaluator );
+        cursor = new SubtreeScopeCursor( store, evaluator );
         assertFalse( cursor.available() );
         cursor.next();
 
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 3L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 7L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 6L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -465,14 +476,14 @@ public class SubtreeScopeTest
     public void testCursorWithDereferencing2() throws Exception
     {
         Dn dn = new Dn( SchemaConstants.OU_AT_OID
-            + "=apache," + SchemaConstants.OU_AT_OID 
+            + "=apache," + SchemaConstants.OU_AT_OID
             + "=board of directors," + SchemaConstants.O_AT_OID
             + "=good times co." );
-        long baseId = store.getEntryId( dn );
+        UUID baseId = store.getEntryId( dn );
 
-        ScopeNode<Long> node = new ScopeNode<Long>( AliasDerefMode.DEREF_IN_SEARCHING, dn, baseId, SearchScope.SUBTREE );
-        SubtreeScopeEvaluator<Entry, Long> evaluator = new SubtreeScopeEvaluator<Entry, Long>( store, node );
-        SubtreeScopeCursor<Long> cursor = new SubtreeScopeCursor<Long>( store, evaluator );
+        ScopeNode node = new ScopeNode( AliasDerefMode.DEREF_IN_SEARCHING, dn, baseId, SearchScope.SUBTREE );
+        SubtreeScopeEvaluator<Entry> evaluator = new SubtreeScopeEvaluator<Entry>( store, node );
+        SubtreeScopeCursor cursor = new SubtreeScopeCursor( store, evaluator );
 
         // --------- Test beforeFirst() ---------
 
@@ -481,17 +492,17 @@ public class SubtreeScopeTest
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        IndexEntry<Long, Long> indexEntry = cursor.get();
+        IndexEntry<UUID, UUID> indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 7L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 7L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 7L ), indexEntry.getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 7L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 6L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 7L ), indexEntry.getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -499,22 +510,22 @@ public class SubtreeScopeTest
 
         // --------- Test first() ---------
 
-        cursor = new SubtreeScopeCursor<Long>( store, evaluator );
+        cursor = new SubtreeScopeCursor( store, evaluator );
         assertFalse( cursor.available() );
         cursor.first();
 
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 7L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 7L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 7L ), indexEntry.getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 7L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 6L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 7L ), indexEntry.getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -522,7 +533,7 @@ public class SubtreeScopeTest
 
         // --------- Test afterLast() ---------
         /*
-        cursor = new SubtreeScopeCursor<Long>( store, evaluator );
+        cursor = new SubtreeScopeCursor( store, evaluator );
         cursor.afterLast();
         assertFalse( cursor.available() );
 
@@ -530,15 +541,15 @@ public class SubtreeScopeTest
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 7L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 6L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 7L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 7L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 7L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 7L ), indexEntry.getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -547,22 +558,22 @@ public class SubtreeScopeTest
 
         // --------- Test last() ---------
         /*
-        cursor = new SubtreeScopeCursor<Long>( store, evaluator );
+        cursor = new SubtreeScopeCursor( store, evaluator );
         assertFalse( cursor.available() );
         cursor.last();
 
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 7L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 6L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 7L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 7L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 7L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 7L ), indexEntry.getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -571,22 +582,22 @@ public class SubtreeScopeTest
 
         // --------- Test previous() before positioning ---------
         /*
-        cursor = new SubtreeScopeCursor<Long>( store, evaluator );
+        cursor = new SubtreeScopeCursor( store, evaluator );
         assertFalse( cursor.available() );
         cursor.previous();
 
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 7L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 6L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 7L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 7L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 7L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 7L ), indexEntry.getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -603,7 +614,7 @@ public class SubtreeScopeTest
             + SchemaConstants.O_AT_OID + "=good times co." );
 
         Entry entry = new DefaultEntry( schemaManager, dn,
-            "objectClass: alias", 
+            "objectClass: alias",
             "objectClass: extensibleObject",
             "cn: jd",
             "aliasedObjectName: cn=Jack Daniels,ou=Engineering,o=Good Times Co.",
@@ -622,61 +633,85 @@ public class SubtreeScopeTest
             "cn: jdoe",
             "sn: doe",
             "entryCSN", new CsnFactory( 1 ).newInstance().toString(),
-            "entryUUID", UUID.randomUUID().toString() );
+            "entryUUID", Strings.getUUID( 13L ).toString() );
 
         addContext = new AddOperationContext( null, entry );
         ( ( Partition ) store ).add( addContext );
 
         dn = new Dn( SchemaConstants.OU_AT_OID + "=board of directors," + SchemaConstants.O_AT_OID + "=good times co." );
-        long baseId = store.getEntryId( dn );
+        UUID baseId = store.getEntryId( dn );
 
-        ScopeNode<Long> node = new ScopeNode<Long>( 
-            AliasDerefMode.DEREF_IN_SEARCHING, 
-            dn, 
-            baseId, 
+        ScopeNode node = new ScopeNode(
+            AliasDerefMode.DEREF_IN_SEARCHING,
+            dn,
+            baseId,
             SearchScope.SUBTREE );
-        SubtreeScopeEvaluator<Entry, Long> evaluator = new SubtreeScopeEvaluator<Entry, Long>( store, node );
-        SubtreeScopeCursor<Long> cursor = new SubtreeScopeCursor<Long>( store, evaluator );
+        SubtreeScopeEvaluator<Entry> evaluator = new SubtreeScopeEvaluator<Entry>( store, node );
+        SubtreeScopeCursor cursor = new SubtreeScopeCursor( store, evaluator );
 
         // --------- Test beforeFirst() ---------
         //( ( AbstractBTreePartition<Long> ) ((Partition)store) ).dumpRdnIdx( 0L, "" );
 
-        long[] expected = new long[]{ 3L, 3L, 7L, 3L, 13L, 3L, 6L, 3L, 8L, 3L };
-        IndexEntry<Long, Long> indexEntry = null;
+        UUID[] expected = new UUID[]
+            {
+                Strings.getUUID( 3L ),
+                Strings.getUUID( 3L ),
+                Strings.getUUID( 7L ),
+                Strings.getUUID( 3L ),
+                Strings.getUUID( 13L ),
+                Strings.getUUID( 3L ),
+                Strings.getUUID( 6L ),
+                Strings.getUUID( 3L ),
+                Strings.getUUID( 8L ),
+                Strings.getUUID( 3L )
+        };
+
+        IndexEntry<UUID, UUID> indexEntry = null;
 
         int pos = 0;
-        
+
         while ( cursor.next() )
         {
             assertTrue( cursor.available() );
             indexEntry = cursor.get();
-            
+
             assertNotNull( indexEntry );
-            assertEquals( expected[pos++], (long)indexEntry.getId() );
-            assertEquals( expected[pos++], (long)indexEntry.getKey() );
+            assertEquals( expected[pos++], indexEntry.getId() );
+            assertEquals( expected[pos++], indexEntry.getKey() );
         }
-        
+
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
         cursor.close();
 
         // --------- Test first() ---------
 
-        cursor = new SubtreeScopeCursor<Long>( store, evaluator );
+        cursor = new SubtreeScopeCursor( store, evaluator );
         assertFalse( cursor.available() );
         cursor.first();
 
-        expected = new long[]{ 7L, 3L, 13L, 3L, 6L, 3L, 8L, 3L };
+        expected = new UUID[]
+            {
+                Strings.getUUID( 7L ),
+                Strings.getUUID( 3L ),
+                Strings.getUUID( 13L ),
+                Strings.getUUID( 3L ),
+                Strings.getUUID( 6L ),
+                Strings.getUUID( 3L ),
+                Strings.getUUID( 8L ),
+                Strings.getUUID( 3L )
+        };
+
         pos = 0;
-        
+
         while ( cursor.next() )
         {
             assertTrue( cursor.available() );
             indexEntry = cursor.get();
-            
+
             assertNotNull( indexEntry );
-            assertEquals( expected[pos++], (long)indexEntry.getId() );
-            assertEquals( expected[pos++], (long)indexEntry.getKey() );
+            assertEquals( expected[pos++], indexEntry.getId() );
+            assertEquals( expected[pos++], indexEntry.getKey() );
         }
 
         assertFalse( cursor.next() );
@@ -685,7 +720,7 @@ public class SubtreeScopeTest
 
         // --------- Test afterLast() ---------
         /*
-        cursor = new SubtreeScopeCursor<Long>( store, evaluator );
+        cursor = new SubtreeScopeCursor( store, evaluator );
         cursor.afterLast();
         assertFalse( cursor.available() );
 
@@ -693,81 +728,81 @@ public class SubtreeScopeTest
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 8L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 8L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 6L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 13L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 13L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 7L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 3L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
         cursor.close();
         */
-        
+
         // --------- Test last() ---------
         /*
-        cursor = new SubtreeScopeCursor<Long>( store, evaluator );
+        cursor = new SubtreeScopeCursor( store, evaluator );
         assertFalse( cursor.available() );
         cursor.last();
 
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 8L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 8L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 6L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 13L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 13L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 7L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 3L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -775,43 +810,43 @@ public class SubtreeScopeTest
         */
         // --------- Test previous() before positioning ---------
         /*
-        cursor = new SubtreeScopeCursor<Long>( store, evaluator );
+        cursor = new SubtreeScopeCursor( store, evaluator );
         assertFalse( cursor.available() );
         cursor.previous();
 
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 8L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 8L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 6L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 13L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 13L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 7L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 3L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 3L ), indexEntry.getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -819,23 +854,35 @@ public class SubtreeScopeTest
         */
         // --------- Test next() before positioning ---------
 
-        cursor = new SubtreeScopeCursor<Long>( store, evaluator );
+        cursor = new SubtreeScopeCursor( store, evaluator );
         assertFalse( cursor.available() );
 
-        expected = new long[]{ 3L, 3L, 7L, 3L, 13, 3L, 6L, 3L, 8L, 3L };
+        expected = new UUID[]
+            {
+                Strings.getUUID( 3L ),
+                Strings.getUUID( 3L ),
+                Strings.getUUID( 7L ),
+                Strings.getUUID( 3L ),
+                Strings.getUUID( 13L ),
+                Strings.getUUID( 3L ),
+                Strings.getUUID( 6L ),
+                Strings.getUUID( 3L ),
+                Strings.getUUID( 8L ),
+                Strings.getUUID( 3L )
+        };
 
         pos = 0;
-        
+
         while ( cursor.next() )
         {
             assertTrue( cursor.available() );
             indexEntry = cursor.get();
-            
+
             assertNotNull( indexEntry );
-            assertEquals( expected[pos++], (long)indexEntry.getId() );
-            assertEquals( expected[pos++], (long)indexEntry.getKey() );
+            assertEquals( expected[pos++], indexEntry.getId() );
+            assertEquals( expected[pos++], indexEntry.getKey() );
         }
-        
+
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
         cursor.close();
@@ -847,13 +894,13 @@ public class SubtreeScopeTest
     {
         Dn dn = new Dn( SchemaConstants.OU_AT_OID
             + "=sales," + SchemaConstants.O_AT_OID + "=good times co." );
-        long baseId = store.getEntryId( dn );
+        UUID baseId = store.getEntryId( dn );
 
-        ScopeNode<Long> node = new ScopeNode<Long>( AliasDerefMode.NEVER_DEREF_ALIASES, dn, baseId, SearchScope.SUBTREE );
-        SubtreeScopeEvaluator<Entry, Long> evaluator = new SubtreeScopeEvaluator<Entry, Long>( store, node );
+        ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES, dn, baseId, SearchScope.SUBTREE );
+        SubtreeScopeEvaluator<Entry> evaluator = new SubtreeScopeEvaluator<Entry>( store, node );
 
-        ForwardIndexEntry<Long, Long> indexEntry = new ForwardIndexEntry<Long, Long>();
-        indexEntry.setId( 6L );
+        ForwardIndexEntry<UUID, UUID> indexEntry = new ForwardIndexEntry<UUID, UUID>();
+        indexEntry.setId( Strings.getUUID( 6L ) );
         assertTrue( evaluator.evaluate( indexEntry ) );
     }
 
@@ -863,26 +910,26 @@ public class SubtreeScopeTest
     {
         Dn dn = new Dn( SchemaConstants.OU_AT_OID
             + "=engineering," + SchemaConstants.O_AT_OID + "=good times co." );
-        long baseId = store.getEntryId( dn );
+        UUID baseId = store.getEntryId( dn );
 
-        ScopeNode<Long> node = new ScopeNode<Long>( AliasDerefMode.DEREF_ALWAYS, dn, baseId, SearchScope.SUBTREE );
-        SubtreeScopeEvaluator<Entry, Long> evaluator = new SubtreeScopeEvaluator<Entry, Long>( store, node );
+        ScopeNode node = new ScopeNode( AliasDerefMode.DEREF_ALWAYS, dn, baseId, SearchScope.SUBTREE );
+        SubtreeScopeEvaluator<Entry> evaluator = new SubtreeScopeEvaluator<Entry>( store, node );
         assertEquals( node, evaluator.getExpression() );
 
         /*
          * With dereferencing the evaluator does not accept candidates that
          * are aliases.  This is done to filter out aliases from the results.
          */
-        ForwardIndexEntry<Long, Long> indexEntry = new ForwardIndexEntry<Long, Long>();
-        indexEntry.setId( 11L );
+        ForwardIndexEntry<UUID, UUID> indexEntry = new ForwardIndexEntry<UUID, UUID>();
+        indexEntry.setId( Strings.getUUID( 11L ) );
         assertFalse( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry<Long, Long>();
-        indexEntry.setId( 8L );
+        indexEntry = new ForwardIndexEntry<UUID, UUID>();
+        indexEntry.setId( Strings.getUUID( 8L ) );
         assertTrue( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry<Long, Long>();
-        indexEntry.setId( 6L );
+        indexEntry = new ForwardIndexEntry<UUID, UUID>();
+        indexEntry.setId( Strings.getUUID( 6L ) );
         assertFalse( evaluator.evaluate( indexEntry ) );
     }
 
@@ -890,15 +937,16 @@ public class SubtreeScopeTest
     @Test(expected = InvalidCursorPositionException.class)
     public void testInvalidCursorPositionException() throws Exception
     {
-        SubtreeScopeCursor<Long> cursor = null;
+        SubtreeScopeCursor cursor = null;
         Dn dn = new Dn( SchemaConstants.OU_AT_OID + "=sales," + SchemaConstants.O_AT_OID + "=good times co." );
-        long baseId = store.getEntryId( dn );
-        
+        UUID baseId = store.getEntryId( dn );
+
         try
         {
-            ScopeNode<Long> node = new ScopeNode<Long>( AliasDerefMode.NEVER_DEREF_ALIASES, dn, baseId, SearchScope.SUBTREE );
-            SubtreeScopeEvaluator<Entry, Long> evaluator = new SubtreeScopeEvaluator<Entry, Long>( store, node );
-            cursor = new SubtreeScopeCursor<Long>( store, evaluator );
+            ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES, dn, baseId,
+                SearchScope.SUBTREE );
+            SubtreeScopeEvaluator<Entry> evaluator = new SubtreeScopeEvaluator<Entry>( store, node );
+            cursor = new SubtreeScopeCursor( store, evaluator );
             cursor.get();
         }
         finally
@@ -911,20 +959,21 @@ public class SubtreeScopeTest
     @Test(expected = UnsupportedOperationException.class)
     public void testUnsupportBeforeWithoutIndex() throws Exception
     {
-        SubtreeScopeCursor<Long> cursor = null;
+        SubtreeScopeCursor cursor = null;
         Dn dn = new Dn( SchemaConstants.OU_AT_OID
             + "=sales," + SchemaConstants.O_AT_OID + "=good times co." );
-        long baseId = store.getEntryId( dn );
-        
+        UUID baseId = store.getEntryId( dn );
+
         try
         {
-            ScopeNode<Long> node = new ScopeNode<Long>( AliasDerefMode.NEVER_DEREF_ALIASES, dn, baseId, SearchScope.SUBTREE );
-            SubtreeScopeEvaluator<Entry, Long> evaluator = new SubtreeScopeEvaluator<Entry, Long>( store, node );
-            cursor = new SubtreeScopeCursor<Long>( store, evaluator );
-    
+            ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES, dn, baseId,
+                SearchScope.SUBTREE );
+            SubtreeScopeEvaluator<Entry> evaluator = new SubtreeScopeEvaluator<Entry>( store, node );
+            cursor = new SubtreeScopeCursor( store, evaluator );
+
             // test before()
-            ForwardIndexEntry<Long, Long> entry = new ForwardIndexEntry<Long, Long>();
-            entry.setKey( 3L );
+            ForwardIndexEntry<UUID, UUID> entry = new ForwardIndexEntry<UUID, UUID>();
+            entry.setKey( Strings.getUUID( 3L ) );
             cursor.before( entry );
         }
         finally
@@ -937,20 +986,20 @@ public class SubtreeScopeTest
     @Test(expected = UnsupportedOperationException.class)
     public void testUnsupportAfterWithoutIndex() throws Exception
     {
-        SubtreeScopeCursor<Long> cursor = null;
+        SubtreeScopeCursor cursor = null;
         Dn dn = new Dn( SchemaConstants.OU_AT_OID
             + "=sales," + SchemaConstants.O_AT_OID + "=good times co." );
-        long baseId = store.getEntryId( dn );
+        UUID baseId = store.getEntryId( dn );
 
         try
         {
-            ScopeNode<Long> node = new ScopeNode<Long>( AliasDerefMode.NEVER_DEREF_ALIASES, dn, baseId, SearchScope.SUBTREE );
-            SubtreeScopeEvaluator<Entry, Long> evaluator = new SubtreeScopeEvaluator<Entry, Long>( store, node );
-            cursor = new SubtreeScopeCursor<Long>( store, evaluator );
-    
+            ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES, dn, baseId, SearchScope.SUBTREE );
+            SubtreeScopeEvaluator evaluator = new SubtreeScopeEvaluator( store, node );
+            cursor = new SubtreeScopeCursor( store, evaluator );
+
             // test after()
-            ForwardIndexEntry<Long, Long> entry = new ForwardIndexEntry<Long, Long>();
-            entry.setKey( 3L );
+            ForwardIndexEntry<UUID, UUID> entry = new ForwardIndexEntry<UUID, UUID>();
+            entry.setKey( Strings.getUUID( 3L ) );
             cursor.after( entry );
         }
         finally
@@ -965,7 +1014,7 @@ public class SubtreeScopeTest
     {
         ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES, new Dn( SchemaConstants.OU_AT_OID
             + "=sales," + SchemaConstants.O_AT_OID + "=good times co." ), null, SearchScope.ONELEVEL );
-        SubtreeScopeEvaluator<Entry, Long> evaluator = new SubtreeScopeEvaluator<Entry, Long>( store, node );
+        SubtreeScopeEvaluator<Entry> evaluator = new SubtreeScopeEvaluator<Entry>( store, node );
         assertNull( evaluator );
     }
 }



Mime
View raw message