directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1149411 [6/6] - in /directory/apacheds/trunk: core-annotations/src/main/java/org/apache/directory/server/core/factory/ core-annotations/src/test/java/org/apache/directory/server/core/factory/ core-api/src/main/java/org/apache/directory/ser...
Date Fri, 22 Jul 2011 00:02:18 GMT
Modified: directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java?rev=1149411&r1=1149410&r2=1149411&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java
Fri Jul 22 00:02:02 2011
@@ -34,11 +34,13 @@ import java.util.Set;
 import java.util.UUID;
 
 import org.apache.commons.io.FileUtils;
+import org.apache.directory.server.core.interceptor.context.AddOperationContext;
+import org.apache.directory.server.core.partition.Partition;
+import org.apache.directory.server.core.partition.impl.avl.AvlPartition;
 import org.apache.directory.server.xdbm.ForwardIndexEntry;
 import org.apache.directory.server.xdbm.Store;
 import org.apache.directory.server.xdbm.StoreUtils;
 import org.apache.directory.server.xdbm.impl.avl.AvlIndex;
-import org.apache.directory.server.xdbm.impl.avl.AvlStore;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.csn.CsnFactory;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
@@ -126,9 +128,8 @@ public class GreaterEqTest
         wkdir.mkdirs();
 
         // initialize the store
-        store = new AvlStore<Entry>();
-        store.setSchemaManager( schemaManager );
-        store.setId( "example" );
+        store = new AvlPartition( schemaManager );
+        ((Partition)store).setId( "example" );
         store.setCacheSize( 10 );
         store.setPartitionPath( wkdir.toURI() );
         store.setSyncOnWrite( false );
@@ -136,6 +137,8 @@ public class GreaterEqTest
         store.addIndex( new AvlIndex( SchemaConstants.OU_AT_OID ) );
         store.addIndex( new AvlIndex( SchemaConstants.CN_AT_OID ) );
         store.addIndex( new AvlIndex( SchemaConstants.POSTALCODE_AT_OID ) );
+        ((Partition)store).setSuffixDn( new Dn( schemaManager, "o=Good Times Co." ) );
+        ((Partition)store).initialize();
 
         StoreUtils.loadExampleData( store, schemaManager );
         LOG.debug( "Created new store" );
@@ -147,7 +150,7 @@ public class GreaterEqTest
     {
         if ( store != null )
         {
-            store.destroy();
+            ((Partition)store).destroy();
         }
 
         store = null;
@@ -610,7 +613,9 @@ public class GreaterEqTest
         attrs.add( "sn", "doe" );
         attrs.add( "entryCSN", new CsnFactory( 1 ).newInstance().toString() );
         attrs.add( "entryUUID", UUID.randomUUID().toString() );
-        store.add( attrs );
+        
+        AddOperationContext addContext = new AddOperationContext( null, attrs );
+        ((Partition)store).add( addContext );
 
         indexEntry.setId( 12L );
         assertTrue( evaluator.evaluate( indexEntry ) );

Modified: directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java?rev=1149411&r1=1149410&r2=1149411&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java
Fri Jul 22 00:02:02 2011
@@ -34,11 +34,13 @@ import java.util.Set;
 import java.util.UUID;
 
 import org.apache.commons.io.FileUtils;
+import org.apache.directory.server.core.interceptor.context.AddOperationContext;
+import org.apache.directory.server.core.partition.Partition;
+import org.apache.directory.server.core.partition.impl.avl.AvlPartition;
 import org.apache.directory.server.xdbm.ForwardIndexEntry;
 import org.apache.directory.server.xdbm.Store;
 import org.apache.directory.server.xdbm.StoreUtils;
 import org.apache.directory.server.xdbm.impl.avl.AvlIndex;
-import org.apache.directory.server.xdbm.impl.avl.AvlStore;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.csn.CsnFactory;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
@@ -126,9 +128,8 @@ public class LessEqTest
         wkdir.mkdirs();
 
         // initialize the store
-        store = new AvlStore<Entry>();
-        store.setSchemaManager( schemaManager );
-        store.setId( "example" );
+        store = new AvlPartition( schemaManager );
+        ((Partition)store).setId( "example" );
         store.setCacheSize( 10 );
         store.setPartitionPath( wkdir.toURI() );
         store.setSyncOnWrite( false );
@@ -136,6 +137,10 @@ public class LessEqTest
         store.addIndex( new AvlIndex( SchemaConstants.OU_AT_OID ) );
         store.addIndex( new AvlIndex( SchemaConstants.CN_AT_OID ) );
         store.addIndex( new AvlIndex( SchemaConstants.POSTALCODE_AT_OID ) );
+        ((Partition)store).setSuffixDn( new Dn( schemaManager, "o=Good Times Co." ) );
+        ((Partition)store).initialize();
+
+        ((Partition)store).initialize();
 
         StoreUtils.loadExampleData( store, schemaManager );
         LOG.debug( "Created new store" );
@@ -147,7 +152,7 @@ public class LessEqTest
     {
         if ( store != null )
         {
-            store.destroy();
+            ((Partition)store).destroy();
         }
 
         store = null;
@@ -636,7 +641,9 @@ public class LessEqTest
         attrs.add( "sn", "doe" );
         attrs.add( "entryCSN", new CsnFactory( 1 ).newInstance().toString() );
         attrs.add( "entryUUID", UUID.randomUUID().toString() );
-        store.add( attrs );
+        
+        AddOperationContext addContext = new AddOperationContext( null, attrs );
+        ((Partition)store).add( addContext );
 
         indexEntry.setId( 12L );
         assertTrue( evaluator.evaluate( indexEntry ) );

Modified: directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NestedFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NestedFilterTest.java?rev=1149411&r1=1149410&r2=1149411&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NestedFilterTest.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NestedFilterTest.java
Fri Jul 22 00:02:02 2011
@@ -30,11 +30,12 @@ import java.util.HashSet;
 import java.util.Set;
 
 import org.apache.commons.io.FileUtils;
+import org.apache.directory.server.core.partition.Partition;
+import org.apache.directory.server.core.partition.impl.avl.AvlPartition;
 import org.apache.directory.server.xdbm.IndexCursor;
 import org.apache.directory.server.xdbm.Store;
 import org.apache.directory.server.xdbm.StoreUtils;
 import org.apache.directory.server.xdbm.impl.avl.AvlIndex;
-import org.apache.directory.server.xdbm.impl.avl.AvlStore;
 import org.apache.directory.server.xdbm.search.Optimizer;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.entry.Entry;
@@ -125,15 +126,17 @@ public class NestedFilterTest
         wkdir.mkdirs();
 
         // initialize the store
-        store = new AvlStore<Entry>();
-        store.setSchemaManager( schemaManager );
-        store.setId( "example" );
+        store = new AvlPartition( schemaManager );
+        ((Partition)store).setId( "example" );
         store.setCacheSize( 10 );
         store.setPartitionPath( wkdir.toURI() );
         store.setSyncOnWrite( false );
 
         store.addIndex( new AvlIndex( SchemaConstants.OU_AT_OID ) );
         store.addIndex( new AvlIndex( SchemaConstants.CN_AT_OID ) );
+        ((Partition)store).setSuffixDn( new Dn( schemaManager, "o=Good Times Co." ) );
+        ((Partition)store).initialize();
+
         StoreUtils.loadExampleData( store, schemaManager );
 
         evaluatorBuilder = new EvaluatorBuilder( store, schemaManager );
@@ -149,7 +152,7 @@ public class NestedFilterTest
     {
         if ( store != null )
         {
-            store.destroy();
+            ((Partition)store).destroy();
         }
 
         store = null;

Modified: directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NotCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NotCursorTest.java?rev=1149411&r1=1149410&r2=1149411&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NotCursorTest.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NotCursorTest.java
Fri Jul 22 00:02:02 2011
@@ -30,12 +30,13 @@ import java.util.HashSet;
 import java.util.Set;
 
 import org.apache.commons.io.FileUtils;
+import org.apache.directory.server.core.partition.Partition;
+import org.apache.directory.server.core.partition.impl.avl.AvlPartition;
 import org.apache.directory.server.xdbm.ForwardIndexEntry;
 import org.apache.directory.server.xdbm.IndexCursor;
 import org.apache.directory.server.xdbm.Store;
 import org.apache.directory.server.xdbm.StoreUtils;
 import org.apache.directory.server.xdbm.impl.avl.AvlIndex;
-import org.apache.directory.server.xdbm.impl.avl.AvlStore;
 import org.apache.directory.server.xdbm.search.Evaluator;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
@@ -124,15 +125,19 @@ public class NotCursorTest
         wkdir.mkdirs();
 
         // initialize the store
-        store = new AvlStore<Entry>();
-        store.setSchemaManager( schemaManager );
-        store.setId( "example" );
+        store = new AvlPartition( schemaManager );
+        ((Partition)store).setId( "example" );
         store.setCacheSize( 10 );
         store.setPartitionPath( wkdir.toURI() );
         store.setSyncOnWrite( false );
 
         store.addIndex( new AvlIndex( SchemaConstants.OU_AT_OID ) );
         store.addIndex( new AvlIndex( SchemaConstants.CN_AT_OID ) );
+        ((Partition)store).setSuffixDn( new Dn( schemaManager, "o=Good Times Co." ) );
+        ((Partition)store).initialize();
+
+        ((Partition)store).initialize();
+        
         StoreUtils.loadExampleData( store, schemaManager );
 
         evaluatorBuilder = new EvaluatorBuilder( store, schemaManager );
@@ -147,7 +152,7 @@ public class NotCursorTest
     {
         if ( store != null )
         {
-            store.destroy();
+            ((Partition)store).destroy();
         }
 
         store = null;

Modified: directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeTest.java?rev=1149411&r1=1149410&r2=1149411&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeTest.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeTest.java
Fri Jul 22 00:02:02 2011
@@ -30,12 +30,14 @@ import java.io.File;
 import java.util.UUID;
 
 import org.apache.commons.io.FileUtils;
+import org.apache.directory.server.core.interceptor.context.AddOperationContext;
+import org.apache.directory.server.core.partition.Partition;
+import org.apache.directory.server.core.partition.impl.avl.AvlPartition;
 import org.apache.directory.server.xdbm.ForwardIndexEntry;
 import org.apache.directory.server.xdbm.IndexEntry;
 import org.apache.directory.server.xdbm.Store;
 import org.apache.directory.server.xdbm.StoreUtils;
 import org.apache.directory.server.xdbm.impl.avl.AvlIndex;
-import org.apache.directory.server.xdbm.impl.avl.AvlStore;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.csn.CsnFactory;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
@@ -118,15 +120,19 @@ public class OneLevelScopeTest
         wkdir.mkdirs();
 
         // initialize the store
-        store = new AvlStore<Entry>();
-        store.setSchemaManager( schemaManager );
-        store.setId( "example" );
+        store = new AvlPartition( schemaManager );
+        ((Partition)store).setId( "example" );
         store.setCacheSize( 10 );
         store.setPartitionPath( wkdir.toURI() );
         store.setSyncOnWrite( true );
 
         store.addIndex( new AvlIndex<String, Entry>( SchemaConstants.OU_AT_OID ) );
         store.addIndex( new AvlIndex<String, Entry>( SchemaConstants.CN_AT_OID ) );
+        ((Partition)store).setSuffixDn( new Dn( schemaManager, "o=Good Times Co." ) );
+        ((Partition)store).initialize();
+
+        ((Partition)store).initialize();
+
         StoreUtils.loadExampleData( store, schemaManager );
         LOG.debug( "Created new store" );
     }
@@ -137,7 +143,7 @@ public class OneLevelScopeTest
     {
         if ( store != null )
         {
-            store.destroy();
+            ((Partition)store).destroy();
         }
 
         store = null;
@@ -653,24 +659,28 @@ public class OneLevelScopeTest
         Dn dn = new Dn( schemaManager, SchemaConstants.CN_AT_OID + "=jd," + SchemaConstants.OU_AT_OID
+ "=board of directors,"
             + SchemaConstants.O_AT_OID + "=good times co." );
 
-        Entry attrs = new DefaultEntry( schemaManager, dn );
-        attrs.add( "objectClass", "alias", "extensibleObject" );
-        attrs.add( "cn", "jd" );
-        attrs.add( "aliasedObjectName", "cn=Jack Daniels,ou=Engineering,o=Good Times Co."
);
-        attrs.add( "entryCSN", new CsnFactory( 1 ).newInstance().toString() );
-        attrs.add( "entryUUID", UUID.randomUUID().toString() );
-        store.add( attrs );
+        Entry entry = new DefaultEntry( schemaManager, dn );
+        entry.add( "objectClass", "alias", "extensibleObject" );
+        entry.add( "cn", "jd" );
+        entry.add( "aliasedObjectName", "cn=Jack Daniels,ou=Engineering,o=Good Times Co."
);
+        entry.add( "entryCSN", new CsnFactory( 1 ).newInstance().toString() );
+        entry.add( "entryUUID", UUID.randomUUID().toString() );
+
+        AddOperationContext addContext = new AddOperationContext( null, entry );
+        ((Partition)store).add( addContext );
 
         dn = new Dn( schemaManager, SchemaConstants.CN_AT_OID + "=jdoe," + SchemaConstants.OU_AT_OID
+ "=board of directors,"
             + SchemaConstants.O_AT_OID + "=good times co." );
 
-        attrs = new DefaultEntry( schemaManager, dn );
-        attrs.add( "objectClass", "person" );
-        attrs.add( "cn", "jdoe" );
-        attrs.add( "sn", "doe" );
-        attrs.add( "entryCSN", new CsnFactory( 1 ).newInstance().toString() );
-        attrs.add( "entryUUID", UUID.randomUUID().toString() );
-        store.add( attrs );
+        entry = new DefaultEntry( schemaManager, dn );
+        entry.add( "objectClass", "person" );
+        entry.add( "cn", "jdoe" );
+        entry.add( "sn", "doe" );
+        entry.add( "entryCSN", new CsnFactory( 1 ).newInstance().toString() );
+        entry.add( "entryUUID", UUID.randomUUID().toString() );
+        
+        addContext = new AddOperationContext( null, entry );
+        ((Partition)store).add( addContext );
 
         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.ONELEVEL
);

Modified: directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java?rev=1149411&r1=1149410&r2=1149411&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java
Fri Jul 22 00:02:02 2011
@@ -30,13 +30,14 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.commons.io.FileUtils;
+import org.apache.directory.server.core.partition.Partition;
+import org.apache.directory.server.core.partition.impl.avl.AvlPartition;
 import org.apache.directory.server.xdbm.ForwardIndexEntry;
 import org.apache.directory.server.xdbm.IndexCursor;
 import org.apache.directory.server.xdbm.IndexEntry;
 import org.apache.directory.server.xdbm.Store;
 import org.apache.directory.server.xdbm.StoreUtils;
 import org.apache.directory.server.xdbm.impl.avl.AvlIndex;
-import org.apache.directory.server.xdbm.impl.avl.AvlStore;
 import org.apache.directory.server.xdbm.search.Evaluator;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.cursor.Cursor;
@@ -126,15 +127,19 @@ public class OrCursorTest
         wkdir.mkdirs();
 
         // initialize the store
-        store = new AvlStore<Entry>();
-        store.setSchemaManager( schemaManager );
-        store.setId( "example" );
+        store = new AvlPartition( schemaManager );
+        ((Partition)store).setId( "example" );
         store.setCacheSize( 10 );
         store.setPartitionPath( wkdir.toURI() );
         store.setSyncOnWrite( false );
 
         store.addIndex( new AvlIndex( SchemaConstants.OU_AT_OID ) );
         store.addIndex( new AvlIndex( SchemaConstants.CN_AT_OID ) );
+        ((Partition)store).setSuffixDn( new Dn( schemaManager, "o=Good Times Co." ) );
+        ((Partition)store).initialize();
+
+        ((Partition)store).initialize();
+
         StoreUtils.loadExampleData( store, schemaManager );
 
         evaluatorBuilder = new EvaluatorBuilder( store, schemaManager );
@@ -149,7 +154,7 @@ public class OrCursorTest
     {
         if ( store != null )
         {
-            store.destroy();
+            ((Partition)store).destroy();
         }
 
         store = null;

Modified: directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.java?rev=1149411&r1=1149410&r2=1149411&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.java
Fri Jul 22 00:02:02 2011
@@ -32,11 +32,12 @@ import java.util.List;
 import java.util.Set;
 
 import org.apache.commons.io.FileUtils;
+import org.apache.directory.server.core.partition.Partition;
+import org.apache.directory.server.core.partition.impl.avl.AvlPartition;
 import org.apache.directory.server.xdbm.ForwardIndexEntry;
 import org.apache.directory.server.xdbm.Store;
 import org.apache.directory.server.xdbm.StoreUtils;
 import org.apache.directory.server.xdbm.impl.avl.AvlIndex;
-import org.apache.directory.server.xdbm.impl.avl.AvlStore;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
 import org.apache.directory.shared.ldap.model.entry.Entry;
@@ -114,16 +115,21 @@ public class PresenceTest
         wkdir.mkdirs();
 
         // initialize the store
-        store = new AvlStore<Entry>();
-        store.setSchemaManager( schemaManager );
-        store.setId( "example" );
+        store = new AvlPartition( schemaManager );
+        ((Partition)store).setId( "example" );
         store.setCacheSize( 10 );
         store.setPartitionPath( wkdir.toURI() );
         store.setSyncOnWrite( false );
 
         store.addIndex( new AvlIndex( SchemaConstants.OU_AT_OID ) );
         store.addIndex( new AvlIndex( SchemaConstants.CN_AT_OID ) );
+        ((Partition)store).setSuffixDn( new Dn( schemaManager, "o=Good Times Co." ) );
+        ((Partition)store).initialize();
+
+        ((Partition)store).initialize();
+
         StoreUtils.loadExampleData( store, schemaManager );
+        
         LOG.debug( "Created new store" );
     }
 
@@ -133,7 +139,7 @@ public class PresenceTest
     {
         if ( store != null )
         {
-            store.destroy();
+            ((Partition)store).destroy();
         }
 
         store = null;

Modified: directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java?rev=1149411&r1=1149410&r2=1149411&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java
Fri Jul 22 00:02:02 2011
@@ -28,11 +28,12 @@ import static org.junit.Assert.fail;
 import java.io.File;
 
 import org.apache.commons.io.FileUtils;
+import org.apache.directory.server.core.partition.Partition;
+import org.apache.directory.server.core.partition.impl.avl.AvlPartition;
 import org.apache.directory.server.xdbm.ForwardIndexEntry;
 import org.apache.directory.server.xdbm.Store;
 import org.apache.directory.server.xdbm.StoreUtils;
 import org.apache.directory.server.xdbm.impl.avl.AvlIndex;
-import org.apache.directory.server.xdbm.impl.avl.AvlStore;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
 import org.apache.directory.shared.ldap.model.entry.Entry;
@@ -110,16 +111,22 @@ public class SubstringTest
         wkdir.mkdirs();
 
         // initialize the store
-        store = new AvlStore<Entry>();
-        store.setSchemaManager( schemaManager );
-        store.setId( "example" );
+        store = new AvlPartition( schemaManager );
+        ((Partition)store).setId( "example" );
         store.setCacheSize( 10 );
         store.setPartitionPath( wkdir.toURI() );
         store.setSyncOnWrite( false );
 
         store.addIndex( new AvlIndex( SchemaConstants.OU_AT_OID ) );
         store.addIndex( new AvlIndex( SchemaConstants.CN_AT_OID ) );
+        
+        Dn suffixDn = new Dn( schemaManager, "o=Good Times Co." );
+        ((Partition)store).setSuffixDn( suffixDn );
+
+        ((Partition)store).initialize();
+
         StoreUtils.loadExampleData( store, schemaManager );
+        
         LOG.debug( "Created new store" );
     }
 
@@ -129,7 +136,7 @@ public class SubstringTest
     {
         if ( store != null )
         {
-            store.destroy();
+            ((Partition)store).destroy();
         }
 
         store = null;

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=1149411&r1=1149410&r2=1149411&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
Fri Jul 22 00:02:02 2011
@@ -31,12 +31,14 @@ import java.io.File;
 import java.util.UUID;
 
 import org.apache.commons.io.FileUtils;
+import org.apache.directory.server.core.interceptor.context.AddOperationContext;
+import org.apache.directory.server.core.partition.Partition;
+import org.apache.directory.server.core.partition.impl.avl.AvlPartition;
 import org.apache.directory.server.xdbm.ForwardIndexEntry;
 import org.apache.directory.server.xdbm.IndexEntry;
 import org.apache.directory.server.xdbm.Store;
 import org.apache.directory.server.xdbm.StoreUtils;
 import org.apache.directory.server.xdbm.impl.avl.AvlIndex;
-import org.apache.directory.server.xdbm.impl.avl.AvlStore;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.csn.CsnFactory;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
@@ -118,16 +120,21 @@ public class SubtreeScopeTest
         wkdir.mkdirs();
 
         // initialize the store
-        store = new AvlStore<Entry>();
-        store.setSchemaManager( schemaManager );
-        store.setId( "example" );
+        store = new AvlPartition( schemaManager );
+        ((Partition)store).setId( "example" );
         store.setCacheSize( 10 );
         store.setPartitionPath( wkdir.toURI() );
         store.setSyncOnWrite( true );
 
         store.addIndex( new AvlIndex<String, Entry>( SchemaConstants.OU_AT_OID ) );
         store.addIndex( new AvlIndex<String, Entry>( SchemaConstants.CN_AT_OID ) );
+        ((Partition)store).setSuffixDn( new Dn( schemaManager, "o=Good Times Co." ) );
+        ((Partition)store).initialize();
+
+        ((Partition)store).initialize();
+
         StoreUtils.loadExampleData( store, schemaManager );
+        
         LOG.debug( "Created new store" );
     }
 
@@ -137,7 +144,7 @@ public class SubtreeScopeTest
     {
         if ( store != null )
         {
-            store.destroy();
+            ((Partition)store).destroy();
         }
 
         store = null;
@@ -619,24 +626,28 @@ public class SubtreeScopeTest
         Dn dn = new Dn( schemaManager, SchemaConstants.CN_AT_OID + "=jd," + SchemaConstants.OU_AT_OID
+ "=board of directors,"
             + SchemaConstants.O_AT_OID + "=good times co." );
 
-        Entry attrs = new DefaultEntry( schemaManager, dn );
-        attrs.add( "objectClass", "alias", "extensibleObject" );
-        attrs.add( "cn", "jd" );
-        attrs.add( "aliasedObjectName", "cn=Jack Daniels,ou=Engineering,o=Good Times Co."
);
-        attrs.add( "entryCSN", new CsnFactory( 1 ).newInstance().toString() );
-        attrs.add( "entryUUID", UUID.randomUUID().toString() );
-        store.add( attrs );
+        Entry entry = new DefaultEntry( schemaManager, dn );
+        entry.add( "objectClass", "alias", "extensibleObject" );
+        entry.add( "cn", "jd" );
+        entry.add( "aliasedObjectName", "cn=Jack Daniels,ou=Engineering,o=Good Times Co."
);
+        entry.add( "entryCSN", new CsnFactory( 1 ).newInstance().toString() );
+        entry.add( "entryUUID", UUID.randomUUID().toString() );
+
+        AddOperationContext addContext = new AddOperationContext( null, entry );
+        ((Partition)store).add( addContext );
 
         dn = new Dn( schemaManager, SchemaConstants.CN_AT_OID + "=jdoe," + SchemaConstants.OU_AT_OID
+ "=board of directors,"
             + SchemaConstants.O_AT_OID + "=good times co." );
 
-        attrs = new DefaultEntry( schemaManager, dn );
-        attrs.add( "objectClass", "person" );
-        attrs.add( "cn", "jdoe" );
-        attrs.add( "sn", "doe" );
-        attrs.add( "entryCSN", new CsnFactory( 1 ).newInstance().toString() );
-        attrs.add( "entryUUID", UUID.randomUUID().toString() );
-        store.add( attrs );
+        entry = new DefaultEntry( schemaManager, dn );
+        entry.add( "objectClass", "person" );
+        entry.add( "cn", "jdoe" );
+        entry.add( "sn", "doe" );
+        entry.add( "entryCSN", new CsnFactory( 1 ).newInstance().toString() );
+        entry.add( "entryUUID", UUID.randomUUID().toString() );
+        
+        addContext = new AddOperationContext( null, entry );
+        ((Partition)store).add( addContext );
 
         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
);

Modified: directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java?rev=1149411&r1=1149410&r2=1149411&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java
(original)
+++ directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java
Fri Jul 22 00:02:02 2011
@@ -100,13 +100,13 @@ public class EntryNode implements TreeNo
 
                 if ( engine != null && exprNode != null )
                 {
-                    if ( db.getChildCount( rec.getId() ) == 0 )
+                    if ( db.getChildCount( (Long)rec.getId() ) == 0 )
                     {
                         Evaluator evaluator = engine.evaluator( exprNode );
                         
                         if ( evaluator.evaluate( rec ) )
                         {
-                            Entry newEntry = db.lookup( rec.getId() );
+                            Entry newEntry = db.lookup( (Long)rec.getId() );
                             EntryNode child = new EntryNode( ( Long ) rec.getId(), this,
db, newEntry, map, exprNode,
                                 engine );
                             children.add( child );
@@ -118,7 +118,7 @@ public class EntryNode implements TreeNo
                     }
                     else
                     {
-                        Entry newEntry = db.lookup( rec.getId() );
+                        Entry newEntry = db.lookup( (Long)rec.getId() );
                         EntryNode child = new EntryNode( ( Long ) rec.getId(), this, db,
newEntry, map, exprNode,
                             engine );
                         children.add( child );

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=1149411&r1=1149410&r2=1149411&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
Fri Jul 22 00:02:02 2011
@@ -167,7 +167,7 @@ public class PartitionFrame extends JFra
         content.add( mainPnl, java.awt.BorderLayout.NORTH );
         getContentPane().add( content, BorderLayout.CENTER );
         // set title
-        setTitle( "Partition: " + this.partition.getSuffix().getName() );
+        setTitle( "Partition: " + this.partition.getSuffixDn().getName() );
         // add status bar
         getContentPane().add( statusBar, BorderLayout.SOUTH );
         // add menu bar
@@ -375,7 +375,7 @@ public class PartitionFrame extends JFra
         try
         {
             TreePath path = tree.getSelectionModel().getSelectionPath();
-            String parentDn = partition.getSuffix().getName();
+            String parentDn = partition.getSuffixDn().getName();
 
             if ( null != path )
             {
@@ -420,7 +420,7 @@ public class PartitionFrame extends JFra
 
         if ( null == path )
         {
-            return partition.getSuffix().getName();
+            return partition.getSuffixDn().getName();
         }
 
         Object last = path.getLastPathComponent();
@@ -439,7 +439,7 @@ public class PartitionFrame extends JFra
         }
         else
         {
-            base = partition.getSuffix().getName();
+            base = partition.getSuffixDn().getName();
         }
 
         return base;
@@ -567,7 +567,7 @@ public class PartitionFrame extends JFra
         }
         else
         {
-            dialog.setBase( partition.getSuffix().getName() );
+            dialog.setBase( partition.getSuffixDn().getName() );
         }
 
         dialog.addActionListener( new ActionListener()
@@ -879,8 +879,8 @@ public class PartitionFrame extends JFra
         // boolean doFiltered = false;
         nodes = new HashMap<Long, EntryNode>();
 
-        Entry suffix = partition.lookup( partition.getEntryId( partition.getSuffix() ) );
-        Long id = partition.getEntryId( partition.getSuffix() );
+        Entry suffix = partition.lookup( partition.getEntryId( partition.getSuffixDn() )
);
+        Long id = partition.getEntryId( partition.getSuffixDn() );
         root = new EntryNode( id, null, partition, suffix, nodes );
 
         /*
@@ -900,7 +900,7 @@ public class PartitionFrame extends JFra
          }
          });
 
-         dialog.setBase(database.getSuffix().toString());
+         dialog.setBase(database.getSuffixDn().toString());
          dialog.setScope(FilterDialog.SUBTREE_SCOPE);
 
          //Center the frame on screen



Mime
View raw message