directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r812301 - in /directory/apacheds/branches/apacheds-schema: avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/ core-api/src/main/java/org/apache/directory/server/core/partition/ core-api/src/main/java/org/apache/dire...
Date Mon, 07 Sep 2009 23:06:28 GMT
Author: elecharny
Date: Mon Sep  7 23:06:27 2009
New Revision: 812301

URL: http://svn.apache.org/viewvc?rev=812301&view=rev
Log:
Modified the tests to make them load the registries

Modified:
    directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlIndex.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java
    directory/apacheds/branches/apacheds-schema/core-entry/pom.xml
    directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerAttributeTest.java
    directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java
    directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
    directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java
    directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/normalization/NormalizationVisitorTest.java
    directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java
    directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java

Modified: directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlIndex.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlIndex.java?rev=812301&r1=812300&r2=812301&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlIndex.java
(original)
+++ directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlIndex.java
Mon Sep  7 23:06:27 2009
@@ -24,7 +24,6 @@
 
 import org.apache.directory.server.core.partition.impl.btree.IndexCursorAdaptor;
 import org.apache.directory.server.core.partition.impl.btree.LongComparator;
-import org.apache.directory.server.core.partition.impl.btree.gui.IndexDialog;
 import org.apache.directory.server.xdbm.Index;
 import org.apache.directory.server.xdbm.IndexCursor;
 import org.apache.directory.server.xdbm.Tuple;

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java?rev=812301&r1=812300&r2=812301&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java
Mon Sep  7 23:06:27 2009
@@ -20,14 +20,14 @@
 package org.apache.directory.server.core.partition;
 
 
+import javax.naming.InvalidNameException;
+import javax.naming.NameNotFoundException;
+
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 
-import javax.naming.InvalidNameException;
-import javax.naming.NameNotFoundException;
-
 
 /**
  * A {@link Partition} that helps users to implement their own partition.
@@ -42,11 +42,13 @@
     /** <tt>true</tt> if and only if this partition is initialized. */
     protected boolean initialized;
 
+    /** the registries managed by this Partition */
     protected Registries registries;
     
 
     protected AbstractPartition()
     {
+        registries = new Registries();
     }
 
 

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java?rev=812301&r1=812300&r2=812301&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java
Mon Sep  7 23:06:27 2009
@@ -115,9 +115,6 @@
     /** the wrapped Partition */
     private Partition wrapped = new NullPartition();
     
-    /** the registries managed by this SchemaPartition */
-    private Registries registries = new Registries();
-    
     /** schema loader: swapped out after {@link SchemaPartition#initialize()} */
     private SchemaLoader loader;
     

Modified: directory/apacheds/branches/apacheds-schema/core-entry/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-entry/pom.xml?rev=812301&r1=812300&r2=812301&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-entry/pom.xml (original)
+++ directory/apacheds/branches/apacheds-schema/core-entry/pom.xml Mon Sep  7 23:06:27 2009
@@ -50,6 +50,12 @@
     </dependency>    
     
     <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+      <scope>test</scope>
+    </dependency>
+      
+    <dependency>
       <groupId>org.apache.directory.shared</groupId>
       <version>${org.apache.directory.shared.version}</version>
       <artifactId>shared-ldap-schema</artifactId>

Modified: directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerAttributeTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerAttributeTest.java?rev=812301&r1=812300&r2=812301&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerAttributeTest.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerAttributeTest.java
Mon Sep  7 23:06:27 2009
@@ -19,12 +19,12 @@
 package org.apache.directory.server.core.entry;
 
 
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import java.io.ByteArrayInputStream;
@@ -43,6 +43,7 @@
 import javax.naming.NamingException;
 import javax.naming.directory.InvalidAttributeValueException;
 
+import org.apache.commons.io.FileUtils;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.entry.client.ClientAttribute;
@@ -54,7 +55,6 @@
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
-
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -112,7 +112,10 @@
             workingDirectory = path.substring( 0, targetPos + 6 );
     	}
     	
-    	File schemaRepository = new File( workingDirectory, "schema" );
+        // Cleanup the target directory
+        File schemaRepository = new File( workingDirectory, "schema" );
+        FileUtils.deleteDirectory( schemaRepository );
+    	
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory
) );
         extractor.extractOrCopy();
     	loader = new LdifSchemaLoader( schemaRepository );

Modified: directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java?rev=812301&r1=812300&r2=812301&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java
Mon Sep  7 23:06:27 2009
@@ -20,7 +20,9 @@
 package org.apache.directory.server.core.authz.support;
 
 
-import java.util.ArrayList; 
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
@@ -28,8 +30,6 @@
 
 import javax.naming.NamingException;
 
-import org.apache.directory.server.core.authz.support.MaxValueCountFilter;
-import org.apache.directory.server.core.authz.support.OperationScope;
 import org.apache.directory.server.core.entry.DefaultServerEntry;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.shared.ldap.aci.ACITuple;
@@ -45,8 +45,6 @@
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-import static org.junit.Assert.assertEquals;
-
 
 /**
  * Tests {@link MaxValueCountFilter}.

Modified: directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java?rev=812301&r1=812300&r2=812301&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
Mon Sep  7 23:06:27 2009
@@ -20,6 +20,8 @@
 package org.apache.directory.server.core.authz.support;
 
 
+import static org.junit.Assert.assertEquals;
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -28,9 +30,6 @@
 
 import javax.naming.directory.Attribute;
 
-import org.apache.directory.server.core.authz.support.OperationScope;
-import org.apache.directory.server.core.authz.support.RelatedProtectedItemFilter;
-import org.apache.directory.server.core.authz.support.RelatedUserClassFilter;
 import org.apache.directory.server.core.entry.DefaultServerAttribute;
 import org.apache.directory.server.core.entry.DefaultServerEntry;
 import org.apache.directory.server.core.entry.ServerAttribute;
@@ -53,13 +52,9 @@
 import org.apache.directory.shared.ldap.schema.registries.OidRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.schema.loader.ldif.JarLdifSchemaLoader;
-
-
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-import static org.junit.Assert.assertEquals;
-
 
 /**
  * Tests {@link RelatedUserClassFilter}.
@@ -94,7 +89,7 @@
     {
         JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
         loader.loadAllEnabled( registries );
-        
+
         OID_REGISTRY = registries.getOidRegistry();
 
         GROUP_NAME = new LdapDN( "ou=test,ou=groups,ou=system" );

Modified: directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java?rev=812301&r1=812300&r2=812301&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java
Mon Sep  7 23:06:27 2009
@@ -20,14 +20,14 @@
 package org.apache.directory.server.core.authz.support;
 
 
+import static org.junit.Assert.assertEquals;
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
 
-import org.apache.directory.server.core.authz.support.OperationScope;
-import org.apache.directory.server.core.authz.support.RestrictedByFilter;
 import org.apache.directory.server.core.entry.DefaultServerEntry;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.shared.ldap.aci.ACITuple;
@@ -40,12 +40,9 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.schema.loader.ldif.JarLdifSchemaLoader;
-
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-import static org.junit.Assert.assertEquals;
-
 
 /**
  * Tests {@link RestrictedByFilter}.

Modified: directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/normalization/NormalizationVisitorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/normalization/NormalizationVisitorTest.java?rev=812301&r1=812300&r2=812301&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/normalization/NormalizationVisitorTest.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/normalization/NormalizationVisitorTest.java
Mon Sep  7 23:06:27 2009
@@ -20,6 +20,10 @@
 package org.apache.directory.server.core.normalization;
 
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
 import java.text.ParseException;
 
 import org.apache.directory.shared.ldap.filter.EqualityNode;
@@ -31,11 +35,8 @@
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.schema.loader.ldif.JarLdifSchemaLoader;
-import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.Test;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertEquals;
 
 
 /**
@@ -52,8 +53,8 @@
     /** A reference to the registries */
     private static Registries registries;
     
-    @Before
-    public void init() throws Exception
+    @BeforeClass
+    public static void init() throws Exception
     {
         registries = new Registries();
         JarLdifSchemaLoader loader = new JarLdifSchemaLoader();

Modified: directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java?rev=812301&r1=812300&r2=812301&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java
Mon Sep  7 23:06:27 2009
@@ -19,10 +19,12 @@
  */
 package org.apache.directory.server.core.subtree;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import org.apache.directory.server.core.entry.DefaultServerAttribute;
 import org.apache.directory.server.core.entry.ServerAttribute;
-import org.apache.directory.server.core.subtree.RefinementEvaluator;
-import org.apache.directory.server.core.subtree.RefinementLeafEvaluator;
 import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
 import org.apache.directory.shared.ldap.filter.EqualityNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;
@@ -37,10 +39,6 @@
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-import static org.junit.Assert.fail;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
 
 /**
  * Unit test cases for testing the evaluator for refinements.

Modified: directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java?rev=812301&r1=812300&r2=812301&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java
Mon Sep  7 23:06:27 2009
@@ -20,11 +20,14 @@
 package org.apache.directory.server.core.subtree;
 
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import javax.naming.NamingException;
 
 import org.apache.directory.server.core.entry.DefaultServerAttribute;
 import org.apache.directory.server.core.entry.ServerAttribute;
-import org.apache.directory.server.core.subtree.RefinementLeafEvaluator;
 import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
 import org.apache.directory.shared.ldap.filter.EqualityNode;
 import org.apache.directory.shared.ldap.filter.GreaterEqNode;
@@ -36,9 +39,6 @@
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
 
 
 /**
@@ -68,6 +68,7 @@
         registries = new Registries();
         JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
         loader.loadAllEnabled( registries );
+        
         OBJECT_CLASS = registries.getAttributeTypeRegistry().lookup( "objectClass" );
     }
     



Mime
View raw message