directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r411585 - in /directory/branches/apacheds/optimization: core-unit/src/main/java/org/apache/directory/server/core/unit/ core/src/main/java/org/apache/directory/server/core/partition/ core/src/main/java/org/apache/directory/server/core/schema...
Date Sun, 04 Jun 2006 17:13:18 GMT
Author: akarasulu
Date: Sun Jun  4 10:13:17 2006
New Revision: 411585

URL: http://svn.apache.org/viewvc?rev=411585&view=rev
Log:
almost have all test cases passing with LdapDN changesf

Modified:
    directory/branches/apacheds/optimization/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractTestCase.java
    directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexusProxy.java
    directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapAttributeTypeRegistry.java
    directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java
    directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java
    directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java
    directory/branches/apacheds/optimization/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java

Modified: directory/branches/apacheds/optimization/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractTestCase.java?rev=411585&r1=411584&r2=411585&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractTestCase.java
(original)
+++ directory/branches/apacheds/optimization/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractTestCase.java
Sun Jun  4 10:13:17 2006
@@ -30,7 +30,6 @@
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 

Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexusProxy.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexusProxy.java?rev=411585&r1=411584&r2=411585&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexusProxy.java
(original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexusProxy.java
Sun Jun  4 10:13:17 2006
@@ -42,11 +42,9 @@
 import org.apache.directory.server.core.interceptor.InterceptorChain;
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.server.core.invocation.InvocationStack;
-import org.apache.directory.server.core.schema.OidRegistry;
 import org.apache.directory.shared.ldap.exception.LdapSizeLimitExceededException;
 import org.apache.directory.shared.ldap.exception.LdapTimeLimitExceededException;
 import org.apache.directory.shared.ldap.filter.ExprNode;
-import org.apache.directory.shared.ldap.name.LdapDN;
 
 
 /**
@@ -481,11 +479,6 @@
             { name }, bypass ) );
         try
         {
-            OidRegistry registry = ( OidRegistry ) this.service.getConfiguration().getGlobalRegistries()
-                .getOidRegistry();
-
-            LdapDN.normalize( name, registry.getNameByOid() );
-
             return this.configuration.getInterceptorChain().lookup( name );
         }
         finally

Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapAttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapAttributeTypeRegistry.java?rev=411585&r1=411584&r2=411585&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapAttributeTypeRegistry.java
(original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapAttributeTypeRegistry.java
Sun Jun  4 10:13:17 2006
@@ -102,20 +102,6 @@
         oidToSchema.put( attributeType.getOid(), schema );
         byOid.put( attributeType.getOid(), attributeType );
         monitor.registered( attributeType );
-
-        // update the cached normalizer mapping
-        if ( mapping == null )
-        {
-            mapping = new HashMap();
-        }
-        
-        Normalizer normalizer = attributeType.getEquality().getNormalizer();
-        mapping.put( attributeType.getOid(), normalizer );
-        String[] aliases = attributeType.getNames();
-        for ( int jj = 0; jj < aliases.length; jj++ )
-        {
-            mapping.put( aliases[jj], normalizer );
-        }
     }
 
 

Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java?rev=411585&r1=411584&r2=411585&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java
(original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java
Sun Jun  4 10:13:17 2006
@@ -18,7 +18,7 @@
 
 
 import org.apache.directory.server.core.schema.OidRegistry;
-import org.apache.directory.shared.ldap.name.LdapName;
+import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.subtree.SubtreeSpecification;
 import org.apache.directory.shared.ldap.util.NamespaceTools;
 
@@ -90,7 +90,7 @@
         }
         else if ( apDn.equals( entryDn ) )
         {
-            apRelativeRdn = new LdapName();
+            apRelativeRdn = new LdapDN();
         }
         else
         {
@@ -110,7 +110,7 @@
         }
         else if ( apRelativeRdn.equals( subtree.getBase() ) )
         {
-            baseRelativeRdn = new LdapName();
+            baseRelativeRdn = new LdapDN();
         }
         else if ( !NamespaceTools.isDescendant( subtree.getBase(), apRelativeRdn ) )
         {

Modified: directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java?rev=411585&r1=411584&r2=411585&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java
(original)
+++ directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java
Sun Jun  4 10:13:17 2006
@@ -21,6 +21,7 @@
 
 import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.Map;
 
 import javax.naming.NamingException;
 
@@ -267,4 +268,9 @@
         return new ArrayList().iterator();
     }
 
+
+    public Map getNormalizerMapping() throws NamingException
+    {
+        return null;
+    }
 }

Modified: directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java?rev=411585&r1=411584&r2=411585&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java
(original)
+++ directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java
Sun Jun  4 10:13:17 2006
@@ -26,6 +26,7 @@
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.FilterParser;
 import org.apache.directory.shared.ldap.filter.FilterParserImpl;
+import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.LdapName;
 import org.apache.directory.shared.ldap.subtree.SubtreeSpecification;
 import org.apache.directory.shared.ldap.subtree.SubtreeSpecificationModifier;
@@ -102,7 +103,7 @@
     public void testWithBase() throws Exception
     {
         SubtreeSpecificationModifier modifier = new SubtreeSpecificationModifier();
-        modifier.setBase( new LdapName( "ou=users" ) );
+        modifier.setBase( new LdapDN( "ou=users" ) );
         SubtreeSpecification ss = modifier.getSubtreeSpecification();
         Name apDn = new LdapName( "ou=system" );
         Name entryDn = new LdapName( "ou=users,ou=system" );
@@ -123,7 +124,7 @@
         SubtreeSpecificationModifier modifier = new SubtreeSpecificationModifier();
         modifier.setMinBaseDistance( 1 );
         modifier.setMaxBaseDistance( 3 );
-        modifier.setBase( new LdapName( "ou=users" ) );
+        modifier.setBase( new LdapDN( "ou=users" ) );
         SubtreeSpecification ss = modifier.getSubtreeSpecification();
         Name apDn = new LdapName( "ou=system" );
         Name entryDn = new LdapName( "ou=users,ou=system" );
@@ -152,32 +153,32 @@
     {
         SubtreeSpecificationModifier modifier = new SubtreeSpecificationModifier();
         Set chopAfter = new HashSet();
-        chopAfter.add( new LdapName( "uid=Tori Amos" ) );
-        chopAfter.add( new LdapName( "ou=twolevels,uid=akarasulu" ) );
+        chopAfter.add( new LdapDN( "uid=Tori Amos" ) );
+        chopAfter.add( new LdapDN( "ou=twolevels,uid=akarasulu" ) );
         modifier.setChopAfterExclusions( chopAfter );
         modifier.setMinBaseDistance( 1 );
         modifier.setMaxBaseDistance( 3 );
-        modifier.setBase( new LdapName( "ou=users" ) );
+        modifier.setBase( new LdapDN( "ou=users" ) );
         SubtreeSpecification ss = modifier.getSubtreeSpecification();
-        Name apDn = new LdapName( "ou=system" );
-        Name entryDn = new LdapName( "ou=users,ou=system" );
+        Name apDn = new LdapDN( "ou=system" );
+        Name entryDn = new LdapDN( "ou=users,ou=system" );
         Attribute objectClasses = new BasicAttribute( "objectClass" );
 
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, objectClasses ) );
 
-        entryDn = new LdapName( "uid=akarasulu,ou=users,ou=system" );
+        entryDn = new LdapDN( "uid=akarasulu,ou=users,ou=system" );
         assertTrue( evaluator.evaluate( ss, apDn, entryDn, objectClasses ) );
 
-        entryDn = new LdapName( "ou=system" );
+        entryDn = new LdapDN( "ou=system" );
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, objectClasses ) );
 
-        entryDn = new LdapName( "ou=twolevels,uid=akarasulu,ou=users,ou=system" );
+        entryDn = new LdapDN( "ou=twolevels,uid=akarasulu,ou=users,ou=system" );
         assertTrue( evaluator.evaluate( ss, apDn, entryDn, objectClasses ) );
 
-        entryDn = new LdapName( "ou=threelevels,ou=twolevels,uid=akarasulu,ou=users,ou=system"
);
+        entryDn = new LdapDN( "ou=threelevels,ou=twolevels,uid=akarasulu,ou=users,ou=system"
);
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, objectClasses ) );
 
-        entryDn = new LdapName( "ou=fourlevels,ou=threelevels,ou=twolevels,uid=akarasulu,ou=users,ou=system"
);
+        entryDn = new LdapDN( "ou=fourlevels,ou=threelevels,ou=twolevels,uid=akarasulu,ou=users,ou=system"
);
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, objectClasses ) );
     }
 
@@ -191,7 +192,7 @@
         modifier.setChopBeforeExclusions( chopBefore );
         modifier.setMinBaseDistance( 1 );
         modifier.setMaxBaseDistance( 3 );
-        modifier.setBase( new LdapName( "ou=users" ) );
+        modifier.setBase( new LdapDN( "ou=users" ) );
         SubtreeSpecification ss = modifier.getSubtreeSpecification();
         Name apDn = new LdapName( "ou=system" );
         Name entryDn = new LdapName( "ou=users,ou=system" );
@@ -225,7 +226,7 @@
         modifier.setRefinement( refinement );
         modifier.setMinBaseDistance( 1 );
         modifier.setMaxBaseDistance( 3 );
-        modifier.setBase( new LdapName( "ou=users" ) );
+        modifier.setBase( new LdapDN( "ou=users" ) );
         SubtreeSpecification ss = modifier.getSubtreeSpecification();
         Name apDn = new LdapName( "ou=system" );
         Name entryDn = new LdapName( "ou=users,ou=system" );

Modified: directory/branches/apacheds/optimization/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java?rev=411585&r1=411584&r2=411585&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java
(original)
+++ directory/branches/apacheds/optimization/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java
Sun Jun  4 10:13:17 2006
@@ -323,7 +323,7 @@
         // darn it getting normalized name back
         assertEquals( "cn=Jack Black".toLowerCase(), listener.result.getName().toLowerCase()
);
         assertEquals( listener.result.control.getChangeType(), ChangeType.MODDN );
-        assertEquals( ( RDN + ",ou=system" ).toLowerCase(), listener.result.control.getPreviousDn().toLowerCase()
);
+        assertEquals( ( RDN + ",ou=system" ).toLowerCase(), listener.result.control.getPreviousDn().getNormName()
);
     }
 
 



Mime
View raw message