directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r209349 - in /directory/sandbox/trunk/asn1-new-codec/src: java/org/apache/asn1/ldap/pojo/ExtendedRequest.java test/org/apache/asn1/ldap/codec/ExtendedRequestTest.java
Date Tue, 05 Jul 2005 23:26:29 GMT
Author: elecharny
Date: Tue Jul  5 16:26:26 2005
New Revision: 209349

URL: http://svn.apache.org/viewcvs?rev=209349&view=rev
Log:
- Added a toString() method
- polished the code

Modified:
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ExtendedRequest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ExtendedRequestTest.java

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ExtendedRequest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ExtendedRequest.java?rev=209349&r1=209348&r2=209349&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ExtendedRequest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ExtendedRequest.java
Tue Jul  5 16:26:26 2005
@@ -89,4 +89,24 @@
     {
         this.value = value;
     }
+
+    /**
+     * Get a String representation of an Extended Request
+     *
+     * @return an Extended Request String 
+     */
+    public String toString()
+    {
+        StringBuffer sb = new StringBuffer();
+
+        sb.append( "    Extended request\n" );
+        sb.append( "        Request name : '" ).append( name.toString() ).append( "'\n" );
+        
+        if ( value != null )
+        {
+            sb.append( "        Request value : '" ).append( value.toString() ).append( "'\n"
);
+        }
+
+        return sb.toString();
+    }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ExtendedRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ExtendedRequestTest.java?rev=209349&r1=209348&r2=209349&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ExtendedRequestTest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ExtendedRequestTest.java
Tue Jul  5 16:26:26 2005
@@ -69,9 +69,10 @@
 
         stream.flip();
 
-        // Allocate a DelRequest Container
+        // Allocate a LdapMessage Container
         IAsn1Container ldapMessageContainer = new LdapMessageContainer();
 
+        // Decode the ExtendedRequest PDU
         try
         {
             ldapDecoder.decode( stream, ldapMessageContainer );
@@ -82,6 +83,7 @@
             Assert.fail( de.getMessage() );
         }
     	
+        // Check the decoded ExtendedRequest PDU
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         ExtendedRequest extendedRequest      = message.getExtendedRequest();
 
@@ -112,9 +114,10 @@
 
         stream.flip();
 
-        // Allocate a DelRequest Container
+        // Allocate a LdapMessage Container
         IAsn1Container ldapMessageContainer = new LdapMessageContainer();
 
+        // Decode the ExtendedRequest PDU
         try
         {
             ldapDecoder.decode( stream, ldapMessageContainer );
@@ -125,6 +128,7 @@
             Assert.fail( de.getMessage() );
         }
     	
+        // Check the decoded ExtendedRequest PDU
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         ExtendedRequest extendedRequest      = message.getExtendedRequest();
 



Mime
View raw message