directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
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 GMT
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 );



Mime
View raw message