You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2006/08/29 18:39:35 UTC

svn commit: r438110 - /directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java

Author: elecharny
Date: Tue Aug 29 09:39:32 2006
New Revision: 438110

URL: http://svn.apache.org/viewvc?rev=438110&view=rev
Log:
Reformated the PDUs comments and updated the tests headers

Modified:
    directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java?rev=438110&r1=438109&r2=438110&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java Tue Aug 29 09:39:32 2006
@@ -56,7 +56,8 @@
 
         ByteBuffer stream = ByteBuffer.allocate( 0x02 );
         stream.put( new byte[]
-            { 0x30, 0x00, // LDAPMessage ::=SEQUENCE {
+            { 
+            0x30, 0x00,                 // LDAPMessage ::=SEQUENCE {
             } );
 
         stream.flip();
@@ -94,8 +95,9 @@
 
         ByteBuffer stream = ByteBuffer.allocate( 0x04 );
         stream.put( new byte[]
-            { 0x30, 0x02, // LDAPMessage ::=SEQUENCE {
-                0x02, 0x00 // messageID MessageID
+            { 
+            0x30, 0x02,                 // LDAPMessage ::=SEQUENCE {
+              0x02, 0x00                // messageID MessageID
             } );
 
         stream.flip();
@@ -133,8 +135,9 @@
 
         ByteBuffer stream = ByteBuffer.allocate( 0x05 );
         stream.put( new byte[]
-            { 0x30, 0x03, // LDAPMessage ::=SEQUENCE {
-                0x02, 0x01, ( byte ) 0xff // messageID MessageID = -1
+            { 
+            0x30, 0x03,                 // LDAPMessage ::=SEQUENCE {
+              0x02, 0x01, ( byte ) 0xff // messageID MessageID = -1
             } );
 
         stream.flip();
@@ -163,7 +166,7 @@
 
 
     /**
-     * Test the decoding of null length messageId
+     * Test the decoding of messageId which value is -1
      */
     public void testDecodeMessageIdMaxInt()
     {
@@ -172,10 +175,10 @@
 
         ByteBuffer stream = ByteBuffer.allocate( 0x08 );
         stream.put( new byte[]
-            { 0x30, 0x06, // LDAPMessage ::=SEQUENCE {
-                0x02, 0x04, ( byte ) 0x7f, ( byte ) 0xff, ( byte ) 0xff, ( byte ) 0xff // messageID
-                                                                                        // MessageID
-                                                                                        // = -1
+            { 
+            0x30, 0x06,                 // LDAPMessage ::=SEQUENCE {
+                                        // messageID MessageID = -1
+              0x02, 0x04, ( byte ) 0x7f, ( byte ) 0xff, ( byte ) 0xff, ( byte ) 0xff
             } );
 
         stream.flip();
@@ -204,15 +207,16 @@
 
 
     /**
-     * Test the decoding of null length messageId
+     * Test the decoding of a message with a wrong protocol operation
      */
     public void testDecodeWrongProtocolOpMaxInt()
     {
 
         byte[] buffer = new byte[]
-            { 0x30, 0x05, // LDAPMessage ::=SEQUENCE {
-                0x02, 0x01, 0x01, // messageID MessageID = 1
-                0x42, 0x00 // ProtocolOp
+            { 
+            0x30, 0x05,                 // LDAPMessage ::=SEQUENCE {
+              0x02, 0x01, 0x01,         // messageID MessageID = 1
+              0x42, 0x00                // ProtocolOp
             };
 
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -299,10 +303,11 @@
 
         ByteBuffer stream = ByteBuffer.allocate( 0x08 );
         stream.put( new byte[]
-            { 0x30, 0x06, // LDAPMessage ::=SEQUENCE {
-                0x02, 0x02, 0x01, ( byte ) 0xF4, // messageID MessageID (500)
-                0x42, 0x00, // CHOICE { ..., unbindRequest UnbindRequest,...
-            // UnbindRequest ::= [APPLICATION 2] NULL
+            { 
+            0x30, 0x06,                         // LDAPMessage ::=SEQUENCE {
+              0x02, 0x02, 0x01, ( byte ) 0xF4,  // messageID MessageID (500)
+              0x42, 0x00,                       // CHOICE { ..., unbindRequest UnbindRequest,...
+                                                // UnbindRequest ::= [APPLICATION 2] NULL
             } );
 
         String decodedPdu = StringTools.dumpBytes( stream.array() );