You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2010/06/09 14:42:23 UTC

svn commit: r952979 - in /directory/shared/trunk/ldap/src: main/java/org/apache/directory/shared/ldap/name/ test/java/org/apache/directory/shared/ldap/entry/ test/java/org/apache/directory/shared/ldap/schema/parser/

Author: elecharny
Date: Wed Jun  9 12:42:23 2010
New Revision: 952979

URL: http://svn.apache.org/viewvc?rev=952979&view=rev
Log:
o Removed two annotations from classes that are not tests : they were producing errors when run in eclipse
o Used the rdn.normalize() method in DN.normalize()
o Added a normalized flag in the RDN class

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RDN.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/EntryUtils.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/ConsoleParserMonitor.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java?rev=952979&r1=952978&r2=952979&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java Wed Jun  9 12:42:23 2010
@@ -1548,10 +1548,8 @@ public class DN implements Cloneable, Se
         while ( localRdns.hasMoreElements() )
         {
             RDN rdn = localRdns.nextElement();
-            String localUpName = rdn.getName();
-            rdnOidToName( rdn, oidsMap );
-            rdn.normalize();
-            rdn.setUpName( localUpName );
+            
+            rdn.normalize( oidsMap );
         }
 
         normalizeInternal();

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RDN.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RDN.java?rev=952979&r1=952978&r2=952979&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RDN.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RDN.java Wed Jun  9 12:42:23 2010
@@ -35,6 +35,7 @@ import org.apache.commons.collections.ma
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.entry.StringValue;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
 import org.apache.directory.shared.ldap.util.StringTools;
@@ -183,6 +184,9 @@ public class RDN implements Cloneable, C
     /** Constant used in comparisons */
     public static final int EQUAL = 0;
 
+    /** A flag used to tell if the RDN has been normalized */
+    private boolean normalized;
+
 
     /**
      * A empty constructor.
@@ -194,6 +198,7 @@ public class RDN implements Cloneable, C
         // treeSet.
         upName = "";
         normName = "";
+        normalized = false;
     }
 
 
@@ -224,6 +229,8 @@ public class RDN implements Cloneable, C
             normName = "";
             length = 0;
         }
+
+        normalized = false;
     }
 
 
@@ -248,6 +255,9 @@ public class RDN implements Cloneable, C
         length = upName.length();
         // create the internal normalized form
         normalize();
+        
+        // As strange as it seems, the RDN is *not* normalized against the schema at this point
+        normalized = false;
     }
 
 
@@ -270,6 +280,9 @@ public class RDN implements Cloneable, C
         length = upName.length();
         // create the internal normalized form
         normalize();
+        
+        // As strange as it seems, the RDN is *not* normalized against the schema at this point
+        normalized = false;
     }
 
 
@@ -287,6 +300,7 @@ public class RDN implements Cloneable, C
         this.length = length;
         this.upName = upName;
         this.normName = normName;
+        normalized = false;
     }
 
 
@@ -304,6 +318,7 @@ public class RDN implements Cloneable, C
         this.upName = rdn.getName();
         this.start = rdn.start;
         this.length = rdn.length;
+        normalized = rdn.normalized;
 
         switch ( rdn.getNbAtavs() )
         {
@@ -401,6 +416,7 @@ public class RDN implements Cloneable, C
         DN.rdnOidToName( this, oidsMap );
         normalize();
         this.upName = upName;
+        normalized = true;
 
         return this;
     }
@@ -527,6 +543,7 @@ public class RDN implements Cloneable, C
         upName = "";
         start = -1;
         length = 0;
+        normalized = false;
     }
 
 
@@ -1293,6 +1310,17 @@ public class RDN implements Cloneable, C
 
         return escapeValue( value );
     }
+    
+    
+    /**
+     * Tells if the RDN has already been normalized or not
+     *
+     * @return <code>true</code> if the RDN is already normalized.
+     */
+    public boolean isNormalized()
+    {
+        return normalized;
+    }
 
 
     /**

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/EntryUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/EntryUtils.java?rev=952979&r1=952978&r2=952979&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/EntryUtils.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/EntryUtils.java Wed Jun  9 12:42:23 2010
@@ -19,11 +19,7 @@
  */
 package org.apache.directory.shared.ldap.entry;
 
-import org.apache.directory.junit.tools.Concurrent;
-import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.entry.BinaryValue;
-import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.LdapComparator;
@@ -34,15 +30,12 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.schema.comparators.ByteArrayComparator;
 import org.apache.directory.shared.ldap.schema.normalizers.DeepTrimToLowerNormalizer;
 import org.apache.directory.shared.ldap.util.StringTools;
-import org.junit.runner.RunWith;
 
 /**
  * Some common declaration used by the serverEntry tests.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-@RunWith(ConcurrentJunitRunner.class)
-@Concurrent(threads = 6)
 public class EntryUtils
 {
     /**

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/ConsoleParserMonitor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/ConsoleParserMonitor.java?rev=952979&r1=952978&r2=952979&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/ConsoleParserMonitor.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/ConsoleParserMonitor.java Wed Jun  9 12:42:23 2010
@@ -19,10 +19,7 @@
  */
 package org.apache.directory.shared.ldap.schema.parser;
 
-import org.apache.directory.junit.tools.Concurrent;
-import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.ldap.schema.parsers.ParserMonitor;
-import org.junit.runner.RunWith;
 
 
 /**
@@ -31,8 +28,6 @@ import org.junit.runner.RunWith;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-@RunWith(ConcurrentJunitRunner.class)
-@Concurrent(threads = 6)
 public class ConsoleParserMonitor implements ParserMonitor
 {
     public static final String TRACE_KEY = "maven.eve.schema.parser.trace";



Re: svn commit: r952979 - in /directory/shared/trunk/ldap/src: main/java/org/apache/directory/shared/ldap/name/ test/java/org/apache/directory/shared/ldap/entry/ test/java/org/apache/directory/shared/ldap/schema/parser/

Posted by Emmanuel Lecharny <el...@gmail.com>.
On 6/9/10 2:53 PM, Felix Knecht wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Thanks Emmanuel.
> I just wonder, how the maven run could pass without problems ...
>    
because maven uses your own compiler, probably Sun's one, when eclipse 
has its own Java compiler, and it may be more strict.

I have also cleaned some util classes which were considered as tests in 
eclipse.--

Regards,
Cordialement,
Emmanuel Lécharny
www.nextury.com



Re: svn commit: r952979 - in /directory/shared/trunk/ldap/src: main/java/org/apache/directory/shared/ldap/name/ test/java/org/apache/directory/shared/ldap/entry/ test/java/org/apache/directory/shared/ldap/schema/parser/

Posted by Felix Knecht <fe...@apache.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks Emmanuel.
I just wonder, how the maven run could pass without problems ...

> o Removed two annotations from classes that are not tests : they were producing errors when run in eclipse
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwPjuEACgkQ2lZVCB08qHEMQgCfQ+vLliCuKBWg/EWKQs4+09Op
9YIAoItwJOYy0yX3r6MTp8mTeaQZfWhG
=MuTv
-----END PGP SIGNATURE-----