directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r893140 - in /directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ: DirectoryServiceFactory.java FrameworkDirectoryServiceFactory.java FrameworkRunner.java
Date Tue, 22 Dec 2009 11:19:56 GMT
Author: elecharny
Date: Tue Dec 22 11:19:53 2009
New Revision: 893140

URL: http://svn.apache.org/viewvc?rev=893140&view=rev
Log:
o Working with a different Loader, to speedup (a bit) the tests
o Adding some timing (we will have to remove them latter)

Modified:
    directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/DirectoryServiceFactory.java
    directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkDirectoryServiceFactory.java
    directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java

Modified: directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/DirectoryServiceFactory.java
URL: http://svn.apache.org/viewvc/directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/DirectoryServiceFactory.java?rev=893140&r1=893139&r2=893140&view=diff
==============================================================================
--- directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/DirectoryServiceFactory.java
(original)
+++ directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/DirectoryServiceFactory.java
Tue Dec 22 11:19:53 2009
@@ -38,9 +38,10 @@
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
+import org.apache.directory.shared.ldap.schema.registries.SchemaLoader;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
 import org.apache.directory.shared.schema.DefaultSchemaManager;
-import org.apache.directory.shared.schema.loader.ldif.JarLdifSchemaLoader;
+import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 
 
 /**
@@ -95,10 +96,11 @@
             // Extract the schema on disk (a brand new one) and load the registries
             File schemaRepository = new File( workingDirectory, "schema" );
             SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory
) );
+            extractor.extractOrCopy();
 
             schemaPartition.setWrappedPartition( ldifPartition );
 
-            JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
+            SchemaLoader loader = new LdifSchemaLoader( schemaRepository );
             SchemaManager schemaManager = new DefaultSchemaManager( loader );
             service.setSchemaManager( schemaManager );
 
@@ -115,8 +117,6 @@
                 throw new Exception( "Schema load failed : " + ExceptionUtils.printErrors(
errors ) );
             }
 
-            extractor.extractOrCopy();
-
             service.getChangeLog().setEnabled( true );
 
             // change the working directory to something that is unique

Modified: directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkDirectoryServiceFactory.java
URL: http://svn.apache.org/viewvc/directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkDirectoryServiceFactory.java?rev=893140&r1=893139&r2=893140&view=diff
==============================================================================
--- directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkDirectoryServiceFactory.java
(original)
+++ directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkDirectoryServiceFactory.java
Tue Dec 22 11:19:53 2009
@@ -20,9 +20,10 @@
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
+import org.apache.directory.shared.ldap.schema.registries.SchemaLoader;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
 import org.apache.directory.shared.schema.DefaultSchemaManager;
-import org.apache.directory.shared.schema.loader.ldif.JarLdifSchemaLoader;
+import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 
 
 public class FrameworkDirectoryServiceFactory implements DirectoryServiceFactory
@@ -62,10 +63,11 @@
         // Extract the schema on disk (a brand new one) and load the registries
         File schemaRepository = new File( workingDirectory, "schema" );
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory
) );
+        extractor.extractOrCopy();
 
         schemaPartition.setWrappedPartition( ldifPartition );
 
-        JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
+        SchemaLoader loader = new LdifSchemaLoader( schemaRepository );
         SchemaManager schemaManager = new DefaultSchemaManager( loader );
         service.setSchemaManager( schemaManager );
 
@@ -80,8 +82,6 @@
 
         schemaPartition.setSchemaManager( schemaManager );
 
-        extractor.extractOrCopy();
-
         service.getChangeLog().setEnabled( true );
 
         // change the working directory to something that is unique

Modified: directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
URL: http://svn.apache.org/viewvc/directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java?rev=893140&r1=893139&r2=893140&view=diff
==============================================================================
--- directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
(original)
+++ directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
Tue Dec 22 11:19:53 2009
@@ -42,9 +42,10 @@
 import org.apache.directory.shared.ldap.ldif.LdifReader;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
+import org.apache.directory.shared.ldap.schema.registries.SchemaLoader;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
 import org.apache.directory.shared.schema.DefaultSchemaManager;
-import org.apache.directory.shared.schema.loader.ldif.JarLdifSchemaLoader;
+import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 import org.junit.Ignore;
 import org.junit.runner.Description;
 import org.junit.runner.notification.RunNotifier;
@@ -164,17 +165,26 @@
         // Extract the schema on disk (a brand new one) and load the registries
         File schemaRepository = new File( workingDirectory, "schema" );
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory
) );
+        
+        long t0 = System.currentTimeMillis();
+        extractor.extractOrCopy();
+        long t1 = System.currentTimeMillis();
+        System.out.println( "Delta = " + ( t1 - t0 ) );
 
         schemaPartition.setWrappedPartition( ldifPartition );
 
-        JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
+        SchemaLoader loader = new LdifSchemaLoader( schemaRepository );
         SchemaManager schemaManager = new DefaultSchemaManager( loader );
         service.setSchemaManager( schemaManager );
 
         // We have to load the schema now, otherwise we won't be able
         // to initialize the Partitions, as we won't be able to parse 
         // and normalize their suffix DN
+        long t2 = System.currentTimeMillis();
         boolean loaded = schemaManager.loadAllEnabled();
+        long t3 = System.currentTimeMillis();
+        System.out.println( "Delta load = " + ( t3 - t2 ) );
+        
         schemaPartition.setSchemaManager( schemaManager );
 
         List<Throwable> errors = schemaManager.getErrors();
@@ -184,8 +194,6 @@
             throw new Exception( "Schema load failed : " + ExceptionUtils.printErrors( errors
) );
         }
 
-        extractor.extractOrCopy();
-
         service.getChangeLog().setEnabled( true );
 
         // change the working directory to something that is unique



Mime
View raw message