directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1235364 [14/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/extended/ExtendedResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java?rev=1235364&r1=1235363&r2=1235364&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java Tue Jan 24 17:27:00 2012
@@ -66,27 +66,54 @@ public class ExtendedResponseTest extend
 
         stream.put( new byte[]
             { 0x30, 0x22, // LDAPMessage ::= SEQUENCE {
-                0x02, 0x01, 0x01, // messageID MessageID
+                0x02,
+                0x01,
+                0x01, // messageID MessageID
                 // CHOICE { ..., extendedResp ExtendedResponse, ...
-                0x78, 0x1D, // ExtendedResponse ::= [APPLICATION 23] SEQUENCE {
+                0x78,
+                0x1D, // ExtendedResponse ::= [APPLICATION 23] SEQUENCE {
                 // COMPONENTS OF 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 }
                 // responseName [10] LDAPOID OPTIONAL,
-                ( byte ) 0x8A, 0x0D, '1', '.', '3', '.', '6', '.', '1', '.', '5', '.', '5', '.', '2',
+                ( byte ) 0x8A,
+                0x0D,
+                '1',
+                '.',
+                '3',
+                '.',
+                '6',
+                '.',
+                '1',
+                '.',
+                '5',
+                '.',
+                '5',
+                '.',
+                '2',
                 // response [11] OCTET STRING OPTIONAL }
-                ( byte ) 0x8B, 0x05, 'v', 'a', 'l', 'u', 'e' } );
+                ( byte ) 0x8B,
+                0x05,
+                'v',
+                'a',
+                'l',
+                'u',
+                'e' } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container =
             new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode the ExtendedResponse PDU
@@ -108,7 +135,7 @@ public class ExtendedResponseTest extend
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", extendedResponse.getLdapResult().getDiagnosticMessage() );
         assertEquals( "1.3.6.1.5.5.2", extendedResponse.getResponseName() );
-        assertEquals( "value", Strings.utf8ToString((byte[]) extendedResponse.getResponseValue()) );
+        assertEquals( "value", Strings.utf8ToString( ( byte[] ) extendedResponse.getResponseValue() ) );
 
         // Check the encoding
         try
@@ -118,7 +145,7 @@ public class ExtendedResponseTest extend
             // Check the length
             assertEquals( 0x24, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }
@@ -167,18 +194,61 @@ public class ExtendedResponseTest extend
                 //     referral [3] Referral OPTIONAL }
                 ( byte ) 0x8A,
                 0x0D, //   responseName [10] LDAPOID OPTIONAL,
-                '1', '.', '3', '.', '6', '.', '1', '.', '5', '.', '5', '.', '2', ( byte ) 0x8B,
+                '1',
+                '.',
+                '3',
+                '.',
+                '6',
+                '.',
+                '1',
+                '.',
+                '5',
+                '.',
+                '5',
+                '.',
+                '2',
+                ( byte ) 0x8B,
                 0x05, // response [11] OCTET STRING OPTIONAL } 
-                'v', 'a', 'l', 'u', 'e', ( byte ) 0xA0,
+                'v',
+                'a',
+                'l',
+                'u',
+                'e',
+                ( byte ) 0xA0,
                 0x1B, // A control
-                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' } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container =
             new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode the ExtendedResponse PDU
@@ -200,7 +270,7 @@ public class ExtendedResponseTest extend
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", extendedResponse.getLdapResult().getDiagnosticMessage() );
         assertEquals( "1.3.6.1.5.5.2", extendedResponse.getResponseName() );
-        assertEquals( "value", Strings.utf8ToString((byte[]) extendedResponse.getResponseValue()) );
+        assertEquals( "value", Strings.utf8ToString( ( byte[] ) extendedResponse.getResponseValue() ) );
 
         // Check the Control
         Map<String, Control> controls = extendedResponse.getControls();
@@ -208,9 +278,10 @@ public class ExtendedResponseTest extend
         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
@@ -220,7 +291,7 @@ public class ExtendedResponseTest extend
             // Check the length
             assertEquals( 0x41, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }
@@ -244,25 +315,32 @@ public class ExtendedResponseTest extend
 
         stream.put( new byte[]
             { 0x30, 0x0C, // LDAPMessage ::= SEQUENCE {
-                0x02, 0x01, 0x01, // messageID MessageID
+                0x02,
+                0x01,
+                0x01, // messageID MessageID
                 // CHOICE { ..., extendedResp Response, ...
-                0x78, 0x07, // ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
+                0x78,
+                0x07, // ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
                 // COMPONENTS OF 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 }
             // responseName [0] LDAPOID,
-            } );
+        } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container =
             new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode the ExtendedResponse PDU
@@ -292,7 +370,7 @@ public class ExtendedResponseTest extend
             // Check the length
             assertEquals( 0x0E, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }
@@ -338,14 +416,39 @@ public class ExtendedResponseTest extend
                 // responseName [0] LDAPOID,
                 ( 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<ExtendedResponseDecorator<?>> container = 
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container =
             new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode the ExtendedResponse PDU
@@ -372,9 +475,10 @@ public class ExtendedResponseTest extend
 
         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
@@ -384,7 +488,7 @@ public class ExtendedResponseTest extend
             // Check the length
             assertEquals( 0x2B, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }
@@ -408,15 +512,18 @@ public class ExtendedResponseTest extend
 
         stream.put( new byte[]
             { 0x30, 0x05, // LDAPMessage ::= SEQUENCE {
-                0x02, 0x01, 0x01, // messageID MessageID
+                0x02,
+                0x01,
+                0x01, // messageID MessageID
                 // CHOICE { ..., extendedResp Response, ...
-                0x78, 0x00 // ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
-            } );
+                0x78,
+                0x00 // ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
+        } );
 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container =
             new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode a DelRequest PDU
@@ -444,24 +551,32 @@ public class ExtendedResponseTest extend
 
         stream.put( new byte[]
             { 0x30, 0x0E, // LDAPMessage ::= SEQUENCE {
-                0x02, 0x01, 0x01, // messageID MessageID
+                0x02,
+                0x01,
+                0x01, // messageID MessageID
                 // CHOICE { ..., extendedResp Response, ...
-                0x78, 0x09, // ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
+                0x78,
+                0x09, // ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
                 // COMPONENTS OF 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 }
                 // responseName [0] LDAPOID,
-                ( byte ) 0x8A, 0x00 } );
+                ( byte ) 0x8A,
+                0x00 } );
 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container =
             new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode a DelRequest PDU
@@ -489,24 +604,34 @@ public class ExtendedResponseTest extend
 
         stream.put( new byte[]
             { 0x30, 0x10, // LDAPMessage ::= SEQUENCE {
-                0x02, 0x01, 0x01, // messageID MessageID
+                0x02,
+                0x01,
+                0x01, // messageID MessageID
                 // CHOICE { ..., extendedResp Response, ...
-                0x78, 0x0B, // ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
+                0x78,
+                0x0B, // ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
                 // COMPONENTS OF 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 }
                 // responseName [0] LDAPOID,
-                ( byte ) 0x8A, 0x02, 'a', 'b' } );
+                ( byte ) 0x8A,
+                0x02,
+                'a',
+                'b' } );
 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container =
             new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode a DelRequest PDU
@@ -534,25 +659,46 @@ public class ExtendedResponseTest extend
 
         stream.put( new byte[]
             { 0x30, 0x1B, // LDAPMessage ::= SEQUENCE {
-                0x02, 0x01, 0x01, // messageID MessageID
+                0x02,
+                0x01,
+                0x01, // messageID MessageID
                 // CHOICE { ..., extendedResp Response, ...
-                0x78, 0x16, // ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
+                0x78,
+                0x16, // ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
                 // COMPONENTS OF 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 }
                 // responseName [0] LDAPOID,
-                ( byte ) 0x8A, 0x0D, '1', '.', '3', '.', '6', '.', '1', '.', '5', '.', '5', '.', '2', } );
+                ( byte ) 0x8A,
+                0x0D,
+                '1',
+                '.',
+                '3',
+                '.',
+                '6',
+                '.',
+                '1',
+                '.',
+                '5',
+                '.',
+                '5',
+                '.',
+                '2', } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container =
             new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode the ExtendedResponse PDU
@@ -574,7 +720,7 @@ public class ExtendedResponseTest extend
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", extendedResponse.getLdapResult().getDiagnosticMessage() );
         assertEquals( "1.3.6.1.5.5.2", extendedResponse.getResponseName() );
-        assertEquals( "", Strings.utf8ToString((byte[]) extendedResponse.getResponseValue()) );
+        assertEquals( "", Strings.utf8ToString( ( byte[] ) extendedResponse.getResponseValue() ) );
 
         // Check the encoding
         try
@@ -584,7 +730,7 @@ public class ExtendedResponseTest extend
             // Check the length
             assertEquals( 0x1D, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }
@@ -629,17 +775,56 @@ public class ExtendedResponseTest extend
                 0x00, // errorMessage LDAPString,
                 // referral [3] Referral OPTIONAL }
                 // responseName [0] LDAPOID,
-                ( byte ) 0x8A, 0x0D, '1', '.', '3', '.', '6', '.', '1', '.', '5', '.', '5', '.', '2',
+                ( byte ) 0x8A,
+                0x0D,
+                '1',
+                '.',
+                '3',
+                '.',
+                '6',
+                '.',
+                '1',
+                '.',
+                '5',
+                '.',
+                '5',
+                '.',
+                '2',
                 ( 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<ExtendedResponseDecorator<?>> container = 
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container =
             new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode the ExtendedResponse PDU
@@ -661,7 +846,7 @@ public class ExtendedResponseTest extend
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", extendedResponse.getLdapResult().getDiagnosticMessage() );
         assertEquals( "1.3.6.1.5.5.2", extendedResponse.getResponseName() );
-        assertEquals( "", Strings.utf8ToString((byte[]) extendedResponse.getResponseValue()) );
+        assertEquals( "", Strings.utf8ToString( ( byte[] ) extendedResponse.getResponseValue() ) );
 
         // Check the Control
         Map<String, Control> controls = extendedResponse.getControls();
@@ -669,7 +854,8 @@ public class ExtendedResponseTest extend
         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() ) );
 
@@ -681,7 +867,7 @@ public class ExtendedResponseTest extend
             // Check the length
             assertEquals( 0x3A, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }
@@ -725,14 +911,29 @@ public class ExtendedResponseTest extend
                 0x00, // errorMessage LDAPString,
                 // referral [3] Referral OPTIONAL }
                 // responseName [0] LDAPOID,
-                ( byte ) 0x8A, 0x0D, '1', '.', '3', '.', '6', '.', '1', '.', '5', '.', '5', '.', '2', ( byte ) 0x8B,
+                ( byte ) 0x8A,
+                0x0D,
+                '1',
+                '.',
+                '3',
+                '.',
+                '6',
+                '.',
+                '1',
+                '.',
+                '5',
+                '.',
+                '5',
+                '.',
+                '2',
+                ( byte ) 0x8B,
                 0x00 } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container =
             new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode the ExtendedResponse PDU
@@ -754,7 +955,7 @@ public class ExtendedResponseTest extend
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", extendedResponse.getLdapResult().getDiagnosticMessage() );
         assertEquals( "1.3.6.1.5.5.2", extendedResponse.getResponseName() );
-        assertEquals( "", Strings.utf8ToString((byte[]) extendedResponse.getResponseValue()) );
+        assertEquals( "", Strings.utf8ToString( ( byte[] ) extendedResponse.getResponseValue() ) );
 
         // Check the encoding
         try
@@ -764,7 +965,7 @@ public class ExtendedResponseTest extend
             // Check the length
             assertEquals( 0x1F, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }
@@ -810,17 +1011,58 @@ public class ExtendedResponseTest extend
                 0x00, // errorMessage LDAPString,
                 // referral [3] Referral OPTIONAL }
                 // responseName [0] LDAPOID,
-                ( byte ) 0x8A, 0x0D, '1', '.', '3', '.', '6', '.', '1', '.', '5', '.', '5', '.', '2', ( byte ) 0x8B,
-                0x00, ( byte ) 0xA0,
+                ( byte ) 0x8A,
+                0x0D,
+                '1',
+                '.',
+                '3',
+                '.',
+                '6',
+                '.',
+                '1',
+                '.',
+                '5',
+                '.',
+                '5',
+                '.',
+                '2',
+                ( byte ) 0x8B,
+                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<ExtendedResponseDecorator<?>> container = 
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container =
             new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode the ExtendedResponse PDU
@@ -842,7 +1084,7 @@ public class ExtendedResponseTest extend
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", extendedResponse.getLdapResult().getDiagnosticMessage() );
         assertEquals( "1.3.6.1.5.5.2", extendedResponse.getResponseName() );
-        assertEquals( "", Strings.utf8ToString((byte[]) extendedResponse.getResponseValue()) );
+        assertEquals( "", Strings.utf8ToString( ( byte[] ) extendedResponse.getResponseValue() ) );
 
         // Check the Control
         Map<String, Control> controls = extendedResponse.getControls();
@@ -850,7 +1092,8 @@ public class ExtendedResponseTest extend
         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() ) );
 
@@ -862,7 +1105,7 @@ public class ExtendedResponseTest extend
             // Check the length
             assertEquals( 0x3C, 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/intermediate/IntermediateResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/intermediate/IntermediateResponseTest.java?rev=1235364&r1=1235363&r2=1235364&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/intermediate/IntermediateResponseTest.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/intermediate/IntermediateResponseTest.java Tue Jan 24 17:27:00 2012
@@ -64,19 +64,42 @@ public class IntermediateResponseTest ex
 
         stream.put( new byte[]
             { 0x30, 0x1B, // LDAPMessage ::= SEQUENCE {
-                0x02, 0x01, 0x01, // messageID MessageID
+                0x02,
+                0x01,
+                0x01, // messageID MessageID
                 // CHOICE { ..., intermediateResponse IntermediateResponse, ...
-                0x79, 0x16, // IntermediateResponse ::= [APPLICATION 25] SEQUENCE {
+                0x79,
+                0x16, // IntermediateResponse ::= [APPLICATION 25] SEQUENCE {
                 // responseName [0] LDAPOID,
-                ( byte ) 0x80, 0x0D, '1', '.', '3', '.', '6', '.', '1', '.', '5', '.', '5', '.', '2',
+                ( byte ) 0x80,
+                0x0D,
+                '1',
+                '.',
+                '3',
+                '.',
+                '6',
+                '.',
+                '1',
+                '.',
+                '5',
+                '.',
+                '5',
+                '.',
+                '2',
                 // responseValue [1] OCTET STRING OPTIONAL }
-                ( byte ) 0x81, 0x05, 'v', 'a', 'l', 'u', 'e' } );
+                ( byte ) 0x81,
+                0x05,
+                'v',
+                'a',
+                'l',
+                'u',
+                'e' } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode the IntermediateResponse PDU
@@ -95,7 +118,7 @@ public class IntermediateResponseTest ex
 
         assertEquals( 1, intermediateResponse.getMessageId() );
         assertEquals( "1.3.6.1.5.5.2", intermediateResponse.getResponseName() );
-        assertEquals( "value", Strings.utf8ToString(intermediateResponse.getResponseValue()) );
+        assertEquals( "value", Strings.utf8ToString( intermediateResponse.getResponseValue() ) );
 
         // Check the encoding
         try
@@ -105,7 +128,7 @@ public class IntermediateResponseTest ex
             // Check the length
             assertEquals( 0x1D, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }
@@ -130,24 +153,71 @@ public class IntermediateResponseTest ex
         stream.put( new byte[]
             { 0x30,
                 0x38, // LDAPMessage ::= SEQUENCE {
-                0x02, 0x01,
+                0x02,
+                0x01,
                 0x01, // messageID MessageID
                 // CHOICE { ..., intermediateResponse IntermediateResponse, ...
                 0x79,
                 0x16, // IntermediateResponse ::= [APPLICATION 25] SEQUENCE {
                 // responseName [0] LDAPOID,
-                ( byte ) 0x80, 0x0D, '1', '.', '3', '.', '6', '.', '1', '.', '5', '.', '5', '.', '2',
+                ( byte ) 0x80,
+                0x0D,
+                '1',
+                '.',
+                '3',
+                '.',
+                '6',
+                '.',
+                '1',
+                '.',
+                '5',
+                '.',
+                '5',
+                '.',
+                '2',
                 // requestValue [1] OCTET STRING OPTIONAL }
-                ( byte ) 0x81, 0x05, 'v', 'a', 'l', 'u', 'e', ( byte ) 0xA0,
+                ( byte ) 0x81,
+                0x05,
+                'v',
+                'a',
+                'l',
+                'u',
+                'e',
+                ( byte ) 0xA0,
                 0x1B, // A control
-                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' } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode the IntermediateResponse PDU
@@ -166,7 +236,7 @@ public class IntermediateResponseTest ex
 
         assertEquals( 1, intermediateResponse.getMessageId() );
         assertEquals( "1.3.6.1.5.5.2", intermediateResponse.getResponseName() );
-        assertEquals( "value", Strings.utf8ToString(intermediateResponse.getResponseValue()) );
+        assertEquals( "value", Strings.utf8ToString( intermediateResponse.getResponseValue() ) );
 
         // Check the Control
         Map<String, Control> controls = intermediateResponse.getControls();
@@ -174,9 +244,10 @@ public class IntermediateResponseTest ex
         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
@@ -186,7 +257,7 @@ public class IntermediateResponseTest ex
             // Check the length
             assertEquals( 0x3A, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }
@@ -212,24 +283,64 @@ public class IntermediateResponseTest ex
         stream.put( new byte[]
             { 0x30,
                 0x31, // LDAPMessage ::= SEQUENCE {
-                0x02, 0x01,
+                0x02,
+                0x01,
                 0x01, // messageID MessageID
                 // CHOICE { ..., intermediateResponse IntermediateResponse, ...
                 0x79,
                 0x0F, // IntermediateResponse ::= [APPLICATION 25] SEQUENCE {
                 // responseName [0] LDAPOID,
-                ( byte ) 0x80, 0x0D, '1', '.', '3', '.', '6', '.', '1', '.', '5', '.', '5', '.', '2',
+                ( byte ) 0x80,
+                0x0D,
+                '1',
+                '.',
+                '3',
+                '.',
+                '6',
+                '.',
+                '1',
+                '.',
+                '5',
+                '.',
+                '5',
+                '.',
+                '2',
                 // requestValue [1] OCTET STRING OPTIONAL }
                 ( byte ) 0xA0,
                 0x1B, // A control
-                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' } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode the IntermediateResponse PDU
@@ -248,7 +359,7 @@ public class IntermediateResponseTest ex
 
         assertEquals( 1, intermediateResponse.getMessageId() );
         assertEquals( "1.3.6.1.5.5.2", intermediateResponse.getResponseName() );
-        assertEquals( "", Strings.utf8ToString(intermediateResponse.getResponseValue()) );
+        assertEquals( "", Strings.utf8ToString( intermediateResponse.getResponseValue() ) );
 
         // Check the Control
         Map<String, Control> controls = intermediateResponse.getControls();
@@ -256,9 +367,10 @@ public class IntermediateResponseTest ex
         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
@@ -268,7 +380,7 @@ public class IntermediateResponseTest ex
             // Check the length
             assertEquals( 0x33, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }
@@ -292,15 +404,18 @@ public class IntermediateResponseTest ex
 
         stream.put( new byte[]
             { 0x30, 0x05, // LDAPMessage ::= SEQUENCE {
-                0x02, 0x01, 0x01, // messageID MessageID
+                0x02,
+                0x01,
+                0x01, // messageID MessageID
                 // CHOICE { ..., intermediateResponse IntermediateResponse, ...
-                0x79, 0x00, // IntermediateResponse ::= [APPLICATION 25] SEQUENCE {
+                0x79,
+                0x00, // IntermediateResponse ::= [APPLICATION 25] SEQUENCE {
             } );
 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode a IntermediateResponse PDU
@@ -328,15 +443,19 @@ public class IntermediateResponseTest ex
 
         stream.put( new byte[]
             { 0x30, 0x07, // LDAPMessage ::= SEQUENCE {
-                0x02, 0x01, 0x01, // messageID MessageID
+                0x02,
+                0x01,
+                0x01, // messageID MessageID
                 // CHOICE { ..., intermediateResponse IntermediateResponse, ...
-                0x79, 0x02, // IntermediateResponse ::= [APPLICATION 25] SEQUENCE {
-                ( byte ) 0x80, 0x00 } );
+                0x79,
+                0x02, // IntermediateResponse ::= [APPLICATION 25] SEQUENCE {
+                ( byte ) 0x80,
+                0x00 } );
 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode a IntermediateResponse PDU
@@ -364,16 +483,33 @@ public class IntermediateResponseTest ex
 
         stream.put( new byte[]
             { 0x30, 0x14, // LDAPMessage ::= SEQUENCE {
-                0x02, 0x01, 0x01, // messageID MessageID
+                0x02,
+                0x01,
+                0x01, // messageID MessageID
                 // CHOICE { ..., intermediateResponse IntermediateResponse, ...
-                0x79, 0x0F, // IntermediateResponse ::= [APPLICATION 25] SEQUENCE {
+                0x79,
+                0x0F, // IntermediateResponse ::= [APPLICATION 25] SEQUENCE {
                 // responseName [0] LDAPOID,
-                ( byte ) 0x80, 0x0D, '1', '-', '3', '.', '6', '.', '1', '.', '5', '.', '5', '.', '2', } );
+                ( byte ) 0x80,
+                0x0D,
+                '1',
+                '-',
+                '3',
+                '.',
+                '6',
+                '.',
+                '1',
+                '.',
+                '5',
+                '.',
+                '5',
+                '.',
+                '2', } );
 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode a IntermediateResponse PDU
@@ -401,17 +537,34 @@ public class IntermediateResponseTest ex
 
         stream.put( new byte[]
             { 0x30, 0x14, // LDAPMessage ::= SEQUENCE {
-                0x02, 0x01, 0x01, // messageID MessageID
+                0x02,
+                0x01,
+                0x01, // messageID MessageID
                 // CHOICE { ..., intermediateResponse IntermediateResponse, ...
-                0x79, 0x0F, // IntermediateResponse ::= [APPLICATION 25] SEQUENCE {
+                0x79,
+                0x0F, // IntermediateResponse ::= [APPLICATION 25] SEQUENCE {
                 // responseName [0] LDAPOID,
-                ( byte ) 0x80, 0x0D, '1', '.', '3', '.', '6', '.', '1', '.', '5', '.', '5', '.', '2', } );
+                ( byte ) 0x80,
+                0x0D,
+                '1',
+                '.',
+                '3',
+                '.',
+                '6',
+                '.',
+                '1',
+                '.',
+                '5',
+                '.',
+                '5',
+                '.',
+                '2', } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode the IntermediateResponse PDU
@@ -439,7 +592,7 @@ public class IntermediateResponseTest ex
             // Check the length
             assertEquals( 0x16, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }
@@ -464,20 +617,36 @@ public class IntermediateResponseTest ex
         stream.put( new byte[]
             { 0x30,
                 0x16, // LDAPMessage ::= SEQUENCE {
-                0x02, 0x01,
+                0x02,
+                0x01,
                 0x01, // messageID MessageID
                 // CHOICE { ..., intermediateResponse IntermediateResponse, ...
                 0x79,
                 0x11, // IntermediateResponse ::= [APPLICATION 25] SEQUENCE {
                 // responseName [0] LDAPOID,
-                ( byte ) 0x80, 0x0D, '1', '.', '3', '.', '6', '.', '1', '.', '5', '.', '5', '.', '2', ( byte ) 0x81,
+                ( byte ) 0x80,
+                0x0D,
+                '1',
+                '.',
+                '3',
+                '.',
+                '6',
+                '.',
+                '1',
+                '.',
+                '5',
+                '.',
+                '5',
+                '.',
+                '2',
+                ( byte ) 0x81,
                 0x00 } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode the IntermediateResponse PDU
@@ -496,7 +665,7 @@ public class IntermediateResponseTest ex
 
         assertEquals( 1, intermediateResponse.getMessageId() );
         assertEquals( "1.3.6.1.5.5.2", intermediateResponse.getResponseName() );
-        assertEquals( "", Strings.utf8ToString(intermediateResponse.getResponseValue()) );
+        assertEquals( "", Strings.utf8ToString( intermediateResponse.getResponseValue() ) );
 
         // Check the encoding
         try
@@ -506,7 +675,7 @@ public class IntermediateResponseTest ex
             // Check the length
             assertEquals( 0x18, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }
@@ -530,17 +699,26 @@ public class IntermediateResponseTest ex
 
         stream.put( new byte[]
             { 0x30, 0x0C, // LDAPMessage ::= SEQUENCE {
-                0x02, 0x01, 0x01, // messageID MessageID
+                0x02,
+                0x01,
+                0x01, // messageID MessageID
                 // CHOICE { ..., intermediateResponse IntermediateResponse, ...
-                0x79, 0x07, // IntermediateResponse ::= [APPLICATION 25] SEQUENCE {
+                0x79,
+                0x07, // IntermediateResponse ::= [APPLICATION 25] SEQUENCE {
                 // responseValue [1] OCTET STRING OPTIONAL,
-                ( byte ) 0x81, 0x05, 'v', 'a', 'l', 'u', 'e' } );
+                ( byte ) 0x81,
+                0x05,
+                'v',
+                'a',
+                'l',
+                'u',
+                'e' } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode the IntermediateResponse PDU
@@ -559,7 +737,7 @@ public class IntermediateResponseTest ex
 
         assertEquals( 1, intermediateResponse.getMessageId() );
         assertEquals( "", intermediateResponse.getResponseName() );
-        assertEquals( "value", Strings.utf8ToString(intermediateResponse.getResponseValue()) );
+        assertEquals( "value", Strings.utf8ToString( intermediateResponse.getResponseValue() ) );
 
         // Check the encoding
         try
@@ -569,7 +747,7 @@ public class IntermediateResponseTest ex
             // Check the length
             assertEquals( 0x0E, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }
@@ -593,17 +771,34 @@ public class IntermediateResponseTest ex
 
         stream.put( new byte[]
             { 0x30, 0x14, // LDAPMessage ::= SEQUENCE {
-                0x02, 0x01, 0x01, // messageID MessageID
+                0x02,
+                0x01,
+                0x01, // messageID MessageID
                 // CHOICE { ..., intermediateResponse IntermediateResponse, ...
-                0x79, 0x0F, // IntermediateResponse ::= [APPLICATION 25] SEQUENCE {
+                0x79,
+                0x0F, // IntermediateResponse ::= [APPLICATION 25] SEQUENCE {
                 // responseName [0] LDAPOID,
-                ( byte ) 0x80, 0x0D, '1', '.', '3', '.', '6', '.', '1', '.', '5', '.', '5', '.', '2', } );
+                ( byte ) 0x80,
+                0x0D,
+                '1',
+                '.',
+                '3',
+                '.',
+                '6',
+                '.',
+                '1',
+                '.',
+                '5',
+                '.',
+                '5',
+                '.',
+                '2', } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode the IntermediateResponse PDU
@@ -622,7 +817,7 @@ public class IntermediateResponseTest ex
 
         assertEquals( 1, intermediateResponse.getMessageId() );
         assertEquals( "1.3.6.1.5.5.2", intermediateResponse.getResponseName() );
-        assertEquals( "", Strings.utf8ToString(intermediateResponse.getResponseValue()) );
+        assertEquals( "", Strings.utf8ToString( intermediateResponse.getResponseValue() ) );
 
         // Check the encoding
         try
@@ -632,7 +827,7 @@ public class IntermediateResponseTest ex
             // Check the length
             assertEquals( 0x16, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }



Mime
View raw message