directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1096585 - in /directory/shared/trunk/ldap/model/src: main/java/org/apache/directory/shared/ldap/model/ldif/ test/java/org/apache/directory/shared/ldap/model/ldif/
Date Mon, 25 Apr 2011 20:28:19 GMT
Author: elecharny
Date: Mon Apr 25 20:28:19 2011
New Revision: 1096585

URL: http://svn.apache.org/viewvc?rev=1096585&view=rev
Log:
o Fixed some Javadoc
o Modified a test for better clarity

Modified:
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/ChangeType.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifEntry.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifUtils.java
    directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/ldif/LdifEntryTest.java

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/ChangeType.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/ChangeType.java?rev=1096585&r1=1096584&r2=1096585&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/ChangeType.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/ChangeType.java
Mon Apr 25 20:28:19 2011
@@ -45,7 +45,7 @@ public enum ChangeType
     /** The Delete changeType */
     Delete(4),
 
-    /** A placeholder when we have no changeType */
+    /** A place-holder when we have no changeType */
     None(-1);
 
     /** Add ordinal value */

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifEntry.java?rev=1096585&r1=1096584&r2=1096585&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifEntry.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifEntry.java
Mon Apr 25 20:28:19 2011
@@ -31,11 +31,11 @@ import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
+import org.apache.directory.shared.ldap.model.entry.Attribute;
 import org.apache.directory.shared.ldap.model.entry.DefaultAttribute;
+import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.model.entry.DefaultModification;
 import org.apache.directory.shared.ldap.model.entry.Entry;
-import org.apache.directory.shared.ldap.model.entry.Attribute;
 import org.apache.directory.shared.ldap.model.entry.Modification;
 import org.apache.directory.shared.ldap.model.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.model.entry.StringValue;
@@ -131,6 +131,9 @@ public class LdifEntry implements Clonea
      * 
      * @param dn The LdifEntry DN
      * @param avas The Ldif to convert to an LdifEntry
+     * @throws LdapInvalidAttributeValueException If either the AttributeType or the associated
value
+     * is incorrect
+     * @throws LdapLdifException If we get any other exception
      */
     public LdifEntry( Dn dn, Object... avas ) throws LdapInvalidAttributeValueException,
LdapLdifException
     {
@@ -256,7 +259,11 @@ public class LdifEntry implements Clonea
      * Creates a LdifEntry using a list of strings representing the Ldif element
      * 
      * @param dn The LdifEntry DN
-     * @param avas The Ldif to convert to an LdifEntry
+     * @param avas The Ldif attributes and values to convert to an LdifEntry
+     * @throws LdapInvalidDnException If the Dn is invalid
+     * @throws LdapInvalidAttributeValueException If either the AttributeType or the associated
value
+     * is incorrect
+     * @throws LdapLdifException If we get any other exception
      */
     public LdifEntry( String dn, Object... strings ) 
         throws LdapInvalidAttributeValueException, LdapLdifException, LdapInvalidDnException

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifUtils.java?rev=1096585&r1=1096584&r2=1096585&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifUtils.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifUtils.java
Mon Apr 25 20:28:19 2011
@@ -40,7 +40,7 @@ import org.apache.directory.shared.util.
 
 
 /**
- * Some LDIF useful methods
+ * Some LDIF helper methods.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -66,7 +66,7 @@ public final class LdifUtils
             LDIF_SAFE_STARTING_CHAR_ALPHABET[i] = true;
         }
 
-        LDIF_SAFE_STARTING_CHAR_ALPHABET[0] = false; // 0 (NUL)
+        LDIF_SAFE_STARTING_CHAR_ALPHABET[0]  = false; // 0 (NUL)
         LDIF_SAFE_STARTING_CHAR_ALPHABET[10] = false; // 10 (LF)
         LDIF_SAFE_STARTING_CHAR_ALPHABET[13] = false; // 13 (CR)
         LDIF_SAFE_STARTING_CHAR_ALPHABET[32] = false; // 32 (SPACE)
@@ -79,7 +79,7 @@ public final class LdifUtils
             LDIF_SAFE_OTHER_CHARS_ALPHABET[i] = true;
         }
 
-        LDIF_SAFE_OTHER_CHARS_ALPHABET[0] = false; // 0 (NUL)
+        LDIF_SAFE_OTHER_CHARS_ALPHABET[0]  = false; // 0 (NUL)
         LDIF_SAFE_OTHER_CHARS_ALPHABET[10] = false; // 10 (LF)
         LDIF_SAFE_OTHER_CHARS_ALPHABET[13] = false; // 13 (CR)
     }

Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/ldif/LdifEntryTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/ldif/LdifEntryTest.java?rev=1096585&r1=1096584&r2=1096585&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/ldif/LdifEntryTest.java
(original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/ldif/LdifEntryTest.java
Mon Apr 25 20:28:19 2011
@@ -99,15 +99,15 @@ public class LdifEntryTest
     @Test
     public void testSimpleLdifEntry() throws Exception
     {
-        String ldif = 
-            "cn: app1\n" + 
-            "objectClass: top\n" + 
-            "objectClass: apApplication\n" + 
-            "displayName:   app1   \n" +
-            "dependencies:\n" + 
-            "envVars:";
-
-        LdifEntry ldifEntry = new LdifEntry( "cn=app1,ou=applications,ou=conf,dc=apache,dc=org",
ldif );
+        String cn = "app1";
+        
+        LdifEntry ldifEntry = new LdifEntry( "cn=app1,ou=applications,ou=conf,dc=apache,dc=org",

+            "cn", cn,
+            "objectClass: top", 
+            "objectClass: apApplication", 
+            "displayName:   app1   ",
+            "dependencies:",
+            "envVars:" );
 
         assertNotNull( ldifEntry );
         assertTrue( ldifEntry.isLdifContent() );
@@ -115,6 +115,9 @@ public class LdifEntryTest
 
         Attribute attr = ldifEntry.get( "displayname" );
         assertTrue( attr.contains( "app1" ) );
+        
+        Attribute cnAttr = ldifEntry.get( "cn" );
+        assertTrue( cnAttr.contains( "app1" ) );
     }
     
     



Mime
View raw message