directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1378574 [5/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/OneLevelScopeTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeTest.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/OneLevelScopeTest.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeTest.java Wed Aug 29 14:23:08 2012
@@ -54,6 +54,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;
@@ -73,7 +74,7 @@ public class OneLevelScopeTest
     public static final Logger LOG = LoggerFactory.getLogger( OneLevelScopeTest.class );
 
     File wkdir;
-    Store<Entry, Long> store;
+    Store<Entry> store;
     static SchemaManager schemaManager = null;
 
 
@@ -162,14 +163,14 @@ public class OneLevelScopeTest
     public void testCursorNoDeref() throws Exception
     {
         Dn dn = new Dn( SchemaConstants.OU_AT_OID
-            + "=sales," + SchemaConstants.O_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.ONELEVEL );
-        OneLevelScopeEvaluator<Entry, Long> evaluator = new OneLevelScopeEvaluator<Entry, Long>( store,
+        ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES, dn, baseId, SearchScope.ONELEVEL );
+        OneLevelScopeEvaluator<Entry> evaluator = new OneLevelScopeEvaluator<Entry>( store,
             node );
-        OneLevelScopeCursor<Long> cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        OneLevelScopeCursor cursor = new OneLevelScopeCursor( store, evaluator );
 
         // --------- Test beforeFirst() ---------
 
@@ -178,41 +179,41 @@ public class OneLevelScopeTest
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        IndexEntry<Long, Long> indexEntry = cursor.get();
+        IndexEntry<UUID, UUID> indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 6L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 2L ), indexEntry.getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 5L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 5L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 2L ), indexEntry.getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
-        
+
         cursor.close();
 
         // --------- Test first() ---------
 
-        cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        cursor = new OneLevelScopeCursor( store, evaluator );
         assertFalse( cursor.available() );
         cursor.first();
 
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 6L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 2L ), indexEntry.getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 5L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 5L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 2L ), indexEntry.getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -221,9 +222,8 @@ public class OneLevelScopeTest
 
         // --------- Test afterLast() ---------
 
-        cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        cursor = new OneLevelScopeCursor( store, evaluator );
 
-        
         try
         {
             cursor.afterLast();
@@ -234,7 +234,7 @@ public class OneLevelScopeTest
             // expected
             cursor.close();
         }
-        
+
         /*
         cursor.afterLast();
         assertFalse( cursor.available() );
@@ -243,15 +243,15 @@ public class OneLevelScopeTest
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 6L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 2L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 5L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 5L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 2L ), indexEntry.getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -259,9 +259,9 @@ public class OneLevelScopeTest
 
         // --------- Test last() ---------
 
-        cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        cursor = new OneLevelScopeCursor( store, evaluator );
         assertFalse( cursor.available() );
-        
+
         try
         {
             cursor.last();
@@ -277,15 +277,15 @@ public class OneLevelScopeTest
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 6L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 2L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 5L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 5L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 2L ), indexEntry.getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -293,9 +293,9 @@ public class OneLevelScopeTest
 
         // --------- Test previous() before positioning ---------
 
-        cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        cursor = new OneLevelScopeCursor( store, evaluator );
         assertFalse( cursor.available() );
-        
+
         try
         {
             cursor.previous();
@@ -306,22 +306,22 @@ public class OneLevelScopeTest
             // expected
             cursor.close();
         }
-        
+
         /*
         cursor.previous();
 
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 6L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 2L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 5L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 5L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 2L ), indexEntry.getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -329,22 +329,22 @@ public class OneLevelScopeTest
 
         // --------- Test next() before positioning ---------
 
-        cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        cursor = new OneLevelScopeCursor( store, evaluator );
         assertFalse( cursor.available() );
         cursor.next();
 
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 6L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 2L ), indexEntry.getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 5L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 5L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 2L ), indexEntry.getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -356,15 +356,15 @@ public class OneLevelScopeTest
     public void testCursorNoDerefReturnAliases() throws Exception
     {
         Dn dn = new Dn( SchemaConstants.OU_AT_OID
-            + "=engineering," 
-            + SchemaConstants.O_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.NEVER_DEREF_ALIASES, dn, baseId, SearchScope.ONELEVEL );
-        OneLevelScopeEvaluator<Entry, Long> evaluator = new OneLevelScopeEvaluator<Entry, Long>( store,
+        ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES, dn, baseId, SearchScope.ONELEVEL );
+        OneLevelScopeEvaluator<Entry> evaluator = new OneLevelScopeEvaluator<Entry>( store,
             node );
-        OneLevelScopeCursor<Long> cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        OneLevelScopeCursor cursor = new OneLevelScopeCursor( store, evaluator );
         // --------- Test beforeFirst() ---------
 
         cursor.beforeFirst();
@@ -372,41 +372,41 @@ public class OneLevelScopeTest
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        IndexEntry<Long, Long> indexEntry = cursor.get();
+        IndexEntry<UUID, UUID> indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 8L, ( long ) indexEntry.getId() );
-        assertEquals( 4L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 8L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 4L ), indexEntry.getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 11L, ( long ) indexEntry.getId() );
-        assertEquals( 4L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 11L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 4L ), indexEntry.getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
-        
+
         cursor.close();
 
         // --------- Test first() ---------
 
-        cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        cursor = new OneLevelScopeCursor( store, evaluator );
         assertFalse( cursor.available() );
         cursor.first();
 
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 8L, ( long ) indexEntry.getId() );
-        assertEquals( 4L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 8L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 4L ), indexEntry.getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 11L, ( long ) indexEntry.getId() );
-        assertEquals( 4L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 11L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 4L ), indexEntry.getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -414,8 +414,8 @@ public class OneLevelScopeTest
 
         // --------- Test afterLast() ---------
 
-        cursor = new OneLevelScopeCursor<Long>( store, evaluator );
-        
+        cursor = new OneLevelScopeCursor( store, evaluator );
+
         try
         {
             cursor.afterLast();
@@ -434,15 +434,15 @@ public class OneLevelScopeTest
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 11L, ( long ) indexEntry.getId() );
-        assertEquals( 4L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 11L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 4L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 8L, ( long ) indexEntry.getId() );
-        assertEquals( 4L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 8L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 4L ), indexEntry.getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -450,9 +450,9 @@ public class OneLevelScopeTest
 
         // --------- Test last() ---------
 
-        cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        cursor = new OneLevelScopeCursor( store, evaluator );
         assertFalse( cursor.available() );
-        
+
         try
         {
             cursor.last();
@@ -468,15 +468,15 @@ public class OneLevelScopeTest
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 11L, ( long ) indexEntry.getId() );
-        assertEquals( 4L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 11L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 4L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 8L, ( long ) indexEntry.getId() );
-        assertEquals( 4L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 8L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 4L ), indexEntry.getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -484,9 +484,9 @@ public class OneLevelScopeTest
 
         // --------- Test previous() before positioning ---------
 
-        cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        cursor = new OneLevelScopeCursor( store, evaluator );
         assertFalse( cursor.available() );
-        
+
         try
         {
             cursor.previous();
@@ -502,15 +502,15 @@ public class OneLevelScopeTest
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 11L, ( long ) indexEntry.getId() );
-        assertEquals( 4L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 11L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 4L ), indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 8L, ( long ) indexEntry.getId() );
-        assertEquals( 4L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 8L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 4L ), indexEntry.getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -518,22 +518,22 @@ public class OneLevelScopeTest
 
         // --------- Test next() before positioning ---------
 
-        cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        cursor = new OneLevelScopeCursor( store, evaluator );
         assertFalse( cursor.available() );
         cursor.next();
 
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 8L, ( long ) indexEntry.getId() );
-        assertEquals( 4L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 8L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 4L ), indexEntry.getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
-        assertEquals( 11L, ( long ) indexEntry.getId() );
-        assertEquals( 4L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 11L ), indexEntry.getId() );
+        assertEquals( Strings.getUUID( 4L ), indexEntry.getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -546,12 +546,12 @@ public class OneLevelScopeTest
     {
         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.ONELEVEL );
-        OneLevelScopeEvaluator<Entry, Long> evaluator = new OneLevelScopeEvaluator<Entry, Long>( store,
+        ScopeNode node = new ScopeNode( AliasDerefMode.DEREF_IN_SEARCHING, dn, baseId, SearchScope.ONELEVEL );
+        OneLevelScopeEvaluator<Entry> evaluator = new OneLevelScopeEvaluator<Entry>( store,
             node );
-        OneLevelScopeCursor<Long> cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        OneLevelScopeCursor cursor = new OneLevelScopeCursor( store, evaluator );
 
         // --------- Test beforeFirst() ---------
 
@@ -560,40 +560,40 @@ public class OneLevelScopeTest
 
         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( 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() );
         cursor.close();
-        
+
         // --------- Test first() ---------
 
-        cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        cursor = new OneLevelScopeCursor( store, evaluator );
         assertFalse( cursor.available() );
         cursor.first();
 
         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() );
@@ -601,7 +601,7 @@ public class OneLevelScopeTest
 
         // --------- Test afterLast() ---------
 
-        cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        cursor = new OneLevelScopeCursor( store, evaluator );
         cursor.afterLast();
         assertFalse( cursor.available() );
 
@@ -609,8 +609,8 @@ public class OneLevelScopeTest
         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() );
         cursor.close();
 
         /*
@@ -618,8 +618,8 @@ public class OneLevelScopeTest
         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() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -627,15 +627,15 @@ public class OneLevelScopeTest
 
         // --------- Test last() ---------
 
-        cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        cursor = new OneLevelScopeCursor( 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() );
         cursor.close();
 
         /*
@@ -643,8 +643,8 @@ public class OneLevelScopeTest
         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() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -652,15 +652,15 @@ public class OneLevelScopeTest
 
         // --------- Test previous() before positioning ---------
 
-        cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        cursor = new OneLevelScopeCursor( 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() );
         cursor.close();
 
         /*
@@ -668,8 +668,8 @@ public class OneLevelScopeTest
         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() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -681,16 +681,16 @@ public class OneLevelScopeTest
     public void testCursorWithDereferencing2() throws Exception
     {
         Dn dn = new Dn( SchemaConstants.OU_AT_OID
-            + "=apache," + SchemaConstants.OU_AT_OID 
-            + "=board of directors," 
+            + "=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.ONELEVEL );
-        OneLevelScopeEvaluator<Entry, Long> evaluator = new OneLevelScopeEvaluator<Entry, Long>( store,
+        ScopeNode node = new ScopeNode( AliasDerefMode.DEREF_IN_SEARCHING, dn, baseId, SearchScope.ONELEVEL );
+        OneLevelScopeEvaluator<Entry> evaluator = new OneLevelScopeEvaluator<Entry>( store,
             node );
-        OneLevelScopeCursor<Long> cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        OneLevelScopeCursor cursor = new OneLevelScopeCursor( store, evaluator );
 
         // --------- Test beforeFirst() ---------
 
@@ -699,10 +699,10 @@ public class OneLevelScopeTest
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        IndexEntry<Long, Long> indexEntry = cursor.get();
+        IndexEntry<UUID, UUID> 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() );
@@ -710,15 +710,15 @@ public class OneLevelScopeTest
 
         // --------- Test first() ---------
 
-        cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        cursor = new OneLevelScopeCursor( store, evaluator );
         assertFalse( cursor.available() );
         cursor.first();
 
         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() );
@@ -726,7 +726,7 @@ public class OneLevelScopeTest
 
         // --------- Test afterLast() ---------
 
-        cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        cursor = new OneLevelScopeCursor( store, evaluator );
         cursor.afterLast();
         assertFalse( cursor.available() );
 
@@ -734,8 +734,8 @@ public class OneLevelScopeTest
         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() );
         cursor.close();
 
         /*
@@ -745,15 +745,15 @@ public class OneLevelScopeTest
 
         // --------- Test last() ---------
 
-        cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        cursor = new OneLevelScopeCursor( 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() );
         cursor.close();
 
         /*
@@ -763,15 +763,15 @@ public class OneLevelScopeTest
 
         // --------- Test previous() before positioning ---------
 
-        cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        cursor = new OneLevelScopeCursor( 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() );
         cursor.close();
 
         /*
@@ -807,21 +807,21 @@ public class OneLevelScopeTest
         entry.add( "cn", "jdoe" );
         entry.add( "sn", "doe" );
         entry.add( "entryCSN", new CsnFactory( 1 ).newInstance().toString() );
-        entry.add( "entryUUID", UUID.randomUUID().toString() );
+        entry.add( "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 
+            + "=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.ONELEVEL );
-        OneLevelScopeEvaluator<Entry, Long> evaluator = new OneLevelScopeEvaluator<Entry, Long>( store,
+        ScopeNode node = new ScopeNode( AliasDerefMode.DEREF_IN_SEARCHING, dn, baseId, SearchScope.ONELEVEL );
+        OneLevelScopeEvaluator<Entry> evaluator = new OneLevelScopeEvaluator<Entry>( store,
             node );
-        OneLevelScopeCursor<Long> cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        OneLevelScopeCursor cursor = new OneLevelScopeCursor( store, evaluator );
 
         // --------- Test beforeFirst() ---------
 
@@ -830,31 +830,31 @@ public class OneLevelScopeTest
 
         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( 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( 13L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 13L ), 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() );
 
         assertTrue( cursor.next() );
         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() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -862,36 +862,36 @@ public class OneLevelScopeTest
 
         // --------- Test first() ---------
 
-        cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        cursor = new OneLevelScopeCursor( store, evaluator );
         assertFalse( cursor.available() );
         cursor.first();
 
         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( 13L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 13L ), 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() );
 
         assertTrue( cursor.next() );
         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() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -899,7 +899,7 @@ public class OneLevelScopeTest
 
         // --------- Test afterLast() ---------
 
-        cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        cursor = new OneLevelScopeCursor( store, evaluator );
         cursor.afterLast();
         assertFalse( cursor.available() );
 
@@ -907,15 +907,15 @@ public class OneLevelScopeTest
         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() );
         cursor.close();
 
         /*
@@ -923,15 +923,15 @@ public class OneLevelScopeTest
         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() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -939,15 +939,15 @@ public class OneLevelScopeTest
 
         // --------- Test last() ---------
 
-        cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        cursor = new OneLevelScopeCursor( 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() );
         cursor.close();
 
         /*
@@ -955,22 +955,22 @@ public class OneLevelScopeTest
         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() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -978,23 +978,23 @@ public class OneLevelScopeTest
 
         // --------- Test previous() before positioning ---------
 
-        cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        cursor = new OneLevelScopeCursor( 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() );
         cursor.close();
 
         /*
@@ -1002,15 +1002,15 @@ public class OneLevelScopeTest
         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() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -1018,36 +1018,36 @@ public class OneLevelScopeTest
 
         // --------- Test next() before positioning ---------
 
-        cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+        cursor = new OneLevelScopeCursor( store, evaluator );
         assertFalse( cursor.available() );
         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( 13L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getKey() );
+        assertEquals( Strings.getUUID( 13L ), 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() );
 
         assertTrue( cursor.next() );
         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() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -1059,16 +1059,17 @@ public class OneLevelScopeTest
     public void testEvaluatorNoDereferencing() throws Exception
     {
         Dn dn = new Dn( SchemaConstants.OU_AT_OID
-            + "=sales," + SchemaConstants.O_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.ONELEVEL );
-        OneLevelScopeEvaluator<Entry, Long> evaluator = new OneLevelScopeEvaluator<Entry, Long>( store,
+        ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES, dn, baseId,
+            SearchScope.ONELEVEL );
+        OneLevelScopeEvaluator<Entry> evaluator = new OneLevelScopeEvaluator<Entry>( store,
             node );
 
-        ForwardIndexEntry<Long, Long> indexEntry = new ForwardIndexEntry<Long, Long>();
-        indexEntry.setId( 6L );
+        ForwardIndexEntry<UUID, UUID> indexEntry = new ForwardIndexEntry<UUID, UUID>();
+        indexEntry.setId( new UUID( 0L, 6L ) );
         assertTrue( evaluator.evaluate( indexEntry ) );
     }
 
@@ -1077,13 +1078,13 @@ public class OneLevelScopeTest
     public void testEvaluatorWithDereferencing() throws Exception
     {
         Dn dn = new Dn( SchemaConstants.OU_AT_OID
-            + "=engineering," 
-            + SchemaConstants.O_AT_OID 
+            + "=engineering,"
+            + SchemaConstants.O_AT_OID
             + "=good times co." );
-        long baseId = store.getEntryId( dn );
-        
-        ScopeNode<Long> node = new ScopeNode<Long>( AliasDerefMode.DEREF_ALWAYS, dn, baseId, SearchScope.ONELEVEL );
-        OneLevelScopeEvaluator<Entry, Long> evaluator = new OneLevelScopeEvaluator<Entry, Long>( store,
+        UUID baseId = store.getEntryId( dn );
+
+        ScopeNode node = new ScopeNode( AliasDerefMode.DEREF_ALWAYS, dn, baseId, SearchScope.ONELEVEL );
+        OneLevelScopeEvaluator<Entry> evaluator = new OneLevelScopeEvaluator<Entry>( store,
             node );
         assertEquals( node, evaluator.getExpression() );
 
@@ -1092,20 +1093,20 @@ public class OneLevelScopeTest
          * will not accept an alias candidate because aliases are not returned
          * when alias dereferencing while searching is enabled.
          */
-        ForwardIndexEntry<Long, Long> indexEntry = new ForwardIndexEntry<Long, Long>();
-        indexEntry.setId( 11L );
+        ForwardIndexEntry<UUID, UUID> indexEntry = new ForwardIndexEntry<UUID, UUID>();
+        indexEntry.setId( new UUID( 0L, 11L ) );
         assertFalse( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry<Long, Long>();
-        indexEntry.setId( 8L );
+        indexEntry = new ForwardIndexEntry<UUID, UUID>();
+        indexEntry.setId( new UUID( 0L, 8L ) );
         assertTrue( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry<Long, Long>();
-        indexEntry.setId( 5L );
+        indexEntry = new ForwardIndexEntry<UUID, UUID>();
+        indexEntry.setId( new UUID( 0L, 5L ) );
         assertTrue( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry<Long, Long>();
-        indexEntry.setId( 6L );
+        indexEntry = new ForwardIndexEntry<UUID, UUID>();
+        indexEntry.setId( new UUID( 0L, 6L ) );
         assertFalse( evaluator.evaluate( indexEntry ) );
     }
 
@@ -1113,19 +1114,20 @@ public class OneLevelScopeTest
     @Test(expected = InvalidCursorPositionException.class)
     public void testInvalidCursorPositionException() throws Exception
     {
-        OneLevelScopeCursor<Long> cursor = null;
+        OneLevelScopeCursor cursor = null;
         Dn dn = new Dn( SchemaConstants.OU_AT_OID
-            + "=sales," 
-            + SchemaConstants.O_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.ONELEVEL );
-            OneLevelScopeEvaluator<Entry, Long> evaluator = new OneLevelScopeEvaluator<Entry, Long>( store,
+            ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES, dn, baseId,
+                SearchScope.ONELEVEL );
+            OneLevelScopeEvaluator<Entry> evaluator = new OneLevelScopeEvaluator<Entry>( store,
                 node );
-            cursor = new OneLevelScopeCursor<Long>( store, evaluator );
+            cursor = new OneLevelScopeCursor( store, evaluator );
             cursor.get();
         }
         finally
@@ -1138,23 +1140,24 @@ public class OneLevelScopeTest
     @Test(expected = UnsupportedOperationException.class)
     public void testUnsupportBeforeWithoutIndex() throws Exception
     {
-        OneLevelScopeCursor<Long> cursor = null;
+        OneLevelScopeCursor cursor = null;
         Dn dn = new Dn( SchemaConstants.OU_AT_OID
-            + "=sales," 
-            + SchemaConstants.O_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.ONELEVEL );
-            OneLevelScopeEvaluator<Entry, Long> evaluator = new OneLevelScopeEvaluator<Entry, Long>( store,
+            ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES, dn, baseId,
+                SearchScope.ONELEVEL );
+            OneLevelScopeEvaluator<Entry> evaluator = new OneLevelScopeEvaluator<Entry>( store,
                 node );
-            cursor = new OneLevelScopeCursor<Long>( store, evaluator );
-    
+            cursor = new OneLevelScopeCursor( 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
@@ -1167,22 +1170,23 @@ public class OneLevelScopeTest
     @Test(expected = UnsupportedOperationException.class)
     public void testUnsupportAfterWithoutIndex() throws Exception
     {
-        OneLevelScopeCursor<Long> cursor = null;
+        OneLevelScopeCursor cursor = null;
         Dn dn = new Dn( SchemaConstants.OU_AT_OID
-            + "=sales," + SchemaConstants.O_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.ONELEVEL );
-            OneLevelScopeEvaluator<Entry, Long> evaluator = new OneLevelScopeEvaluator<Entry, Long>( store,
+            ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES, dn, baseId,
+                SearchScope.ONELEVEL );
+            OneLevelScopeEvaluator<Entry> evaluator = new OneLevelScopeEvaluator<Entry>( store,
                 node );
-            cursor = new OneLevelScopeCursor<Long>( store, evaluator );
-    
+            cursor = new OneLevelScopeCursor( 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
@@ -1196,12 +1200,12 @@ public class OneLevelScopeTest
     public void testIllegalStateBadScope() throws Exception
     {
         Dn dn = new Dn( SchemaConstants.OU_AT_OID
-            + "=sales," 
-            + SchemaConstants.O_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 );
-        new OneLevelScopeEvaluator<Entry, Long>( store, node );
+        ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES, dn, baseId, SearchScope.SUBTREE );
+        new OneLevelScopeEvaluator<Entry>( store, node );
     }
 }
\ No newline at end of file

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.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/OrCursorTest.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java Wed Aug 29 14:23:08 2012
@@ -28,6 +28,7 @@ import static org.junit.Assert.fail;
 import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.UUID;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.directory.server.core.api.partition.Partition;
@@ -55,6 +56,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;
@@ -79,7 +81,7 @@ public class OrCursorTest
     private static final Logger LOG = LoggerFactory.getLogger( OrCursorTest.class.getSimpleName() );
 
     File wkdir;
-    Store<Entry, Long> store;
+    Store<Entry> store;
     static SchemaManager schemaManager = null;
     EvaluatorBuilder evaluatorBuilder;
     CursorBuilder cursorBuilder;
@@ -176,38 +178,38 @@ public class OrCursorTest
 
         ExprNode exprNode = FilterParser.parse( schemaManager, filter );
 
-        Cursor<IndexEntry<?, Long>> cursor = cursorBuilder.build( exprNode );
+        Cursor<IndexEntry<?, UUID>> cursor = cursorBuilder.build( exprNode );
 
         cursor.afterLast();
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 5 ), cursor.get().getId() );
         assertEquals( "walker", cursor.get().getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 11, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 11L ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10L ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9L ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6L ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 8, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 8L ), cursor.get().getId() );
         assertEquals( "jack daniels", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
@@ -217,32 +219,32 @@ public class OrCursorTest
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 8, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 8L ), cursor.get().getId() );
         assertEquals( "jack daniels", cursor.get().getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6L ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9L ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10L ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 11, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 11L ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 5L ), cursor.get().getId() );
         assertEquals( "walker", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
@@ -257,9 +259,9 @@ public class OrCursorTest
     @SuppressWarnings("unchecked")
     public void testOrCursor() throws Exception
     {
-        List<Evaluator<? extends ExprNode, Long>> evaluators = new ArrayList<Evaluator<? extends ExprNode, Long>>();
-        List<Cursor<IndexEntry<?, Long>>> cursors = new ArrayList<Cursor<IndexEntry<?, Long>>>();
-        Evaluator<? extends ExprNode, Long> eval;
+        List<Evaluator<? extends ExprNode>> evaluators = new ArrayList<Evaluator<? extends ExprNode>>();
+        List<Cursor<IndexEntry<?, UUID>>> cursors = new ArrayList<Cursor<IndexEntry<?, UUID>>>();
+        Evaluator<? extends ExprNode> eval;
         Cursor<IndexEntry<?, Long>> cursor;
 
         OrNode orNode = new OrNode();
@@ -294,32 +296,32 @@ public class OrCursorTest
         // from first
         assertTrue( 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( "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() );
@@ -331,32 +333,32 @@ public class OrCursorTest
 
         assertTrue( 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( "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() );

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.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/PresenceTest.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.java Wed Aug 29 14:23:08 2012
@@ -30,6 +30,7 @@ import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
+import java.util.UUID;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.directory.server.core.api.partition.Partition;
@@ -50,6 +51,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;
@@ -69,7 +71,7 @@ public class PresenceTest
     private static final Logger LOG = LoggerFactory.getLogger( PresenceTest.class.getSimpleName() );
 
     File wkdir;
-    Store<Entry, Long> store;
+    Store<Entry> store;
     static SchemaManager schemaManager = null;
 
 
@@ -158,30 +160,30 @@ public class PresenceTest
     public void testIndexedServerEntry() throws Exception
     {
         PresenceNode node = new PresenceNode( schemaManager.getAttributeType( "cn" ) );
-        PresenceEvaluator<Long> evaluator = new PresenceEvaluator<Long>( node, store, schemaManager );
-        PresenceCursor<Long> cursor = new PresenceCursor<Long>( store, evaluator );
+        PresenceEvaluator evaluator = new PresenceEvaluator( node, store, schemaManager );
+        PresenceCursor cursor = new PresenceCursor( store, evaluator );
 
         assertEquals( node, evaluator.getExpression() );
 
         cursor.beforeFirst();
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 5 ), cursor.get().getId() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 8, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 8 ), cursor.get().getId() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 11, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 11 ), cursor.get().getId() );
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
 
@@ -210,7 +212,7 @@ public class PresenceTest
         assertEquals( SchemaConstants.CN_AT_OID, cursor.get().getKey() );
 
         // test before()
-        ForwardIndexEntry<String, Long> entry = new ForwardIndexEntry<String, Long>();
+        ForwardIndexEntry<String, UUID> entry = new ForwardIndexEntry<String, UUID>();
         entry.setKey( SchemaConstants.CN_AT_OID );
         cursor.before( entry );
         assertTrue( cursor.next() );
@@ -218,7 +220,7 @@ public class PresenceTest
         assertEquals( SchemaConstants.CN_AT_OID, cursor.get().getKey() );
 
         // test after()
-        entry = new ForwardIndexEntry<String, Long>();
+        entry = new ForwardIndexEntry<String, UUID>();
         cursor.after( entry );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
@@ -226,37 +228,37 @@ public class PresenceTest
         cursor.close();
 
         node = new PresenceNode( schemaManager.getAttributeType( "ou" ) );
-        evaluator = new PresenceEvaluator<Long>( node, store, schemaManager );
-        cursor = new PresenceCursor<Long>( store, evaluator );
+        evaluator = new PresenceEvaluator( node, store, schemaManager );
+        cursor = new PresenceCursor( store, evaluator );
 
         cursor.beforeFirst();
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 2, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 2 ), cursor.get().getId() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 3, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 3 ), cursor.get().getId() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 4, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 4 ), cursor.get().getId() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 5 ), cursor.get().getId() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 7, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 7 ), cursor.get().getId() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 8, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 8 ), cursor.get().getId() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 11, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 11 ), cursor.get().getId() );
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
 
@@ -278,24 +280,24 @@ public class PresenceTest
     public void testSystemIndexedServerEntry( String oid ) throws Exception
     {
         PresenceNode node = new PresenceNode( schemaManager.getAttributeType( oid ) );
-        PresenceEvaluator<Long> evaluator = new PresenceEvaluator<Long>( node, store, schemaManager );
-        PresenceCursor<Long> cursor = new PresenceCursor<Long>( store, evaluator );
+        PresenceEvaluator evaluator = new PresenceEvaluator( node, store, schemaManager );
+        PresenceCursor cursor = new PresenceCursor( store, evaluator );
 
         assertEquals( node, evaluator.getExpression() );
 
         cursor.beforeFirst();
 
-        List<Long> ids = new ArrayList<Long>();
-        
+        List<UUID> ids = new ArrayList<UUID>();
+
         while ( cursor.next() && cursor.available() )
         {
             ids.add( cursor.get().getId() );
         }
-        
+
         assertEquals( 11, ids.size() );
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
-        
+
         cursor.close();
     }
 
@@ -304,26 +306,26 @@ public class PresenceTest
     public void testNonIndexedServerEntry() throws Exception
     {
         PresenceNode node = new PresenceNode( schemaManager.getAttributeType( "sn" ) );
-        PresenceEvaluator<Long> evaluator = new PresenceEvaluator<Long>( node, store, schemaManager );
-        PresenceCursor<Long> cursor = new PresenceCursor<Long>( store, evaluator );
+        PresenceEvaluator evaluator = new PresenceEvaluator( node, store, schemaManager );
+        PresenceCursor cursor = new PresenceCursor( store, evaluator );
 
         assertEquals( node, evaluator.getExpression() );
 
         cursor.beforeFirst();
 
-        Set<Long> set = new HashSet<Long>();
-        
+        Set<UUID> set = new HashSet<UUID>();
+
         while ( cursor.next() )
         {
             assertTrue( cursor.available() );
             assertEquals( SchemaConstants.SN_AT_OID, cursor.get().getKey() );
             set.add( cursor.get().getId() );
         }
-        
+
         assertEquals( 3, set.size() );
-        assertTrue( set.contains( 5L ) );
-        assertTrue( set.contains( 6L ) );
-        assertTrue( set.contains( 8L ) );
+        assertTrue( set.contains( Strings.getUUID( 5L ) ) );
+        assertTrue( set.contains( Strings.getUUID( 6L ) ) );
+        assertTrue( set.contains( Strings.getUUID( 8L ) ) );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -356,27 +358,27 @@ public class PresenceTest
             assertEquals( SchemaConstants.SN_AT_OID, cursor.get().getKey() );
             set.add( cursor.get().getId() );
         }
-        
+
         assertEquals( 3, set.size() );
-        assertTrue( set.contains( 5L ) );
-        assertTrue( set.contains( 6L ) );
-        assertTrue( set.contains( 8L ) );
+        assertTrue( set.contains( Strings.getUUID( 5L ) ) );
+        assertTrue( set.contains( Strings.getUUID( 6L ) ) );
+        assertTrue( set.contains( Strings.getUUID( 8L ) ) );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
-        
+
         cursor.close();
 
         // ----------- organizationName attribute
 
         node = new PresenceNode( schemaManager.getAttributeType( "o" ) );
-        evaluator = new PresenceEvaluator<Long>( node, store, schemaManager );
-        cursor = new PresenceCursor<Long>( store, evaluator );
+        evaluator = new PresenceEvaluator( node, store, schemaManager );
+        cursor = new PresenceCursor( store, evaluator );
 
         cursor.beforeFirst();
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 1, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 1 ), cursor.get().getId() );
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
 
@@ -390,14 +392,14 @@ public class PresenceTest
     public void testEvaluatorIndexed() throws Exception
     {
         PresenceNode node = new PresenceNode( schemaManager.getAttributeType( "cn" ) );
-        PresenceEvaluator<Long> evaluator = new PresenceEvaluator<Long>( node, store, schemaManager );
-        ForwardIndexEntry<String, Long> entry = new ForwardIndexEntry<String, Long>();
+        PresenceEvaluator evaluator = new PresenceEvaluator( node, store, schemaManager );
+        ForwardIndexEntry<String, UUID> entry = new ForwardIndexEntry<String, UUID>();
         entry.setKey( SchemaConstants.CN_AT_OID );
-        entry.setId( ( long ) 3 );
+        entry.setId( Strings.getUUID( 3L ) );
         assertFalse( evaluator.evaluate( entry ) );
-        entry = new ForwardIndexEntry<String, Long>();
+        entry = new ForwardIndexEntry<String, UUID>();
         entry.setKey( SchemaConstants.CN_AT_OID );
-        entry.setId( ( long ) 5 );
+        entry.setId( Strings.getUUID( 5 ) );
         assertTrue( evaluator.evaluate( entry ) );
     }
 
@@ -414,16 +416,16 @@ public class PresenceTest
     private void testEvaluatorSystemIndexed( String oid ) throws Exception
     {
         PresenceNode node = new PresenceNode( schemaManager.getAttributeType( oid ) );
-        PresenceEvaluator<Long> evaluator = new PresenceEvaluator<Long>( node, store, schemaManager );
+        PresenceEvaluator evaluator = new PresenceEvaluator( node, store, schemaManager );
 
-        ForwardIndexEntry<String, Long> entry = new ForwardIndexEntry<String, Long>();
+        ForwardIndexEntry<String, UUID> entry = new ForwardIndexEntry<String, UUID>();
         // no need to set a value or id, because the evaluator must always evaluate to true
         // as each entry contains an objectClass, entryUUID, and entryCSN attribute
         assertTrue( evaluator.evaluate( entry ) );
 
-        entry = new ForwardIndexEntry<String, Long>();
+        entry = new ForwardIndexEntry<String, UUID>();
         entry.setKey( oid );
-        entry.setId( ( long ) 5 );
+        entry.setId( Strings.getUUID( 5 ) );
         assertTrue( evaluator.evaluate( entry ) );
     }
 
@@ -432,38 +434,38 @@ public class PresenceTest
     public void testEvaluatorNotIndexed() throws Exception
     {
         PresenceNode node = new PresenceNode( schemaManager.getAttributeType( "name" ) );
-        PresenceEvaluator<Long> evaluator = new PresenceEvaluator<Long>( node, store, schemaManager );
-        ForwardIndexEntry<String, Long> entry = new ForwardIndexEntry<String, Long>();
+        PresenceEvaluator evaluator = new PresenceEvaluator( node, store, schemaManager );
+        ForwardIndexEntry<String, UUID> entry = new ForwardIndexEntry<String, UUID>();
         entry.setKey( SchemaConstants.NAME_AT_OID );
-        entry.setId( ( long ) 3 );
+        entry.setId( Strings.getUUID( 3 ) );
         assertTrue( evaluator.evaluate( entry ) );
-        entry = new ForwardIndexEntry<String, Long>();
+        entry = new ForwardIndexEntry<String, UUID>();
         entry.setKey( SchemaConstants.NAME_AT_OID );
-        entry.setId( ( long ) 5 );
+        entry.setId( Strings.getUUID( 5 ) );
         assertTrue( evaluator.evaluate( entry ) );
 
         node = new PresenceNode( schemaManager.getAttributeType( "searchGuide" ) );
-        evaluator = new PresenceEvaluator<Long>( node, store, schemaManager );
-        entry = new ForwardIndexEntry<String, Long>();
+        evaluator = new PresenceEvaluator( node, store, schemaManager );
+        entry = new ForwardIndexEntry<String, UUID>();
         entry.setKey( SchemaConstants.SEARCHGUIDE_AT_OID );
-        entry.setId( ( long ) 3 );
+        entry.setId( Strings.getUUID( 3 ) );
         assertFalse( evaluator.evaluate( entry ) );
-        entry = new ForwardIndexEntry<String, Long>();
+        entry = new ForwardIndexEntry<String, UUID>();
         entry.setKey( SchemaConstants.SEARCHGUIDE_AT_OID );
-        entry.setId( ( long ) 5 );
-        entry.setEntry( store.lookup( ( long ) 5 ) );
+        entry.setId( Strings.getUUID( 5 ) );
+        entry.setEntry( store.lookup( Strings.getUUID( 5 ) ) );
         assertFalse( evaluator.evaluate( entry ) );
 
         node = new PresenceNode( schemaManager.getAttributeType( "st" ) );
-        evaluator = new PresenceEvaluator<Long>( node, store, schemaManager );
-        entry = new ForwardIndexEntry<String, Long>();
+        evaluator = new PresenceEvaluator( node, store, schemaManager );
+        entry = new ForwardIndexEntry<String, UUID>();
         entry.setKey( SchemaConstants.ST_AT_OID );
-        entry.setId( ( long ) 3 );
+        entry.setId( Strings.getUUID( 3 ) );
         assertFalse( evaluator.evaluate( entry ) );
-        entry = new ForwardIndexEntry<String, Long>();
+        entry = new ForwardIndexEntry<String, UUID>();
         entry.setKey( SchemaConstants.ST_AT_OID );
-        entry.setId( ( long ) 5 );
-        entry.setEntry( store.lookup( ( long ) 5 ) );
+        entry.setId( Strings.getUUID( 5 ) );
+        entry.setEntry( store.lookup( Strings.getUUID( 5 ) ) );
         assertFalse( evaluator.evaluate( entry ) );
     }
 
@@ -471,16 +473,16 @@ public class PresenceTest
     @Test(expected = InvalidCursorPositionException.class)
     public void testInvalidCursorPositionException() throws Exception
     {
-        PresenceCursor<Long> cursor = null;
-    
+        PresenceCursor cursor = null;
+
         try
         {
             PresenceNode node = new PresenceNode( schemaManager.getAttributeType( "sn" ) );
-            PresenceEvaluator<Long> evaluator = new PresenceEvaluator<Long>( node, store, schemaManager );
-            cursor = new PresenceCursor<Long>( store, evaluator );
+            PresenceEvaluator evaluator = new PresenceEvaluator( node, store, schemaManager );
+            cursor = new PresenceCursor( store, evaluator );
             cursor.get();
         }
-        finally 
+        finally
         {
             cursor.close();
         }
@@ -490,16 +492,16 @@ public class PresenceTest
     @Test(expected = InvalidCursorPositionException.class)
     public void testInvalidCursorPositionException2() throws Exception
     {
-        PresenceCursor<Long> cursor = null;
-        
+        PresenceCursor cursor = null;
+
         try
         {
             PresenceNode node = new PresenceNode( schemaManager.getAttributeType( "cn" ) );
-            PresenceEvaluator<Long> evaluator = new PresenceEvaluator<Long>( node, store, schemaManager );
-            cursor = new PresenceCursor<Long>( store, evaluator );
+            PresenceEvaluator evaluator = new PresenceEvaluator( node, store, schemaManager );
+            cursor = new PresenceCursor( store, evaluator );
             cursor.get();
         }
-        finally 
+        finally
         {
             cursor.close();
         }
@@ -509,16 +511,16 @@ public class PresenceTest
     @Test(expected = UnsupportedOperationException.class)
     public void testUnsupportBeforeWithoutIndex() throws Exception
     {
-        PresenceCursor<Long> cursor = null;
-        
+        PresenceCursor cursor = null;
+
         try
         {
             PresenceNode node = new PresenceNode( schemaManager.getAttributeType( "sn" ) );
-            PresenceEvaluator<Long> evaluator = new PresenceEvaluator<Long>( node, store, schemaManager );
-            cursor = new PresenceCursor<Long>( store, evaluator );
-    
+            PresenceEvaluator evaluator = new PresenceEvaluator( node, store, schemaManager );
+            cursor = new PresenceCursor( 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 );
         }
@@ -532,16 +534,16 @@ public class PresenceTest
     @Test(expected = UnsupportedOperationException.class)
     public void testUnsupportAfterWithoutIndex() throws Exception
     {
-        PresenceCursor<Long> cursor = null;
-        
+        PresenceCursor cursor = null;
+
         try
         {
             PresenceNode node = new PresenceNode( schemaManager.getAttributeType( "sn" ) );
-            PresenceEvaluator<Long> evaluator = new PresenceEvaluator<Long>( node, store, schemaManager );
-            cursor = new PresenceCursor<Long>( store, evaluator );
-    
+            PresenceEvaluator evaluator = new PresenceEvaluator( node, store, schemaManager );
+            cursor = new PresenceCursor( 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 );
         }



Mime
View raw message