directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1235364 [15/27] - in /directory/shared/trunk: asn1/api/src/main/java/org/apache/directory/shared/asn1/util/ asn1/api/src/test/java/org/apache/directory/shared/asn1/util/ asn1/ber/src/main/java/org/apache/directory/shared/asn1/actions/ asn1...
Date Tue, 24 Jan 2012 17:27:12 GMT
Modified: directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java?rev=1235364&r1=1235363&r2=1235364&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java Tue Jan 24 17:27:00 2012
@@ -74,41 +74,107 @@ public class ModifyRequestTest extends A
         stream.put( new byte[]
             { 0x30,
                 0x52, // LDAPMessage ::= SEQUENCE {
-                0x02, 0x01,
+                0x02,
+                0x01,
                 0x01, // messageID MessageID
                 0x66,
                 0x4d, // CHOICE { ..., modifyRequest ModifyRequest, ...
                 // ModifyRequest ::= [APPLICATION 6] SEQUENCE {
                 // object LDAPDN,
-                0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o', 'u', '=', 'u',
-                's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm', 0x30, 0x29,
+                0x04,
+                0x20,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                ',',
+                'o',
+                'u',
+                '=',
+                'u',
+                's',
+                'e',
+                'r',
+                's',
+                ',',
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm',
+                0x30,
+                0x29,
                 // modification SEQUENCE OF SEQUENCE {
-                0x30, 0x11, 0x0A, 0x01, 0x02, // operation ENUMERATED {
+                0x30,
+                0x11,
+                0x0A,
+                0x01,
+                0x02, // operation ENUMERATED {
                 // add (0),
                 // delete (1),
                 // replace (2) },
                 // modification AttributeTypeAndValues } }
-                0x30, 0x0c, // AttributeTypeAndValues ::= SEQUENCE {
-                0x04, 0x01, 'l', // type AttributeDescription,
-                0x31, 0x07, // vals SET OF AttributeValue }
-                0x04, 0x05, 'P', 'a', 'r', 'i', 's',
+                0x30,
+                0x0c, // AttributeTypeAndValues ::= SEQUENCE {
+                0x04,
+                0x01,
+                'l', // type AttributeDescription,
+                0x31,
+                0x07, // vals SET OF AttributeValue }
+                0x04,
+                0x05,
+                'P',
+                'a',
+                'r',
+                'i',
+                's',
 
-                0x30, 0x14, // modification SEQUENCE OF *SEQUENCE* {
-                0x0A, 0x01, 0x00, // operation ENUMERATED {
+                0x30,
+                0x14, // modification SEQUENCE OF *SEQUENCE* {
+                0x0A,
+                0x01,
+                0x00, // operation ENUMERATED {
                 // add (0),
                 // delete (1),
                 // replace (2) },
                 // modification AttributeTypeAndValues } }
-                0x30, 0x0f, // AttributeTypeAndValues ::= SEQUENCE {
+                0x30,
+                0x0f, // AttributeTypeAndValues ::= SEQUENCE {
                 // type AttributeDescription,
-                0x04, 0x05, 'a', 't', 't', 'r', 's', 0x31, 0x06, // vals SET OF AttributeValue }
-                0x04, 0x04, 't', 'e', 's', 't' } );
+                0x04,
+                0x05,
+                'a',
+                't',
+                't',
+                'r',
+                's',
+                0x31,
+                0x06, // vals SET OF AttributeValue }
+                0x04,
+                0x04,
+                't',
+                'e',
+                's',
+                't' } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -156,7 +222,7 @@ public class ModifyRequestTest extends A
             // Check the length
             assertEquals( 0x54, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }
@@ -181,40 +247,106 @@ public class ModifyRequestTest extends A
         stream.put( new byte[]
             { 0x30,
                 0x52, // LDAPMessage ::= SEQUENCE {
-                0x02, 0x01,
+                0x02,
+                0x01,
                 0x01, // messageID MessageID
                 0x66,
                 0x4d, // CHOICE { ..., modifyRequest ModifyRequest, ...
                 // ModifyRequest ::= [APPLICATION 6] SEQUENCE {
                 // object LDAPDN,
-                0x04, 0x20, 'c', 'n', ':', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o', 'u', '=', 'u',
-                's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm', 0x30, 0x29,
+                0x04,
+                0x20,
+                'c',
+                'n',
+                ':',
+                't',
+                'e',
+                's',
+                't',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                ',',
+                'o',
+                'u',
+                '=',
+                'u',
+                's',
+                'e',
+                'r',
+                's',
+                ',',
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm',
+                0x30,
+                0x29,
                 // modification SEQUENCE OF SEQUENCE {
-                0x30, 0x11, 0x0A, 0x01, 0x02, // operation ENUMERATED {
+                0x30,
+                0x11,
+                0x0A,
+                0x01,
+                0x02, // operation ENUMERATED {
                 // add (0),
                 // delete (1),
                 // replace (2) },
                 // modification AttributeTypeAndValues } }
-                0x30, 0x0c, // AttributeTypeAndValues ::= SEQUENCE {
-                0x04, 0x01, 'l', // type AttributeDescription,
-                0x31, 0x07, // vals SET OF AttributeValue }
-                0x04, 0x05, 'P', 'a', 'r', 'i', 's',
+                0x30,
+                0x0c, // AttributeTypeAndValues ::= SEQUENCE {
+                0x04,
+                0x01,
+                'l', // type AttributeDescription,
+                0x31,
+                0x07, // vals SET OF AttributeValue }
+                0x04,
+                0x05,
+                'P',
+                'a',
+                'r',
+                'i',
+                's',
 
-                0x30, 0x14, // modification SEQUENCE OF *SEQUENCE* {
-                0x0A, 0x01, 0x00, // operation ENUMERATED {
+                0x30,
+                0x14, // modification SEQUENCE OF *SEQUENCE* {
+                0x0A,
+                0x01,
+                0x00, // operation ENUMERATED {
                 // add (0),
                 // delete (1),
                 // replace (2) },
                 // modification AttributeTypeAndValues } }
-                0x30, 0x0f, // AttributeTypeAndValues ::= SEQUENCE {
+                0x30,
+                0x0f, // AttributeTypeAndValues ::= SEQUENCE {
                 // type AttributeDescription,
-                0x04, 0x05, 'a', 't', 't', 'r', 's', 0x31, 0x06, // vals SET OF AttributeValue }
-                0x04, 0x04, 't', 'e', 's', 't' } );
+                0x04,
+                0x05,
+                'a',
+                't',
+                't',
+                'r',
+                's',
+                0x31,
+                0x06, // vals SET OF AttributeValue }
+                0x04,
+                0x04,
+                't',
+                'e',
+                's',
+                't' } );
 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -251,35 +383,141 @@ public class ModifyRequestTest extends A
                 0x67,
                 0x04,
                 0x2B, // ModifyRequest object : cn=Tori Amos,ou=playground,dc=apache,dc=org
-                'c', 'n', '=', 'T', 'o', 'r', 'i', ' ', 'A', 'm', 'o', 's', ',', 'o', 'u', '=', 'p', 'l', 'a', 'y',
-                'g', 'r', 'o', 'u', 'n', 'd', ',', 'd', 'c', '=', 'a', 'p', 'a', 'c', 'h', 'e', ',', 'd', 'c', '=',
-                'o', 'r', 'g', 0x30,
+                'c',
+                'n',
+                '=',
+                'T',
+                'o',
+                'r',
+                'i',
+                ' ',
+                'A',
+                'm',
+                'o',
+                's',
+                ',',
+                'o',
+                'u',
+                '=',
+                'p',
+                'l',
+                'a',
+                'y',
+                'g',
+                'r',
+                'o',
+                'u',
+                'n',
+                'd',
+                ',',
+                'd',
+                'c',
+                '=',
+                'a',
+                'p',
+                'a',
+                'c',
+                'h',
+                'e',
+                ',',
+                'd',
+                'c',
+                '=',
+                'o',
+                'r',
+                'g',
+                0x30,
                 0x38, // Modifications
                 0x30,
                 0x24, // Modification
-                0x0A, 0x01,
+                0x0A,
+                0x01,
                 0x00, // Operation = ADD
                 0x30,
                 0x1F, // type : telephoneNumber
-                0x04, 0x0F, 't', 'e', 'l', 'e', 'p', 'h', 'o', 'n', 'e', 'N', 'u', 'm', 'b', 'e', 'r', 0x31,
+                0x04,
+                0x0F,
+                't',
+                'e',
+                'l',
+                'e',
+                'p',
+                'h',
+                'o',
+                'n',
+                'e',
+                'N',
+                'u',
+                'm',
+                'b',
+                'e',
+                'r',
+                0x31,
                 0x0C, // vals : 1234567890
-                0x04, 0x0A, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 0x30,
+                0x04,
+                0x0A,
+                '1',
+                '2',
+                '3',
+                '4',
+                '5',
+                '6',
+                '7',
+                '8',
+                '9',
+                '0',
+                0x30,
                 0x10, // Modification
-                0x0A, 0x01,
+                0x0A,
+                0x01,
                 0x02, // Operation = REPLACE
                 0x30,
                 0x0B, // type : cn
-                0x04, 0x02, 'c', 'n', 0x31,
+                0x04,
+                0x02,
+                'c',
+                'n',
+                0x31,
                 0x05, // vals : XXX
-                0x04, 0x03, 'X', 'X', 'X', ( byte ) 0xA0,
+                0x04,
+                0x03,
+                'X',
+                'X',
+                'X',
+                ( byte ) 0xA0,
                 0x1B, // Control : 2.16.840.1.113730.3.4.2
-                0x30, 0x19, 0x04, 0x17, '2', '.', '1', '6', '.', '8', '4', '0', '.', '1', '.', '1', '1', '3', '7', '3',
-                '0', '.', '3', '.', '4', '.', '2' } );
+                0x30,
+                0x19,
+                0x04,
+                0x17,
+                '2',
+                '.',
+                '1',
+                '6',
+                '.',
+                '8',
+                '4',
+                '0',
+                '.',
+                '1',
+                '.',
+                '1',
+                '1',
+                '3',
+                '7',
+                '3',
+                '0',
+                '.',
+                '3',
+                '.',
+                '4',
+                '.',
+                '2' } );
 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -327,7 +565,7 @@ public class ModifyRequestTest extends A
             // Check the length
             assertEquals( 0x8C, bb.limit() );
 
-            String decodedPdu1 = Strings.dumpBytes(bb.array());
+            String decodedPdu1 = Strings.dumpBytes( bb.array() );
 
             try
             {
@@ -342,7 +580,7 @@ public class ModifyRequestTest extends A
             ModifyRequest modifyRequest2 = ldapMessageContainer.getMessage();
 
             bb = encoder.encodeMessage( modifyRequest2 );
-            String decodedPdu2 = Strings.dumpBytes(bb.array());
+            String decodedPdu2 = Strings.dumpBytes( bb.array() );
 
             assertEquals( decodedPdu1, decodedPdu2 );
         }
@@ -377,43 +615,185 @@ public class ModifyRequestTest extends A
                 ( byte ) 0x93, // ModifyRequest
                 0x04,
                 0x2B, // object : cn=Tori Amos,ou=playground,dc=apache,dc=org
-                'c', 'n', '=', 'T', 'o', 'r', 'i', ' ', 'A', 'm', 'o', 's', ',', 'o', 'u', '=', 'p', 'l', 'a', 'y',
-                'g', 'r', 'o', 'u', 'n', 'd', ',', 'd', 'c', '=', 'a', 'p', 'a', 'c', 'h', 'e', ',', 'd', 'c', '=',
-                'o', 'r', 'g', 0x30,
+                'c',
+                'n',
+                '=',
+                'T',
+                'o',
+                'r',
+                'i',
+                ' ',
+                'A',
+                'm',
+                'o',
+                's',
+                ',',
+                'o',
+                'u',
+                '=',
+                'p',
+                'l',
+                'a',
+                'y',
+                'g',
+                'r',
+                'o',
+                'u',
+                'n',
+                'd',
+                ',',
+                'd',
+                'c',
+                '=',
+                'a',
+                'p',
+                'a',
+                'c',
+                'h',
+                'e',
+                ',',
+                'd',
+                'c',
+                '=',
+                'o',
+                'r',
+                'g',
+                0x30,
                 0x64, // Modifications
                 0x30,
                 0x14, // Modification
-                0x0A, 0x01,
+                0x0A,
+                0x01,
                 0x01, // Operation : Delete
                 0x30,
                 0x0F, // type : description
-                0x04, 0x0B, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6F, 0x6E, 0x31,
+                0x04,
+                0x0B,
+                0x64,
+                0x65,
+                0x73,
+                0x63,
+                0x72,
+                0x69,
+                0x70,
+                0x74,
+                0x69,
+                0x6F,
+                0x6E,
+                0x31,
                 0x00, // Vals = null
                 0x30,
                 0x25, // Modification
-                0x0A, 0x01,
+                0x0A,
+                0x01,
                 0x00, // Operation : Add
                 0x30,
                 0x20, // type : telephoneNumber
-                0x04, 0x0F, 't', 'e', 'l', 'e', 'p', 'h', 'o', 'n', 'e', 'N', 'u', 'm', 'b', 'e', 'r', 0x31,
+                0x04,
+                0x0F,
+                't',
+                'e',
+                'l',
+                'e',
+                'p',
+                'h',
+                'o',
+                'n',
+                'e',
+                'N',
+                'u',
+                'm',
+                'b',
+                'e',
+                'r',
+                0x31,
                 0x0D, // Vals : 01234567890
-                0x04, 0x0B, '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 0x30,
+                0x04,
+                0x0B,
+                '0',
+                '1',
+                '2',
+                '3',
+                '4',
+                '5',
+                '6',
+                '7',
+                '8',
+                '9',
+                '0',
+                0x30,
                 0x25, // Modification
-                0x0A, 0x01,
+                0x0A,
+                0x01,
                 0x00, // Operation : Add
                 0x30,
                 0x20, // type : telephoneNumber
-                0x04, 0x0F, 't', 'e', 'l', 'e', 'p', 'h', 'o', 'n', 'e', 'N', 'u', 'm', 'b', 'e', 'r', 0x31,
+                0x04,
+                0x0F,
+                't',
+                'e',
+                'l',
+                'e',
+                'p',
+                'h',
+                'o',
+                'n',
+                'e',
+                'N',
+                'u',
+                'm',
+                'b',
+                'e',
+                'r',
+                0x31,
                 0x0D, // Vals : 01234567890
-                0x04, 0x0B, '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', ( byte ) 0xA0,
+                0x04,
+                0x0B,
+                '0',
+                '1',
+                '2',
+                '3',
+                '4',
+                '5',
+                '6',
+                '7',
+                '8',
+                '9',
+                '0',
+                ( byte ) 0xA0,
                 0x1B, // Controls : 2.16.840.1.113730.3.4.2
-                0x30, 0x19, 0x04, 0x17, '2', '.', '1', '6', '.', '8', '4', '0', '.', '1', '.', '1', '1', '3', '7', '3',
-                '0', '.', '3', '.', '4', '.', '2' } );
+                0x30,
+                0x19,
+                0x04,
+                0x17,
+                '2',
+                '.',
+                '1',
+                '6',
+                '.',
+                '8',
+                '4',
+                '0',
+                '.',
+                '1',
+                '.',
+                '1',
+                '1',
+                '3',
+                '7',
+                '3',
+                '0',
+                '.',
+                '3',
+                '.',
+                '4',
+                '.',
+                '2' } );
 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -470,7 +850,7 @@ public class ModifyRequestTest extends A
             // Check the length
             assertEquals( 0xB9, bb.limit() );
 
-            String decodedPdu1 = Strings.dumpBytes(bb.array());
+            String decodedPdu1 = Strings.dumpBytes( bb.array() );
 
             try
             {
@@ -485,7 +865,7 @@ public class ModifyRequestTest extends A
             ModifyRequest modifyRequest2 = ldapMessageContainer.getMessage();
 
             bb = encoder.encodeMessage( modifyRequest2 );
-            String decodedPdu2 = Strings.dumpBytes(bb.array());
+            String decodedPdu2 = Strings.dumpBytes( bb.array() );
 
             assertEquals( decodedPdu1, decodedPdu2 );
         }
@@ -510,38 +890,113 @@ public class ModifyRequestTest extends A
         stream.put( new byte[]
             { 0x30,
                 0x5A, // LDAPMessage ::= SEQUENCE {
-                0x02, 0x01,
+                0x02,
+                0x01,
                 0x01, // messageID MessageID
                 0x66,
                 0x55, // CHOICE { ..., modifyRequest ModifyRequest, ...
                 // ModifyRequest ::= [APPLICATION 6] SEQUENCE {
                 // object LDAPDN,
-                0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o', 'u', '=', 'u',
-                's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm', 0x30, 0x31, // modification SEQUENCE OF SEQUENCE {
-                0x30, 0x19, 0x0A, 0x01, 0x02, // operation ENUMERATED {
+                0x04,
+                0x20,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                ',',
+                'o',
+                'u',
+                '=',
+                'u',
+                's',
+                'e',
+                'r',
+                's',
+                ',',
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm',
+                0x30,
+                0x31, // modification SEQUENCE OF SEQUENCE {
+                0x30,
+                0x19,
+                0x0A,
+                0x01,
+                0x02, // operation ENUMERATED {
                 // add (0),
                 // delete (1),
                 // replace (2) },
                 // modification AttributeTypeAndValues } }
-                0x30, 0x14, // AttributeTypeAndValues ::= SEQUENCE {
-                0x04, 0x01, 'l', // type AttributeDescription,
-                0x31, 0x0F, // vals SET OF AttributeValue }
-                0x04, 0x05, 'P', 'a', 'r', 'i', 's', 0x04, 0x06, 'L', 'o', 'n', 'd', 'o', 'n', 0x30, 0x14, // modification SEQUENCE OF *SEQUENCE*  {
-                0x0A, 0x01, 0x00, // operation ENUMERATED {
+                0x30,
+                0x14, // AttributeTypeAndValues ::= SEQUENCE {
+                0x04,
+                0x01,
+                'l', // type AttributeDescription,
+                0x31,
+                0x0F, // vals SET OF AttributeValue }
+                0x04,
+                0x05,
+                'P',
+                'a',
+                'r',
+                'i',
+                's',
+                0x04,
+                0x06,
+                'L',
+                'o',
+                'n',
+                'd',
+                'o',
+                'n',
+                0x30,
+                0x14, // modification SEQUENCE OF *SEQUENCE*  {
+                0x0A,
+                0x01,
+                0x00, // operation ENUMERATED {
                 // add (0),
                 // delete (1),
                 // replace (2) },
                 // modification AttributeTypeAndValues } }
-                0x30, 0x0f, // AttributeTypeAndValues ::= SEQUENCE {
+                0x30,
+                0x0f, // AttributeTypeAndValues ::= SEQUENCE {
                 // type AttributeDescription,
-                0x04, 0x05, 'a', 't', 't', 'r', 's', 0x31, 0x06, // vals SET OF AttributeValue }
-                0x04, 0x04, 't', 'e', 's', 't' } );
+                0x04,
+                0x05,
+                'a',
+                't',
+                't',
+                'r',
+                's',
+                0x31,
+                0x06, // vals SET OF AttributeValue }
+                0x04,
+                0x04,
+                't',
+                'e',
+                's',
+                't' } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -589,7 +1044,7 @@ public class ModifyRequestTest extends A
             // Check the length
             assertEquals( 0x5C, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }
@@ -615,14 +1070,17 @@ public class ModifyRequestTest extends A
 
         stream.put( new byte[]
             { 0x30, 0x05, // LdapMessage
-                0x02, 0x01, 0x31, // Message ID : 49
-                0x66, 0x00 // ModifyRequest
-            } );
+                0x02,
+                0x01,
+                0x31, // Message ID : 49
+                0x66,
+                0x00 // ModifyRequest
+        } );
 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -650,14 +1108,18 @@ public class ModifyRequestTest extends A
 
         stream.put( new byte[]
             { 0x30, 0x07, // LdapMessage
-                0x02, 0x01, 0x31, // Message ID : 49
-                0x66, 0x02, // ModifyRequest
-                0x04, 0x00 } );
+                0x02,
+                0x01,
+                0x31, // Message ID : 49
+                0x66,
+                0x02, // ModifyRequest
+                0x04,
+                0x00 } );
 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -686,17 +1148,50 @@ public class ModifyRequestTest extends A
         stream.put( new byte[]
             { 0x30,
                 0x27, // LdapMessage
-                0x02, 0x01,
+                0x02,
+                0x01,
                 0x31, // Message ID : 49
                 0x66,
                 0x22, // ModifyRequest
-                0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o', 'u', '=', 'u',
-                's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm' } );
+                0x04,
+                0x20,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                ',',
+                'o',
+                'u',
+                '=',
+                'u',
+                's',
+                'e',
+                'r',
+                's',
+                ',',
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm' } );
 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -725,17 +1220,52 @@ public class ModifyRequestTest extends A
         stream.put( new byte[]
             { 0x30,
                 0x29, // LdapMessage
-                0x02, 0x01,
+                0x02,
+                0x01,
                 0x31, // Message ID : 49
                 0x66,
                 0x24, // ModifyRequest
-                0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o', 'u', '=', 'u',
-                's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm', 0x30, 0x00 } );
+                0x04,
+                0x20,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                ',',
+                'o',
+                'u',
+                '=',
+                'u',
+                's',
+                'e',
+                'r',
+                's',
+                ',',
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm',
+                0x30,
+                0x00 } );
 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -764,17 +1294,54 @@ public class ModifyRequestTest extends A
         stream.put( new byte[]
             { 0x30,
                 0x2B, // LdapMessage
-                0x02, 0x01,
+                0x02,
+                0x01,
                 0x31, // Message ID : 49
                 0x66,
                 0x26, // ModifyRequest
-                0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o', 'u', '=', 'u',
-                's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm', 0x30, 0x02, 0x30, 0x00 } );
+                0x04,
+                0x20,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                ',',
+                'o',
+                'u',
+                '=',
+                'u',
+                's',
+                'e',
+                'r',
+                's',
+                ',',
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm',
+                0x30,
+                0x02,
+                0x30,
+                0x00 } );
 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -809,14 +1376,51 @@ public class ModifyRequestTest extends A
                 0x31, // Message ID : 49
                 0x66,
                 0x28, // ModifyRequest
-                0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o', 'u', '=', 'u',
-                's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm', 0x30, 0x04, 0x30, 0x02, 0x0A,
+                0x04,
+                0x20,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                ',',
+                'o',
+                'u',
+                '=',
+                'u',
+                's',
+                'e',
+                'r',
+                's',
+                ',',
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm',
+                0x30,
+                0x04,
+                0x30,
+                0x02,
+                0x0A,
                 0x00 } );
 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -851,14 +1455,52 @@ public class ModifyRequestTest extends A
                 0x31, // Message ID : 49
                 0x66,
                 0x29, // ModifyRequest
-                0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o', 'u', '=', 'u',
-                's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm', 0x30, 0x05, 0x30, 0x03, 0x0A,
-                0x01, 0x04 } );
+                0x04,
+                0x20,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                ',',
+                'o',
+                'u',
+                '=',
+                'u',
+                's',
+                'e',
+                'r',
+                's',
+                ',',
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm',
+                0x30,
+                0x05,
+                0x30,
+                0x03,
+                0x0A,
+                0x01,
+                0x04 } );
 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -894,14 +1536,52 @@ public class ModifyRequestTest extends A
                 0x31, // Message ID : 49
                 0x66,
                 0x29, // ModifyRequest
-                0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o', 'u', '=', 'u',
-                's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm', 0x30, 0x05, 0x30, 0x03, 0x0A,
-                0x01, 0x00 } );
+                0x04,
+                0x20,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                ',',
+                'o',
+                'u',
+                '=',
+                'u',
+                's',
+                'e',
+                'r',
+                's',
+                ',',
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm',
+                0x30,
+                0x05,
+                0x30,
+                0x03,
+                0x0A,
+                0x01,
+                0x00 } );
 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -937,14 +1617,54 @@ public class ModifyRequestTest extends A
                 0x31, // Message ID : 49
                 0x66,
                 0x2B, // ModifyRequest
-                0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o', 'u', '=', 'u',
-                's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm', 0x30, 0x07, 0x30, 0x05, 0x0A,
-                0x01, 0x00, 0x30, 0x00 } );
+                0x04,
+                0x20,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                ',',
+                'o',
+                'u',
+                '=',
+                'u',
+                's',
+                'e',
+                'r',
+                's',
+                ',',
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm',
+                0x30,
+                0x07,
+                0x30,
+                0x05,
+                0x0A,
+                0x01,
+                0x00,
+                0x30,
+                0x00 } );
 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -980,14 +1700,56 @@ public class ModifyRequestTest extends A
                 0x31, // Message ID : 49
                 0x66,
                 0x2D, // ModifyRequest
-                0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o', 'u', '=', 'u',
-                's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm', 0x30, 0x09, 0x30, 0x07, 0x0A,
-                0x01, 0x00, 0x30, 0x02, 0x04, 0x00 } );
+                0x04,
+                0x20,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                ',',
+                'o',
+                'u',
+                '=',
+                'u',
+                's',
+                'e',
+                'r',
+                's',
+                ',',
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm',
+                0x30,
+                0x09,
+                0x30,
+                0x07,
+                0x0A,
+                0x01,
+                0x00,
+                0x30,
+                0x02,
+                0x04,
+                0x00 } );
 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -1000,7 +1762,7 @@ public class ModifyRequestTest extends A
         {
             assertTrue( de instanceof ResponseCarryingException );
             Message response = ( ( ResponseCarryingException ) de ).getResponse();
-            assertTrue( response instanceof ModifyResponseImpl);
+            assertTrue( response instanceof ModifyResponseImpl );
             assertEquals( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, ( ( ModifyResponseImpl ) response ).getLdapResult()
                 .getResultCode() );
             return;
@@ -1028,14 +1790,57 @@ public class ModifyRequestTest extends A
                 0x31, // Message ID : 49
                 0x66,
                 0x2E, // ModifyRequest
-                0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o', 'u', '=', 'u',
-                's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm', 0x30, 0x0A, 0x30, 0x08, 0x0A,
-                0x01, 0x00, 0x30, 0x03, 0x04, 0x01, 'l' } );
+                0x04,
+                0x20,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                ',',
+                'o',
+                'u',
+                '=',
+                'u',
+                's',
+                'e',
+                'r',
+                's',
+                ',',
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm',
+                0x30,
+                0x0A,
+                0x30,
+                0x08,
+                0x0A,
+                0x01,
+                0x00,
+                0x30,
+                0x03,
+                0x04,
+                0x01,
+                'l' } );
 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -1071,15 +1876,60 @@ public class ModifyRequestTest extends A
                 0x31, // Message ID : 49
                 0x66,
                 0x30, // ModifyRequest
-                0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o', 'u', '=', 'u',
-                's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm', 0x30, 0x0C, 0x30, 0x0A, 0x0A,
-                0x01, 0x00, 0x30, 0x05, 0x04, 0x01, 'l', 0x31, 0x00 } );
+                0x04,
+                0x20,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                ',',
+                'o',
+                'u',
+                '=',
+                'u',
+                's',
+                'e',
+                'r',
+                's',
+                ',',
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm',
+                0x30,
+                0x0C,
+                0x30,
+                0x0A,
+                0x0A,
+                0x01,
+                0x00,
+                0x30,
+                0x05,
+                0x04,
+                0x01,
+                'l',
+                0x31,
+                0x00 } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -1117,7 +1967,7 @@ public class ModifyRequestTest extends A
             // Check the length
             assertEquals( 0x37, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }
@@ -1149,18 +1999,89 @@ public class ModifyRequestTest extends A
                 0x31, // Message ID : 49
                 0x66,
                 0x30, // ModifyRequest
-                0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o', 'u', '=', 'u',
-                's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm', 0x30, 0x0C, 0x30, 0x0A, 0x0A,
-                0x01, 0x00, 0x30, 0x05, 0x04, 0x01, 'l', 0x31, 0x00, ( byte ) 0xA0,
+                0x04,
+                0x20,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                ',',
+                'o',
+                'u',
+                '=',
+                'u',
+                's',
+                'e',
+                'r',
+                's',
+                ',',
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm',
+                0x30,
+                0x0C,
+                0x30,
+                0x0A,
+                0x0A,
+                0x01,
+                0x00,
+                0x30,
+                0x05,
+                0x04,
+                0x01,
+                'l',
+                0x31,
+                0x00,
+                ( byte ) 0xA0,
                 0x1B, // A control
-                0x30, 0x19, 0x04, 0x17, 0x32, 0x2E, 0x31, 0x36, 0x2E, 0x38, 0x34, 0x30, 0x2E, 0x31, 0x2E, 0x31, 0x31,
-                0x33, 0x37, 0x33, 0x30, 0x2E, 0x33, 0x2E, 0x34, 0x2E, 0x32 } );
+                0x30,
+                0x19,
+                0x04,
+                0x17,
+                0x32,
+                0x2E,
+                0x31,
+                0x36,
+                0x2E,
+                0x38,
+                0x34,
+                0x30,
+                0x2E,
+                0x31,
+                0x2E,
+                0x31,
+                0x31,
+                0x33,
+                0x37,
+                0x33,
+                0x30,
+                0x2E,
+                0x33,
+                0x2E,
+                0x34,
+                0x2E,
+                0x32 } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -1196,9 +2117,10 @@ public class ModifyRequestTest extends A
         assertEquals( 1, controls.size() );
 
         @SuppressWarnings("unchecked")
-        CodecControl<Control> control = (org.apache.directory.shared.ldap.codec.api.CodecControl<Control> )modifyRequest.getControl( "2.16.840.1.113730.3.4.2" );
+        CodecControl<Control> control = ( org.apache.directory.shared.ldap.codec.api.CodecControl<Control> ) modifyRequest
+            .getControl( "2.16.840.1.113730.3.4.2" );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
-        assertEquals( "", Strings.dumpBytes((byte[]) control.getValue()) );
+        assertEquals( "", Strings.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the encoding
         try
@@ -1208,7 +2130,7 @@ public class ModifyRequestTest extends A
             // Check the length
             assertEquals( 0x54, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }
@@ -1240,15 +2162,66 @@ public class ModifyRequestTest extends A
                 0x31, // Message ID : 49
                 0x66,
                 0x36, // ModifyRequest
-                0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o', 'u', '=', 'u',
-                's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm', 0x30, 0x12, 0x30, 0x10, 0x0A,
-                0x01, 0x00, 0x30, 0x0B, 0x04, 0x01, 'l', 0x31, 0x06, 0x04, 0x01, 'a', 0x04, 0x01, 'b' } );
+                0x04,
+                0x20,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                ',',
+                'o',
+                'u',
+                '=',
+                'u',
+                's',
+                'e',
+                'r',
+                's',
+                ',',
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm',
+                0x30,
+                0x12,
+                0x30,
+                0x10,
+                0x0A,
+                0x01,
+                0x00,
+                0x30,
+                0x0B,
+                0x04,
+                0x01,
+                'l',
+                0x31,
+                0x06,
+                0x04,
+                0x01,
+                'a',
+                0x04,
+                0x01,
+                'b' } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -1289,7 +2262,7 @@ public class ModifyRequestTest extends A
             // Check the length
             assertEquals( 0x3D, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }

Modified: directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java?rev=1235364&r1=1235363&r2=1235364&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java Tue Jan 24 17:27:00 2012
@@ -66,24 +66,31 @@ public class ModifyResponseTest extends 
 
         stream.put( new byte[]
             { 0x30, 0x0C, // LDAPMessage ::=SEQUENCE {
-                0x02, 0x01, 0x01, // messageID MessageID
-                0x67, 0x07, // CHOICE { ..., modifyResponse ModifyResponse, ...
+                0x02,
+                0x01,
+                0x01, // messageID MessageID
+                0x67,
+                0x07, // CHOICE { ..., modifyResponse ModifyResponse, ...
                 // ModifyResponse ::= [APPLICATION 7] LDAPResult
-                0x0A, 0x01, 0x00, // LDAPResult ::= SEQUENCE {
+                0x0A,
+                0x01,
+                0x00, // LDAPResult ::= SEQUENCE {
                 // resultCode ENUMERATED {
                 // success (0), ...
                 // },
-                0x04, 0x00, // matchedDN LDAPDN,
-                0x04, 0x00 // errorMessage LDAPString,
+                0x04,
+                0x00, // matchedDN LDAPDN,
+                0x04,
+                0x00 // errorMessage LDAPString,
             // referral [3] Referral OPTIONAL }
             // }
-            } );
+        } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyResponseDecorator>( codec );
 
         // Decode a ModifyResponse PDU
@@ -113,7 +120,7 @@ public class ModifyResponseTest extends 
             // Check the length
             assertEquals( 0x0E, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }
@@ -138,7 +145,8 @@ public class ModifyResponseTest extends 
         stream.put( new byte[]
             { 0x30,
                 0x29, // LDAPMessage ::=SEQUENCE {
-                0x02, 0x01,
+                0x02,
+                0x01,
                 0x01, // messageID MessageID
                 0x67,
                 0x07, // CHOICE { ..., modifyResponse ModifyResponse, ...
@@ -157,14 +165,39 @@ public class ModifyResponseTest extends 
                 // }
                 ( byte ) 0xA0,
                 0x1B, // A control
-                0x30, 0x19, 0x04, 0x17, 0x32, 0x2E, 0x31, 0x36, 0x2E, 0x38, 0x34, 0x30, 0x2E, 0x31, 0x2E, 0x31, 0x31,
-                0x33, 0x37, 0x33, 0x30, 0x2E, 0x33, 0x2E, 0x34, 0x2E, 0x32 } );
+                0x30,
+                0x19,
+                0x04,
+                0x17,
+                0x32,
+                0x2E,
+                0x31,
+                0x36,
+                0x2E,
+                0x38,
+                0x34,
+                0x30,
+                0x2E,
+                0x31,
+                0x2E,
+                0x31,
+                0x31,
+                0x33,
+                0x37,
+                0x33,
+                0x30,
+                0x2E,
+                0x33,
+                0x2E,
+                0x34,
+                0x2E,
+                0x32 } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyResponseDecorator>( codec );
 
         // Decode a ModifyResponse PDU
@@ -192,9 +225,10 @@ public class ModifyResponseTest extends 
         assertEquals( 1, controls.size() );
 
         @SuppressWarnings("unchecked")
-        CodecControl<Control> control = (org.apache.directory.shared.ldap.codec.api.CodecControl<Control> )controls.get( "2.16.840.1.113730.3.4.2" );
+        CodecControl<Control> control = ( org.apache.directory.shared.ldap.codec.api.CodecControl<Control> ) controls
+            .get( "2.16.840.1.113730.3.4.2" );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
-        assertEquals( "", Strings.dumpBytes((byte[]) control.getValue()) );
+        assertEquals( "", Strings.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the encoding
         try
@@ -204,7 +238,7 @@ public class ModifyResponseTest extends 
             // Check the length
             assertEquals( 0x2B, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }
@@ -228,14 +262,17 @@ public class ModifyResponseTest extends 
 
         stream.put( new byte[]
             { 0x30, 0x05, // LDAPMessage ::=SEQUENCE {
-                0x02, 0x01, 0x01, // messageID MessageID
-                0x67, 0x00, // CHOICE { ..., modifyResponse ModifyResponse, ...
+                0x02,
+                0x01,
+                0x01, // messageID MessageID
+                0x67,
+                0x00, // CHOICE { ..., modifyResponse ModifyResponse, ...
             } );
 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyResponseDecorator>( codec );
 
         // Decode a ModifyResponse message

Modified: directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java?rev=1235364&r1=1235363&r2=1235364&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java Tue Jan 24 17:27:00 2012
@@ -78,19 +78,79 @@ public class ModifyDNRequestTest extends
                 // ...
                 // ModifyDNRequest ::= [APPLICATION 12] SEQUENCE {
                 // entry LDAPDN,
-                0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o', 'u', '=', 'u',
-                's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm',
+                0x04,
+                0x20,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                ',',
+                'o',
+                'u',
+                '=',
+                'u',
+                's',
+                'e',
+                'r',
+                's',
+                ',',
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm',
                 // newrdn RelativeLDAPDN,
-                0x04, 0x0F, 'c', 'n', '=', 't', 'e', 's', 't', 'D', 'N', 'M', 'o', 'd', 'i', 'f', 'y', 0x01, 0x01,
+                0x04,
+                0x0F,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'D',
+                'N',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                0x01,
+                0x01,
                 0x00, // deleteoldrdn BOOLEAN,
                 // newSuperior [0] LDAPDN OPTIONAL }
-                ( byte ) 0x80, 0x09, 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm' } );
+                ( byte ) 0x80,
+                0x09,
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm' } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a ModifyRequest Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         try
@@ -119,7 +179,7 @@ public class ModifyDNRequestTest extends
             // Check the length
             assertEquals( 0x48, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }
@@ -153,18 +213,78 @@ public class ModifyDNRequestTest extends
                 // ...
                 // ModifyDNRequest ::= [APPLICATION 12] SEQUENCE {
                 // entry LDAPDN,
-                0x04, 0x20, 'c', 'n', ':', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o', 'u', '=', 'u',
-                's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm',
+                0x04,
+                0x20,
+                'c',
+                'n',
+                ':',
+                't',
+                'e',
+                's',
+                't',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                ',',
+                'o',
+                'u',
+                '=',
+                'u',
+                's',
+                'e',
+                'r',
+                's',
+                ',',
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm',
                 // newrdn RelativeLDAPDN,
-                0x04, 0x0F, 'c', 'n', '=', 't', 'e', 's', 't', 'D', 'N', 'M', 'o', 'd', 'i', 'f', 'y', 0x01, 0x01,
+                0x04,
+                0x0F,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'D',
+                'N',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                0x01,
+                0x01,
                 0x00, // deleteoldrdn BOOLEAN,
                 // newSuperior [0] LDAPDN OPTIONAL }
-                ( byte ) 0x80, 0x09, 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm' } );
+                ( byte ) 0x80,
+                0x09,
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm' } );
 
         stream.flip();
 
         // Allocate a ModifyRequest Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         try
@@ -207,18 +327,78 @@ public class ModifyDNRequestTest extends
                 // ...
                 // ModifyDNRequest ::= [APPLICATION 12] SEQUENCE {
                 // entry LDAPDN,
-                0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o', 'u', '=', 'u',
-                's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm',
+                0x04,
+                0x20,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                ',',
+                'o',
+                'u',
+                '=',
+                'u',
+                's',
+                'e',
+                'r',
+                's',
+                ',',
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm',
                 // newrdn RelativeLDAPDN,
-                0x04, 0x0F, 'c', 'n', ':', 't', 'e', 's', 't', 'D', 'N', 'M', 'o', 'd', 'i', 'f', 'y', 0x01, 0x01,
+                0x04,
+                0x0F,
+                'c',
+                'n',
+                ':',
+                't',
+                'e',
+                's',
+                't',
+                'D',
+                'N',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                0x01,
+                0x01,
                 0x00, // deleteoldrdn BOOLEAN,
                 // newSuperior [0] LDAPDN OPTIONAL }
-                ( byte ) 0x80, 0x09, 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm' } );
+                ( byte ) 0x80,
+                0x09,
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm' } );
 
         stream.flip();
 
         // Allocate a ModifyRequest Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         try
@@ -261,18 +441,78 @@ public class ModifyDNRequestTest extends
                 // ...
                 // ModifyDNRequest ::= [APPLICATION 12] SEQUENCE {
                 // entry LDAPDN,
-                0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o', 'u', '=', 'u',
-                's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm',
+                0x04,
+                0x20,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                ',',
+                'o',
+                'u',
+                '=',
+                'u',
+                's',
+                'e',
+                'r',
+                's',
+                ',',
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm',
                 // newrdn RelativeLDAPDN,
-                0x04, 0x0F, 'c', 'n', '=', 't', 'e', 's', 't', 'D', 'N', 'M', 'o', 'd', 'i', 'f', 'y', 0x01, 0x01,
+                0x04,
+                0x0F,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'D',
+                'N',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                0x01,
+                0x01,
                 0x00, // deleteoldrdn BOOLEAN,
                 // newSuperior [0] LDAPDN OPTIONAL }
-                ( byte ) 0x80, 0x09, 'o', 'u', ':', 's', 'y', 's', 't', 'e', 'm' } );
+                ( byte ) 0x80,
+                0x09,
+                'o',
+                'u',
+                ':',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm' } );
 
         stream.flip();
 
         // Allocate a ModifyRequest Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         try
@@ -284,7 +524,7 @@ public class ModifyDNRequestTest extends
             assertTrue( de instanceof ResponseCarryingException );
             Message response = ( ( ResponseCarryingException ) de ).getResponse();
             assertTrue( response instanceof ModifyDnResponseImpl );
-            assertEquals( ResultCodeEnum.INVALID_DN_SYNTAX, ( (ModifyDnResponseImpl) response ).getLdapResult()
+            assertEquals( ResultCodeEnum.INVALID_DN_SYNTAX, ( ( ModifyDnResponseImpl ) response ).getLdapResult()
                 .getResultCode() );
             return;
         }
@@ -315,24 +555,108 @@ public class ModifyDNRequestTest extends
                 // ...
                 // ModifyDNRequest ::= [APPLICATION 12] SEQUENCE {
                 // entry LDAPDN,
-                0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o', 'u', '=', 'u',
-                's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e',
+                0x04,
+                0x20,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                ',',
+                'o',
+                'u',
+                '=',
+                'u',
+                's',
+                'e',
+                'r',
+                's',
+                ',',
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
                 'm',
                 // newrdn RelativeLDAPDN,
-                0x04, 0x0F, 'c', 'n', '=', 't', 'e', 's', 't', 'D', 'N', 'M', 'o', 'd', 'i', 'f', 'y', 0x01,
+                0x04,
+                0x0F,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'D',
+                'N',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                0x01,
                 0x01,
                 0x00, // deleteoldrdn BOOLEAN,
                 // newSuperior [0] LDAPDN OPTIONAL }
-                ( byte ) 0x80, 0x09, 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm', ( byte ) 0xA0,
+                ( byte ) 0x80,
+                0x09,
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm',
+                ( byte ) 0xA0,
                 0x1B, // A control
-                0x30, 0x19, 0x04, 0x17, 0x32, 0x2E, 0x31, 0x36, 0x2E, 0x38, 0x34, 0x30, 0x2E, 0x31, 0x2E, 0x31, 0x31,
-                0x33, 0x37, 0x33, 0x30, 0x2E, 0x33, 0x2E, 0x34, 0x2E, 0x32 } );
+                0x30,
+                0x19,
+                0x04,
+                0x17,
+                0x32,
+                0x2E,
+                0x31,
+                0x36,
+                0x2E,
+                0x38,
+                0x34,
+                0x30,
+                0x2E,
+                0x31,
+                0x2E,
+                0x31,
+                0x31,
+                0x33,
+                0x37,
+                0x33,
+                0x30,
+                0x2E,
+                0x33,
+                0x2E,
+                0x34,
+                0x2E,
+                0x32 } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a ModifyRequest Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         try
@@ -359,9 +683,10 @@ public class ModifyDNRequestTest extends
         assertEquals( 1, controls.size() );
 
         @SuppressWarnings("unchecked")
-        CodecControl<Control> control = (org.apache.directory.shared.ldap.codec.api.CodecControl<Control> )modifyDnRequest.getControl( "2.16.840.1.113730.3.4.2" );
+        CodecControl<Control> control = ( org.apache.directory.shared.ldap.codec.api.CodecControl<Control> ) modifyDnRequest
+            .getControl( "2.16.840.1.113730.3.4.2" );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
-        assertEquals( "", Strings.dumpBytes((byte[]) control.getValue()) );
+        assertEquals( "", Strings.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the encoding
         try
@@ -371,7 +696,7 @@ public class ModifyDNRequestTest extends
             // Check the length
             assertEquals( 0x65, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }
@@ -404,18 +729,69 @@ public class ModifyDNRequestTest extends
                 // ...
                 // ModifyDNRequest ::= [APPLICATION 12] SEQUENCE {
                 // entry LDAPDN,
-                0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o', 'u', '=', 'u',
-                's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm',
+                0x04,
+                0x20,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                ',',
+                'o',
+                'u',
+                '=',
+                'u',
+                's',
+                'e',
+                'r',
+                's',
+                ',',
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm',
                 // newrdn RelativeLDAPDN,
-                0x04, 0x0F, 'c', 'n', '=', 't', 'e', 's', 't', 'D', 'N', 'M', 'o', 'd', 'i', 'f', 'y', 0x01, 0x01, 0x00 // deleteoldrdn BOOLEAN,
+                0x04,
+                0x0F,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'D',
+                'N',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                0x01,
+                0x01,
+                0x00 // deleteoldrdn BOOLEAN,
             // newSuperior [0] LDAPDN OPTIONAL }
-            } );
+        } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a ModifyRequest Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         try
@@ -443,7 +819,7 @@ public class ModifyDNRequestTest extends
             // Check the length
             assertEquals( 0x3D, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }
@@ -477,24 +853,97 @@ public class ModifyDNRequestTest extends
                 // ...
                 // ModifyDNRequest ::= [APPLICATION 12] SEQUENCE {
                 // entry LDAPDN,
-                0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o', 'u', '=', 'u',
-                's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e',
+                0x04,
+                0x20,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                ',',
+                'o',
+                'u',
+                '=',
+                'u',
+                's',
+                'e',
+                'r',
+                's',
+                ',',
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
                 'm',
                 // newrdn RelativeLDAPDN,
-                0x04, 0x0F, 'c', 'n', '=', 't', 'e', 's', 't', 'D', 'N', 'M', 'o', 'd', 'i', 'f', 'y', 0x01,
+                0x04,
+                0x0F,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'D',
+                'N',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                0x01,
                 0x01,
                 0x00, // deleteoldrdn BOOLEAN,
                 // newSuperior [0] LDAPDN OPTIONAL }
                 ( byte ) 0xA0,
                 0x1B, // A control
-                0x30, 0x19, 0x04, 0x17, 0x32, 0x2E, 0x31, 0x36, 0x2E, 0x38, 0x34, 0x30, 0x2E, 0x31, 0x2E, 0x31, 0x31,
-                0x33, 0x37, 0x33, 0x30, 0x2E, 0x33, 0x2E, 0x34, 0x2E, 0x32 } );
+                0x30,
+                0x19,
+                0x04,
+                0x17,
+                0x32,
+                0x2E,
+                0x31,
+                0x36,
+                0x2E,
+                0x38,
+                0x34,
+                0x30,
+                0x2E,
+                0x31,
+                0x2E,
+                0x31,
+                0x31,
+                0x33,
+                0x37,
+                0x33,
+                0x30,
+                0x2E,
+                0x33,
+                0x2E,
+                0x34,
+                0x2E,
+                0x32 } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a ModifyRequest Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         try
@@ -522,9 +971,10 @@ public class ModifyDNRequestTest extends
         assertTrue( modifyDnRequest.hasControl( "2.16.840.1.113730.3.4.2" ) );
 
         @SuppressWarnings("unchecked")
-        CodecControl<Control> control = (org.apache.directory.shared.ldap.codec.api.CodecControl<Control> )modifyDnRequest.getControl( "2.16.840.1.113730.3.4.2" );
+        CodecControl<Control> control = ( org.apache.directory.shared.ldap.codec.api.CodecControl<Control> ) modifyDnRequest
+            .getControl( "2.16.840.1.113730.3.4.2" );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
-        assertEquals( "", Strings.dumpBytes((byte[]) control.getValue()) );
+        assertEquals( "", Strings.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the encoding
         try
@@ -534,7 +984,7 @@ public class ModifyDNRequestTest extends
             // Check the length
             assertEquals( 0x5A, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }
@@ -560,15 +1010,18 @@ public class ModifyDNRequestTest extends
 
         stream.put( new byte[]
             { 0x30, 0x05, // LDAPMessage ::= SEQUENCE {
-                0x02, 0x01, 0x01, // messageID MessageID
-                0x6C, 0x00 // CHOICE { ..., modifyDNRequest ModifyDNRequest,
+                0x02,
+                0x01,
+                0x01, // messageID MessageID
+                0x6C,
+                0x00 // CHOICE { ..., modifyDNRequest ModifyDNRequest,
             // ...
-            } );
+        } );
 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         // Decode a ModifyDNRequest PDU
@@ -596,15 +1049,19 @@ public class ModifyDNRequestTest extends
 
         stream.put( new byte[]
             { 0x30, 0x07, // LDAPMessage ::= SEQUENCE {
-                0x02, 0x01, 0x01, // messageID MessageID
-                0x6C, 0x02, // CHOICE { ..., modifyDNRequest ModifyDNRequest,
+                0x02,
+                0x01,
+                0x01, // messageID MessageID
+                0x6C,
+                0x02, // CHOICE { ..., modifyDNRequest ModifyDNRequest,
                 // ...
-                0x04, 0x00 } );
+                0x04,
+                0x00 } );
 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         // Decode a ModifyDNRequest PDU
@@ -633,18 +1090,53 @@ public class ModifyDNRequestTest extends
         stream.put( new byte[]
             { 0x30,
                 0x2B, // LDAPMessage ::= SEQUENCE {
-                0x02, 0x01,
+                0x02,
+                0x01,
                 0x01, // messageID MessageID
                 0x6C,
                 0x26, // CHOICE { ..., modifyDNRequest ModifyDNRequest,
                 // ...
-                0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o', 'u', '=', 'u',
-                's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm', 0x04, 0x00 } );
+                0x04,
+                0x20,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                ',',
+                'o',
+                'u',
+                '=',
+                'u',
+                's',
+                'e',
+                'r',
+                's',
+                ',',
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm',
+                0x04,
+                0x00 } );
 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         // Decode a ModifyDNRequest PDU
@@ -680,15 +1172,65 @@ public class ModifyDNRequestTest extends
                 0x6C,
                 0x35, // CHOICE { ..., modifyDNRequest ModifyDNRequest,
                 // ...
-                0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o', 'u', '=', 'u',
-                's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm', 0x04, 0x0F, 'c', 'n', '=', 't',
-                'e', 's', 't', 'D', 'N', 'M', 'o', 'd', 'i', 'f', 'y', 0x01, 0x00 // deleteoldrdn BOOLEAN
-            } );
+                0x04,
+                0x20,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                ',',
+                'o',
+                'u',
+                '=',
+                'u',
+                's',
+                'e',
+                'r',
+                's',
+                ',',
+                'o',
+                'u',
+                '=',
+                's',
+                'y',
+                's',
+                't',
+                'e',
+                'm',
+                0x04,
+                0x0F,
+                'c',
+                'n',
+                '=',
+                't',
+                'e',
+                's',
+                't',
+                'D',
+                'N',
+                'M',
+                'o',
+                'd',
+                'i',
+                'f',
+                'y',
+                0x01,
+                0x00 // deleteoldrdn BOOLEAN
+        } );
 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         // Decode a ModifyDNRequest PDU



Mime
View raw message