directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1330754 [3/3] - in /directory/apacheds/branches/index-work: core-constants/src/main/java/org/apache/directory/server/constants/ jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ ldif-partition/src/mai...
Date Thu, 26 Apr 2012 10:22:15 GMT
Modified: directory/apacheds/branches/index-work/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java?rev=1330754&r1=1330753&r2=1330754&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java (original)
+++ directory/apacheds/branches/index-work/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java Thu Apr 26 10:22:13 2012
@@ -163,29 +163,29 @@ public class SubstringTest
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( 8, ( long ) cursor.get().getId() );
-        assertEquals( "jack daniels", cursor.get().getValue() );
+        assertEquals( "jack daniels", cursor.get().getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( 6, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( 9, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( 10, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( 5, ( long ) cursor.get().getId() );
-        assertEquals( "johnny walker", cursor.get().getValue() );
+        assertEquals( "johnny walker", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( 11, ( long ) cursor.get().getId() );
-        assertEquals( "johnny walker", cursor.get().getValue() );
+        assertEquals( "johnny walker", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -201,29 +201,29 @@ public class SubstringTest
 
         assertTrue( cursor.available() );
         assertEquals( 8, ( long ) cursor.get().getId() );
-        assertEquals( "jack daniels", cursor.get().getValue() );
+        assertEquals( "jack daniels", cursor.get().getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( 6, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( 9, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( 10, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( 5, ( long ) cursor.get().getId() );
-        assertEquals( "johnny walker", cursor.get().getValue() );
+        assertEquals( "johnny walker", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( 11, ( long ) cursor.get().getId() );
-        assertEquals( "johnny walker", cursor.get().getValue() );
+        assertEquals( "johnny walker", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -238,29 +238,29 @@ public class SubstringTest
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( 11, ( long ) cursor.get().getId() );
-        assertEquals( "johnny walker", cursor.get().getValue() );
+        assertEquals( "johnny walker", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( 5, ( long ) cursor.get().getId() );
-        assertEquals( "johnny walker", cursor.get().getValue() );
+        assertEquals( "johnny walker", cursor.get().getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( 10, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( 9, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( 6, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( 8, ( long ) cursor.get().getId() );
-        assertEquals( "jack daniels", cursor.get().getValue() );
+        assertEquals( "jack daniels", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -273,29 +273,29 @@ public class SubstringTest
         assertTrue( cursor.available() );
 
         assertEquals( 11, ( long ) cursor.get().getId() );
-        assertEquals( "johnny walker", cursor.get().getValue() );
+        assertEquals( "johnny walker", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( 5, ( long ) cursor.get().getId() );
-        assertEquals( "johnny walker", cursor.get().getValue() );
+        assertEquals( "johnny walker", cursor.get().getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( 10, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( 9, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( 6, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( 8, ( long ) cursor.get().getId() );
-        assertEquals( "jack daniels", cursor.get().getValue() );
+        assertEquals( "jack daniels", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -317,15 +317,15 @@ public class SubstringTest
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( 6, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( 9, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( 10, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -338,15 +338,15 @@ public class SubstringTest
 
         assertTrue( cursor.available() );
         assertEquals( 6, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( 9, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( 10, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -361,15 +361,15 @@ public class SubstringTest
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( 10, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( 9, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( 6, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -382,15 +382,15 @@ public class SubstringTest
         assertTrue( cursor.available() );
 
         assertEquals( 10, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( 9, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( 6, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -412,15 +412,15 @@ public class SubstringTest
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( 6, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( 9, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( 10, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -434,15 +434,15 @@ public class SubstringTest
 
         assertTrue( cursor.available() );
         assertEquals( 6, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( 9, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( 10, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -457,15 +457,15 @@ public class SubstringTest
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( 10, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( 9, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( 6, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -478,15 +478,15 @@ public class SubstringTest
         assertTrue( cursor.available() );
 
         assertEquals( 10, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( 9, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( 6, ( long ) cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getValue() );
+        assertEquals( "jim bean", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -508,7 +508,7 @@ public class SubstringTest
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( 6, ( long ) cursor.get().getId() );
-        assertEquals( "bean", cursor.get().getValue() );
+        assertEquals( "bean", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -521,7 +521,7 @@ public class SubstringTest
 
         assertTrue( cursor.available() );
         assertEquals( 6, ( long ) cursor.get().getId() );
-        assertEquals( "bean", cursor.get().getValue() );
+        assertEquals( "bean", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -536,7 +536,7 @@ public class SubstringTest
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( 6, ( long ) cursor.get().getId() );
-        assertEquals( "bean", cursor.get().getValue() );
+        assertEquals( "bean", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -550,7 +550,7 @@ public class SubstringTest
 
         assertTrue( cursor.available() );
         assertEquals( 6, ( long ) cursor.get().getId() );
-        assertEquals( "bean", cursor.get().getValue() );
+        assertEquals( "bean", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -572,7 +572,7 @@ public class SubstringTest
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( 5, ( long ) cursor.get().getId() );
-        assertEquals( "walker", cursor.get().getValue() );
+        assertEquals( "walker", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -585,7 +585,7 @@ public class SubstringTest
 
         assertTrue( cursor.available() );
         assertEquals( 5, ( long ) cursor.get().getId() );
-        assertEquals( "walker", cursor.get().getValue() );
+        assertEquals( "walker", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -600,7 +600,7 @@ public class SubstringTest
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( 5, ( long ) cursor.get().getId() );
-        assertEquals( "walker", cursor.get().getValue() );
+        assertEquals( "walker", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -614,7 +614,7 @@ public class SubstringTest
 
         assertTrue( cursor.available() );
         assertEquals( 5L, ( long ) cursor.get().getId() );
-        assertEquals( "walker", cursor.get().getValue() );
+        assertEquals( "walker", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -759,7 +759,7 @@ public class SubstringTest
     
             // test before()
             ForwardIndexEntry<String, Long> entry = new ForwardIndexEntry<String, Long>();
-            entry.setValue( SchemaConstants.SN_AT_OID );
+            entry.setKey( SchemaConstants.SN_AT_OID );
             cursor.before( entry );
         }
         finally
@@ -782,7 +782,7 @@ public class SubstringTest
     
             // test before()
             ForwardIndexEntry<String, Long> entry = new ForwardIndexEntry<String, Long>();
-            entry.setValue( SchemaConstants.SN_AT_OID );
+            entry.setKey( SchemaConstants.SN_AT_OID );
             cursor.after( entry );
         }
         finally

Modified: directory/apacheds/branches/index-work/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java?rev=1330754&r1=1330753&r2=1330754&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java (original)
+++ directory/apacheds/branches/index-work/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java Thu Apr 26 10:22:13 2012
@@ -34,6 +34,7 @@ import org.apache.commons.io.FileUtils;
 import org.apache.directory.server.core.api.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.api.partition.Partition;
 import org.apache.directory.server.core.partition.impl.avl.AvlPartition;
+import org.apache.directory.server.core.partition.impl.btree.AbstractBTreePartition;
 import org.apache.directory.server.xdbm.ForwardIndexEntry;
 import org.apache.directory.server.xdbm.IndexEntry;
 import org.apache.directory.server.xdbm.Store;
@@ -160,162 +161,105 @@ public class SubtreeScopeTest
     @Test
     public void testCursorNoDeref() throws Exception
     {
-        ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES, new Dn( SchemaConstants.OU_AT_OID
-            + "=sales," + SchemaConstants.O_AT_OID + "=good times co." ), SearchScope.SUBTREE );
+        ScopeNode node = new ScopeNode( 
+            AliasDerefMode.NEVER_DEREF_ALIASES, 
+            new Dn( SchemaConstants.OU_AT_OID + "=board of directors," + SchemaConstants.O_AT_OID + "=good times co." ), 
+            SearchScope.SUBTREE );
         SubtreeScopeEvaluator<Entry, Long> evaluator = new SubtreeScopeEvaluator<Entry, Long>( store, node );
         SubtreeScopeCursor<Long> cursor = new SubtreeScopeCursor<Long>( store, evaluator );
 
+        long[] expected = new long[]{ 3L, 3L, 7L, 3L, 9L, 3L, 10L, 3L };
+        
         // --------- Test beforeFirst() ---------
-
+        //( ( AbstractBTreePartition<Long> ) ((Partition)store) ).dumpRdnIdx( 0L, "" );
+        
+        IndexEntry<Long, Long> indexEntry = null;
+        
         cursor.beforeFirst();
         assertFalse( cursor.available() );
 
-        assertTrue( cursor.next() );
-        assertTrue( cursor.available() );
-        IndexEntry<Long, Long> indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 2L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getValue() );
-
-        assertTrue( cursor.next() );
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 5L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getValue() );
-
-        assertTrue( cursor.next() );
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getValue() );
-
+        int pos = 0;
+        
+        while ( cursor.next() )
+        {
+            assertTrue( cursor.available() );
+            indexEntry = cursor.get();
+            
+            assertNotNull( indexEntry );
+            assertEquals( expected[pos++], (long)indexEntry.getId() );
+            assertEquals( expected[pos++], (long)indexEntry.getKey() );
+        }
+        
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
         cursor.close();
 
         // --------- Test first() ---------
-
         cursor = new SubtreeScopeCursor<Long>( store, evaluator );
         assertFalse( cursor.available() );
         cursor.first();
+        pos = 2;
 
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 2L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getValue() );
-
-        assertTrue( cursor.next() );
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 5L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getValue() );
-
-        assertTrue( cursor.next() );
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getValue() );
-
+        while ( cursor.next() )
+        {
+            assertTrue( cursor.available() );
+            indexEntry = cursor.get();
+            
+            assertNotNull( indexEntry );
+            assertEquals( expected[pos++], (long)indexEntry.getId() );
+            assertEquals( expected[pos++], (long)indexEntry.getKey() );
+        }
+        
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
         cursor.close();
 
         // --------- Test afterLast() ---------
-
         cursor = new SubtreeScopeCursor<Long>( store, evaluator );
-        cursor.afterLast();
-        assertFalse( cursor.available() );
-
-        assertTrue( cursor.previous() );
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getValue() );
-
-        assertTrue( cursor.previous() );
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 5L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getValue() );
-
-        assertTrue( cursor.previous() );
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 2L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getValue() );
+        
+        try
+        {
+            cursor.afterLast();
+            fail( "should fail with UnsupportedOperationException" );
+        }
+        catch ( UnsupportedOperationException uoe )
+        {
+        }
 
-        assertFalse( cursor.previous() );
-        assertFalse( cursor.available() );
         cursor.close();
 
         // --------- Test last() ---------
 
         cursor = new SubtreeScopeCursor<Long>( store, evaluator );
-        assertFalse( cursor.available() );
-        cursor.last();
 
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getValue() );
-
-        assertTrue( cursor.previous() );
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 5L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getValue() );
-
-        assertTrue( cursor.previous() );
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 2L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getValue() );
+        try
+        {
+            assertFalse( cursor.available() );
+            cursor.last();
+            fail( "should fail with UnsupportedOperationException" );
+        }
+        catch ( UnsupportedOperationException uoe )
+        {
+        }
 
-        assertFalse( cursor.previous() );
-        assertFalse( cursor.available() );
         cursor.close();
 
         // --------- Test previous() before positioning ---------
 
         cursor = new SubtreeScopeCursor<Long>( store, evaluator );
-        assertFalse( cursor.available() );
-        cursor.previous();
-
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getValue() );
-
-        assertTrue( cursor.previous() );
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 5L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getValue() );
 
-        assertTrue( cursor.previous() );
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 2L, ( long ) indexEntry.getId() );
-        assertEquals( 2L, ( long ) indexEntry.getValue() );
+        try
+        {
+            assertFalse( cursor.available() );
+            cursor.previous();
+            fail( "should fail with UnsupportedOperationException" );
+        }
+        catch ( UnsupportedOperationException uoe )
+        {
+        }
 
-        assertFalse( cursor.previous() );
-        assertFalse( cursor.available() );
         cursor.close();
-}
+    }
 
 
     @Test
@@ -336,21 +280,21 @@ public class SubtreeScopeTest
         IndexEntry<Long, Long> indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 3L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -366,28 +310,28 @@ public class SubtreeScopeTest
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 3L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
         cursor.close();
 
         // --------- Test afterLast() ---------
-
+        /*
         cursor = new SubtreeScopeCursor<Long>( store, evaluator );
         cursor.afterLast();
         assertFalse( cursor.available() );
@@ -397,28 +341,29 @@ public class SubtreeScopeTest
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 3L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
         cursor.close();
+        */
 
         // --------- Test last() ---------
-
+        /*
         cursor = new SubtreeScopeCursor<Long>( store, evaluator );
         assertFalse( cursor.available() );
         cursor.last();
@@ -427,28 +372,29 @@ public class SubtreeScopeTest
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 3L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
         cursor.close();
-
+        */
+        
         // --------- Test previous() before positioning ---------
-
+        /*
         cursor = new SubtreeScopeCursor<Long>( store, evaluator );
         assertFalse( cursor.available() );
         cursor.previous();
@@ -457,26 +403,26 @@ public class SubtreeScopeTest
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 3L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
         cursor.close();
-
+        */
         // --------- Test next() before positioning ---------
 
         cursor = new SubtreeScopeCursor<Long>( store, evaluator );
@@ -487,21 +433,21 @@ public class SubtreeScopeTest
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 3L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -528,14 +474,14 @@ public class SubtreeScopeTest
         IndexEntry<Long, Long> indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 7L, ( long ) indexEntry.getValue() );
+        assertEquals( 7L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 7L, ( long ) indexEntry.getValue() );
+        assertEquals( 7L, ( long ) indexEntry.getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -551,21 +497,21 @@ public class SubtreeScopeTest
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 7L, ( long ) indexEntry.getValue() );
+        assertEquals( 7L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 7L, ( long ) indexEntry.getValue() );
+        assertEquals( 7L, ( long ) indexEntry.getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
         cursor.close();
 
         // --------- Test afterLast() ---------
-
+        /*
         cursor = new SubtreeScopeCursor<Long>( store, evaluator );
         cursor.afterLast();
         assertFalse( cursor.available() );
@@ -575,21 +521,22 @@ public class SubtreeScopeTest
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 7L, ( long ) indexEntry.getValue() );
+        assertEquals( 7L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 7L, ( long ) indexEntry.getValue() );
+        assertEquals( 7L, ( long ) indexEntry.getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
         cursor.close();
+        */
 
         // --------- Test last() ---------
-
+        /*
         cursor = new SubtreeScopeCursor<Long>( store, evaluator );
         assertFalse( cursor.available() );
         cursor.last();
@@ -598,21 +545,22 @@ public class SubtreeScopeTest
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 7L, ( long ) indexEntry.getValue() );
+        assertEquals( 7L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 7L, ( long ) indexEntry.getValue() );
+        assertEquals( 7L, ( long ) indexEntry.getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
         cursor.close();
+        */
 
         // --------- Test previous() before positioning ---------
-
+        /*
         cursor = new SubtreeScopeCursor<Long>( store, evaluator );
         assertFalse( cursor.available() );
         cursor.previous();
@@ -621,18 +569,19 @@ public class SubtreeScopeTest
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 7L, ( long ) indexEntry.getValue() );
+        assertEquals( 7L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 7L, ( long ) indexEntry.getValue() );
+        assertEquals( 7L, ( long ) indexEntry.getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
         cursor.close();
+        */
     }
 
 
@@ -676,48 +625,25 @@ public class SubtreeScopeTest
         SubtreeScopeCursor<Long> cursor = new SubtreeScopeCursor<Long>( store, evaluator );
 
         // --------- Test beforeFirst() ---------
+        //( ( AbstractBTreePartition<Long> ) ((Partition)store) ).dumpRdnIdx( 0L, "" );
 
-        cursor.beforeFirst();
-        assertFalse( cursor.available() );
-
-        assertTrue( cursor.next() );
-        assertTrue( cursor.available() );
-        IndexEntry<Long, Long> indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 3L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
-
-        assertTrue( cursor.next() );
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
-
-        assertTrue( cursor.next() );
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 13L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
-
-        assertTrue( cursor.next() );
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
-
-        assertTrue( cursor.next() );
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 8L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        long[] expected = new long[]{ 3L, 3L, 7L, 3L, 13L, 3L, 6L, 3L, 8L, 3L };
+        IndexEntry<Long, Long> indexEntry = null;
 
+        int pos = 0;
+        
+        while ( cursor.next() )
+        {
+            assertTrue( cursor.available() );
+            indexEntry = cursor.get();
+            
+            assertNotNull( indexEntry );
+            assertEquals( expected[pos++], (long)indexEntry.getId() );
+            assertEquals( expected[pos++], (long)indexEntry.getKey() );
+        }
+        
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
-        
         cursor.close();
 
         // --------- Test first() ---------
@@ -726,40 +652,25 @@ public class SubtreeScopeTest
         assertFalse( cursor.available() );
         cursor.first();
 
-        assertTrue( cursor.next() );
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
-
-        assertTrue( cursor.next() );
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 13L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
-
-        assertTrue( cursor.next() );
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
-
-        assertTrue( cursor.next() );
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 8L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        expected = new long[]{ 7L, 3L, 13L, 3L, 6L, 3L, 8L, 3L };
+        pos = 0;
+        
+        while ( cursor.next() )
+        {
+            assertTrue( cursor.available() );
+            indexEntry = cursor.get();
+            
+            assertNotNull( indexEntry );
+            assertEquals( expected[pos++], (long)indexEntry.getId() );
+            assertEquals( expected[pos++], (long)indexEntry.getKey() );
+        }
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
         cursor.close();
 
         // --------- Test afterLast() ---------
-
+        /*
         cursor = new SubtreeScopeCursor<Long>( store, evaluator );
         cursor.afterLast();
         assertFalse( cursor.available() );
@@ -769,42 +680,43 @@ public class SubtreeScopeTest
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 8L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 13L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 3L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
         cursor.close();
-
+        */
+        
         // --------- Test last() ---------
-
+        /*
         cursor = new SubtreeScopeCursor<Long>( store, evaluator );
         assertFalse( cursor.available() );
         cursor.last();
@@ -813,42 +725,42 @@ public class SubtreeScopeTest
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 8L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 13L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 3L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
         cursor.close();
-
+        */
         // --------- Test previous() before positioning ---------
-
+        /*
         cursor = new SubtreeScopeCursor<Long>( store, evaluator );
         assertFalse( cursor.available() );
         cursor.previous();
@@ -857,80 +769,59 @@ public class SubtreeScopeTest
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 8L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 13L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         indexEntry = cursor.get();
         assertNotNull( indexEntry );
         assertEquals( 3L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        assertEquals( 3L, ( long ) indexEntry.getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
         cursor.close();
-
+        */
         // --------- Test next() before positioning ---------
 
         cursor = new SubtreeScopeCursor<Long>( store, evaluator );
         assertFalse( cursor.available() );
-        cursor.next();
 
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 3L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
-
-        assertTrue( cursor.next() );
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 7L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
-
-        assertTrue( cursor.next() );
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 13L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
-
-        assertTrue( cursor.next() );
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 6L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
-
-        assertTrue( cursor.next() );
-        assertTrue( cursor.available() );
-        indexEntry = cursor.get();
-        assertNotNull( indexEntry );
-        assertEquals( 8L, ( long ) indexEntry.getId() );
-        assertEquals( 3L, ( long ) indexEntry.getValue() );
+        expected = new long[]{ 3L, 3L, 7L, 3L, 13, 3L, 6L, 3L, 8L, 3L };
 
+        pos = 0;
+        
+        while ( cursor.next() )
+        {
+            assertTrue( cursor.available() );
+            indexEntry = cursor.get();
+            
+            assertNotNull( indexEntry );
+            assertEquals( expected[pos++], (long)indexEntry.getId() );
+            assertEquals( expected[pos++], (long)indexEntry.getKey() );
+        }
+        
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
         cursor.close();
@@ -1010,7 +901,7 @@ public class SubtreeScopeTest
     
             // test before()
             ForwardIndexEntry<Long, Long> entry = new ForwardIndexEntry<Long, Long>();
-            entry.setValue( 3L );
+            entry.setKey( 3L );
             cursor.before( entry );
         }
         finally
@@ -1034,7 +925,7 @@ public class SubtreeScopeTest
     
             // test after()
             ForwardIndexEntry<Long, Long> entry = new ForwardIndexEntry<Long, Long>();
-            entry.setValue( 3L );
+            entry.setKey( 3L );
             cursor.after( entry );
         }
         finally

Modified: directory/apacheds/branches/index-work/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java?rev=1330754&r1=1330753&r2=1330754&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java (original)
+++ directory/apacheds/branches/index-work/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java Thu Apr 26 10:22:13 2012
@@ -297,7 +297,7 @@ public class IndexDialog<K, O, ID> exten
                 {
                     IndexEntry<K, ID> rec = list.get();
                     row = new Object[2];
-                    row[0] = rec.getValue();
+                    row[0] = rec.getKey();
                     row[1] = rec.getId();
                     model.addRow( row );
                     count++;
@@ -307,13 +307,13 @@ public class IndexDialog<K, O, ID> exten
             {
                 list = index.forwardCursor();
                 ForwardIndexEntry<K, ID> entry = new ForwardIndexEntry<K, ID>();
-                entry.setValue( key );
+                entry.setKey( key );
                 list.before( entry );
                 while ( list.next() )
                 {
                     IndexEntry<K, ID> rec = list.get();
                     row = new Object[2];
-                    row[0] = rec.getValue();
+                    row[0] = rec.getKey();
                     row[1] = rec.getId();
                     model.addRow( row );
                     count++;
@@ -323,13 +323,13 @@ public class IndexDialog<K, O, ID> exten
             {
                 list = index.forwardCursor();
                 ForwardIndexEntry<K, ID> entry = new ForwardIndexEntry<K, ID>();
-                entry.setValue( key );
+                entry.setKey( key );
                 list.after( entry );
                 while ( list.previous() )
                 {
                     IndexEntry<K, ID> rec = list.get();
                     row = new Object[2];
-                    row[0] = rec.getValue();
+                    row[0] = rec.getKey();
                     row[1] = rec.getId();
                     model.addRow( row );
                     count++;
@@ -362,7 +362,7 @@ public class IndexDialog<K, O, ID> exten
                 {
                     IndexEntry<K, ID> rec = list.get();
                     row = new Object[2];
-                    row[0] = rec.getValue();
+                    row[0] = rec.getKey();
                     row[1] = rec.getId();
                     model.addRow( row );
                     count++;

Modified: directory/apacheds/branches/index-work/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexDialog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexDialog.java?rev=1330754&r1=1330753&r2=1330754&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexDialog.java (original)
+++ directory/apacheds/branches/index-work/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexDialog.java Thu Apr 26 10:22:13 2012
@@ -299,7 +299,7 @@ public class IndexDialog<K, O, ID> exten
                 {
                     IndexEntry<K, ID> rec = list.get();
                     row = new Object[2];
-                    row[0] = rec.getValue();
+                    row[0] = rec.getKey();
                     row[1] = rec.getId();
                     model.addRow( row );
                     count++;
@@ -309,13 +309,13 @@ public class IndexDialog<K, O, ID> exten
             {
                 list = index.forwardCursor();
                 ForwardIndexEntry<K, ID> entry = new ForwardIndexEntry<K, ID>();
-                entry.setValue( key );
+                entry.setKey( key );
                 list.before( entry );
                 while ( list.next() )
                 {
                     IndexEntry<K, ID> rec = list.get();
                     row = new Object[2];
-                    row[0] = rec.getValue();
+                    row[0] = rec.getKey();
                     row[1] = rec.getId();
                     model.addRow( row );
                     count++;
@@ -325,13 +325,13 @@ public class IndexDialog<K, O, ID> exten
             {
                 list = index.forwardCursor();
                 ForwardIndexEntry<K, ID> entry = new ForwardIndexEntry<K, ID>();
-                entry.setValue( key );
+                entry.setKey( key );
                 list.after( entry );
                 while ( list.previous() )
                 {
                     IndexEntry<K, ID> rec = list.get();
                     row = new Object[2];
-                    row[0] = rec.getValue();
+                    row[0] = rec.getKey();
                     row[1] = rec.getId();
                     model.addRow( row );
                     count++;
@@ -364,7 +364,7 @@ public class IndexDialog<K, O, ID> exten
                 {
                     IndexEntry<K, ID> rec = list.get();
                     row = new Object[2];
-                    row[0] = rec.getValue();
+                    row[0] = rec.getKey();
                     row[1] = rec.getId();
                     model.addRow( row );
                     count++;



Mime
View raw message