directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r812181 - in /directory/apacheds/branches/apacheds-schema: core-integ/ core-integ/src/main/java/org/apache/directory/server/core/integ/ core/src/test/java/org/apache/directory/server/core/authz/support/ core/src/test/java/org/apache/directo...
Date Mon, 07 Sep 2009 15:04:17 GMT
Author: akarasulu
Date: Mon Sep  7 15:04:16 2009
New Revision: 812181

URL: http://svn.apache.org/viewvc?rev=812181&view=rev
Log:
making all core module tests pass

Modified:
    directory/apacheds/branches/apacheds-schema/core-integ/pom.xml
    directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/DirectoryServiceFactory.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/core-integ/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-integ/pom.xml?rev=812181&r1=812180&r2=812181&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-integ/pom.xml (original)
+++ directory/apacheds/branches/apacheds-schema/core-integ/pom.xml Mon Sep  7 15:04:16 2009
@@ -59,6 +59,18 @@
       <scope>test</scope>
     </dependency>  
 
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-avl-partition</artifactId>
+      <version>${pom.version}</version>
+    </dependency>  
+
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-ldif-partition</artifactId>
+      <version>${pom.version}</version>
+    </dependency>  
+
   </dependencies>
 
   <profiles>

Modified: directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/DirectoryServiceFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/DirectoryServiceFactory.java?rev=812181&r1=812180&r2=812181&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/DirectoryServiceFactory.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/DirectoryServiceFactory.java
Mon Sep  7 15:04:16 2009
@@ -21,6 +21,8 @@
 
 import org.apache.directory.server.core.DefaultDirectoryService;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.partition.ldif.LdifPartition;
+import org.apache.directory.server.core.schema.SchemaPartition;
 
 
 /**
@@ -43,6 +45,10 @@
         public DirectoryService newInstance() throws Exception
         {
             DirectoryService service = new DefaultDirectoryService();
+            SchemaPartition schemaPartition = new SchemaPartition();
+            LdifPartition wrapped = new LdifPartition();
+            schemaPartition.setWrappedPartition( wrapped );
+            service.getSchemaService().setSchemaPartition( schemaPartition );
             service.getChangeLog().setEnabled( true );
 
             // change the working directory to something that is unique

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=812181&r1=812180&r2=812181&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 15:04:16 2009
@@ -20,7 +20,7 @@
 package org.apache.directory.server.core.authz.support;
 
 
-import java.util.ArrayList;
+import java.util.ArrayList; 
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
@@ -28,9 +28,6 @@
 
 import javax.naming.NamingException;
 
-
-import org.apache.directory.server.core.DefaultDirectoryService;
-import org.apache.directory.server.core.DirectoryService;
 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;
@@ -42,6 +39,8 @@
 import org.apache.directory.shared.ldap.aci.ProtectedItem.MaxValueCountItem;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 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.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -75,20 +74,22 @@
     }
 
 
-    /** A reference to the directory service */
-    private static DirectoryService service;
+    /** A reference to the registries */
+    private static Registries registries;
 
     
     @BeforeClass public static void init() throws Exception
     {
-        service = new DefaultDirectoryService();
+        registries = new Registries();
+        JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
+        loader.loadAllEnabled( registries );
     }
     
     @Before public void setup() throws NamingException
     {
         LdapDN entryName = new LdapDN( "ou=test, ou=system" );
-        ENTRY = new DefaultServerEntry( service.getRegistries(), entryName );
-        FULL_ENTRY = new DefaultServerEntry( service.getRegistries(), entryName );
+        ENTRY = new DefaultServerEntry( registries, entryName );
+        FULL_ENTRY = new DefaultServerEntry( registries, entryName );
         
         ENTRY.put( "cn", "1" );
         FULL_ENTRY.put( "cn", "1", "2", "3" );

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=812181&r1=812180&r2=812181&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 15:04:16 2009
@@ -28,8 +28,6 @@
 
 import javax.naming.directory.Attribute;
 
-import org.apache.directory.server.core.DefaultDirectoryService;
-import org.apache.directory.server.core.DirectoryService;
 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;
@@ -53,6 +51,8 @@
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 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;
@@ -78,33 +78,30 @@
     private static Set<LdapDN> USER_NAMES = new HashSet<LdapDN>();
     private static Set<LdapDN> GROUP_NAMES = new HashSet<LdapDN>();
 
+    private static Registries registries = new Registries();
     private static AttributeTypeRegistry atRegistryA;
     private static AttributeTypeRegistry atRegistryB;
     private static OidRegistry OID_REGISTRY;
 
     private static RelatedProtectedItemFilter filterA;
     private static RelatedProtectedItemFilter filterB;
-
-    /** A reference to the directory service */
-    private static DirectoryService service;
     
     /** The CN attribute Type */
     private static AttributeType CN_AT;
 
-    /** The SN attribute Type */
-    private static AttributeType SN_AT;
-
     
     @BeforeClass public static void setup() throws Exception
     {
-        service = new DefaultDirectoryService();
-        OID_REGISTRY = service.getRegistries().getOidRegistry();
+        JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
+        loader.loadAllEnabled( registries );
+        
+        OID_REGISTRY = registries.getOidRegistry();
 
         GROUP_NAME = new LdapDN( "ou=test,ou=groups,ou=system" );
         USER_NAME = new LdapDN( "ou=test, ou=users, ou=system" );
         
-        atRegistryA = service.getRegistries().getAttributeTypeRegistry();
-        atRegistryB = service.getRegistries().getAttributeTypeRegistry();
+        atRegistryA = registries.getAttributeTypeRegistry();
+        atRegistryB = registries.getAttributeTypeRegistry();
 
         filterA = new RelatedProtectedItemFilter( new RefinementEvaluator( new RefinementLeafEvaluator(
             OID_REGISTRY ) ), new ExpressionEvaluator( OID_REGISTRY, atRegistryA ), OID_REGISTRY,
atRegistryA );
@@ -114,8 +111,7 @@
 
         USER_NAMES.add( USER_NAME );
         GROUP_NAMES.add( GROUP_NAME );
-        CN_AT = service.getRegistries().getAttributeTypeRegistry().lookup( "cn" );
-        SN_AT = service.getRegistries().getAttributeTypeRegistry().lookup( "sn" );
+        CN_AT = registries.getAttributeTypeRegistry().lookup( "cn" );
     }
 
     
@@ -333,7 +329,7 @@
         attrTypes.add( "cn" );
         Collection<ACITuple> tuples = getTuples( new ProtectedItem.SelfValue( attrTypes
) );
 
-        ServerEntry entry = new DefaultServerEntry( service.getRegistries(), USER_NAME );
+        ServerEntry entry = new DefaultServerEntry( registries, USER_NAME );
         entry.put( "cn", USER_NAME.toNormName() );
 
         // Test wrong scope

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=812181&r1=812180&r2=812181&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 15:04:16 2009
@@ -26,8 +26,6 @@
 import java.util.HashSet;
 import java.util.Set;
 
-import org.apache.directory.server.core.DefaultDirectoryService;
-import org.apache.directory.server.core.DirectoryService;
 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;
@@ -40,6 +38,8 @@
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
 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;
@@ -71,17 +71,19 @@
     }
 
 
-    /** A reference to the directory service */
-    private static DirectoryService service;
+    /** A reference to the registries */
+    private static Registries registries;
 
     
     @BeforeClass public static void setup() throws Exception
     {
-        service = new DefaultDirectoryService();
+        registries = new Registries();
+        JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
+        loader.loadAllEnabled( registries );
 
         LdapDN entryName = new LdapDN( "ou=test, ou=system" );
         PROTECTED_ITEMS.add( new ProtectedItem.MaxImmSub( 2 ) );
-        ENTRY = new DefaultServerEntry( service.getRegistries(), entryName );
+        ENTRY = new DefaultServerEntry( registries, entryName );
 
         ENTRY.put( "cn", "1", "2" );
     }

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=812181&r1=812180&r2=812181&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 15:04:16 2009
@@ -22,8 +22,6 @@
 
 import java.text.ParseException;
 
-import org.apache.directory.server.core.DefaultDirectoryService;
-import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.shared.ldap.filter.EqualityNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.FilterParser;
@@ -31,6 +29,8 @@
 import org.apache.directory.shared.ldap.name.NameComponentNormalizer;
 import org.apache.directory.shared.ldap.schema.normalizers.ConcreteNameComponentNormalizer;
 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.Test;
 import static org.junit.Assert.assertNotNull;
@@ -49,17 +49,19 @@
     /** a filter node value normalizer and undefined node remover */
     private static FilterNormalizingVisitor normVisitor;
     
-    /** A reference to the directory service */
-    private static DirectoryService service;
+    /** A reference to the registries */
+    private static Registries registries;
     
     @Before
     public void init() throws Exception
     {
-        service = new DefaultDirectoryService();
+        registries = new Registries();
+        JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
+        loader.loadAllEnabled( registries );
 
-        AttributeTypeRegistry attributeRegistry = service.getRegistries().getAttributeTypeRegistry();
+        AttributeTypeRegistry attributeRegistry = registries.getAttributeTypeRegistry();
         NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( attributeRegistry
);
-        normVisitor = new FilterNormalizingVisitor( ncn, service.getRegistries() );
+        normVisitor = new FilterNormalizingVisitor( ncn, registries );
     }
 
     @Test

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=812181&r1=812180&r2=812181&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 15:04:16 2009
@@ -19,9 +19,6 @@
  */
 package org.apache.directory.server.core.subtree;
 
-
-import org.apache.directory.server.core.DefaultDirectoryService;
-import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.DefaultServerAttribute;
 import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.subtree.RefinementEvaluator;
@@ -34,6 +31,7 @@
 import org.apache.directory.shared.ldap.schema.AttributeType;
 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.After;
 import org.junit.Before;
 import org.junit.BeforeClass;
@@ -63,10 +61,7 @@
 
     /** The CN AttributeType */
     private static AttributeType CN;
-
-    /** A reference to the directory service */
-    private static DirectoryService service;
-
+    
     
     /**
      * Initializes the global registries.
@@ -74,8 +69,9 @@
      */
     @BeforeClass public static void init() throws Exception
     {
-        service = new DefaultDirectoryService();
-        registries = service.getRegistries();
+        registries = new Registries();
+        JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
+        loader.loadAllEnabled( registries );
     }
 
 

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=812181&r1=812180&r2=812181&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 15:04:16 2009
@@ -22,8 +22,6 @@
 
 import javax.naming.NamingException;
 
-import org.apache.directory.server.core.DefaultDirectoryService;
-import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.DefaultServerAttribute;
 import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.subtree.RefinementLeafEvaluator;
@@ -33,6 +31,7 @@
 import org.apache.directory.shared.ldap.schema.AttributeType;
 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.After;
 import org.junit.Before;
 import org.junit.BeforeClass;
@@ -52,9 +51,6 @@
 {
     /** The ObjectClass AttributeType */
     private static AttributeType OBJECT_CLASS;
-
-    /** A reference to the directory service */
-    private static DirectoryService service;
     
     /** the registries */
     private static Registries registries;
@@ -69,8 +65,9 @@
      */
     @BeforeClass public static void init() throws Exception
     {
-        service = new DefaultDirectoryService();
-        registries = service.getRegistries();
+        registries = new Registries();
+        JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
+        loader.loadAllEnabled( registries );
         OBJECT_CLASS = registries.getAttributeTypeRegistry().lookup( "objectClass" );
     }
     



Mime
View raw message