directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r234005 - /directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/LdapDecoderTest.java
Date Sat, 20 Aug 2005 07:25:29 GMT
Author: elecharny
Date: Sat Aug 20 00:25:25 2005
New Revision: 234005

URL: http://svn.apache.org/viewcvs?rev=234005&view=rev
Log:
Test the return of the encode function

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

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/LdapDecoderTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/LdapDecoderTest.java?rev=234005&r1=234004&r2=234005&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/LdapDecoderTest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/LdapDecoderTest.java
Sat Aug 20 00:25:25 2005
@@ -132,9 +132,11 @@
         IAsn1Container ldapMessageContainer = new LdapMessageContainer();
 
         // Decode a BindRequest PDU
+        boolean isDecoded = false;
+        
         try
         {
-            ldapDecoder.decode( stream, ldapMessageContainer );
+            isDecoded = ldapDecoder.decode( stream, ldapMessageContainer );
         }
         catch ( DecoderException de )
         {
@@ -142,6 +144,8 @@
             Assert.fail( de.getMessage() );
         }
 
+        Assert.assertEquals( isDecoded, false );
+        
         // Check the decoded PDU
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         BindRequest br      = message.getBindRequest();
@@ -179,9 +183,11 @@
         IAsn1Container ldapMessageContainer = new LdapMessageContainer();
 
         // Decode a BindRequest PDU first block of data
+        boolean isDecoded = false;
+
         try
         {
-            ldapDecoder.decode( stream, ldapMessageContainer );
+            isDecoded = ldapDecoder.decode( stream, ldapMessageContainer );
         }
         catch ( DecoderException de )
         {
@@ -189,6 +195,8 @@
             Assert.fail( de.getMessage() );
         }
 
+        Assert.assertEquals( isDecoded, false );
+
         // Second block of data
         stream = ByteBuffer.allocate( 37 );
         stream.put(
@@ -205,7 +213,7 @@
         // Decode a BindRequest PDU second block of data
         try
         {
-            ldapDecoder.decode( stream, ldapMessageContainer );
+            isDecoded = ldapDecoder.decode( stream, ldapMessageContainer );
         }
         catch ( DecoderException de )
         {
@@ -213,6 +221,8 @@
             Assert.fail( de.getMessage() );
         }
 
+        Assert.assertEquals( isDecoded, true );
+        
         // Check the decoded PDU
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         BindRequest br      = message.getBindRequest();



Mime
View raw message