directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1199852 [4/5] - in /directory/apacheds/branches/apacheds-txns/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, 09 Nov 2011 17:04:47 GMT
Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java?rev=1199852&r1=1199851&r2=1199852&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java Wed Nov  9 17:04:46 2011
@@ -77,7 +77,7 @@ public class OrCursorTest
     private static final Logger LOG = LoggerFactory.getLogger( OrCursorTest.class.getSimpleName() );
 
     File wkdir;
-    Store<Entry, Long> store;
+    Store store;
     static SchemaManager schemaManager = null;
     EvaluatorBuilder evaluatorBuilder;
     CursorBuilder cursorBuilder;
@@ -174,38 +174,38 @@ public class OrCursorTest
 
         ExprNode exprNode = FilterParser.parse( schemaManager, filter );
 
-        IndexCursor<?, Entry, Long> cursor = cursorBuilder.build( exprNode );
+        IndexCursor<?> cursor = cursorBuilder.build( exprNode );
 
         cursor.afterLast();
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 5 ), cursor.get().getId() );
         assertEquals( "walker", cursor.get().getValue() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 11, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 11 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getValue() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 8, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 8 ), cursor.get().getId() );
         assertEquals( "jack daniels", cursor.get().getValue() );
 
         assertFalse( cursor.previous() );
@@ -215,32 +215,32 @@ public class OrCursorTest
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 8, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 8 ), cursor.get().getId() );
         assertEquals( "jack daniels", cursor.get().getValue() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 11, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 11 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getValue() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 5 ), cursor.get().getId() );
         assertEquals( "walker", cursor.get().getValue() );
 
         assertFalse( cursor.next() );
@@ -255,10 +255,10 @@ public class OrCursorTest
     @SuppressWarnings("unchecked")
     public void testOrCursor() throws Exception
     {
-        List<Evaluator<? extends ExprNode, Entry, Long>> evaluators = new ArrayList<Evaluator<? extends ExprNode, Entry, Long>>();
-        List<Cursor<IndexEntry<?, Long>>> cursors = new ArrayList<Cursor<IndexEntry<?, Long>>>();
-        Evaluator<? extends ExprNode, Entry, Long> eval;
-        Cursor<IndexEntry<?, Long>> cursor;
+        List<Evaluator<? extends ExprNode>> evaluators = new ArrayList<Evaluator<? extends ExprNode>>();
+        List<Cursor<IndexEntry<?>>> cursors = new ArrayList<Cursor<IndexEntry<?>>>();
+        Evaluator<? extends ExprNode> eval;
+        Cursor<IndexEntry<?>> cursor;
 
         OrNode orNode = new OrNode();
 
@@ -292,32 +292,32 @@ public class OrCursorTest
         // from first
         assertTrue( cursor.first() );
         assertTrue( cursor.available() );
-        assertEquals( 8, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 8 ), cursor.get().getId() );
         assertEquals( "jack daniels", cursor.get().getValue() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 5 ), cursor.get().getId() );
         assertEquals( "walker", cursor.get().getValue() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 11, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 11 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getValue() );
 
         assertFalse( cursor.next() );
@@ -329,32 +329,32 @@ public class OrCursorTest
 
         assertTrue( cursor.last() );
         assertTrue( cursor.available() );
-        assertEquals( 11, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 11 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getValue() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 5 ), cursor.get().getId() );
         assertEquals( "walker", cursor.get().getValue() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 8, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 8 ), cursor.get().getId() );
         assertEquals( "jack daniels", cursor.get().getValue() );
 
         assertFalse( cursor.previous() );

Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.java?rev=1199852&r1=1199851&r2=1199852&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.java Wed Nov  9 17:04:46 2011
@@ -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;
@@ -67,7 +68,7 @@ public class PresenceTest
     private static final Logger LOG = LoggerFactory.getLogger( PresenceTest.class.getSimpleName() );
 
     File wkdir;
-    Store<Entry, Long> store;
+    Store store;
     static SchemaManager schemaManager = null;
 
 
@@ -156,30 +157,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( StoreUtils.getUUIDString( 5 ), cursor.get().getId() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 6 ), cursor.get().getId() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 8, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 8 ), cursor.get().getId() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 9 ), cursor.get().getId() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 10 ), cursor.get().getId() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 11, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 11 ), cursor.get().getId() );
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
 
@@ -208,7 +209,7 @@ public class PresenceTest
         assertEquals( SchemaConstants.CN_AT_OID, cursor.get().getValue() );
 
         // test before()
-        ForwardIndexEntry<String, Long> entry = new ForwardIndexEntry<String, Long>();
+        ForwardIndexEntry<String> entry = new ForwardIndexEntry<String>();
         entry.setValue( SchemaConstants.CN_AT_OID );
         cursor.before( entry );
         assertTrue( cursor.next() );
@@ -216,44 +217,44 @@ public class PresenceTest
         assertEquals( SchemaConstants.CN_AT_OID, cursor.get().getValue() );
 
         // test after()
-        entry = new ForwardIndexEntry<String, Long>();
+        entry = new ForwardIndexEntry<String>();
         cursor.after( entry );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( SchemaConstants.CN_AT_OID, cursor.get().getValue() );
 
         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( StoreUtils.getUUIDString( 2 ), cursor.get().getId() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 3, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 3 ), cursor.get().getId() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 4, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 4 ), cursor.get().getId() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 5 ), cursor.get().getId() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 6 ), cursor.get().getId() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 7, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 7 ), cursor.get().getId() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 8, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 8 ), cursor.get().getId() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 9 ), cursor.get().getId() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 11, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 11 ), cursor.get().getId() );
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
 
@@ -275,14 +276,14 @@ 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() );
@@ -297,14 +298,14 @@ 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() );
@@ -312,9 +313,9 @@ public class PresenceTest
             set.add( cursor.get().getId() );
         }
         assertEquals( 3, set.size() );
-        assertTrue( set.contains( 5L ) );
-        assertTrue( set.contains( 6L ) );
-        assertTrue( set.contains( 8L ) );
+        assertTrue( set.contains( StoreUtils.getUUIDString( 5 ) ) );
+        assertTrue( set.contains( StoreUtils.getUUIDString( 6 ) ) );
+        assertTrue( set.contains( StoreUtils.getUUIDString( 8 ) ) );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -348,9 +349,9 @@ public class PresenceTest
             set.add( cursor.get().getId() );
         }
         assertEquals( 3, set.size() );
-        assertTrue( set.contains( 5L ) );
-        assertTrue( set.contains( 6L ) );
-        assertTrue( set.contains( 8L ) );
+        assertTrue( set.contains( StoreUtils.getUUIDString( 5 ) ) );
+        assertTrue( set.contains( StoreUtils.getUUIDString( 6 ) ) );
+        assertTrue( set.contains( StoreUtils.getUUIDString( 8 ) ) );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -358,13 +359,13 @@ public class PresenceTest
         // ----------- 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( StoreUtils.getUUIDString( 1 ), cursor.get().getId() );
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
 
@@ -378,14 +379,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> entry = new ForwardIndexEntry<String>();
         entry.setValue( SchemaConstants.CN_AT_OID );
-        entry.setId( ( long ) 3 );
+        entry.setId( StoreUtils.getUUIDString( 3 ) );
         assertFalse( evaluator.evaluate( entry ) );
-        entry = new ForwardIndexEntry<String, Long>();
+        entry = new ForwardIndexEntry<String>();
         entry.setValue( SchemaConstants.CN_AT_OID );
-        entry.setId( ( long ) 5 );
+        entry.setId( StoreUtils.getUUIDString( 5 ) );
         assertTrue( evaluator.evaluate( entry ) );
     }
 
@@ -402,16 +403,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> entry = new ForwardIndexEntry<String>();
         // 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>();
         entry.setValue( oid );
-        entry.setId( ( long ) 5 );
+        entry.setId( StoreUtils.getUUIDString( 5 ) );
         assertTrue( evaluator.evaluate( entry ) );
     }
 
@@ -420,38 +421,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> entry = new ForwardIndexEntry<String>();
         entry.setValue( SchemaConstants.NAME_AT_OID );
-        entry.setId( ( long ) 3 );
+        entry.setId( StoreUtils.getUUIDString( 3 ) );
         assertTrue( evaluator.evaluate( entry ) );
-        entry = new ForwardIndexEntry<String, Long>();
+        entry = new ForwardIndexEntry<String>();
         entry.setValue( SchemaConstants.NAME_AT_OID );
-        entry.setId( ( long ) 5 );
+        entry.setId( StoreUtils.getUUIDString( 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>();
         entry.setValue( SchemaConstants.SEARCHGUIDE_AT_OID );
-        entry.setId( ( long ) 3 );
+        entry.setId( StoreUtils.getUUIDString( 3 ) );
         assertFalse( evaluator.evaluate( entry ) );
-        entry = new ForwardIndexEntry<String, Long>();
+        entry = new ForwardIndexEntry<String>();
         entry.setValue( SchemaConstants.SEARCHGUIDE_AT_OID );
-        entry.setId( ( long ) 5 );
-        entry.setEntry( store.lookup( ( long ) 5 ) );
+        entry.setId( StoreUtils.getUUIDString( 5 ) );
+        entry.setEntry( store.lookup( StoreUtils.getUUIDString( 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>();
         entry.setValue( SchemaConstants.ST_AT_OID );
-        entry.setId( ( long ) 3 );
+        entry.setId( StoreUtils.getUUIDString( 3 ) );
         assertFalse( evaluator.evaluate( entry ) );
-        entry = new ForwardIndexEntry<String, Long>();
+        entry = new ForwardIndexEntry<String>();
         entry.setValue( SchemaConstants.ST_AT_OID );
-        entry.setId( ( long ) 5 );
-        entry.setEntry( store.lookup( ( long ) 5 ) );
+        entry.setId( StoreUtils.getUUIDString( 5 ) );
+        entry.setEntry( store.lookup( StoreUtils.getUUIDString(53 ) ) );
         assertFalse( evaluator.evaluate( entry ) );
     }
 
@@ -460,8 +461,8 @@ public class PresenceTest
     public void testInvalidCursorPositionException() 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 );
         cursor.get();
     }
 
@@ -470,8 +471,8 @@ public class PresenceTest
     public void testInvalidCursorPositionException2() 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 );
         cursor.get();
     }
 
@@ -480,11 +481,11 @@ public class PresenceTest
     public void testUnsupportBeforeWithoutIndex() 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 );
 
         // test before()
-        ForwardIndexEntry<String, Long> entry = new ForwardIndexEntry<String, Long>();
+        ForwardIndexEntry<String> entry = new ForwardIndexEntry<String>();
         entry.setValue( SchemaConstants.SN_AT_OID );
         cursor.before( entry );
     }
@@ -494,11 +495,11 @@ public class PresenceTest
     public void testUnsupportAfterWithoutIndex() 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 );
 
         // test before()
-        ForwardIndexEntry<String, Long> entry = new ForwardIndexEntry<String, Long>();
+        ForwardIndexEntry<String> entry = new ForwardIndexEntry<String>();
         entry.setValue( SchemaConstants.SN_AT_OID );
         cursor.after( entry );
     }

Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java?rev=1199852&r1=1199851&r2=1199852&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java Wed Nov  9 17:04:46 2011
@@ -63,7 +63,7 @@ public class SubstringTest
     private static final Logger LOG = LoggerFactory.getLogger( SubstringTest.class.getSimpleName() );
 
     File wkdir;
-    Store<Entry, Long> store;
+    Store store;
     static SchemaManager schemaManager = null;
 
 
@@ -153,8 +153,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() );
 
@@ -162,29 +162,29 @@ public class SubstringTest
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 8, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 8 ), cursor.get().getId() );
         assertEquals( "jack daniels", cursor.get().getValue() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 5 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getValue() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 11, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 11 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getValue() );
 
         assertFalse( cursor.next() );
@@ -196,33 +196,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( StoreUtils.getUUIDString( 8 ), cursor.get().getId() );
         assertEquals( "jack daniels", cursor.get().getValue() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 5 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getValue() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 11, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 11 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getValue() );
 
         assertFalse( cursor.next() );
@@ -230,35 +230,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( StoreUtils.getUUIDString( 11 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getValue() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 5 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getValue() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 8, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 8 ), cursor.get().getId() );
         assertEquals( "jack daniels", cursor.get().getValue() );
 
         assertFalse( cursor.previous() );
@@ -266,33 +266,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( StoreUtils.getUUIDString( 11 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getValue() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 5 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getValue() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 8, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 8 ), cursor.get().getId() );
         assertEquals( "jack daniels", cursor.get().getValue() );
 
         assertFalse( cursor.previous() );
@@ -304,8 +304,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() );
 
@@ -313,15 +313,15 @@ public class SubstringTest
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
 
         assertFalse( cursor.next() );
@@ -329,19 +329,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( StoreUtils.getUUIDString( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
 
         assertFalse( cursor.next() );
@@ -349,21 +349,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( StoreUtils.getUUIDString( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
 
         assertFalse( cursor.previous() );
@@ -371,19 +371,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( StoreUtils.getUUIDString( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
 
         assertFalse( cursor.previous() );
@@ -395,8 +395,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() );
 
@@ -404,15 +404,15 @@ public class SubstringTest
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 6 ), cursor.get().getId() );;
         assertEquals( "jim bean", cursor.get().getValue() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
 
         assertFalse( cursor.next() );
@@ -420,19 +420,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( StoreUtils.getUUIDString( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
 
         assertFalse( cursor.next() );
@@ -440,21 +440,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( StoreUtils.getUUIDString( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
 
         assertFalse( cursor.previous() );
@@ -462,19 +462,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( StoreUtils.getUUIDString( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getValue() );
 
         assertFalse( cursor.previous() );
@@ -486,8 +486,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() );
 
@@ -495,7 +495,7 @@ public class SubstringTest
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 6 ), cursor.get().getId() );
         assertEquals( "bean", cursor.get().getValue() );
 
         assertFalse( cursor.next() );
@@ -504,11 +504,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( StoreUtils.getUUIDString( 6 ), cursor.get().getId() );
         assertEquals( "bean", cursor.get().getValue() );
 
         assertFalse( cursor.next() );
@@ -516,13 +516,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( StoreUtils.getUUIDString( 6 ), cursor.get().getId() );
         assertEquals( "bean", cursor.get().getValue() );
 
         assertFalse( cursor.previous() );
@@ -530,12 +530,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( StoreUtils.getUUIDString( 6 ), cursor.get().getId() );
         assertEquals( "bean", cursor.get().getValue() );
 
         assertFalse( cursor.previous() );
@@ -547,8 +547,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() );
 
@@ -556,7 +556,7 @@ public class SubstringTest
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( StoreUtils.getUUIDString( 5 ), cursor.get().getId() );
         assertEquals( "walker", cursor.get().getValue() );
 
         assertFalse( cursor.next() );
@@ -564,11 +564,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( StoreUtils.getUUIDString( 5 ), cursor.get().getId() );
         assertEquals( "walker", cursor.get().getValue() );
 
         assertFalse( cursor.next() );
@@ -576,13 +576,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( StoreUtils.getUUIDString( 5 ), cursor.get().getId() );
         assertEquals( "walker", cursor.get().getValue() );
 
         assertFalse( cursor.previous() );
@@ -590,12 +590,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( StoreUtils.getUUIDString( 5 ), cursor.get().getId() );
         assertEquals( "walker", cursor.get().getValue() );
 
         assertFalse( cursor.previous() );
@@ -607,50 +607,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> indexEntry = new ForwardIndexEntry<String>();
+        indexEntry.setId( StoreUtils.getUUIDString( 5 ) );
         assertTrue( evaluator.evaluate( indexEntry ) );
-        indexEntry.setId( 3L );
+        indexEntry.setId( StoreUtils.getUUIDString( 3 ) );
         indexEntry.setEntry( null );
         assertFalse( evaluator.evaluate( indexEntry ) );
-        indexEntry.setId( 6L );
+        indexEntry.setId( StoreUtils.getUUIDString( 6 ) );
         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>();
+        indexEntry.setId( StoreUtils.getUUIDString( 5 ) );
+        indexEntry.setEntry( store.lookup( StoreUtils.getUUIDString( 5 ) ) );
         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>();
+        indexEntry.setId( StoreUtils.getUUIDString( 6 ) );
+        indexEntry.setEntry( store.lookup( StoreUtils.getUUIDString( 6 ) ) );
         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>();
+        indexEntry.setId( StoreUtils.getUUIDString( 6 ) );
+        indexEntry.setEntry( store.lookup( StoreUtils.getUUIDString( 6 ) ) );
         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>();
+        indexEntry.setId( StoreUtils.getUUIDString( 6 ) );
+        indexEntry.setEntry( store.lookup( StoreUtils.getUUIDString( 6 ) ) );
         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>();
+        indexEntry.setId( StoreUtils.getUUIDString( 6 ) );
+        indexEntry.setEntry( store.lookup( StoreUtils.getUUIDString( 6 ) ) );
         assertTrue( evaluator.evaluate( indexEntry ) );
     }
 
@@ -659,26 +659,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> indexEntry = new ForwardIndexEntry<String>();
+        indexEntry.setId( StoreUtils.getUUIDString( 6 ) );
         assertTrue( evaluator.evaluate( indexEntry ) );
-        indexEntry.setId( 3L );
+        indexEntry.setId( StoreUtils.getUUIDString( 3 ) );
         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>();
+        indexEntry.setId( StoreUtils.getUUIDString( 6 ) );
+        indexEntry.setEntry( store.lookup( StoreUtils.getUUIDString( 6 ) ) );
         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>();
+        indexEntry.setId( StoreUtils.getUUIDString( 6 ) );
+        indexEntry.setEntry( store.lookup( StoreUtils.getUUIDString( 6 ) ) );
         assertFalse( evaluator.evaluate( indexEntry ) );
     }
 
@@ -693,8 +693,8 @@ public class SubstringTest
     public void testInvalidCursorPositionException() 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 );
         cursor.get();
     }
 
@@ -703,8 +703,8 @@ public class SubstringTest
     public void testInvalidCursorPositionException2() 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 );
         cursor.get();
     }
 
@@ -713,11 +713,11 @@ public class SubstringTest
     public void testUnsupportBeforeWithoutIndex() throws Exception
     {
         SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "sn" ), "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 );
 
         // test before()
-        ForwardIndexEntry<String, Long> entry = new ForwardIndexEntry<String, Long>();
+        ForwardIndexEntry<String> entry = new ForwardIndexEntry<String>();
         entry.setValue( SchemaConstants.SN_AT_OID );
         cursor.before( entry );
     }
@@ -727,11 +727,11 @@ public class SubstringTest
     public void testUnsupportAfterWithoutIndex() throws Exception
     {
         SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "sn" ), "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 );
 
         // test before()
-        ForwardIndexEntry<String, Long> entry = new ForwardIndexEntry<String, Long>();
+        ForwardIndexEntry<String> entry = new ForwardIndexEntry<String>();
         entry.setValue( SchemaConstants.SN_AT_OID );
         cursor.after( entry );
     }



Mime
View raw message