directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r887155 - /directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
Date Fri, 04 Dec 2009 11:00:46 GMT
Author: elecharny
Date: Fri Dec  4 11:00:46 2009
New Revision: 887155

URL: http://svn.apache.org/viewvc?rev=887155&view=rev
Log:
Modified the initialization to speedup the tests

Modified:
    directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java

Modified: directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java?rev=887155&r1=887154&r2=887155&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
(original)
+++ directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
Fri Dec  4 11:00:46 2009
@@ -32,16 +32,13 @@
 import javax.naming.directory.NoSuchAttributeException;
 
 import org.apache.commons.io.FileUtils;
-import org.apache.directory.server.schema.loader.ldif.LdifSchemaLoaderTest;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.UsageEnum;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 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.apache.directory.shared.schema.loader.ldif.SchemaEntityFactory;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -58,12 +55,15 @@
     // A directory in which the ldif files will be stored
     private static String workingDirectory;
 
+    // The schema repository
+    private static File schemaRepository;
+
+
     // A LDIF loader
-    private static LdifSchemaLoader ldifLoader;
+    //private static LdifSchemaLoader ldifLoader;
 
     // A SchemaObject factory
-    private static SchemaEntityFactory factory;
-
+    //private static SchemaEntityFactory factory;
 
     @BeforeClass
     public static void setup() throws Exception
@@ -72,19 +72,18 @@
 
         if ( workingDirectory == null )
         {
-            String path = LdifSchemaLoaderTest.class.getResource( "" ).getPath();
+            String path = SchemaManagerTest.class.getResource( "" ).getPath();
             int targetPos = path.indexOf( "target" );
             workingDirectory = path.substring( 0, targetPos + 6 );
         }
 
+        schemaRepository = new File( workingDirectory, "schema" );
+
         // Cleanup the target directory
-        FileUtils.deleteDirectory( new File( workingDirectory + "/schema" ) );
+        FileUtils.deleteDirectory( schemaRepository );
 
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory
) );
         extractor.extractOrCopy();
-
-        ldifLoader = new LdifSchemaLoader( new File( workingDirectory, "schema" ) );
-        factory = new SchemaEntityFactory();
     }
 
 
@@ -92,13 +91,13 @@
     public static void cleanup() throws IOException
     {
         // Cleanup the target directory
-        FileUtils.deleteDirectory( new File( workingDirectory + "/schema" ) );
+        FileUtils.deleteDirectory( schemaRepository );
     }
 
 
     private SchemaManager loadSystem() throws Exception
     {
-        JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
         SchemaManager schemaManager = new DefaultSchemaManager( loader );
 
         String schemaName = "system";



Mime
View raw message