Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 84415 invoked from network); 29 Aug 2006 16:39:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 Aug 2006 16:39:59 -0000 Received: (qmail 27771 invoked by uid 500); 29 Aug 2006 16:39:59 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 27715 invoked by uid 500); 29 Aug 2006 16:39:59 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 27704 invoked by uid 99); 29 Aug 2006 16:39:59 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Aug 2006 09:39:59 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Aug 2006 09:39:58 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id CD3891A981A; Tue, 29 Aug 2006 09:39:37 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r438110 - /directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java Date: Tue, 29 Aug 2006 16:39:35 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060829163937.CD3891A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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() );