directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r226634 - in /directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec: AbandonRequestTest.java CompareResponseTest.java
Date Sun, 31 Jul 2005 12:03:35 GMT
Author: elecharny
Date: Sun Jul 31 05:03:31 2005
New Revision: 226634

URL: http://svn.apache.org/viewcvs?rev=226634&view=rev
Log:
Added a comment

Modified:
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/AbandonRequestTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/CompareResponseTest.java

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/AbandonRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/AbandonRequestTest.java?rev=226634&r1=226633&r2=226634&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/AbandonRequestTest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/AbandonRequestTest.java
Sun Jul 31 05:03:31 2005
@@ -89,6 +89,7 @@
         // Check the length
         Assert.assertEquals(8, message.computeLength());
         
+        // Check the encoding
         try
         {
             ByteBuffer bb = message.encode( null );

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=226634&r1=226633&r2=226634&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
Sun Jul 31 05:03:31 2005
@@ -19,10 +19,12 @@
 import java.nio.ByteBuffer;
 
 import org.apache.asn1.DecoderException;
+import org.apache.asn1.EncoderException;
 import org.apache.asn1.ber.Asn1Decoder;
 import org.apache.asn1.ber.containers.IAsn1Container;
 import org.apache.asn1.ldap.pojo.CompareResponse;
 import org.apache.asn1.ldap.pojo.LdapMessage;
+import org.apache.asn1.util.StringUtils;
 import org.apache.log4j.Logger;
 import org.apache.log4j.PropertyConfigurator;
 
@@ -71,6 +73,7 @@
 									// }
             } );
 
+        String decodedPdu = StringUtils.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a LdapMessage Container
@@ -98,5 +101,20 @@
 
         // Check the length
         Assert.assertEquals(0x2D, message.computeLength());
+        
+        // Check the encoding
+        try
+        {
+            ByteBuffer bb = message.encode( null );
+            
+            String encodedPdu = StringUtils.dumpBytes( bb.array() ); 
+            
+            Assert.assertEquals(encodedPdu, decodedPdu );
+        }
+        catch ( EncoderException ee )
+        {
+            ee.printStackTrace();
+            Assert.fail( ee.getMessage() );
+        }
     }
 }



Mime
View raw message