Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 78147 invoked from network); 5 Jul 2005 22:28:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Jul 2005 22:28:42 -0000 Received: (qmail 82860 invoked by uid 500); 5 Jul 2005 22:28:42 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 82816 invoked by uid 500); 5 Jul 2005 22:28:41 -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 82803 invoked by uid 99); 5 Jul 2005 22:28:41 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jul 2005 15:28:41 -0700 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 05 Jul 2005 15:28:41 -0700 Received: (qmail 78125 invoked by uid 65534); 5 Jul 2005 22:28:36 -0000 Message-ID: <20050705222836.78124.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r209337 - in /directory/sandbox/trunk/asn1-new-codec/src: java/org/apache/asn1/ldap/pojo/CompareRequest.java test/org/apache/asn1/ldap/codec/CompareRequestTest.java Date: Tue, 05 Jul 2005 22:28:35 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.2 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 Jul 5 15:28:33 2005 New Revision: 209337 URL: http://svn.apache.org/viewcvs?rev=209337&view=rev Log: - Added a toString() method - polished the code and the comments Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/CompareRequest.java directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/CompareRequestTest.java Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/CompareRequest.java URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/CompareRequest.java?rev=209337&r1=209336&r2=209337&view=diff ============================================================================== --- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/CompareRequest.java (original) +++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/CompareRequest.java Tue Jul 5 15:28:33 2005 @@ -63,7 +63,7 @@ //~ Methods ------------------------------------------------------------------------------------ /** - * Get the entry to be deleted + * Get the entry to be compared * * @return Returns the entry. */ @@ -73,7 +73,7 @@ } /** - * Set the entry to be deleted + * Set the entry to be compared * * @param entry The entry to set. */ @@ -120,5 +120,22 @@ public void setAttributeDesc( LdapString attributeDesc ) { this.attributeDesc = attributeDesc; + } + + /** + * Get a String representation of a Compare Request + * + * @return A Compare Request String + */ + public String toString() + { + StringBuffer sb = new StringBuffer(); + + sb.append( " Compare request\n" ); + sb.append( " Entry : '" ).append( entry.toString() ).append( "'\n" ); + sb.append( " Attribute description : '" ).append( attributeDesc.toString() ).append( "'\n" ); + sb.append( " Attribute value : '" ).append( assertionValue.toString() ).append( "'\n" ); + + return sb.toString(); } } Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/CompareRequestTest.java URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/CompareRequestTest.java?rev=209337&r1=209336&r2=209337&view=diff ============================================================================== --- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/CompareRequestTest.java (original) +++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/CompareRequestTest.java Tue Jul 5 15:28:33 2005 @@ -73,9 +73,10 @@ stream.flip(); - // Allocate a DelRequest Container + // Allocate a LdapMessage Container IAsn1Container ldapMessageContainer = new LdapMessageContainer(); + // Decode the CompareRequest PDU try { ldapDecoder.decode( stream, ldapMessageContainer ); @@ -86,6 +87,7 @@ Assert.fail( de.getMessage() ); } + // Ceck the decoded CompareRequest PDU LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage(); CompareRequest compareRequest = message.getCompareRequest(); @@ -122,9 +124,10 @@ stream.flip(); - // Allocate a DelRequest Container + // Allocate a LdapMessage Container IAsn1Container ldapMessageContainer = new LdapMessageContainer(); + // Decode the CompareRequest PDU try { ldapDecoder.decode( stream, ldapMessageContainer );