You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2013/09/06 15:28:00 UTC
svn commit: r1520568 [2/2] - in /directory/apacheds/trunk:
core-annotations/src/main/java/org/apache/directory/server/core/factory/
core-api/src/main/java/org/apache/directory/server/core/api/
core-api/src/main/java/org/apache/directory/server/core/api...
Modified: directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/ApacheDsService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/ApacheDsService.java?rev=1520568&r1=1520567&r2=1520568&view=diff
==============================================================================
--- directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/ApacheDsService.java (original)
+++ directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/ApacheDsService.java Fri Sep 6 13:27:59 2013
@@ -64,6 +64,7 @@ import org.apache.directory.server.confi
import org.apache.directory.server.core.api.CacheService;
import org.apache.directory.server.core.api.CoreSession;
import org.apache.directory.server.core.api.DirectoryService;
+import org.apache.directory.server.core.api.DnFactory;
import org.apache.directory.server.core.api.InstanceLayout;
import org.apache.directory.server.core.api.filtering.EntryFilteringCursor;
import org.apache.directory.server.core.api.interceptor.context.ModifyOperationContext;
@@ -71,6 +72,7 @@ import org.apache.directory.server.core.
import org.apache.directory.server.core.api.schema.SchemaPartition;
import org.apache.directory.server.core.partition.ldif.LdifPartition;
import org.apache.directory.server.core.partition.ldif.SingleFileLdifPartition;
+import org.apache.directory.server.core.shared.DefaultDnFactory;
import org.apache.directory.server.i18n.I18n;
import org.apache.directory.server.integration.http.HttpServer;
import org.apache.directory.server.kerberos.kdc.KdcServer;
@@ -163,10 +165,11 @@ public class ApacheDsService
CacheService cacheService = new CacheService();
cacheService.initialize( instanceLayout );
+ DnFactory dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
initSchemaManager( instanceLayout );
- initSchemaLdifPartition( instanceLayout );
- initConfigPartition( instanceLayout, cacheService );
+ initSchemaLdifPartition( instanceLayout, dnFactory );
+ initConfigPartition( instanceLayout, dnFactory, cacheService );
// Read the configuration
cpReader = new ConfigPartitionReader( configPartition );
@@ -246,12 +249,12 @@ public class ApacheDsService
* @param instanceLayout the instance layout
* @throws Exception in case of any problems while initializing the SchemaPartition
*/
- private void initSchemaLdifPartition( InstanceLayout instanceLayout ) throws Exception
+ private void initSchemaLdifPartition( InstanceLayout instanceLayout, DnFactory dnFactory ) throws Exception
{
File schemaPartitionDirectory = new File( instanceLayout.getPartitionsDirectory(), "schema" );
// Init the LdifPartition
- schemaLdifPartition = new LdifPartition( schemaManager );
+ schemaLdifPartition = new LdifPartition( schemaManager, dnFactory );
schemaLdifPartition.setPartitionPath( schemaPartitionDirectory.toURI() );
}
@@ -264,7 +267,8 @@ public class ApacheDsService
* @param cacheService the Cache service
* @throws Exception in case of any issues while extracting the schema
*/
- private void initConfigPartition( InstanceLayout instanceLayout, CacheService cacheService ) throws Exception
+ private void initConfigPartition( InstanceLayout instanceLayout, DnFactory dnFactory, CacheService cacheService )
+ throws Exception
{
File confFile = new File( instanceLayout.getConfDirectory(), LdifConfigExtractor.LDIF_CONFIG_FILE );
@@ -279,7 +283,7 @@ public class ApacheDsService
isConfigPartitionFirstExtraction = true;
}
- configPartition = new SingleFileLdifPartition( schemaManager );
+ configPartition = new SingleFileLdifPartition( schemaManager, dnFactory );
configPartition.setId( "config" );
configPartition.setPartitionPath( confFile.toURI() );
configPartition.setSuffixDn( new Dn( schemaManager, "ou=config" ) );
Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/avl/AvlPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/avl/AvlPartition.java?rev=1520568&r1=1520567&r2=1520568&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/avl/AvlPartition.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/avl/AvlPartition.java Fri Sep 6 13:27:59 2013
@@ -26,6 +26,7 @@ import org.apache.directory.api.ldap.mod
import org.apache.directory.api.ldap.model.schema.SchemaManager;
import org.apache.directory.api.ldap.model.schema.comparators.UuidComparator;
import org.apache.directory.server.constants.ApacheSchemaConstants;
+import org.apache.directory.server.core.api.DnFactory;
import org.apache.directory.server.core.api.partition.Partition;
import org.apache.directory.server.core.partition.impl.btree.AbstractBTreePartition;
import org.apache.directory.server.xdbm.Index;
@@ -55,9 +56,9 @@ public class AvlPartition extends Abstra
/**
* Creates a store based on AVL Trees.
*/
- public AvlPartition( SchemaManager schemaManager )
+ public AvlPartition( SchemaManager schemaManager, DnFactory dnFactory )
{
- super( schemaManager );
+ super( schemaManager, dnFactory );
}
Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java?rev=1520568&r1=1520567&r2=1520568&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java Fri Sep 6 13:27:59 2013
@@ -61,6 +61,7 @@ import org.apache.directory.api.ldap.mod
import org.apache.directory.api.util.Strings;
import org.apache.directory.api.util.exception.MultiException;
import org.apache.directory.server.constants.ApacheSchemaConstants;
+import org.apache.directory.server.core.api.DnFactory;
import org.apache.directory.server.core.api.entry.ClonedServerEntry;
import org.apache.directory.server.core.api.filtering.BaseEntryFilteringCursor;
import org.apache.directory.server.core.api.filtering.EntryFilteringCursor;
@@ -186,9 +187,10 @@ public abstract class AbstractBTreeParti
/**
* Creates a B-tree based context partition.
*/
- protected AbstractBTreePartition( SchemaManager schemaManager )
+ protected AbstractBTreePartition( SchemaManager schemaManager, DnFactory dnFactory )
{
this.schemaManager = schemaManager;
+ this.dnFactory = dnFactory;
indexedAttributes = new HashSet<Index<?, ?, String>>();
Modified: directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/PartitionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/PartitionTest.java?rev=1520568&r1=1520567&r2=1520568&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/PartitionTest.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/PartitionTest.java Fri Sep 6 13:27:59 2013
@@ -51,6 +51,7 @@ import org.apache.directory.api.ldap.sch
import org.apache.directory.api.ldap.schemaloader.LdifSchemaLoader;
import org.apache.directory.api.ldap.schemamanager.impl.DefaultSchemaManager;
import org.apache.directory.api.util.exception.Exceptions;
+import org.apache.directory.server.core.api.DnFactory;
import org.apache.directory.server.core.partition.impl.avl.AvlPartition;
import org.apache.directory.server.xdbm.impl.avl.AvlIndex;
import org.apache.directory.server.xdbm.impl.avl.AvlPartitionTest;
@@ -73,6 +74,7 @@ public class PartitionTest
private static AvlPartition partition;
private static SchemaManager schemaManager = null;
+ private static DnFactory dnFactory;
/** The OU AttributType instance */
private static AttributeType OU_AT;
@@ -121,7 +123,7 @@ public class PartitionTest
{
// initialize the partition
- partition = new AvlPartition( schemaManager );
+ partition = new AvlPartition( schemaManager, dnFactory );
partition.setId( "example" );
partition.setSyncOnWrite( false );
Modified: directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlPartitionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlPartitionTest.java?rev=1520568&r1=1520567&r2=1520568&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlPartitionTest.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlPartitionTest.java Fri Sep 6 13:27:59 2013
@@ -53,9 +53,12 @@ import org.apache.directory.api.ldap.sch
import org.apache.directory.api.util.Strings;
import org.apache.directory.api.util.exception.Exceptions;
import org.apache.directory.server.constants.ApacheSchemaConstants;
+import org.apache.directory.server.core.api.CacheService;
+import org.apache.directory.server.core.api.DnFactory;
import org.apache.directory.server.core.api.entry.ClonedServerEntry;
import org.apache.directory.server.core.api.interceptor.context.AddOperationContext;
import org.apache.directory.server.core.partition.impl.avl.AvlPartition;
+import org.apache.directory.server.core.shared.DefaultDnFactory;
import org.apache.directory.server.xdbm.IndexNotFoundException;
import org.apache.directory.server.xdbm.StoreUtils;
import org.junit.After;
@@ -78,6 +81,7 @@ public class AvlPartitionTest
private static AvlPartition partition;
private static SchemaManager schemaManager = null;
+ private static DnFactory dnFactory;
private static Dn EXAMPLE_COM;
/** The OU AttributeType instance */
@@ -111,6 +115,9 @@ public class AvlPartitionTest
LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
schemaManager = new DefaultSchemaManager( loader );
+ CacheService cacheService = new CacheService();
+ cacheService.initialize( null );
+ dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
boolean loaded = schemaManager.loadAllEnabled();
@@ -132,7 +139,7 @@ public class AvlPartitionTest
public void createStore() throws Exception
{
// initialize the partition
- partition = new AvlPartition( schemaManager );
+ partition = new AvlPartition( schemaManager, dnFactory );
partition.setId( "example" );
partition.setSyncOnWrite( false );
@@ -157,7 +164,7 @@ public class AvlPartitionTest
@Test
public void testSimplePropertiesUnlocked() throws Exception
{
- AvlPartition avlPartition = new AvlPartition( schemaManager );
+ AvlPartition avlPartition = new AvlPartition( schemaManager, dnFactory );
avlPartition.setSyncOnWrite( true ); // for code coverage
assertNull( avlPartition.getAliasIndex() );
Modified: directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/AndCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/AndCursorTest.java?rev=1520568&r1=1520567&r2=1520568&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/AndCursorTest.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/AndCursorTest.java Fri Sep 6 13:27:59 2013
@@ -112,6 +112,8 @@ public class AndCursorTest extends Abstr
@Before
public void createStore() throws Exception
{
+ directoryService = new MockDirectoryService();
+
// setup the working directory for the store
wkdir = File.createTempFile( getClass().getSimpleName(), "db" );
wkdir.delete();
@@ -119,7 +121,7 @@ public class AndCursorTest extends Abstr
wkdir.mkdirs();
// initialize the store
- store = new AvlPartition( schemaManager );
+ store = new AvlPartition( schemaManager, directoryService.getDnFactory() );
( ( Partition ) store ).setId( "example" );
store.setCacheSize( 10 );
store.setPartitionPath( wkdir.toURI() );
@@ -134,7 +136,6 @@ public class AndCursorTest extends Abstr
evaluatorBuilder = new EvaluatorBuilder( store, schemaManager );
cursorBuilder = new CursorBuilder( store, evaluatorBuilder );
- directoryService = new MockDirectoryService();
directoryService.setSchemaManager( schemaManager );
session = new MockCoreSession( new LdapPrincipal(), directoryService );
Modified: directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/EqualityTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/EqualityTest.java?rev=1520568&r1=1520567&r2=1520568&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/EqualityTest.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/EqualityTest.java Fri Sep 6 13:27:59 2013
@@ -45,8 +45,11 @@ import org.apache.directory.api.ldap.sch
import org.apache.directory.api.ldap.schemamanager.impl.DefaultSchemaManager;
import org.apache.directory.api.util.Strings;
import org.apache.directory.api.util.exception.Exceptions;
+import org.apache.directory.server.core.api.CacheService;
+import org.apache.directory.server.core.api.DnFactory;
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.shared.DefaultDnFactory;
import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.Store;
import org.apache.directory.server.xdbm.StoreUtils;
@@ -75,6 +78,7 @@ public class EqualityTest
File wkdir;
Store store;
static SchemaManager schemaManager = null;
+ private static DnFactory dnFactory;
@BeforeClass
@@ -108,6 +112,10 @@ public class EqualityTest
{
fail( "Schema load failed : " + Exceptions.printErrors( schemaManager.getErrors() ) );
}
+
+ CacheService cacheService = new CacheService();
+ cacheService.initialize( null );
+ dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
}
@@ -121,7 +129,7 @@ public class EqualityTest
wkdir.mkdirs();
// initialize the store
- store = new AvlPartition( schemaManager );
+ store = new AvlPartition( schemaManager, dnFactory );
( ( Partition ) store ).setId( "example" );
store.setCacheSize( 10 );
store.setPartitionPath( wkdir.toURI() );
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=1520568&r1=1520567&r2=1520568&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 Sep 6 13:27:59 2013
@@ -55,9 +55,12 @@ import org.apache.directory.api.ldap.sch
import org.apache.directory.api.ldap.schemamanager.impl.DefaultSchemaManager;
import org.apache.directory.api.util.Strings;
import org.apache.directory.api.util.exception.Exceptions;
+import org.apache.directory.server.core.api.CacheService;
+import org.apache.directory.server.core.api.DnFactory;
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.shared.DefaultDnFactory;
import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.Store;
import org.apache.directory.server.xdbm.StoreUtils;
@@ -84,6 +87,7 @@ public class GreaterEqTest
File wkdir;
Store store;
static SchemaManager schemaManager = null;
+ private static DnFactory dnFactory;
@BeforeClass
@@ -118,6 +122,10 @@ public class GreaterEqTest
{
fail( "Schema load failed : " + Exceptions.printErrors( schemaManager.getErrors() ) );
}
+
+ CacheService cacheService = new CacheService();
+ cacheService.initialize( null );
+ dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
}
@@ -131,7 +139,7 @@ public class GreaterEqTest
wkdir.mkdirs();
// initialize the store
- store = new AvlPartition( schemaManager );
+ store = new AvlPartition( schemaManager, dnFactory );
( ( Partition ) store ).setId( "example" );
store.setCacheSize( 10 );
store.setPartitionPath( wkdir.toURI() );
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=1520568&r1=1520567&r2=1520568&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 Sep 6 13:27:59 2013
@@ -55,9 +55,12 @@ import org.apache.directory.api.ldap.sch
import org.apache.directory.api.ldap.schemamanager.impl.DefaultSchemaManager;
import org.apache.directory.api.util.Strings;
import org.apache.directory.api.util.exception.Exceptions;
+import org.apache.directory.server.core.api.CacheService;
+import org.apache.directory.server.core.api.DnFactory;
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.shared.DefaultDnFactory;
import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.Store;
import org.apache.directory.server.xdbm.StoreUtils;
@@ -84,6 +87,7 @@ public class LessEqTest
File wkdir;
Store store;
static SchemaManager schemaManager = null;
+ private static DnFactory dnFactory;
@BeforeClass
@@ -118,6 +122,10 @@ public class LessEqTest
{
fail( "Schema load failed : " + Exceptions.printErrors( schemaManager.getErrors() ) );
}
+
+ CacheService cacheService = new CacheService();
+ cacheService.initialize( null );
+ dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
}
@@ -131,7 +139,7 @@ public class LessEqTest
wkdir.mkdirs();
// initialize the store
- store = new AvlPartition( schemaManager );
+ store = new AvlPartition( schemaManager, dnFactory );
( ( Partition ) store ).setId( "example" );
store.setCacheSize( 10 );
store.setPartitionPath( wkdir.toURI() );
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=1520568&r1=1520567&r2=1520568&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 Sep 6 13:27:59 2013
@@ -119,6 +119,8 @@ public class NestedFilterTest extends Ab
@Before
public void createStore() throws Exception
{
+ directoryService = new MockDirectoryService();
+
// setup the working directory for the store
wkdir = File.createTempFile( getClass().getSimpleName(), "db" );
wkdir.delete();
@@ -126,7 +128,7 @@ public class NestedFilterTest extends Ab
wkdir.mkdirs();
// initialize the store
- store = new AvlPartition( schemaManager );
+ store = new AvlPartition( schemaManager, directoryService.getDnFactory() );
( ( Partition ) store ).setId( "example" );
store.setCacheSize( 10 );
store.setPartitionPath( wkdir.toURI() );
@@ -143,7 +145,6 @@ public class NestedFilterTest extends Ab
cursorBuilder = new CursorBuilder( store, evaluatorBuilder );
optimizer = new DefaultOptimizer( store );
- directoryService = new MockDirectoryService();
directoryService.setSchemaManager( schemaManager );
session = new MockCoreSession( new LdapPrincipal(), directoryService );
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=1520568&r1=1520567&r2=1520568&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 Sep 6 13:27:59 2013
@@ -120,6 +120,8 @@ public class NotCursorTest extends Abstr
@Before
public void createStore() throws Exception
{
+ directoryService = new MockDirectoryService();
+
// setup the working directory for the store
wkdir = File.createTempFile( getClass().getSimpleName(), "db" );
wkdir.delete();
@@ -127,7 +129,7 @@ public class NotCursorTest extends Abstr
wkdir.mkdirs();
// initialize the store
- store = new AvlPartition( schemaManager );
+ store = new AvlPartition( schemaManager, directoryService.getDnFactory() );
( ( Partition ) store ).setId( "example" );
store.setCacheSize( 10 );
store.setPartitionPath( wkdir.toURI() );
@@ -142,7 +144,6 @@ public class NotCursorTest extends Abstr
evaluatorBuilder = new EvaluatorBuilder( store, schemaManager );
cursorBuilder = new CursorBuilder( store, evaluatorBuilder );
- directoryService = new MockDirectoryService();
directoryService.setSchemaManager( schemaManager );
session = new MockCoreSession( new LdapPrincipal(), directoryService );
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=1520568&r1=1520567&r2=1520568&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 Sep 6 13:27:59 2013
@@ -121,6 +121,8 @@ public class OrCursorTest extends Abstra
@Before
public void createStore() throws Exception
{
+ directoryService = new MockDirectoryService();
+
// setup the working directory for the store
wkdir = File.createTempFile( getClass().getSimpleName(), "db" );
wkdir.delete();
@@ -128,7 +130,7 @@ public class OrCursorTest extends Abstra
wkdir.mkdirs();
// initialize the store
- store = new AvlPartition( schemaManager );
+ store = new AvlPartition( schemaManager, directoryService.getDnFactory() );
( ( Partition ) store ).setId( "example" );
store.setCacheSize( 10 );
store.setPartitionPath( wkdir.toURI() );
@@ -143,7 +145,6 @@ public class OrCursorTest extends Abstra
evaluatorBuilder = new EvaluatorBuilder( store, schemaManager );
cursorBuilder = new CursorBuilder( store, evaluatorBuilder );
- directoryService = new MockDirectoryService();
directoryService.setSchemaManager( schemaManager );
session = new MockCoreSession( new LdapPrincipal(), directoryService );
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=1520568&r1=1520567&r2=1520568&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 Sep 6 13:27:59 2013
@@ -43,8 +43,11 @@ import org.apache.directory.api.ldap.sch
import org.apache.directory.api.ldap.schemamanager.impl.DefaultSchemaManager;
import org.apache.directory.api.util.Strings;
import org.apache.directory.api.util.exception.Exceptions;
+import org.apache.directory.server.core.api.CacheService;
+import org.apache.directory.server.core.api.DnFactory;
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.shared.DefaultDnFactory;
import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.Store;
import org.apache.directory.server.xdbm.StoreUtils;
@@ -71,6 +74,7 @@ public class PresenceTest
File wkdir;
Store store;
static SchemaManager schemaManager = null;
+ private static DnFactory dnFactory;
@BeforeClass
@@ -104,6 +108,10 @@ public class PresenceTest
{
fail( "Schema load failed : " + Exceptions.printErrors( schemaManager.getErrors() ) );
}
+
+ CacheService cacheService = new CacheService();
+ cacheService.initialize( null );
+ dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
}
@@ -117,7 +125,7 @@ public class PresenceTest
wkdir.mkdirs();
// initialize the store
- store = new AvlPartition( schemaManager );
+ store = new AvlPartition( schemaManager, dnFactory );
( ( Partition ) store ).setId( "example" );
store.setCacheSize( 10 );
store.setPartitionPath( wkdir.toURI() );
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=1520568&r1=1520567&r2=1520568&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 Sep 6 13:27:59 2013
@@ -39,8 +39,11 @@ import org.apache.directory.api.ldap.sch
import org.apache.directory.api.ldap.schemamanager.impl.DefaultSchemaManager;
import org.apache.directory.api.util.Strings;
import org.apache.directory.api.util.exception.Exceptions;
+import org.apache.directory.server.core.api.CacheService;
+import org.apache.directory.server.core.api.DnFactory;
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.shared.DefaultDnFactory;
import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.Store;
import org.apache.directory.server.xdbm.StoreUtils;
@@ -67,6 +70,7 @@ public class SubstringTest
File wkdir;
Store store;
static SchemaManager schemaManager = null;
+ private static DnFactory dnFactory;
@BeforeClass
@@ -100,6 +104,10 @@ public class SubstringTest
{
fail( "Schema load failed : " + Exceptions.printErrors( schemaManager.getErrors() ) );
}
+
+ CacheService cacheService = new CacheService();
+ cacheService.initialize( null );
+ dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
}
@@ -113,7 +121,7 @@ public class SubstringTest
wkdir.mkdirs();
// initialize the store
- store = new AvlPartition( schemaManager );
+ store = new AvlPartition( schemaManager, dnFactory );
( ( Partition ) store ).setId( "example" );
store.setCacheSize( 10 );
store.setPartitionPath( wkdir.toURI() );