directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1083250 - in /directory: apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/ apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/ shared/trunk/integ/src/test/java/org/apache/directory/...
Date Sat, 19 Mar 2011 19:12:35 GMT
Author: elecharny
Date: Sat Mar 19 19:12:35 2011
New Revision: 1083250

URL: http://svn.apache.org/viewvc?rev=1083250&view=rev
Log:
Renamed two methods in RDN : isNormalized() and normalize()

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
    directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/MultiThreadedTest.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Dn.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Rdn.java
    directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/RdnTest.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java?rev=1083250&r1=1083249&r2=1083250&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
Sat Mar 19 19:12:35 2011
@@ -167,7 +167,7 @@ public class NormalizationInterceptor ex
             renameContext.getDn().normalize( schemaManager );
         }
 
-        renameContext.getNewRdn().normalize( schemaManager );
+        renameContext.getNewRdn().applySchemaManager( schemaManager );
 
         if ( !renameContext.getNewDn().isNormalized() )
         {
@@ -204,9 +204,9 @@ public class NormalizationInterceptor ex
             moveContext.getNewDn().normalize( schemaManager );
         }
 
-        if ( !moveContext.getRdn().isNormalized() )
+        if ( !moveContext.getRdn().isSchemaAware() )
         {
-            moveContext.getRdn().normalize( schemaManager );
+            moveContext.getRdn().applySchemaManager( schemaManager );
         }
 
         nextInterceptor.move( moveContext );
@@ -220,9 +220,9 @@ public class NormalizationInterceptor ex
         throws LdapException
     {
 
-        if ( !moveAndRenameContext.getNewRdn().isNormalized() )
+        if ( !moveAndRenameContext.getNewRdn().isSchemaAware() )
         {
-            moveAndRenameContext.getNewRdn().normalize( schemaManager );
+            moveAndRenameContext.getNewRdn().applySchemaManager( schemaManager );
         }
 
         if ( !moveAndRenameContext.getDn().isNormalized() )

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java?rev=1083250&r1=1083249&r2=1083250&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
Sat Mar 19 19:12:35 2011
@@ -1179,7 +1179,7 @@ public abstract class AbstractStore<E, I
 
         Dn updn = entry.getDn();
 
-        newRdn.normalize( schemaManager );
+        newRdn.applySchemaManager( schemaManager );
 
         /*
          * H A N D L E   N E W   R D N

Modified: directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/MultiThreadedTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/MultiThreadedTest.java?rev=1083250&r1=1083249&r2=1083250&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/MultiThreadedTest.java
(original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/MultiThreadedTest.java
Sat Mar 19 19:12:35 2011
@@ -70,9 +70,9 @@ public class MultiThreadedTest
         sharedDn.normalize( schemaManager );
 
         referenceRdn = new Rdn( "ou=system" );
-        referenceRdn.normalize( schemaManager );
+        referenceRdn.applySchemaManager( schemaManager );
         sharedRdn = new Rdn( "ou=system" );
-        sharedRdn.normalize( schemaManager );
+        sharedRdn.applySchemaManager( schemaManager );
 
         referenceAva = new Ava( schemaManager, "ou", "System" );
         sharedAva = new Ava( schemaManager, "ou", "System" );
@@ -84,8 +84,8 @@ public class MultiThreadedTest
     {
         sharedAva.normalize();
 
-        sharedRdn.normalize( schemaManager );
-        assertTrue( sharedRdn.isNormalized() );
+        sharedRdn.applySchemaManager( schemaManager );
+        assertTrue( sharedRdn.isSchemaAware() );
 
         sharedDn.normalize( schemaManager );
         assertTrue( sharedDn.isNormalized() );
@@ -97,7 +97,7 @@ public class MultiThreadedTest
     {
         assertEquals( referenceAva.hashCode(), sharedAva.hashCode() );
 
-        sharedRdn.normalize( schemaManager );
+        sharedRdn.applySchemaManager( schemaManager );
         assertEquals( referenceRdn.hashCode(), sharedRdn.hashCode() );
 
         sharedDn.normalize( schemaManager );
@@ -112,7 +112,7 @@ public class MultiThreadedTest
         assertTrue( referenceAva.equals( sharedAva ) );
         assertTrue( sharedAva.equals( referenceAva ) );
 
-        sharedRdn.normalize( schemaManager );
+        sharedRdn.applySchemaManager( schemaManager );
         assertEquals( referenceRdn, sharedRdn );
         assertTrue( referenceRdn.equals( sharedRdn ) );
         assertTrue( sharedRdn.equals( referenceRdn ) );

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Dn.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Dn.java?rev=1083250&r1=1083249&r2=1083250&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Dn.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Dn.java
Sat Mar 19 19:12:35 2011
@@ -1348,7 +1348,7 @@ public final class Dn implements Iterabl
         // instead this method should throw the LdapInvalidDnException
         try
         {
-            if ( clonedDn.isNormalized() && newRdn.isNormalized() )
+            if ( clonedDn.isNormalized() && newRdn.isSchemaAware() )
             {
                 clonedDn.normalizeInternal();
             }
@@ -1613,7 +1613,7 @@ public final class Dn implements Iterabl
 
                 for ( Rdn rdn : rdns )
                 {
-                    rdn.normalize( schemaManager );
+                    rdn.applySchemaManager( schemaManager );
                 }
 
                 normalizeInternal();

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Rdn.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Rdn.java?rev=1083250&r1=1083249&r2=1083250&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Rdn.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Rdn.java
Sat Mar 19 19:12:35 2011
@@ -237,7 +237,7 @@ public final class Rdn implements Clonea
             if ( schemaManager != null )
             {
                 this.schemaManager = schemaManager;
-                normalize( schemaManager );
+                applySchemaManager( schemaManager );
                 normalized = true;
             }
             else
@@ -341,7 +341,7 @@ public final class Rdn implements Clonea
         if( schemaManager != null )
         {
             this.schemaManager = schemaManager;
-            normalize( schemaManager );
+            applySchemaManager( schemaManager );
             normalized = true;
         }
         else
@@ -473,7 +473,7 @@ public final class Rdn implements Clonea
      * @return this Rdn, normalized
      * @throws org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException if
the Rdn is invalid
      */
-    public Rdn normalize( SchemaManager schemaManager ) throws LdapInvalidDnException
+    public Rdn applySchemaManager( SchemaManager schemaManager ) throws LdapInvalidDnException
     {
         if ( normalized )
         {
@@ -1408,11 +1408,11 @@ public final class Rdn implements Clonea
 
 
     /**
-     * Tells if the Rdn has already been normalized or not
+     * Tells if the Rdn is schema aware.
      *
-     * @return <code>true</code> if the Rdn is already normalized.
+     * @return <code>true</code> if the Rdn is schema aware
      */
-    public boolean isNormalized()
+    public boolean isSchemaAware()
     {
         return normalized;
     }

Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/RdnTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/RdnTest.java?rev=1083250&r1=1083249&r2=1083250&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/RdnTest.java
(original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/RdnTest.java
Sat Mar 19 19:12:35 2011
@@ -1207,4 +1207,24 @@ public class RdnTest
         
         assertEquals( " A = b + C = d ", rdn.getName() );
     }
+
+
+    /**
+     * test the iterator over a RDN
+     */
+    @Test 
+    public void testIterator() throws LdapException
+    {
+        Rdn rdn = new Rdn( "cn=John + sn=Doe" );
+        
+        String[] expected = new String[]{ "cn=John", "sn=Doe" };
+        int i = 0;
+        
+        for ( Ava ava : rdn )
+        {
+            System.out.println( ava.toString() );
+            assertEquals( expected[i], ava.toString() );
+            i++;
+        }
+    }
 }



Mime
View raw message