directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r408162 - /directory/branches/elecharny/shared/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java
Date Sun, 21 May 2006 12:23:32 GMT
Author: elecharny
Date: Sun May 21 05:23:31 2006
New Revision: 408162

URL: http://svn.apache.org/viewvc?rev=408162&view=rev
Log:
- Reformatted the code
- Added a test for modifications

Modified:
    directory/branches/elecharny/shared/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java

Modified: directory/branches/elecharny/shared/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java
URL: http://svn.apache.org/viewvc/directory/branches/elecharny/shared/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java?rev=408162&r1=408161&r2=408162&view=diff
==============================================================================
--- directory/branches/elecharny/shared/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java (original)
+++ directory/branches/elecharny/shared/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java Sun May 21 05:23:31 2006
@@ -96,7 +96,12 @@
 
     public void testLdifComments() throws NamingException
     {
-        String ldif = "#Comment 1\r" + "#\r" + " th\n" + " is is still a comment\n" + "\n";
+        String ldif = 
+            "#Comment 1\r" + 
+            "#\r" + 
+            " th\n" + 
+            " is is still a comment\n" + 
+            "\n";
 
         LdifReader reader = new LdifReader();
         List entries = reader.parseLdif( ldif );
@@ -106,7 +111,15 @@
 
     public void testLdifVersion() throws NamingException
     {
-        String ldif = "#Comment 1\r" + "#\r" + " th\n" + " is is still a comment\n" + "\n" + "version:\n" + " 1\n" + "# end";
+        String ldif = 
+            "#Comment 1\r" + 
+            "#\r" + 
+            " th\n" + 
+            " is is still a comment\n" + 
+            "\n" + 
+            "version:\n" + 
+            " 1\n" + 
+            "# end";
 
         LdifReader reader = new LdifReader();
         List entries = reader.parseLdif( ldif );
@@ -123,9 +136,15 @@
      */
     public void testLdifParserEndSpaces() throws NamingException
     {
-        String ldif = "version:   1\n" + "dn: cn=app1,ou=applications,ou=conf,dc=apache,dc=org\n" + "cn: app1\n"
-                + "objectClass: top\n" + "objectClass: apApplication\n" + "displayName:   app1   \n" + "dependencies:\n"
-                + "envVars:";
+        String ldif = 
+            "version:   1\n" + 
+            "dn: cn=app1,ou=applications,ou=conf,dc=apache,dc=org\n" + 
+            "cn: app1\n" + 
+            "objectClass: top\n" + 
+            "objectClass: apApplication\n" + 
+            "displayName:   app1   \n" + 
+            "dependencies:\n" + 
+            "envVars:";
 
         LdifReader reader = new LdifReader();
 
@@ -151,13 +170,23 @@
      */
     public void testLdifParserCombinedEntriesChanges() throws NamingException
     {
-        String ldif = "version:   1\n" + "dn: cn=app1,ou=applications,ou=conf,dc=apache,dc=org\n" + "cn: app1\n"
-                + "objectClass: top\n" + "objectClass: apApplication\n" + "displayName:   app1   \n" + "dependencies:\n"
-                + "envVars:\n" + "\n" + "# Delete an entry. The operation will attach the LDAPv3\n"
-                + "# Tree Delete Control defined in [9]. The criticality\n"
-                + "# field is \"true\" and the controlValue field is\n" + "# absent, as required by [9].\n"
-                + "dn: ou=Product Development, dc=airius, dc=com\n" + "control: 1.2.840.11A556.1.4.805 true\n"
-                + "changetype: delete\n";
+        String ldif = 
+            "version:   1\n" + 
+            "dn: cn=app1,ou=applications,ou=conf,dc=apache,dc=org\n" + 
+            "cn: app1\n" + 
+            "objectClass: top\n" + 
+            "objectClass: apApplication\n" + 
+            "displayName:   app1   \n" + 
+            "dependencies:\n" + 
+            "envVars:\n" + 
+            "\n" + 
+            "# Delete an entry. The operation will attach the LDAPv3\n" + 
+            "# Tree Delete Control defined in [9]. The criticality\n" + 
+            "# field is \"true\" and the controlValue field is\n" + 
+            "# absent, as required by [9].\n" + 
+            "dn: ou=Product Development, dc=airius, dc=com\n" + 
+            "control: 1.2.840.11A556.1.4.805 true\n" + 
+            "changetype: delete\n";
 
         LdifReader reader = new LdifReader();
 
@@ -180,12 +209,22 @@
      */
     public void testLdifParserCombinedEntriesChanges2() throws NamingException
     {
-        String ldif = "version:   1\n" + "dn: cn=app1,ou=applications,ou=conf,dc=apache,dc=org\n" + "cn: app1\n"
-                + "objectClass: top\n" + "objectClass: apApplication\n" + "displayName:   app1   \n" + "dependencies:\n"
-                + "envVars:\n" + "\n" + "# Delete an entry. The operation will attach the LDAPv3\n"
-                + "# Tree Delete Control defined in [9]. The criticality\n"
-                + "# field is \"true\" and the controlValue field is\n" + "# absent, as required by [9].\n"
-                + "dn: ou=Product Development, dc=airius, dc=com\n" + "changetype: delete\n";
+        String ldif = 
+            "version:   1\n" + 
+            "dn: cn=app1,ou=applications,ou=conf,dc=apache,dc=org\n" + 
+            "cn: app1\n" + 
+            "objectClass: top\n" + 
+            "objectClass: apApplication\n" + 
+            "displayName:   app1   \n" + 
+            "dependencies:\n" + 
+            "envVars:\n" + 
+            "\n" + 
+            "# Delete an entry. The operation will attach the LDAPv3\n" + 
+            "# Tree Delete Control defined in [9]. The criticality\n" + 
+            "# field is \"true\" and the controlValue field is\n" + 
+            "# absent, as required by [9].\n" + 
+            "dn: ou=Product Development, dc=airius, dc=com\n" + 
+            "changetype: delete\n";
 
         LdifReader reader = new LdifReader();
 
@@ -208,13 +247,23 @@
      */
     public void testLdifParserCombinedChangesEntries() throws NamingException
     {
-        String ldif = "version:   1\n" + "# Delete an entry. The operation will attach the LDAPv3\n"
-                + "# Tree Delete Control defined in [9]. The criticality\n"
-                + "# field is \"true\" and the controlValue field is\n" + "# absent, as required by [9].\n"
-                + "dn: ou=Product Development, dc=airius, dc=com\n" + "control: 1.2.840.11A556.1.4.805 true\n"
-                + "changetype: delete\n" + "\n" + "dn: cn=app1,ou=applications,ou=conf,dc=apache,dc=org\n" + "cn: app1\n"
-                + "objectClass: top\n" + "objectClass: apApplication\n" + "displayName:   app1   \n" + "dependencies:\n"
-                + "envVars:\n";
+        String ldif = 
+            "version:   1\n" + 
+            "# Delete an entry. The operation will attach the LDAPv3\n" + 
+            "# Tree Delete Control defined in [9]. The criticality\n" + 
+            "# field is \"true\" and the controlValue field is\n" + 
+            "# absent, as required by [9].\n" + 
+            "dn: ou=Product Development, dc=airius, dc=com\n" + 
+            "control: 1.2.840.11A556.1.4.805 true\n" + 
+            "changetype: delete\n" + 
+            "\n" + 
+            "dn: cn=app1,ou=applications,ou=conf,dc=apache,dc=org\n" + 
+            "cn: app1\n" + 
+            "objectClass: top\n" + 
+            "objectClass: apApplication\n" + 
+            "displayName:   app1   \n" + 
+            "dependencies:\n" + 
+            "envVars:\n";
 
         LdifReader reader = new LdifReader();
 
@@ -237,12 +286,22 @@
      */
     public void testLdifParserCombinedChangesEntries2() throws NamingException
     {
-        String ldif = "version:   1\n" + "# Delete an entry. The operation will attach the LDAPv3\n"
-                + "# Tree Delete Control defined in [9]. The criticality\n"
-                + "# field is \"true\" and the controlValue field is\n" + "# absent, as required by [9].\n"
-                + "dn: ou=Product Development, dc=airius, dc=com\n" + "changetype: delete\n" + "\n"
-                + "dn: cn=app1,ou=applications,ou=conf,dc=apache,dc=org\n" + "cn: app1\n" + "objectClass: top\n"
-                + "objectClass: apApplication\n" + "displayName:   app1   \n" + "dependencies:\n" + "envVars:\n";
+        String ldif = 
+            "version:   1\n" + 
+            "# Delete an entry. The operation will attach the LDAPv3\n" + 
+            "# Tree Delete Control defined in [9]. The criticality\n" + 
+            "# field is \"true\" and the controlValue field is\n" + 
+            "# absent, as required by [9].\n" + 
+            "dn: ou=Product Development, dc=airius, dc=com\n" + 
+            "changetype: delete\n" + 
+            "\n" + 
+            "dn: cn=app1,ou=applications,ou=conf,dc=apache,dc=org\n" + 
+            "cn: app1\n" + 
+            "objectClass: top\n" + 
+            "objectClass: apApplication\n" + 
+            "displayName:   app1   \n" + 
+            "dependencies:\n" + 
+            "envVars:\n";
 
         LdifReader reader = new LdifReader();
 
@@ -259,9 +318,15 @@
 
     public void testLdifParser() throws NamingException
     {
-        String ldif = "version:   1\n" + "dn: cn=app1,ou=applications,ou=conf,dc=apache,dc=org\n" + "cn: app1\n"
-                + "objectClass: top\n" + "objectClass: apApplication\n" + "displayName: app1   \n" + "dependencies:\n"
-                + "envVars:";
+        String ldif = 
+            "version:   1\n" + 
+            "dn: cn=app1,ou=applications,ou=conf,dc=apache,dc=org\n" + 
+            "cn: app1\n" + 
+            "objectClass: top\n" + 
+            "objectClass: apApplication\n" + 
+            "displayName: app1   \n" + 
+            "dependencies:\n" + 
+            "envVars:";
 
         LdifReader reader = new LdifReader();
         List entries = reader.parseLdif( ldif );
@@ -292,9 +357,19 @@
 
     public void testLdifParserMuiltiLineComments() throws NamingException
     {
-        String ldif = "#comment\n" + " still a comment\n" + "dn: cn=app1,ou=applications,ou=conf,dc=apache,dc=org\n"
-                + "cn: app1#another comment\n" + "objectClass: top\n" + "objectClass: apApplication\n" + "displayName: app1\n"
-                + "serviceType: http\n" + "dependencies:\n" + "httpHeaders:\n" + "startupOptions:\n" + "envVars:";
+        String ldif = 
+            "#comment\n" + 
+            " still a comment\n" + 
+            "dn: cn=app1,ou=applications,ou=conf,dc=apache,dc=org\n" + 
+            "cn: app1#another comment\n" + 
+            "objectClass: top\n" + 
+            "objectClass: apApplication\n" + 
+            "displayName: app1\n" + 
+            "serviceType: http\n" + 
+            "dependencies:\n" + 
+            "httpHeaders:\n" + 
+            "startupOptions:\n" + 
+            "envVars:";
 
         LdifReader reader = new LdifReader();
         List entries = reader.parseLdif( ldif );
@@ -325,9 +400,19 @@
 
     public void testLdifParserMultiLineEntries() throws NamingException
     {
-        String ldif = "#comment\n" + "dn: cn=app1,ou=appli\n" + " cations,ou=conf,dc=apache,dc=org\n"
-                + "cn: app1#another comment\n" + "objectClass: top\n" + "objectClass: apApplication\n" + "displayName: app1\n"
-                + "serviceType: http\n" + "dependencies:\n" + "httpHeaders:\n" + "startupOptions:\n" + "envVars:";
+        String ldif = 
+            "#comment\n" + 
+            "dn: cn=app1,ou=appli\n" + 
+            " cations,ou=conf,dc=apache,dc=org\n" + 
+            "cn: app1#another comment\n" + 
+            "objectClass: top\n" + 
+            "objectClass: apApplication\n" + 
+            "displayName: app1\n" + 
+            "serviceType: http\n" + 
+            "dependencies:\n" + 
+            "httpHeaders:\n" + 
+            "startupOptions:\n" + 
+            "envVars:";
 
         LdifReader reader = new LdifReader();
         List entries = reader.parseLdif( ldif );
@@ -358,10 +443,18 @@
 
     public void testLdifParserBase64() throws NamingException, UnsupportedEncodingException
     {
-        String ldif = "#comment\n" + "dn: cn=app1,ou=applications,ou=conf,dc=apache,dc=org\n"
-                + "cn:: RW1tYW51ZWwgTMOpY2hhcm55\n" + "objectClass: top\n" + "objectClass: apApplication\n"
-                + "displayName: app1\n" + "serviceType: http\n" + "dependencies:\n" + "httpHeaders:\n" + "startupOptions:\n"
-                + "envVars:";
+        String ldif = 
+            "#comment\n" + 
+            "dn: cn=app1,ou=applications,ou=conf,dc=apache,dc=org\n" + 
+            "cn:: RW1tYW51ZWwgTMOpY2hhcm55\n" + 
+            "objectClass: top\n" + 
+            "objectClass: apApplication\n" + 
+            "displayName: app1\n" + 
+            "serviceType: http\n" + 
+            "dependencies:\n" + 
+            "httpHeaders:\n" + 
+            "startupOptions:\n" + 
+            "envVars:";
 
         LdifReader reader = new LdifReader();
         List entries = reader.parseLdif( ldif );
@@ -392,9 +485,19 @@
 
     public void testLdifParserBase64MultiLine() throws NamingException, UnsupportedEncodingException
     {
-        String ldif = "#comment\n" + "dn: cn=app1,ou=applications,ou=conf,dc=apache,dc=org\n" + "cn:: RW1tYW51ZWwg\n"
-                + " TMOpY2hhcm55ICA=\n" + "objectClass: top\n" + "objectClass: apApplication\n" + "displayName: app1\n"
-                + "serviceType: http\n" + "dependencies:\n" + "httpHeaders:\n" + "startupOptions:\n" + "envVars:";
+        String ldif = 
+            "#comment\n" + 
+            "dn: cn=app1,ou=applications,ou=conf,dc=apache,dc=org\n" + 
+            "cn:: RW1tYW51ZWwg\n" + 
+            " TMOpY2hhcm55ICA=\n" + 
+            "objectClass: top\n" + 
+            "objectClass: apApplication\n" + 
+            "displayName: app1\n" + 
+            "serviceType: http\n" + 
+            "dependencies:\n" + 
+            "httpHeaders:\n" + 
+            "startupOptions:\n" + 
+            "envVars:";
 
         LdifReader reader = new LdifReader();
         List entries = reader.parseLdif( ldif );
@@ -425,13 +528,27 @@
 
     public void testLdifParserRFC2849Sample1() throws NamingException
     {
-        String ldif = "version: 1\n" + "dn: cn=Barbara Jensen, ou=Product Development, dc=airius, dc=com\n"
-                + "objectclass: top\n" + "objectclass: person\n" + "objectclass: organizationalPerson\n"
-                + "cn: Barbara Jensen\n" + "cn: Barbara J Jensen\n" + "cn: Babs Jensen\n" + "sn: Jensen\n" + "uid: bjensen\n"
-                + "telephonenumber: +1 408 555 1212\n" + "description: A big sailing fan.\n" + "\n"
-                + "dn: cn=Bjorn Jensen, ou=Accounting, dc=airius, dc=com\n" + "objectclass: top\n" + "objectclass: person\n"
-                + "objectclass: organizationalPerson\n" + "cn: Bjorn Jensen\n" + "sn: Jensen\n"
-                + "telephonenumber: +1 408 555 1212";
+        String ldif = 
+            "version: 1\n" + 
+            "dn: cn=Barbara Jensen, ou=Product Development, dc=airius, dc=com\n" + 
+            "objectclass: top\n" + 
+            "objectclass: person\n" + 
+            "objectclass: organizationalPerson\n" + 
+            "cn: Barbara Jensen\n" + 
+            "cn: Barbara J Jensen\n" + 
+            "cn: Babs Jensen\n" + 
+            "sn: Jensen\n" + 
+            "uid: bjensen\n" + 
+            "telephonenumber: +1 408 555 1212\n" + 
+            "description: A big sailing fan.\n" + 
+            "\n" + 
+            "dn: cn=Bjorn Jensen, ou=Accounting, dc=airius, dc=com\n" + 
+            "objectclass: top\n" + 
+            "objectclass: person\n" + 
+            "objectclass: organizationalPerson\n" + 
+            "cn: Bjorn Jensen\n" + 
+            "sn: Jensen\n" + 
+            "telephonenumber: +1 408 555 1212";
 
         LdifReader reader = new LdifReader();
         List entries = reader.parseLdif( ldif );
@@ -490,12 +607,21 @@
 
     public void testLdifParserRFC2849Sample2() throws NamingException
     {
-        String ldif = "version: 1\n" + "dn: cn=Barbara Jensen, ou=Product Development, dc=airius, dc=com\n"
-                + "objectclass: top\n" + "objectclass: person\n" + "objectclass: organizationalPerson\n"
-                + "cn: Barbara Jensen\n" + "cn: Barbara J Jensen\n" + "cn: Babs Jensen\n" + "sn: Jensen\n" + "uid: bjensen\n"
-                + "telephonenumber: +1 408 555 1212\n"
-                + "description:Babs is a big sailing fan, and travels extensively in sea\n"
-                + " rch of perfect sailing conditions.\n" + "title:Product Manager, Rod and Reel Division";
+        String ldif = 
+            "version: 1\n" + 
+            "dn: cn=Barbara Jensen, ou=Product Development, dc=airius, dc=com\n" + 
+            "objectclass: top\n" + 
+            "objectclass: person\n" + 
+            "objectclass: organizationalPerson\n" + 
+            "cn: Barbara Jensen\n" + 
+            "cn: Barbara J Jensen\n" + 
+            "cn: Babs Jensen\n" + 
+            "sn: Jensen\n" + 
+            "uid: bjensen\n" + 
+            "telephonenumber: +1 408 555 1212\n" + 
+            "description:Babs is a big sailing fan, and travels extensively in sea\n" + 
+            " rch of perfect sailing conditions.\n" + 
+            "title:Product Manager, Rod and Reel Division";
 
         LdifReader reader = new LdifReader();
         List entries = reader.parseLdif( ldif );
@@ -538,12 +664,21 @@
 
     public void testLdifParserRFC2849Sample3() throws NamingException, Exception
     {
-        String ldif = "version: 1\n" + "dn: cn=Gern Jensen, ou=Product Testing, dc=airius, dc=com\n" + "objectclass: top\n"
-                + "objectclass: person\n" + "objectclass: organizationalPerson\n" + "cn: Gern Jensen\n" + "cn: Gern O Jensen\n"
-                + "sn: Jensen\n" + "uid: gernj\n" + "telephonenumber: +1 408 555 1212\n"
-                + "description:: V2hhdCBhIGNhcmVmdWwgcmVhZGVyIHlvdSBhcmUhICBUaGlzIHZhbHVl\n"
-                + " IGlzIGJhc2UtNjQtZW5jb2RlZCBiZWNhdXNlIGl0IGhhcyBhIGNvbnRyb2wgY2hhcmFjdG\n"
-                + " VyIGluIGl0IChhIENSKS4NICBCeSB0aGUgd2F5LCB5b3Ugc2hvdWxkIHJlYWxseSBnZXQg\n" + " b3V0IG1vcmUu";
+        String ldif = 
+            "version: 1\n" + 
+            "dn: cn=Gern Jensen, ou=Product Testing, dc=airius, dc=com\n" + 
+            "objectclass: top\n" + 
+            "objectclass: person\n" + 
+            "objectclass: organizationalPerson\n" + 
+            "cn: Gern Jensen\n" + 
+            "cn: Gern O Jensen\n" + 
+            "sn: Jensen\n" + 
+            "uid: gernj\n" + 
+            "telephonenumber: +1 408 555 1212\n" + 
+            "description:: V2hhdCBhIGNhcmVmdWwgcmVhZGVyIHlvdSBhcmUhICBUaGlzIHZhbHVl\n" + 
+            " IGlzIGJhc2UtNjQtZW5jb2RlZCBiZWNhdXNlIGl0IGhhcyBhIGNvbnRyb2wgY2hhcmFjdG\n" + 
+            " VyIGluIGl0IChhIENSKS4NICBCeSB0aGUgd2F5LCB5b3Ugc2hvdWxkIHJlYWxseSBnZXQg\n" + 
+            " b3V0IG1vcmUu";
 
         LdifReader reader = new LdifReader();
         List entries = reader.parseLdif( ldif );
@@ -582,12 +717,21 @@
 
     public void testLdifParserRFC2849Sample3VariousSpacing() throws NamingException, Exception
     {
-        String ldif = "version:1\n" + "dn:cn=Gern Jensen, ou=Product Testing, dc=airius, dc=com  \n" + "objectclass:top\n"
-                + "objectclass:   person   \n" + "objectclass:organizationalPerson\n" + "cn:Gern Jensen\n"
-                + "cn:Gern O Jensen\n" + "sn:Jensen\n" + "uid:gernj\n" + "telephonenumber:+1 408 555 1212  \n"
-                + "description::  V2hhdCBhIGNhcmVmdWwgcmVhZGVyIHlvdSBhcmUhICBUaGlzIHZhbHVl\n"
-                + " IGlzIGJhc2UtNjQtZW5jb2RlZCBiZWNhdXNlIGl0IGhhcyBhIGNvbnRyb2wgY2hhcmFjdG\n"
-                + " VyIGluIGl0IChhIENSKS4NICBCeSB0aGUgd2F5LCB5b3Ugc2hvdWxkIHJlYWxseSBnZXQg\n" + " b3V0IG1vcmUu  ";
+        String ldif = 
+            "version:1\n" + 
+            "dn:cn=Gern Jensen, ou=Product Testing, dc=airius, dc=com  \n" + 
+            "objectclass:top\n" + 
+            "objectclass:   person   \n" + 
+            "objectclass:organizationalPerson\n" + 
+            "cn:Gern Jensen\n"  + 
+            "cn:Gern O Jensen\n" + 
+            "sn:Jensen\n" + 
+            "uid:gernj\n" + 
+            "telephonenumber:+1 408 555 1212  \n" + 
+            "description::  V2hhdCBhIGNhcmVmdWwgcmVhZGVyIHlvdSBhcmUhICBUaGlzIHZhbHVl\n" + 
+            " IGlzIGJhc2UtNjQtZW5jb2RlZCBiZWNhdXNlIGl0IGhhcyBhIGNvbnRyb2wgY2hhcmFjdG\n" + 
+            " VyIGluIGl0IChhIENSKS4NICBCeSB0aGUgd2F5LCB5b3Ugc2hvdWxkIHJlYWxseSBnZXQg\n" + 
+            " b3V0IG1vcmUu  ";
 
         LdifReader reader = new LdifReader();
         List entries = reader.parseLdif( ldif );
@@ -626,66 +770,102 @@
 
     public void testLdifParserRFC2849Sample4() throws NamingException, Exception
     {
-        String ldif = "version: 1\n" + "dn:: b3U95Za25qWt6YOoLG89QWlyaXVz\n" + "# dn:: ou=営業部,o=Airius\n"
-                + "objectclass: top\n" + "objectclass: organizationalUnit\n" + "ou:: 5Za25qWt6YOo\n" + "# ou:: 営業部\n"
-                + "ou;lang-ja:: 5Za25qWt6YOo\n" + "# ou;lang-ja:: 営業部\n" + "ou;lang-ja;phonetic:: 44GI44GE44GO44KH44GG44G2\n"
-                + "# ou;lang-ja:: えいぎょうぶ\n" + "ou;lang-en: Sales\n" + "description: Japanese office\n" + "\n"
-                + "dn:: dWlkPXJvZ2FzYXdhcmEsb3U95Za25qWt6YOoLG89QWlyaXVz\n" + "# dn:: uid=rogasawara,ou=営業部,o=Airius\n"
-                + "userpassword: {SHA}O3HSv1MusyL4kTjP+HKI5uxuNoM=\n" + "objectclass: top\n" + "objectclass: person\n"
-                + "objectclass: organizationalPerson\n" + "objectclass: inetOrgPerson\n" + "uid: rogasawara\n"
-                + "mail: rogasawara@airius.co.jp\n" + "givenname;lang-ja:: 44Ot44OJ44OL44O8\n" + "# givenname;lang-ja:: ロドニー\n"
-                + "sn;lang-ja:: 5bCP56yg5Y6f\n" + "# sn;lang-ja:: 小笠原\n" + "cn;lang-ja:: 5bCP56yg5Y6fIOODreODieODi+ODvA==\n"
-                + "# cn;lang-ja:: 小笠原 ロドニー\n" + "title;lang-ja:: 5Za25qWt6YOoIOmDqOmVtw==\n" + "# title;lang-ja:: 営業部 部長\n"
-                + "preferredlanguage: ja\n" + "givenname:: 44Ot44OJ44OL44O8\n" + "# givenname:: ロドニー\n" + "sn:: 5bCP56yg5Y6f\n"
-                + "# sn:: 小笠原\n" + "cn:: 5bCP56yg5Y6fIOODreODieODi+ODvA==\n" + "# cn:: 小笠原 ロドニー\n"
-                + "title:: 5Za25qWt6YOoIOmDqOmVtw==\n" + "# title:: 営業部 部長\n"
-                + "givenname;lang-ja;phonetic:: 44KN44Gp44Gr44O8\n" + "# givenname;lang-ja;phonetic::\n" + " ろどにー\n"
-                + "sn;lang-ja;phonetic:: 44GK44GM44GV44KP44KJ\n" + "# sn;lang-ja;phonetic:: おがさわら\n"
-                + "cn;lang-ja;phonetic:: 44GK44GM44GV44KP44KJIOOCjeOBqeOBq+ODvA==\n" + "# cn;lang-ja;phonetic:: おがさわら ろどにー\n"
-                + "title;lang-ja;phonetic:: 44GI44GE44GO44KH44GG44G2IOOBtuOBoeOCh+OBhg==\n" + "# title;lang-ja;phonetic::\n"
-                + "# えいぎょうぶ ぶちょう\n" + "givenname;lang-en: Rodney\n" + "sn;lang-en: Ogasawara\n"
-                + "cn;lang-en: Rodney Ogasawara\n" + "title;lang-en: Sales, Director\n";
+        String ldif = 
+            "version: 1\n" + "dn:: b3U95Za25qWt6YOoLG89QWlyaXVz\n" + 
+            "# dn:: ou=営業部,o=Airius\n" + 
+            "objectclass: top\n" + 
+            "objectclass: organizationalUnit\n" + 
+            "ou:: 5Za25qWt6YOo\n" + "# ou:: 営業部\n" + 
+            "ou;lang-ja:: 5Za25qWt6YOo\n" + 
+            "# ou;lang-ja:: 営業部\n" + 
+            "ou;lang-ja;phonetic:: 44GI44GE44GO44KH44GG44G2\n" + 
+            "# ou;lang-ja:: えいぎょうぶ\n" + 
+            "ou;lang-en: Sales\n" + 
+            "description: Japanese office\n" + 
+            "\n" + 
+            "dn:: dWlkPXJvZ2FzYXdhcmEsb3U95Za25qWt6YOoLG89QWlyaXVz\n" + 
+            "# dn:: uid=rogasawara,ou=営業部,o=Airius\n" + 
+            "userpassword: {SHA}O3HSv1MusyL4kTjP+HKI5uxuNoM=\n" + 
+            "objectclass: top\n" + 
+            "objectclass: person\n" + 
+            "objectclass: organizationalPerson\n" + 
+            "objectclass: inetOrgPerson\n" + 
+            "uid: rogasawara\n" + 
+            "mail: rogasawara@airius.co.jp\n" + 
+            "givenname;lang-ja:: 44Ot44OJ44OL44O8\n" + 
+            "# givenname;lang-ja:: ロドニー\n" + 
+            "sn;lang-ja:: 5bCP56yg5Y6f\n" + 
+            "# sn;lang-ja:: 小笠原\n" + 
+            "cn;lang-ja:: 5bCP56yg5Y6fIOODreODieODi+ODvA==\n" + 
+            "# cn;lang-ja:: 小笠原 ロドニー\n" + 
+            "title;lang-ja:: 5Za25qWt6YOoIOmDqOmVtw==\n" + 
+            "# title;lang-ja:: 営業部 部長\n" + 
+            "preferredlanguage: ja\n" + 
+            "givenname:: 44Ot44OJ44OL44O8\n" + 
+            "# givenname:: ロドニー\n" + 
+            "sn:: 5bCP56yg5Y6f\n" + 
+            "# sn:: 小笠原\n" + 
+            "cn:: 5bCP56yg5Y6fIOODreODieODi+ODvA==\n" + 
+            "# cn:: 小笠原 ロドニー\n" + 
+            "title:: 5Za25qWt6YOoIOmDqOmVtw==\n" + 
+            "# title:: 営業部 部長\n" + 
+            "givenname;lang-ja;phonetic:: 44KN44Gp44Gr44O8\n" + 
+            "# givenname;lang-ja;phonetic::\n" + 
+              " ろどにー\n" + 
+            "sn;lang-ja;phonetic:: 44GK44GM44GV44KP44KJ\n" + 
+            "# sn;lang-ja;phonetic:: おがさわら\n" + 
+            "cn;lang-ja;phonetic:: 44GK44GM44GV44KP44KJIOOCjeOBqeOBq+ODvA==\n" + 
+            "# cn;lang-ja;phonetic:: おがさわら ろどにー\n" + 
+            "title;lang-ja;phonetic:: 44GI44GE44GO44KH44GG44G2IOOBtuOBoeOCh+OBhg==\n" + 
+            "# title;lang-ja;phonetic::\n" + 
+              "# えいぎょうぶ ぶちょう\n" + 
+            "givenname;lang-en: Rodney\n" + 
+            "sn;lang-en: Ogasawara\n" + 
+            "cn;lang-en: Rodney Ogasawara\n" + 
+            "title;lang-en: Sales, Director\n";
 
         LdifReader reader = new LdifReader();
         List entries = reader.parseLdif( ldif );
 
         String[][][] values =
-        {
-        {
-        { "dn", "ou=営業部,o=Airius" },
-        { "objectclass", "top" },
-        { "objectclass", "organizationalUnit" },
-        { "ou", "営業部" },
-        { "ou;lang-ja", "営業部" },
-        { "ou;lang-ja;phonetic", "えいぎょうぶ" },
-        { "ou;lang-en", "Sales" },
-        { "description", "Japanese office" } },
-        {
-        { "dn", "uid=rogasawara,ou=営業部,o=Airius" },
-        { "userpassword", "{SHA}O3HSv1MusyL4kTjP+HKI5uxuNoM=" },
-        { "objectclass", "top" },
-        { "objectclass", "person" },
-        { "objectclass", "organizationalPerson" },
-        { "objectclass", "inetOrgPerson" },
-        { "uid", "rogasawara" },
-        { "mail", "rogasawara@airius.co.jp" },
-        { "givenname;lang-ja", "ロドニー" },
-        { "sn;lang-ja", "小笠原" },
-        { "cn;lang-ja", "小笠原 ロドニー" },
-        { "title;lang-ja", "営業部 部長" },
-        { "preferredlanguage", "ja" },
-        { "givenname", "ロドニー" },
-        { "sn", "小笠原" },
-        { "cn", "小笠原 ロドニー" },
-        { "title", "営業部 部長" },
-        { "givenname;lang-ja;phonetic", "ろどにー" },
-        { "sn;lang-ja;phonetic", "おがさわら" },
-        { "cn;lang-ja;phonetic", "おがさわら ろどにー" },
-        { "title;lang-ja;phonetic", "えいぎょうぶ ぶちょう" },
-        { "givenname;lang-en", "Rodney" },
-        { "sn;lang-en", "Ogasawara" },
-        { "cn;lang-en", "Rodney Ogasawara" },
-        { "title;lang-en", "Sales, Director" } } };
+            {
+                {
+                    { "dn", "ou=営業部,o=Airius" },
+                    { "objectclass", "top" },
+                    { "objectclass", "organizationalUnit" },
+                    { "ou", "営業部" },
+                    { "ou;lang-ja", "営業部" },
+                    { "ou;lang-ja;phonetic", "えいぎょうぶ" },
+                    { "ou;lang-en", "Sales" },
+                    { "description", "Japanese office" } },
+                    {
+                    { "dn", "uid=rogasawara,ou=営業部,o=Airius" },
+                    { "userpassword", "{SHA}O3HSv1MusyL4kTjP+HKI5uxuNoM=" },
+                    { "objectclass", "top" },
+                    { "objectclass", "person" },
+                    { "objectclass", "organizationalPerson" },
+                    { "objectclass", "inetOrgPerson" },
+                    { "uid", "rogasawara" },
+                    { "mail", "rogasawara@airius.co.jp" },
+                    { "givenname;lang-ja", "ロドニー" },
+                    { "sn;lang-ja", "小笠原" },
+                    { "cn;lang-ja", "小笠原 ロドニー" },
+                    { "title;lang-ja", "営業部 部長" },
+                    { "preferredlanguage", "ja" },
+                    { "givenname", "ロドニー" },
+                    { "sn", "小笠原" },
+                    { "cn", "小笠原 ロドニー" },
+                    { "title", "営業部 部長" },
+                    { "givenname;lang-ja;phonetic", "ろどにー" },
+                    { "sn;lang-ja;phonetic", "おがさわら" },
+                    { "cn;lang-ja;phonetic", "おがさわら ろどにー" },
+                    { "title;lang-ja;phonetic", "えいぎょうぶ ぶちょう" },
+                    { "givenname;lang-en", "Rodney" },
+                    { "sn;lang-en", "Ogasawara" },
+                    { "cn;lang-en", "Rodney Ogasawara" },
+                    { "title;lang-en", "Sales, Director" } 
+                } 
+            };
 
         assertEquals( 2, entries.size() );
 
@@ -720,26 +900,35 @@
 
     public void testLdifParserRFC2849Sample5() throws NamingException, Exception
     {
-        String ldif = "version: 1\n" + "dn: cn=Horatio Jensen, ou=Product Testing, dc=airius, dc=com\n" + "objectclass: top\n"
-                + "objectclass: person\n" + "objectclass: organizationalPerson\n" + "cn: Horatio Jensen\n"
-                + "cn: Horatio N Jensen\n" + "sn: Jensen\n" + "uid: hjensen\n" + "telephonenumber: +1 408 555 1212\n"
-                + "jpegphoto:< file:///tmp/hjensen.jpg";
+        String ldif = 
+            "version: 1\n" + 
+            "dn: cn=Horatio Jensen, ou=Product Testing, dc=airius, dc=com\n" + 
+            "objectclass: top\n" + 
+            "objectclass: person\n" + 
+            "objectclass: organizationalPerson\n" + 
+            "cn: Horatio Jensen\n" + 
+            "cn: Horatio N Jensen\n" + 
+            "sn: Jensen\n" + 
+            "uid: hjensen\n" + 
+            "telephonenumber: +1 408 555 1212\n" + 
+            "jpegphoto:< file:///tmp/hjensen.jpg";
 
         LdifReader reader = new LdifReader();
         List entries = reader.parseLdif( ldif );
 
         String[][] values =
-        {
-        { "dn", "cn=Horatio Jensen, ou=Product Testing, dc=airius, dc=com" },
-        { "objectclass", "top" },
-        { "objectclass", "person" },
-        { "objectclass", "organizationalPerson" },
-        { "cn", "Horatio Jensen" },
-        { "cn", "Horatio N Jensen" },
-        { "sn", "Jensen" },
-        { "uid", "hjensen" },
-        { "telephonenumber", "+1 408 555 1212" },
-        { "jpegphoto", null }, };
+            {
+                { "dn", "cn=Horatio Jensen, ou=Product Testing, dc=airius, dc=com" },
+                { "objectclass", "top" },
+                { "objectclass", "person" },
+                { "objectclass", "organizationalPerson" },
+                { "cn", "Horatio Jensen" },
+                { "cn", "Horatio N Jensen" },
+                { "sn", "Jensen" },
+                { "uid", "hjensen" },
+                { "telephonenumber", "+1 408 555 1212" },
+                { "jpegphoto", null } 
+            };
 
         assertEquals( 1, entries.size() );
 
@@ -776,10 +965,18 @@
 
     public void testLdifParserRFC2849Sample5WithSizeLimit() throws NamingException, Exception
     {
-        String ldif = "version: 1\n" + "dn: cn=Horatio Jensen, ou=Product Testing, dc=airius, dc=com\n" + "objectclass: top\n"
-                + "objectclass: person\n" + "objectclass: organizationalPerson\n" + "cn: Horatio Jensen\n"
-                + "cn: Horatio N Jensen\n" + "sn: Jensen\n" + "uid: hjensen\n" + "telephonenumber: +1 408 555 1212\n"
-                + "jpegphoto:< file:///tmp/hjensen.jpg";
+        String ldif = 
+            "version: 1\n" + 
+            "dn: cn=Horatio Jensen, ou=Product Testing, dc=airius, dc=com\n" + 
+            "objectclass: top\n" + 
+            "objectclass: person\n" + 
+            "objectclass: organizationalPerson\n" + 
+            "cn: Horatio Jensen\n" + 
+            "cn: Horatio N Jensen\n" + 
+            "sn: Jensen\n" + 
+            "uid: hjensen\n" + 
+            "telephonenumber: +1 408 555 1212\n" + 
+            "jpegphoto:< file:///tmp/hjensen.jpg";
 
         LdifReader reader = new LdifReader();
         reader.setSizeLimit( 128 );
@@ -797,111 +994,128 @@
 
     public void testLdifParserRFC2849Sample6() throws NamingException, Exception
     {
-        String ldif = "version: 1\n"
-                +
-                // First entry modification : ADD
-                "# Add a new entry\n"
-                + "dn: cn=Fiona Jensen, ou=Marketing, dc=airius, dc=com\n"
-                + "changetype: add\n"
-                + "objectclass: top\n"
-                + "objectclass: person\n"
-                + "objectclass: organizationalPerson\n"
-                + "cn: Fiona Jensen\n"
-                + "sn: Jensen\n"
-                + "uid: fiona\n"
-                + "telephonenumber: +1 408 555 1212\n"
-                + "jpegphoto:< file:///tmp/fiona.jpg\n"
-                + "\n"
-                +
-                // Second entry modification : DELETE
-                "# Delete an existing entry\n"
-                + "dn: cn=Robert Jensen, ou=Marketing, dc=airius, dc=com\n"
-                + "changetype: delete\n"
-                + "\n"
-                +
-                // Third entry modification : MODRDN
-                "# Modify an entry's relative distinguished name\n"
-                + "dn: cn=Paul Jensen, ou=Product Development, dc=airius, dc=com\n"
-                + "changetype: modrdn\n"
-                + "newrdn: cn=Paula Jensen\n"
-                + "deleteoldrdn: 1\n"
-                + "\n"
-                +
-                // Forth entry modification : MODRDN
-                "# Rename an entry and move all of its children to a new location in\n"
-                + "# the directory tree (only implemented by LDAPv3 servers).\n"
-                + "dn: ou=PD Accountants, ou=Product Development, dc=airius, dc=com\n"
-                + "changetype: moddn\n"
-                + "newrdn: ou=Product Development Accountants\n"
-                + "deleteoldrdn: 0\n"
-                + "newsuperior: ou=Accounting, dc=airius, dc=com\n"
-                + "# Modify an entry: add an additional value to the postaladdress\n"
-                + "# attribute, completely delete the description attribute, replace\n"
-                + "# the telephonenumber attribute with two values, and delete a specific\n"
-                + "# value from the facsimiletelephonenumber attribute\n"
-                + "\n"
-                +
-                // Fitfh entry modification : MODIFY
-                "dn: cn=Paula Jensen, ou=Product Development, dc=airius, dc=com\n" + "changetype: modify\n"
-                + "add: postaladdress\n" + "postaladdress: 123 Anystreet $ Sunnyvale, CA $ 94086\n" + "-\n"
-                + "delete: description\n" + "-\n" + "replace: telephonenumber\n"
-                + "telephonenumber: +1 408 555 1234\n"
-                + "telephonenumber: +1 408 555 5678\n"
-                + "-\n"
-                + "delete: facsimiletelephonenumber\n"
-                + "facsimiletelephonenumber: +1 408 555 9876\n"
-                + "-\n"
-                + "\n"
-                +
-                // Sixth entry modification : MODIFY
-                "# Modify an entry: replace the postaladdress attribute with an empty\n"
-                + "# set of values (which will cause the attribute to be removed), and\n"
-                + "# delete the entire description attribute. Note that the first will\n"
-                + "# always succeed, while the second will only succeed if at least\n"
-                + "# one value for the description attribute is present.\n"
-                + "dn: cn=Ingrid Jensen, ou=Product Support, dc=airius, dc=com\n" + "changetype: modify\n"
-                + "replace: postaladdress\n" + "-\n" + "delete: description\n" + "-\n";
+        String ldif = 
+            "version: 1\n" +
+            // First entry modification : ADD
+            "# Add a new entry\n" +
+            "dn: cn=Fiona Jensen, ou=Marketing, dc=airius, dc=com\n" +
+            "changetype: add\n" +
+            "objectclass: top\n" +
+            "objectclass: person\n" +
+            "objectclass: organizationalPerson\n" +
+            "cn: Fiona Jensen\n" +
+            "sn: Jensen\n" +
+            "uid: fiona\n" +
+            "telephonenumber: +1 408 555 1212\n" +
+            "jpegphoto:< file:///tmp/fiona.jpg\n" +
+            "\n" +
+            // Second entry modification : DELETE
+            "# Delete an existing entry\n" +
+            "dn: cn=Robert Jensen, ou=Marketing, dc=airius, dc=com\n" +
+            "changetype: delete\n" +
+            "\n" +
+            // Third entry modification : MODRDN
+            "# Modify an entry's relative distinguished name\n" +
+            "dn: cn=Paul Jensen, ou=Product Development, dc=airius, dc=com\n" +
+            "changetype: modrdn\n" +
+            "newrdn: cn=Paula Jensen\n" +
+            "deleteoldrdn: 1\n" +
+            "\n" +
+            // Forth entry modification : MODRDN
+            "# Rename an entry and move all of its children to a new location in\n" +
+            "# the directory tree (only implemented by LDAPv3 servers).\n" +
+            "dn: ou=PD Accountants, ou=Product Development, dc=airius, dc=com\n" +
+            "changetype: moddn\n" +
+            "newrdn: ou=Product Development Accountants\n" +
+            "deleteoldrdn: 0\n" +
+            "newsuperior: ou=Accounting, dc=airius, dc=com\n" +
+            "# Modify an entry: add an additional value to the postaladdress\n" +
+            "# attribute, completely delete the description attribute, replace\n" +
+            "# the telephonenumber attribute with two values, and delete a specific\n" +
+            "# value from the facsimiletelephonenumber attribute\n" +
+            "\n" +
+            // Fitfh entry modification : MODIFY
+            "dn: cn=Paula Jensen, ou=Product Development, dc=airius, dc=com\n" + 
+            "changetype: modify\n" +
+            "add: postaladdress\n" +
+            "postaladdress: 123 Anystreet $ Sunnyvale, CA $ 94086\n" + 
+            "-\n" +
+            "delete: description\n" +
+            "-\n" + 
+            "replace: telephonenumber\n" +
+            "telephonenumber: +1 408 555 1234\n" +
+            "telephonenumber: +1 408 555 5678\n" +
+            "-\n" +
+            "delete: facsimiletelephonenumber\n" +
+            "facsimiletelephonenumber: +1 408 555 9876\n" +
+            "-\n" +
+            "\n" +
+            // Sixth entry modification : MODIFY
+            "# Modify an entry: replace the postaladdress attribute with an empty\n" +
+            "# set of values (which will cause the attribute to be removed), and\n" +
+            "# delete the entire description attribute. Note that the first will\n" +
+            "# always succeed, while the second will only succeed if at least\n" +
+            "# one value for the description attribute is present.\n" +
+            "dn: cn=Ingrid Jensen, ou=Product Support, dc=airius, dc=com\n" + 
+            "changetype: modify\n" +
+            "replace: postaladdress\n" + 
+            "-\n" + 
+            "delete: description\n" + 
+            "-\n";
 
         LdifReader reader = new LdifReader();
         List entries = reader.parseLdif( ldif );
 
         String[][][] values =
-        {
-        {
-        { "dn", "cn=Fiona Jensen, ou=Marketing, dc=airius, dc=com" },
-        { "objectclass", "top" },
-        { "objectclass", "person" },
-        { "objectclass", "organizationalPerson" },
-        { "cn", "Fiona Jensen" },
-        { "sn", "Jensen" },
-        { "uid", "fiona" },
-        { "telephonenumber", "+1 408 555 1212" },
-        { "jpegphoto", "" } },
-        {
-        { "dn", "cn=Robert Jensen, ou=Marketing, dc=airius, dc=com" } },
-        {
-        { "dn", "cn=Paul Jensen, ou=Product Development, dc=airius, dc=com" },
-        { "cn=Paula Jensen" } },
-        {
-        { "dn", "ou=PD Accountants, ou=Product Development, dc=airius, dc=com" },
-        { "ou=Product Development Accountants" },
-        { "ou=Accounting, dc=airius, dc=com" } },
-        {
-        { "dn", "cn=Paula Jensen, ou=Product Development, dc=airius, dc=com" },
-        // add
-                { "postaladdress", "123 Anystreet $ Sunnyvale, CA $ 94086" },
-                // delete
-                { "description" },
-                // replace
-                { "telephonenumber", "+1 408 555 1234", "+1 408 555 5678" },
-                // delete
-                { "facsimiletelephonenumber", "+1 408 555 9876" }, },
-        {
-        { "dn", "cn=Ingrid Jensen, ou=Product Support, dc=airius, dc=com" },
-        // replace
-                { "postaladdress" },
-                // delete
-                { "description" } } };
+            {
+                // First entry modification : ADD                
+                {
+                    { "dn", "cn=Fiona Jensen, ou=Marketing, dc=airius, dc=com" },
+                    { "objectclass", "top" },
+                    { "objectclass", "person" },
+                    { "objectclass", "organizationalPerson" },
+                    { "cn", "Fiona Jensen" },
+                    { "sn", "Jensen" },
+                    { "uid", "fiona" },
+                    { "telephonenumber", "+1 408 555 1212" },
+                    { "jpegphoto", "" } 
+                },
+                // Second entry modification : DELETE
+                {
+                    { "dn", "cn=Robert Jensen, ou=Marketing, dc=airius, dc=com" } 
+                },
+                // Third entry modification : MODRDN
+                {
+                    { "dn", "cn=Paul Jensen, ou=Product Development, dc=airius, dc=com" },
+                    { "cn=Paula Jensen" } 
+                },
+                // Forth entry modification : MODRDN
+                {
+                    { "dn", "ou=PD Accountants, ou=Product Development, dc=airius, dc=com" },
+                    { "ou=Product Development Accountants" },
+                    { "ou=Accounting, dc=airius, dc=com" } 
+                },
+                // Fitfh entry modification : MODIFY
+                {
+                    { "dn", "cn=Paula Jensen, ou=Product Development, dc=airius, dc=com" },
+                    // add
+                    { "postaladdress", "123 Anystreet $ Sunnyvale, CA $ 94086" },
+                    // delete
+                    { "description" },
+                    // replace
+                    { "telephonenumber", "+1 408 555 1234", "+1 408 555 5678" },
+                    // delete
+                    { "facsimiletelephonenumber", "+1 408 555 9876" }, 
+                },
+                // Sixth entry modification : MODIFY
+                {
+                    { "dn", "cn=Ingrid Jensen, ou=Product Support, dc=airius, dc=com" },
+                    // replace
+                    { "postaladdress" },
+                    // delete
+                    { "description" } 
+                } 
+            };
 
         Entry entry = (Entry) entries.get( 0 );
         assertTrue( entry.isChangeAdd() );
@@ -1007,11 +1221,15 @@
 
     public void testLdifParserRFC2849Sample7() throws NamingException, Exception
     {
-        String ldif = "version: 1\n" + "# Delete an entry. The operation will attach the LDAPv3\n"
-                + "# Tree Delete Control defined in [9]. The criticality\n"
-                + "# field is \"true\" and the controlValue field is\n" + "# absent, as required by [9].\n"
-                + "dn: ou=Product Development, dc=airius, dc=com\n" + "control: 1.2.840.113556.1.4.805 true\n"
-                + "changetype: delete\n";
+        String ldif = 
+            "version: 1\n" + 
+            "# Delete an entry. The operation will attach the LDAPv3\n" + 
+            "# Tree Delete Control defined in [9]. The criticality\n" + 
+            "# field is \"true\" and the controlValue field is\n" + 
+            "# absent, as required by [9].\n" + 
+            "dn: ou=Product Development, dc=airius, dc=com\n" + 
+            "control: 1.2.840.113556.1.4.805 true\n" + 
+            "changetype: delete\n";
 
         LdifReader reader = new LdifReader();
         List entries = reader.parseLdif( ldif );
@@ -1030,11 +1248,15 @@
 
     public void testLdifParserRFC2849Sample7NoValueNoCritical() throws NamingException, Exception
     {
-        String ldif = "version: 1\n" + "# Delete an entry. The operation will attach the LDAPv3\n"
-                + "# Tree Delete Control defined in [9]. The criticality\n"
-                + "# field is \"true\" and the controlValue field is\n" + "# absent, as required by [9].\n"
-                + "dn: ou=Product Development, dc=airius, dc=com\n" + "control: 1.2.840.11556.1.4.805\n"
-                + "changetype: delete\n";
+        String ldif = 
+            "version: 1\n" + 
+            "# Delete an entry. The operation will attach the LDAPv3\n" + 
+            "# Tree Delete Control defined in [9]. The criticality\n" + 
+            "# field is \"true\" and the controlValue field is\n" + 
+            "# absent, as required by [9].\n" + 
+            "dn: ou=Product Development, dc=airius, dc=com\n" + 
+            "control: 1.2.840.11556.1.4.805\n" + 
+            "changetype: delete\n";
 
         LdifReader reader = new LdifReader();
         List entries = reader.parseLdif( ldif );
@@ -1053,11 +1275,15 @@
 
     public void testLdifParserRFC2849Sample7NoCritical() throws NamingException, Exception
     {
-        String ldif = "version: 1\n" + "# Delete an entry. The operation will attach the LDAPv3\n"
-                + "# Tree Delete Control defined in [9]. The criticality\n"
-                + "# field is \"true\" and the controlValue field is\n" + "# absent, as required by [9].\n"
-                + "dn: ou=Product Development, dc=airius, dc=com\n" + "control: 1.2.840.11556.1.4.805:control-value\n"
-                + "changetype: delete\n";
+        String ldif = 
+            "version: 1\n" + 
+            "# Delete an entry. The operation will attach the LDAPv3\n" + 
+            "# Tree Delete Control defined in [9]. The criticality\n" + 
+            "# field is \"true\" and the controlValue field is\n" + 
+            "# absent, as required by [9].\n" + 
+            "dn: ou=Product Development, dc=airius, dc=com\n" + 
+            "control: 1.2.840.11556.1.4.805:control-value\n" + 
+            "changetype: delete\n";
 
         LdifReader reader = new LdifReader();
         List entries = reader.parseLdif( ldif );
@@ -1077,10 +1303,15 @@
 
     public void testLdifParserRFC2849Sample7NoOid() throws NamingException, Exception
     {
-        String ldif = "version: 1\n" + "# Delete an entry. The operation will attach the LDAPv3\n"
-                + "# Tree Delete Control defined in [9]. The criticality\n"
-                + "# field is \"true\" and the controlValue field is\n" + "# absent, as required by [9].\n"
-                + "dn: ou=Product Development, dc=airius, dc=com\n" + "control: true\n" + "changetype: delete\n";
+        String ldif = 
+            "version: 1\n" + 
+            "# Delete an entry. The operation will attach the LDAPv3\n" + 
+            "# Tree Delete Control defined in [9]. The criticality\n" + 
+            "# field is \"true\" and the controlValue field is\n" + 
+            "# absent, as required by [9].\n" + 
+            "dn: ou=Product Development, dc=airius, dc=com\n" + 
+            "control: true\n" + 
+            "changetype: delete\n";
 
         LdifReader reader = new LdifReader();
 
@@ -1097,11 +1328,46 @@
 
     public void testLdifParserRFC2849Sample7BadOid() throws NamingException, Exception
     {
-        String ldif = "version: 1\n" + "# Delete an entry. The operation will attach the LDAPv3\n"
-                + "# Tree Delete Control defined in [9]. The criticality\n"
-                + "# field is \"true\" and the controlValue field is\n" + "# absent, as required by [9].\n"
-                + "dn: ou=Product Development, dc=airius, dc=com\n" + "control: 1.2.840.11A556.1.4.805 true\n"
-                + "changetype: delete\n";
+        String ldif = 
+            "version: 1\n" + 
+            "# Delete an entry. The operation will attach the LDAPv3\n" + 
+            "# Tree Delete Control defined in [9]. The criticality\n" + 
+            "# field is \"true\" and the controlValue field is\n" + 
+            "# absent, as required by [9].\n" + 
+            "dn: ou=Product Development, dc=airius, dc=com\n" + 
+            "control: 1.2.840.11A556.1.4.805 true\n" + 
+            "changetype: delete\n";
+
+        LdifReader reader = new LdifReader();
+
+        try
+        {
+            reader.parseLdif( ldif );
+            fail();
+        }
+        catch (NamingException ne)
+        {
+            assertTrue( true );
+        }
+    }
+
+    public void testLdifParserChangeModifyMultiAttrs() throws NamingException, Exception
+    {
+        String ldif = 
+            "version: 1\n" + 
+            "dn: ou=Product Development, dc=airius, dc=com\n" + 
+            "changetype: modify\n" +
+            "add: postaladdress\n" +
+            "postaladdress: 123 Anystreet $ Sunnyvale, CA $ 94086\n" + 
+            "-\n" +
+            "delete: postaladdress\n" +
+            "-\n" + 
+            "replace: telephonenumber\n" +
+            "telephonenumber: +1 408 555 1234\n" +
+            "telephonenumber: +1 408 555 5678\n" +
+            "-\n" +
+            "delete: facsimiletelephonenumber\n" +
+            "facsimiletelephonenumber: +1 408 555 9876\n";
 
         LdifReader reader = new LdifReader();
 



Mime
View raw message