directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r209339 - in /directory/sandbox/trunk/asn1-new-codec/src: java/org/apache/asn1/ldap/pojo/CompareResponse.java test/org/apache/asn1/ldap/codec/CompareResponseTest.java
Date Tue, 05 Jul 2005 22:34:21 GMT
Author: elecharny
Date: Tue Jul  5 15:34:19 2005
New Revision: 209339

URL: http://svn.apache.org/viewcvs?rev=209339&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/CompareResponse.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/CompareResponseTest.java

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/CompareResponse.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/CompareResponse.java?rev=209339&r1=209338&r2=209339&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/CompareResponse.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/CompareResponse.java
Tue Jul  5 15:34:19 2005
@@ -33,4 +33,22 @@
     {
         super( );
     }
+
+    //~ Methods ------------------------------------------------------------------------------------
+
+    /**
+     * Get a String representation of an CompareResponse
+     *
+     * @return An CompareResponse String 
+     */
+    public String toString()
+    {
+
+        StringBuffer sb = new StringBuffer();
+
+        sb.append( "    Compare Response\n" );
+        sb.append( super.toString() );
+
+        return sb.toString();
+    }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/CompareResponseTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/CompareResponseTest.java?rev=209339&r1=209338&r2=209339&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/CompareResponseTest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/CompareResponseTest.java
Tue Jul  5 15:34:19 2005
@@ -30,6 +30,8 @@
 import junit.framework.TestCase;
 
 /**
+ * Test the CompareResponse codec
+ * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class CompareResponseTest extends TestCase {
@@ -71,9 +73,10 @@
 
         stream.flip();
 
-        // Allocate a BindRequest Container
+        // Allocate a LdapMessage Container
         IAsn1Container ldapMessageContainer = new LdapMessageContainer();
 
+        // Decode the CompareResponse PDU
         try
         {
             ldapDecoder.decode( stream, ldapMessageContainer );
@@ -84,8 +87,9 @@
             Assert.fail( de.getMessage() );
         }
     	
+        // Check the decoded CompareResponse PDU
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        CompareResponse compareResponse      = ( CompareResponse ) ( message.getProtocolOp()
);
+        CompareResponse compareResponse      = message.getCompareResponse();
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( 0, compareResponse.getLdapResult().getResultCode() );



Mime
View raw message