directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1615303 - 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/schema/ jdbm-partition/src/test/java/org/apache/directory/server/c...
Date Sat, 02 Aug 2014 12:16:22 GMT
Author: kayyagari
Date: Sat Aug  2 12:16:21 2014
New Revision: 1615303

URL: http://svn.apache.org/r1615303
Log:
o replaced LRUMap with ehCache instance (DIRSERVER-1992)
o protected saveContextCsn() with a semaphore
o updated the affected tests due to replacing LRUMap with ehCache instance

Modified:
    directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/SchemaPartition.java
    directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
    directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/LdifPartitionTest.java
    directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartitionTest.java
    directory/apacheds/trunk/mavibot-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotStoreTest.java
    directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ChangePasswordConfigReaderTest.java
    directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ConfigPartitionReaderTest.java
    directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ConfigWriterTest.java
    directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/HttpServerConfigReaderTest.java
    directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/KerberosServerConfigReaderTest.java
    directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/LdapServerConfigReaderTest.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
    directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/PartitionTest.java
    directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlPartitionTest.java
    directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/AndCursorTest.java
    directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/EqualityTest.java
    directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java
    directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java
    directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NestedFilterTest.java
    directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NotCursorTest.java
    directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java
    directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.java
    directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java

Modified: directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java?rev=1615303&r1=1615302&r2=1615303&view=diff
==============================================================================
--- directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java (original)
+++ directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java Sat Aug  2 12:16:21 2014
@@ -239,6 +239,7 @@ public class DSAnnotationProcessor
                 if ( partition instanceof AbstractBTreePartition )
                 {
                     AbstractBTreePartition btreePartition = ( AbstractBTreePartition ) partition;
+                    btreePartition.setCacheService( service.getCacheService() );
                     btreePartition.setCacheSize( createPartition.cacheSize() );
                     btreePartition.setPartitionPath( new File( service
                         .getInstanceLayout().getPartitionsDirectory(),

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/SchemaPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/SchemaPartition.java?rev=1615303&r1=1615302&r2=1615303&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/SchemaPartition.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/SchemaPartition.java Sat Aug  2 12:16:21 2014
@@ -44,6 +44,7 @@ import org.apache.directory.api.ldap.mod
 import org.apache.directory.api.ldap.model.schema.SchemaUtils;
 import org.apache.directory.api.util.DateUtils;
 import org.apache.directory.server.constants.ApacheSchemaConstants;
+import org.apache.directory.server.core.api.CacheService;
 import org.apache.directory.server.core.api.CoreSession;
 import org.apache.directory.server.core.api.filtering.EntryFilteringCursor;
 import org.apache.directory.server.core.api.interceptor.context.AddOperationContext;
@@ -526,6 +527,14 @@ public final class SchemaPartition exten
     }
 
 
+    @Override
+    public void setCacheService( CacheService cacheService )
+    {
+        super.setCacheService( cacheService );
+        wrapped.setCacheService( cacheService );
+    }
+
+
     /**
      * @see Object#toString()
      */

Modified: directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java?rev=1615303&r1=1615302&r2=1615303&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java (original)
+++ directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java Sat Aug  2 12:16:21 2014
@@ -106,7 +106,8 @@ public class JdbmStoreTest
 
     /** The SN AttributeType instance */
     private static AttributeType SN_AT;
-
+    
+    private static CacheService cacheService;
 
     @BeforeClass
     public static void setup() throws Exception
@@ -140,7 +141,7 @@ public class JdbmStoreTest
         SN_AT = schemaManager.getAttributeType( SchemaConstants.SN_AT );
         APACHE_ALIAS_AT = schemaManager.getAttributeType( ApacheSchemaConstants.APACHE_ALIAS_AT );
 
-        CacheService cacheService = new CacheService();
+        cacheService = new CacheService();
         cacheService.initialize( null );
         dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
     }
@@ -172,6 +173,7 @@ public class JdbmStoreTest
         Dn suffixDn = new Dn( schemaManager, "o=Good Times Co." );
         store.setSuffixDn( suffixDn );
 
+        store.setCacheService( cacheService );
         store.initialize();
 
         StoreUtils.loadExampleData( store, schemaManager );
@@ -226,6 +228,7 @@ public class JdbmStoreTest
         store2.addIndex( new JdbmIndex( SchemaConstants.OU_AT_OID, false ) );
         store2.addIndex( new JdbmIndex( SchemaConstants.UID_AT_OID, false ) );
         store2.setSuffixDn( EXAMPLE_COM );
+        store2.setCacheService( cacheService );
         store2.initialize();
 
         // inject context entry
@@ -808,6 +811,7 @@ public class JdbmStoreTest
         Dn suffixDn = new Dn( schemaManager, "o=Good Times Co." );
         store.setSuffixDn( suffixDn );
         // init the store to call deleteUnusedIndexFiles() method
+        store.setCacheService( cacheService );
         store.initialize();
 
         assertFalse( ouIndexDbFile.exists() );

Modified: directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/LdifPartitionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/LdifPartitionTest.java?rev=1615303&r1=1615302&r2=1615303&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/LdifPartitionTest.java (original)
+++ directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/LdifPartitionTest.java Sat Aug  2 12:16:21 2014
@@ -92,7 +92,8 @@ public class LdifPartitionTest
     private static SchemaManager schemaManager = null;
     private static DnFactory dnFactory;
     private static CsnFactory defaultCSNFactory;
-
+    private static CacheService cacheService;
+    
     @Rule
     public TemporaryFolder folder = new TemporaryFolder();
 
@@ -124,7 +125,7 @@ public class LdifPartitionTest
 
         defaultCSNFactory = new CsnFactory( 0 );
 
-        CacheService cacheService = new CacheService();
+        cacheService = new CacheService();
         cacheService.initialize( null );
         dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
     }
@@ -145,6 +146,7 @@ public class LdifPartitionTest
         partition.setSchemaManager( schemaManager );
         partition.setPartitionPath( wkdir.toURI() );
 
+        partition.setCacheService( cacheService );
         partition.initialize();
 
         Entry entry = createEntry( "ou=test, ou=system" );

Modified: directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartitionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartitionTest.java?rev=1615303&r1=1615302&r2=1615303&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartitionTest.java (original)
+++ directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartitionTest.java Sat Aug  2 12:16:21 2014
@@ -117,6 +117,7 @@ public class SingleFileLdifPartitionTest
     @Rule
     public TemporaryFolder folder = new TemporaryFolder();
 
+    private static CacheService cacheService;
 
     @BeforeClass
     public static void init() throws Exception
@@ -164,7 +165,7 @@ public class SingleFileLdifPartitionTest
 
         contextEntry = new ClonedServerEntry( new DefaultEntry( schemaManager, ldifEntry.getEntry() ) );
 
-        CacheService cacheService = new CacheService();
+        cacheService = new CacheService();
         cacheService.initialize( null );
         dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
     }
@@ -236,6 +237,7 @@ public class SingleFileLdifPartitionTest
         partition.setPartitionPath( new File( fileName ).toURI() );
         partition.setSuffixDn( new Dn( "ou=test,ou=system" ) );
         partition.setSchemaManager( schemaManager );
+        partition.setCacheService( cacheService );
         partition.initialize();
 
         return partition;

Modified: directory/apacheds/trunk/mavibot-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mavibot-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotStoreTest.java?rev=1615303&r1=1615302&r2=1615303&view=diff
==============================================================================
--- directory/apacheds/trunk/mavibot-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotStoreTest.java (original)
+++ directory/apacheds/trunk/mavibot-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotStoreTest.java Sat Aug  2 12:16:21 2014
@@ -115,6 +115,8 @@ public class MavibotStoreTest
 
     private RecordManager recordMan;
 
+    private static CacheService cacheService;
+    
     @Rule
     public TemporaryFolder tmpDir = new TemporaryFolder();
 
@@ -151,7 +153,7 @@ public class MavibotStoreTest
         SN_AT = schemaManager.getAttributeType( SchemaConstants.SN_AT );
         APACHE_ALIAS_AT = schemaManager.getAttributeType( ApacheSchemaConstants.APACHE_ALIAS_AT );
 
-        CacheService cacheService = new CacheService();
+        cacheService = new CacheService();
         cacheService.initialize( null );
         dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
     }
@@ -181,6 +183,7 @@ public class MavibotStoreTest
         Dn suffixDn = new Dn( schemaManager, "o=Good Times Co." );
         store.setSuffixDn( suffixDn );
 
+        store.setCacheService( cacheService );
         store.initialize();
 
         recordMan = store.getRecordMan();
@@ -698,7 +701,7 @@ public class MavibotStoreTest
 
         Entry lookedup = store.fetch( store.getEntryId( dn ), dn );
 
-        store.modify( dn, add );
+        lookedup = store.modify( dn, add );
         assertTrue( lookedup.get( "sn" ).contains( attribVal ) );
     }
 

Modified: directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ChangePasswordConfigReaderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ChangePasswordConfigReaderTest.java?rev=1615303&r1=1615302&r2=1615303&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ChangePasswordConfigReaderTest.java (original)
+++ directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ChangePasswordConfigReaderTest.java Sat Aug  2 12:16:21 2014
@@ -63,6 +63,7 @@ public class ChangePasswordConfigReaderT
 
     private static SchemaManager schemaManager;
     private static DnFactory dnFactory;
+    private static CacheService cacheService;
 
 
     @BeforeClass
@@ -100,7 +101,7 @@ public class ChangePasswordConfigReaderT
             throw new Exception( "Schema load failed : " + Exceptions.printErrors( errors ) );
         }
 
-        CacheService cacheService = new CacheService();
+        cacheService = new CacheService();
         cacheService.initialize( null );
         dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
     }
@@ -125,6 +126,7 @@ public class ChangePasswordConfigReaderT
         configPartition.setSuffixDn( new Dn( "ou=config" ) );
         configPartition.setSchemaManager( schemaManager );
 
+        configPartition.setCacheService( cacheService );
         configPartition.initialize();
         ConfigPartitionReader cpReader = new ConfigPartitionReader( configPartition );
 

Modified: directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ConfigPartitionReaderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ConfigPartitionReaderTest.java?rev=1615303&r1=1615302&r2=1615303&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ConfigPartitionReaderTest.java (original)
+++ directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ConfigPartitionReaderTest.java Sat Aug  2 12:16:21 2014
@@ -60,7 +60,8 @@ public class ConfigPartitionReaderTest
 {
     private static SchemaManager schemaManager;
     private static DnFactory dnFactory;
-
+    private static CacheService cacheService;
+    
     private static File workDir = new File( System.getProperty( "java.io.tmpdir" ) + "/server-work" );
 
 
@@ -98,7 +99,7 @@ public class ConfigPartitionReaderTest
             throw new Exception( "Schema load failed : " + Exceptions.printErrors( errors ) );
         }
 
-        CacheService cacheService = new CacheService();
+        cacheService = new CacheService();
         cacheService.initialize( null );
         dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
     }
@@ -117,6 +118,7 @@ public class ConfigPartitionReaderTest
         configPartition.setSuffixDn( new Dn( "ou=config" ) );
         configPartition.setSchemaManager( schemaManager );
 
+        configPartition.setCacheService( cacheService );
         configPartition.initialize();
 
         ConfigPartitionReader cpReader = new ConfigPartitionReader( configPartition );

Modified: directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ConfigWriterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ConfigWriterTest.java?rev=1615303&r1=1615302&r2=1615303&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ConfigWriterTest.java (original)
+++ directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ConfigWriterTest.java Sat Aug  2 12:16:21 2014
@@ -67,7 +67,8 @@ public class ConfigWriterTest
 {
     private static SchemaManager schemaManager;
     private static DnFactory dnFactory;
-
+    private static CacheService cacheService;
+    
     private static File workDir = new File( System.getProperty( "java.io.tmpdir" ) + "/server-work" );
 
 
@@ -104,7 +105,7 @@ public class ConfigWriterTest
             throw new Exception( "Schema load failed : " + Exceptions.printErrors( errors ) );
         }
 
-        CacheService cacheService = new CacheService();
+        cacheService = new CacheService();
         cacheService.initialize( null );
         dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
     }
@@ -123,6 +124,7 @@ public class ConfigWriterTest
         configPartition.setPartitionPath( new File( configFile ).toURI() );
         configPartition.setSuffixDn( new Dn( "ou=config" ) );
         configPartition.setSchemaManager( schemaManager );
+        configPartition.setCacheService( cacheService );
         configPartition.initialize();
 
         // Reading the config partition

Modified: directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/HttpServerConfigReaderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/HttpServerConfigReaderTest.java?rev=1615303&r1=1615302&r2=1615303&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/HttpServerConfigReaderTest.java (original)
+++ directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/HttpServerConfigReaderTest.java Sat Aug  2 12:16:21 2014
@@ -60,7 +60,8 @@ public class HttpServerConfigReaderTest
 {
     private static SchemaManager schemaManager;
     private static DnFactory dnFactory;
-
+    private static CacheService cacheService;
+    
     private static File workDir = new File( System.getProperty( "java.io.tmpdir" ) + "/server-work" );
 
 
@@ -97,7 +98,7 @@ public class HttpServerConfigReaderTest
             throw new Exception( "Schema load failed : " + Exceptions.printErrors( errors ) );
         }
 
-        CacheService cacheService = new CacheService();
+        cacheService = new CacheService();
         cacheService.initialize( null );
         dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
     }
@@ -115,6 +116,7 @@ public class HttpServerConfigReaderTest
         configPartition.setSuffixDn( new Dn( "ou=config" ) );
         configPartition.setSchemaManager( schemaManager );
 
+        configPartition.setCacheService( cacheService );
         configPartition.initialize();
 
         ConfigPartitionReader cpReader = new ConfigPartitionReader( configPartition );

Modified: directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/KerberosServerConfigReaderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/KerberosServerConfigReaderTest.java?rev=1615303&r1=1615302&r2=1615303&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/KerberosServerConfigReaderTest.java (original)
+++ directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/KerberosServerConfigReaderTest.java Sat Aug  2 12:16:21 2014
@@ -62,7 +62,8 @@ public class KerberosServerConfigReaderT
 
     private static SchemaManager schemaManager;
     private static DnFactory dnFactory;
-
+    private static CacheService cacheService;
+    
 
     @BeforeClass
     public static void readConfig() throws Exception
@@ -98,7 +99,7 @@ public class KerberosServerConfigReaderT
             throw new Exception( "Schema load failed : " + Exceptions.printErrors( errors ) );
         }
 
-        CacheService cacheService = new CacheService();
+        cacheService = new CacheService();
         cacheService.initialize( null );
         dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
     }
@@ -116,6 +117,7 @@ public class KerberosServerConfigReaderT
         configPartition.setSuffixDn( new Dn( "ou=config" ) );
         configPartition.setSchemaManager( schemaManager );
 
+        configPartition.setCacheService( cacheService );
         configPartition.initialize();
         ConfigPartitionReader cpReader = new ConfigPartitionReader( configPartition );
 

Modified: directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/LdapServerConfigReaderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/LdapServerConfigReaderTest.java?rev=1615303&r1=1615302&r2=1615303&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/LdapServerConfigReaderTest.java (original)
+++ directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/LdapServerConfigReaderTest.java Sat Aug  2 12:16:21 2014
@@ -62,7 +62,8 @@ public class LdapServerConfigReaderTest
 
     private static SchemaManager schemaManager;
     private static DnFactory dnFactory;
-
+    private static CacheService cacheService;
+    
 
     @BeforeClass
     public static void readConfig() throws Exception
@@ -98,7 +99,7 @@ public class LdapServerConfigReaderTest
             throw new Exception( "Schema load failed : " + Exceptions.printErrors( errors ) );
         }
 
-        CacheService cacheService = new CacheService();
+        cacheService = new CacheService();
         cacheService.initialize( null );
         dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
     }
@@ -116,6 +117,7 @@ public class LdapServerConfigReaderTest
         configPartition.setSuffixDn( new Dn( "ou=config" ) );
         configPartition.setSchemaManager( schemaManager );
 
+        configPartition.setCacheService( cacheService );
         configPartition.initialize();
         ConfigPartitionReader cpReader = new ConfigPartitionReader( configPartition );
 

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=1615303&r1=1615302&r2=1615303&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 Sat Aug  2 12:16:21 2014
@@ -29,14 +29,16 @@ import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.Semaphore;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 import net.sf.ehcache.Cache;
+import net.sf.ehcache.CacheManager;
 import net.sf.ehcache.Element;
+import net.sf.ehcache.store.LruPolicy;
 
-import org.apache.commons.collections.map.LRUMap;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.cursor.Cursor;
 import org.apache.directory.api.ldap.model.entry.Attribute;
@@ -67,8 +69,8 @@ import org.apache.directory.api.util.exc
 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.EntryFilteringCursorImpl;
 import org.apache.directory.server.core.api.filtering.EntryFilteringCursor;
+import org.apache.directory.server.core.api.filtering.EntryFilteringCursorImpl;
 import org.apache.directory.server.core.api.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.DeleteOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.HasEntryOperationContext;
@@ -191,7 +193,10 @@ public abstract class AbstractBTreeParti
     private ReadWriteLock rwLock;
 
     /** a cache to hold <entryUUID, Dn> pairs, this is used for speeding up the buildEntryDn() method */
-    private LRUMap entryDnCache = new LRUMap( 10000 );
+    private Cache entryDnCache;
+    
+    /** a semaphore to serialize the writes on context entry while updating contextCSN attribute */
+    private Semaphore ctxCsnSemaphore = new Semaphore( 1 );
     
     // ------------------------------------------------------------------------
     // C O N S T R U C T O R S
@@ -494,7 +499,7 @@ public abstract class AbstractBTreeParti
         // don't reset initialized flag
         initialized = false;
 
-        entryDnCache.clear();
+        entryDnCache.removeAll();
         
         MultiException errors = new MultiException( I18n.err( I18n.ERR_577 ) );
 
@@ -581,6 +586,10 @@ public abstract class AbstractBTreeParti
             {
                 piarCache.getCacheConfiguration().setMaxElementsInMemory( cacheSize * 3 );
             }
+            
+            entryDnCache = cacheService.getCache( "entryDn" );
+            entryDnCache.setMemoryStoreEvictionPolicy( new LruPolicy() );
+            entryDnCache.getCacheConfiguration().setMaxElementsInMemory( 100 );
         }
     }
 
@@ -1114,7 +1123,19 @@ public abstract class AbstractBTreeParti
 
             if ( ctxCsnChanged && getSuffixDn().getNormName().equals( searchContext.getDn().getNormName() ) )
             {
-                saveContextCsn();
+                try
+                {
+                    ctxCsnSemaphore.acquire();
+                    saveContextCsn();
+                }
+                catch ( Exception e )
+                {
+                    throw new LdapOperationErrorException( e.getMessage(), e );
+                }
+                finally
+                {
+                    ctxCsnSemaphore.release();
+                }
             }
             
             PartitionSearchResult searchResult = searchEngine.computeResult( schemaManager, searchContext );
@@ -1153,7 +1174,19 @@ public abstract class AbstractBTreeParti
 
         if ( ctxCsnChanged && getSuffixDn().getNormName().equals( lookupContext.getDn().getNormName() ) )
         {
-            saveContextCsn();
+            try
+            {
+                ctxCsnSemaphore.acquire();
+                saveContextCsn();
+            }
+            catch ( Exception e )
+            {
+                throw new LdapOperationErrorException( e.getMessage(), e );
+            }
+            finally
+            {
+                ctxCsnSemaphore.release();
+            }
         }
 
         Entry entry = fetch( id, lookupContext.getDn() );
@@ -1860,7 +1893,7 @@ public abstract class AbstractBTreeParti
         // Remove the EntryDN
         modifiedEntry.removeAttributes( ENTRY_DN_AT );
 
-        entryDnCache.clear();
+        entryDnCache.removeAll();
         
         setContextCsn( modifiedEntry.get( ENTRY_CSN_AT ).getString() );
 
@@ -1965,7 +1998,7 @@ public abstract class AbstractBTreeParti
         rename( oldId, newRdn, deleteOldRdn, modifiedEntry );
         moveAndRename( oldDn, oldId, newSuperiorDn, newRdn, modifiedEntry );
 
-        entryDnCache.clear();
+        entryDnCache.removeAll();
         
         if ( isSyncOnWrite.get() )
         {
@@ -2223,7 +2256,7 @@ public abstract class AbstractBTreeParti
 
         rdnIdx.add( parentIdAndRdn, oldId );
 
-        entryDnCache.clear();
+        entryDnCache.removeAll();
         
         if ( isSyncOnWrite.get() )
         {
@@ -2311,11 +2344,11 @@ public abstract class AbstractBTreeParti
         {
             rwLock.readLock().lock();
 
-            dn = ( Dn ) entryDnCache.get( id );
+            Element el = entryDnCache.get( id );
             
-            if ( dn != null )
+            if ( el != null )
             {
-                return dn;
+                return ( Dn ) el.getValue();
             }
             
             do
@@ -2373,7 +2406,7 @@ public abstract class AbstractBTreeParti
             
             dn = new Dn( schemaManager, Arrays.copyOf( rdnArray, pos ) );
             
-            entryDnCache.put( id, dn );
+            entryDnCache.put( new Element( id, dn ) );
             return dn;
         }
         finally
@@ -3305,14 +3338,12 @@ public abstract class AbstractBTreeParti
             return;
         }
         
-        if( rwLock == null )
-        {
-            // Create a ReadWrite lock from scratch
-            rwLock = new ReentrantReadWriteLock();
-        }
-        
         try
         {
+            // we don't need to use the ctxCsnSemaphore here cause
+            // the only other place this is called is from PartitionNexus.sync()
+            // but that is protected by write lock in DefaultDirectoryService.shutdown()
+            
             String contextEntryId = getEntryId( getSuffixDn() );
             Entry origEntry = fetch( contextEntryId );
             

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=1615303&r1=1615302&r2=1615303&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 Sat Aug  2 12:16:21 2014
@@ -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.CacheService;
 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;
@@ -85,6 +86,7 @@ public class PartitionTest
     /** The CN AttributType instance */
     private static AttributeType CN_AT;
 
+    private static CacheService cacheService;
 
     @BeforeClass
     public static void setup() throws Exception
@@ -103,6 +105,8 @@ public class PartitionTest
         extractor.extractOrCopy( true );
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
 
+        cacheService = new CacheService();
+        cacheService.initialize( null );
         schemaManager = new DefaultSchemaManager( loader );
 
         boolean loaded = schemaManager.loadAllEnabled();
@@ -132,6 +136,7 @@ public class PartitionTest
         partition.addIndex( new AvlIndex<String>( SchemaConstants.CN_AT_OID ) );
         partition.setSuffixDn( new Dn( schemaManager, "o=Good Times Co." ) );
 
+        partition.setCacheService( cacheService );
         partition.initialize();
 
         StoreUtils.loadExampleData( partition, schemaManager );

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=1615303&r1=1615302&r2=1615303&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 Sat Aug  2 12:16:21 2014
@@ -95,7 +95,8 @@ public class AvlPartitionTest
     /** The ApacheAlias AttributeType instance */
     private static AttributeType APACHE_ALIAS_AT;
 
-
+    private static CacheService cacheService;
+    
     @BeforeClass
     public static void setup() throws Exception
     {
@@ -114,7 +115,7 @@ public class AvlPartitionTest
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
 
         schemaManager = new DefaultSchemaManager( loader );
-        CacheService cacheService = new CacheService();
+        cacheService = new CacheService();
         cacheService.initialize( null );
         dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
 
@@ -146,6 +147,7 @@ public class AvlPartitionTest
         partition.addIndex( new AvlIndex<String>( SchemaConstants.UID_AT_OID ) );
         partition.setSuffixDn( new Dn( schemaManager, "o=Good Times Co." ) );
 
+        partition.setCacheService( cacheService );
         partition.initialize();
 
         StoreUtils.loadExampleData( partition, schemaManager );

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=1615303&r1=1615302&r2=1615303&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 Sat Aug  2 12:16:21 2014
@@ -41,6 +41,7 @@ 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.LdapPrincipal;
 import org.apache.directory.server.core.api.MockCoreSession;
 import org.apache.directory.server.core.api.MockDirectoryService;
@@ -67,7 +68,7 @@ public class AndCursorTest extends Abstr
     private static final Logger LOG = LoggerFactory.getLogger( AndCursorTest.class );
 
     File wkdir;
-
+    private static CacheService cacheService;
 
     @BeforeClass
     public static void setup() throws Exception
@@ -101,6 +102,9 @@ public class AndCursorTest extends Abstr
         {
             fail( "Schema load failed : " + Exceptions.printErrors( schemaManager.getErrors() ) );
         }
+
+        cacheService = new CacheService();
+        cacheService.initialize( null );
     }
 
 
@@ -130,6 +134,7 @@ public class AndCursorTest extends Abstr
         store.addIndex( new AvlIndex<String>( SchemaConstants.OU_AT_OID ) );
         store.addIndex( new AvlIndex<String>( SchemaConstants.CN_AT_OID ) );
         ( ( Partition ) store ).setSuffixDn( new Dn( schemaManager, "o=Good Times Co." ) );
+        ( ( Partition ) store ).setCacheService( cacheService );
         ( ( Partition ) store ).initialize();
 
         StoreUtils.loadExampleData( store, schemaManager );

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=1615303&r1=1615302&r2=1615303&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 Sat Aug  2 12:16:21 2014
@@ -79,7 +79,7 @@ public class EqualityTest
     Store store;
     static SchemaManager schemaManager = null;
     private static DnFactory dnFactory;
-
+    private static CacheService cacheService;
 
     @BeforeClass
     public static void setup() throws Exception
@@ -113,7 +113,7 @@ public class EqualityTest
             fail( "Schema load failed : " + Exceptions.printErrors( schemaManager.getErrors() ) );
         }
 
-        CacheService cacheService = new CacheService();
+        cacheService = new CacheService();
         cacheService.initialize( null );
         dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
     }
@@ -138,8 +138,7 @@ public class EqualityTest
         store.addIndex( new AvlIndex<String>( SchemaConstants.OU_AT_OID ) );
         store.addIndex( new AvlIndex<String>( SchemaConstants.CN_AT_OID ) );
         ( ( Partition ) store ).setSuffixDn( new Dn( schemaManager, "o=Good Times Co." ) );
-        ( ( Partition ) store ).initialize();
-
+        ( ( Partition ) store ).setCacheService( cacheService );
         ( ( Partition ) store ).initialize();
 
         StoreUtils.loadExampleData( store, schemaManager );

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=1615303&r1=1615302&r2=1615303&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 Sat Aug  2 12:16:21 2014
@@ -88,7 +88,7 @@ public class GreaterEqTest
     Store store;
     static SchemaManager schemaManager = null;
     private static DnFactory dnFactory;
-
+    private static CacheService cacheService;
 
     @BeforeClass
     public static void setup() throws Exception
@@ -123,7 +123,7 @@ public class GreaterEqTest
             fail( "Schema load failed : " + Exceptions.printErrors( schemaManager.getErrors() ) );
         }
 
-        CacheService cacheService = new CacheService();
+        cacheService = new CacheService();
         cacheService.initialize( null );
         dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
     }
@@ -149,6 +149,7 @@ public class GreaterEqTest
         store.addIndex( new AvlIndex<String>( SchemaConstants.CN_AT_OID ) );
         store.addIndex( new AvlIndex<String>( SchemaConstants.POSTALCODE_AT_OID ) );
         ( ( Partition ) store ).setSuffixDn( new Dn( schemaManager, "o=Good Times Co." ) );
+        ( ( Partition ) store ).setCacheService( cacheService );
         ( ( Partition ) store ).initialize();
 
         StoreUtils.loadExampleData( store, schemaManager );

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=1615303&r1=1615302&r2=1615303&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 Sat Aug  2 12:16:21 2014
@@ -88,7 +88,7 @@ public class LessEqTest
     Store store;
     static SchemaManager schemaManager = null;
     private static DnFactory dnFactory;
-
+    private static CacheService cacheService;
 
     @BeforeClass
     public static void setup() throws Exception
@@ -123,7 +123,7 @@ public class LessEqTest
             fail( "Schema load failed : " + Exceptions.printErrors( schemaManager.getErrors() ) );
         }
 
-        CacheService cacheService = new CacheService();
+        cacheService = new CacheService();
         cacheService.initialize( null );
         dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
     }
@@ -149,8 +149,7 @@ public class LessEqTest
         store.addIndex( new AvlIndex<String>( SchemaConstants.CN_AT_OID ) );
         store.addIndex( new AvlIndex<String>( SchemaConstants.POSTALCODE_AT_OID ) );
         ( ( Partition ) store ).setSuffixDn( new Dn( schemaManager, "o=Good Times Co." ) );
-        ( ( Partition ) store ).initialize();
-
+        ( ( Partition ) store ).setCacheService( cacheService );
         ( ( Partition ) store ).initialize();
 
         StoreUtils.loadExampleData( store, schemaManager );

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=1615303&r1=1615302&r2=1615303&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 Sat Aug  2 12:16:21 2014
@@ -46,6 +46,7 @@ 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.LdapPrincipal;
 import org.apache.directory.server.core.api.MockCoreSession;
 import org.apache.directory.server.core.api.MockDirectoryService;
@@ -76,7 +77,7 @@ public class NestedFilterTest extends Ab
     static SchemaManager schemaManager = null;
     Optimizer optimizer;
     static FilterNormalizingVisitor visitor;
-
+    private static CacheService cacheService;
 
     @BeforeClass
     static public void setup() throws Exception
@@ -113,6 +114,9 @@ public class NestedFilterTest extends Ab
 
         NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( schemaManager );
         visitor = new FilterNormalizingVisitor( ncn, schemaManager );
+        
+        cacheService = new CacheService();
+        cacheService.initialize( null );
     }
 
 
@@ -137,6 +141,7 @@ public class NestedFilterTest extends Ab
         store.addIndex( new AvlIndex<String>( SchemaConstants.OU_AT_OID ) );
         store.addIndex( new AvlIndex<String>( SchemaConstants.CN_AT_OID ) );
         ( ( Partition ) store ).setSuffixDn( new Dn( schemaManager, "o=Good Times Co." ) );
+        ( ( Partition ) store ).setCacheService( cacheService );
         ( ( Partition ) store ).initialize();
 
         StoreUtils.loadExampleData( store, schemaManager );

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=1615303&r1=1615302&r2=1615303&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 Sat Aug  2 12:16:21 2014
@@ -47,6 +47,7 @@ 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.LdapPrincipal;
 import org.apache.directory.server.core.api.MockCoreSession;
 import org.apache.directory.server.core.api.MockDirectoryService;
@@ -80,7 +81,7 @@ public class NotCursorTest extends Abstr
 
     File wkdir;
     static SchemaManager schemaManager = null;
-
+    private static CacheService cacheService;
 
     @BeforeClass
     static public void setup() throws Exception
@@ -114,6 +115,9 @@ public class NotCursorTest extends Abstr
         {
             fail( "Schema load failed : " + Exceptions.printErrors( schemaManager.getErrors() ) );
         }
+        
+        cacheService = new CacheService();
+        cacheService.initialize( null );
     }
 
 
@@ -138,6 +142,7 @@ public class NotCursorTest extends Abstr
         store.addIndex( new AvlIndex<String>( SchemaConstants.OU_AT_OID ) );
         store.addIndex( new AvlIndex<String>( SchemaConstants.CN_AT_OID ) );
         ( ( Partition ) store ).setSuffixDn( new Dn( schemaManager, "o=Good Times Co." ) );
+        ( ( Partition ) store ).setCacheService( cacheService );
         ( ( Partition ) store ).initialize();
 
         StoreUtils.loadExampleData( store, schemaManager );

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=1615303&r1=1615302&r2=1615303&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 Sat Aug  2 12:16:21 2014
@@ -46,6 +46,7 @@ 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.LdapPrincipal;
 import org.apache.directory.server.core.api.MockCoreSession;
 import org.apache.directory.server.core.api.MockDirectoryService;
@@ -82,7 +83,7 @@ public class OrCursorTest extends Abstra
 
     File wkdir;
     static SchemaManager schemaManager = null;
-
+    private static CacheService cacheService;
 
     @BeforeClass
     public static void setup() throws Exception
@@ -115,6 +116,9 @@ public class OrCursorTest extends Abstra
         {
             fail( "Schema load failed : " + Exceptions.printErrors( schemaManager.getErrors() ) );
         }
+
+        cacheService = new CacheService();
+        cacheService.initialize( null );
     }
 
 
@@ -139,6 +143,7 @@ public class OrCursorTest extends Abstra
         store.addIndex( new AvlIndex<String>( SchemaConstants.OU_AT_OID ) );
         store.addIndex( new AvlIndex<String>( SchemaConstants.CN_AT_OID ) );
         ( ( Partition ) store ).setSuffixDn( new Dn( schemaManager, "o=Good Times Co." ) );
+        ( ( Partition ) store ).setCacheService( cacheService );
         ( ( Partition ) store ).initialize();
 
         StoreUtils.loadExampleData( store, schemaManager );

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=1615303&r1=1615302&r2=1615303&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 Sat Aug  2 12:16:21 2014
@@ -75,7 +75,7 @@ public class PresenceTest
     Store store;
     static SchemaManager schemaManager = null;
     private static DnFactory dnFactory;
-
+    private static CacheService cacheService;
 
     @BeforeClass
     public static void setup() throws Exception
@@ -109,7 +109,7 @@ public class PresenceTest
             fail( "Schema load failed : " + Exceptions.printErrors( schemaManager.getErrors() ) );
         }
 
-        CacheService cacheService = new CacheService();
+        cacheService = new CacheService();
         cacheService.initialize( null );
         dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
     }
@@ -134,6 +134,7 @@ public class PresenceTest
         store.addIndex( new AvlIndex<String>( SchemaConstants.OU_AT_OID ) );
         store.addIndex( new AvlIndex<String>( SchemaConstants.CN_AT_OID ) );
         ( ( Partition ) store ).setSuffixDn( new Dn( schemaManager, "o=Good Times Co." ) );
+        ( ( Partition ) store ).setCacheService( cacheService );
         ( ( Partition ) store ).initialize();
 
         ( ( Partition ) store ).initialize();

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=1615303&r1=1615302&r2=1615303&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 Sat Aug  2 12:16:21 2014
@@ -71,7 +71,7 @@ public class SubstringTest
     Store store;
     static SchemaManager schemaManager = null;
     private static DnFactory dnFactory;
-
+    private static CacheService cacheService;
 
     @BeforeClass
     public static void setup() throws Exception
@@ -105,7 +105,7 @@ public class SubstringTest
             fail( "Schema load failed : " + Exceptions.printErrors( schemaManager.getErrors() ) );
         }
 
-        CacheService cacheService = new CacheService();
+        cacheService = new CacheService();
         cacheService.initialize( null );
         dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
     }
@@ -133,6 +133,7 @@ public class SubstringTest
         Dn suffixDn = new Dn( schemaManager, "o=Good Times Co." );
         ( ( Partition ) store ).setSuffixDn( suffixDn );
 
+        ( ( Partition ) store ).setCacheService( cacheService );
         ( ( Partition ) store ).initialize();
 
         StoreUtils.loadExampleData( store, schemaManager );



Mime
View raw message