directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1332268 [5/5] - in /directory/apacheds/trunk: ./ all/ core-annotations/ core-annotations/src/main/java/org/apache/directory/server/core/factory/ core-api/ core-api/src/main/java/org/apache/directory/server/core/api/changelog/ core-api/src/...
Date Mon, 30 Apr 2012 15:59:27 GMT
Modified: directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java?rev=1332268&r1=1332267&r2=1332268&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java Mon Apr 30 15:59:22 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,169 +161,116 @@ 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 );
+        Dn dn = new Dn( SchemaConstants.OU_AT_OID + "=board of directors," + SchemaConstants.O_AT_OID + "=good times co." );
+        long baseId = store.getEntryId( dn );
+
+        ScopeNode<Long> node = new ScopeNode<Long>( AliasDerefMode.NEVER_DEREF_ALIASES, dn, baseId, 
+            SearchScope.SUBTREE );
         SubtreeScopeEvaluator<Entry, Long> evaluator = new SubtreeScopeEvaluator<Entry, Long>( store, node );
         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
     public void testCursorWithDereferencing() throws Exception
     {
-        ScopeNode node = new ScopeNode( AliasDerefMode.DEREF_IN_SEARCHING, new Dn( SchemaConstants.OU_AT_OID
-            + "=board of directors," + SchemaConstants.O_AT_OID + "=good times co." ), SearchScope.SUBTREE );
+        Dn dn = new Dn( SchemaConstants.OU_AT_OID
+            + "=board of directors," + SchemaConstants.O_AT_OID + "=good times co." );
+        long baseId = store.getEntryId( dn );
+
+        ScopeNode<Long> node = new ScopeNode<Long>( AliasDerefMode.DEREF_IN_SEARCHING, dn, baseId, SearchScope.SUBTREE );
         SubtreeScopeEvaluator<Entry, Long> evaluator = new SubtreeScopeEvaluator<Entry, Long>( store, node );
         SubtreeScopeCursor<Long> cursor = new SubtreeScopeCursor<Long>( store, evaluator );
 
@@ -336,21 +284,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 +314,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 +345,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 +376,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 +407,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 +437,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() );
@@ -512,9 +462,13 @@ public class SubtreeScopeTest
     @Test
     public void testCursorWithDereferencing2() throws Exception
     {
-        ScopeNode node = new ScopeNode( AliasDerefMode.DEREF_IN_SEARCHING, new Dn( SchemaConstants.OU_AT_OID
-            + "=apache," + SchemaConstants.OU_AT_OID + "=board of directors," + SchemaConstants.O_AT_OID
-            + "=good times co." ), SearchScope.SUBTREE );
+        Dn dn = new Dn( SchemaConstants.OU_AT_OID
+            + "=apache," + SchemaConstants.OU_AT_OID 
+            + "=board of directors," + SchemaConstants.O_AT_OID
+            + "=good times co." );
+        long baseId = store.getEntryId( dn );
+
+        ScopeNode<Long> node = new ScopeNode<Long>( AliasDerefMode.DEREF_IN_SEARCHING, dn, baseId, SearchScope.SUBTREE );
         SubtreeScopeEvaluator<Entry, Long> evaluator = new SubtreeScopeEvaluator<Entry, Long>( store, node );
         SubtreeScopeCursor<Long> cursor = new SubtreeScopeCursor<Long>( store, evaluator );
 
@@ -528,14 +482,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 +505,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 +529,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 +553,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 +577,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();
+        */
     }
 
 
@@ -668,56 +625,37 @@ public class SubtreeScopeTest
         addContext = new AddOperationContext( null, entry );
         ( ( Partition ) store ).add( addContext );
 
-        ScopeNode node = new ScopeNode( 
+        dn = new Dn( SchemaConstants.OU_AT_OID + "=board of directors," + SchemaConstants.O_AT_OID + "=good times co." );
+        long baseId = store.getEntryId( dn );
+
+        ScopeNode<Long> node = new ScopeNode<Long>( 
             AliasDerefMode.DEREF_IN_SEARCHING, 
-            new Dn( SchemaConstants.OU_AT_OID + "=board of directors," + SchemaConstants.O_AT_OID + "=good times co." ), 
+            dn, 
+            baseId, 
             SearchScope.SUBTREE );
         SubtreeScopeEvaluator<Entry, Long> evaluator = new SubtreeScopeEvaluator<Entry, Long>( store, node );
         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 +664,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 +692,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 +737,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 +781,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();
@@ -940,8 +843,11 @@ public class SubtreeScopeTest
     @Test
     public void testEvaluatorNoDereferencing() 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 );
+        Dn dn = new Dn( SchemaConstants.OU_AT_OID
+            + "=sales," + SchemaConstants.O_AT_OID + "=good times co." );
+        long baseId = store.getEntryId( dn );
+
+        ScopeNode<Long> node = new ScopeNode<Long>( AliasDerefMode.NEVER_DEREF_ALIASES, dn, baseId, SearchScope.SUBTREE );
         SubtreeScopeEvaluator<Entry, Long> evaluator = new SubtreeScopeEvaluator<Entry, Long>( store, node );
 
         ForwardIndexEntry<Long, Long> indexEntry = new ForwardIndexEntry<Long, Long>();
@@ -953,8 +859,11 @@ public class SubtreeScopeTest
     @Test
     public void testEvaluatorWithDereferencing() throws Exception
     {
-        ScopeNode node = new ScopeNode( AliasDerefMode.DEREF_ALWAYS, new Dn( SchemaConstants.OU_AT_OID
-            + "=engineering," + SchemaConstants.O_AT_OID + "=good times co." ), SearchScope.SUBTREE );
+        Dn dn = new Dn( SchemaConstants.OU_AT_OID
+            + "=engineering," + SchemaConstants.O_AT_OID + "=good times co." );
+        long baseId = store.getEntryId( dn );
+
+        ScopeNode<Long> node = new ScopeNode<Long>( AliasDerefMode.DEREF_ALWAYS, dn, baseId, SearchScope.SUBTREE );
         SubtreeScopeEvaluator<Entry, Long> evaluator = new SubtreeScopeEvaluator<Entry, Long>( store, node );
         assertEquals( node, evaluator.getExpression() );
 
@@ -980,11 +889,12 @@ public class SubtreeScopeTest
     public void testInvalidCursorPositionException() throws Exception
     {
         SubtreeScopeCursor<Long> cursor = null;
+        Dn dn = new Dn( SchemaConstants.OU_AT_OID + "=sales," + SchemaConstants.O_AT_OID + "=good times co." );
+        long baseId = store.getEntryId( dn );
         
         try
         {
-            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<Long> node = new ScopeNode<Long>( AliasDerefMode.NEVER_DEREF_ALIASES, dn, baseId, SearchScope.SUBTREE );
             SubtreeScopeEvaluator<Entry, Long> evaluator = new SubtreeScopeEvaluator<Entry, Long>( store, node );
             cursor = new SubtreeScopeCursor<Long>( store, evaluator );
             cursor.get();
@@ -1000,17 +910,19 @@ public class SubtreeScopeTest
     public void testUnsupportBeforeWithoutIndex() throws Exception
     {
         SubtreeScopeCursor<Long> cursor = null;
+        Dn dn = new Dn( SchemaConstants.OU_AT_OID
+            + "=sales," + SchemaConstants.O_AT_OID + "=good times co." );
+        long baseId = store.getEntryId( dn );
         
         try
         {
-            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<Long> node = new ScopeNode<Long>( AliasDerefMode.NEVER_DEREF_ALIASES, dn, baseId, SearchScope.SUBTREE );
             SubtreeScopeEvaluator<Entry, Long> evaluator = new SubtreeScopeEvaluator<Entry, Long>( store, node );
             cursor = new SubtreeScopeCursor<Long>( store, evaluator );
     
             // test before()
             ForwardIndexEntry<Long, Long> entry = new ForwardIndexEntry<Long, Long>();
-            entry.setValue( 3L );
+            entry.setKey( 3L );
             cursor.before( entry );
         }
         finally
@@ -1024,17 +936,19 @@ public class SubtreeScopeTest
     public void testUnsupportAfterWithoutIndex() throws Exception
     {
         SubtreeScopeCursor<Long> cursor = null;
-        
+        Dn dn = new Dn( SchemaConstants.OU_AT_OID
+            + "=sales," + SchemaConstants.O_AT_OID + "=good times co." );
+        long baseId = store.getEntryId( dn );
+
         try
         {
-            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<Long> node = new ScopeNode<Long>( AliasDerefMode.NEVER_DEREF_ALIASES, dn, baseId, SearchScope.SUBTREE );
             SubtreeScopeEvaluator<Entry, Long> evaluator = new SubtreeScopeEvaluator<Entry, Long>( store, node );
             cursor = new SubtreeScopeCursor<Long>( store, evaluator );
     
             // test after()
             ForwardIndexEntry<Long, Long> entry = new ForwardIndexEntry<Long, Long>();
-            entry.setValue( 3L );
+            entry.setKey( 3L );
             cursor.after( entry );
         }
         finally
@@ -1048,7 +962,7 @@ public class SubtreeScopeTest
     public void testIllegalStateBadScope() 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.ONELEVEL );
+            + "=sales," + SchemaConstants.O_AT_OID + "=good times co." ), null, SearchScope.ONELEVEL );
         SubtreeScopeEvaluator<Entry, Long> evaluator = new SubtreeScopeEvaluator<Entry, Long>( store, node );
         assertNull( evaluator );
     }

Propchange: directory/apacheds/trunk/xdbm-tools/
------------------------------------------------------------------------------
  Merged /directory/apacheds/branches/index-work/xdbm-tools:r1324715-1332211

Modified: directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java?rev=1332268&r1=1332267&r2=1332268&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java (original)
+++ directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java Mon Apr 30 15:59:22 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/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java?rev=1332268&r1=1332267&r2=1332268&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java (original)
+++ directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java Mon Apr 30 15:59:22 2012
@@ -72,6 +72,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.model.ldif.LdifReader;
 import org.apache.directory.shared.ldap.model.message.AliasDerefMode;
+import org.apache.directory.shared.ldap.model.message.SearchScope;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
@@ -629,19 +630,19 @@ public class PartitionFrame extends JFra
             return false;
         }
 
-        SearchControls ctls = new SearchControls();
+        SearchScope searchScope = null;
 
         if ( scope.equals( FilterDialog.BASE_SCOPE ) )
         {
-            ctls.setSearchScope( SearchControls.OBJECT_SCOPE );
+            searchScope = SearchScope.OBJECT;
         }
         else if ( scope.equals( FilterDialog.SINGLE_SCOPE ) )
         {
-            ctls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
+            searchScope = SearchScope.ONELEVEL;
         }
         else if ( scope.equals( FilterDialog.SUBTREE_SCOPE ) )
         {
-            ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
+            searchScope = SearchScope.SUBTREE;
         }
         else
         {
@@ -655,7 +656,7 @@ public class PartitionFrame extends JFra
         }
 
         IndexCursor<Long, Entry, Long> cursor = partition.getSearchEngine().cursor( new Dn( base ),
-            AliasDerefMode.DEREF_ALWAYS, root, ctls );
+            AliasDerefMode.DEREF_ALWAYS, root, searchScope );
         String[] cols = new String[2];
         cols[0] = "id";
         cols[1] = "dn";

Modified: directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexDialog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexDialog.java?rev=1332268&r1=1332267&r2=1332268&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexDialog.java (original)
+++ directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexDialog.java Mon Apr 30 15:59:22 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