You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2005/08/22 01:18:46 UTC

svn commit: r234388 - /directory/shared/ldap/branches/new-codec-integration/apache2-provider/src/test/org/apache/asn1new/ldap/codec/LdapDecoderTest.java

Author: elecharny
Date: Sun Aug 21 16:18:43 2005
New Revision: 234388

URL: http://svn.apache.org/viewcvs?rev=234388&view=rev
Log:
Change the decoder call : there is no more return value. 

Modified:
    directory/shared/ldap/branches/new-codec-integration/apache2-provider/src/test/org/apache/asn1new/ldap/codec/LdapDecoderTest.java

Modified: directory/shared/ldap/branches/new-codec-integration/apache2-provider/src/test/org/apache/asn1new/ldap/codec/LdapDecoderTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/new-codec-integration/apache2-provider/src/test/org/apache/asn1new/ldap/codec/LdapDecoderTest.java?rev=234388&r1=234387&r2=234388&view=diff
==============================================================================
--- directory/shared/ldap/branches/new-codec-integration/apache2-provider/src/test/org/apache/asn1new/ldap/codec/LdapDecoderTest.java (original)
+++ directory/shared/ldap/branches/new-codec-integration/apache2-provider/src/test/org/apache/asn1new/ldap/codec/LdapDecoderTest.java Sun Aug 21 16:18:43 2005
@@ -22,6 +22,7 @@
 import org.apache.asn1.codec.DecoderException;
 import org.apache.asn1new.ber.Asn1Decoder;
 import org.apache.asn1new.ber.containers.IAsn1Container;
+import org.apache.asn1new.ber.tlv.TLVStateEnum;
 import org.apache.asn1new.ldap.pojo.BindRequest;
 import org.apache.asn1new.ldap.pojo.LdapMessage;
 import org.apache.asn1new.ldap.pojo.SimpleAuthentication;
@@ -133,11 +134,9 @@
         IAsn1Container ldapMessageContainer = new LdapMessageContainer();
 
         // Decode a BindRequest PDU
-        boolean isDecoded = false;
-        
         try
         {
-            isDecoded = ldapDecoder.decode( stream, ldapMessageContainer );
+            ldapDecoder.decode( stream, ldapMessageContainer );
         }
         catch ( DecoderException de )
         {
@@ -145,7 +144,7 @@
             Assert.fail( de.getMessage() );
         }
 
-        Assert.assertEquals( isDecoded, false );
+        Assert.assertEquals( ldapMessageContainer.getState(), TLVStateEnum.PDU_DECODED );
         
         // Check the decoded PDU
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
@@ -184,11 +183,9 @@
         IAsn1Container ldapMessageContainer = new LdapMessageContainer();
 
         // Decode a BindRequest PDU first block of data
-        boolean isDecoded = false;
-
         try
         {
-            isDecoded = ldapDecoder.decode( stream, ldapMessageContainer );
+            ldapDecoder.decode( stream, ldapMessageContainer );
         }
         catch ( DecoderException de )
         {
@@ -196,7 +193,7 @@
             Assert.fail( de.getMessage() );
         }
 
-        Assert.assertEquals( isDecoded, false );
+        Assert.assertEquals( ldapMessageContainer.getState(), TLVStateEnum.PDU_DECODED );
 
         // Second block of data
         stream = ByteBuffer.allocate( 37 );
@@ -214,7 +211,7 @@
         // Decode a BindRequest PDU second block of data
         try
         {
-            isDecoded = ldapDecoder.decode( stream, ldapMessageContainer );
+            ldapDecoder.decode( stream, ldapMessageContainer );
         }
         catch ( DecoderException de )
         {
@@ -222,7 +219,7 @@
             Assert.fail( de.getMessage() );
         }
 
-        Assert.assertEquals( isDecoded, true );
+        Assert.assertEquals( ldapMessageContainer.getState(), TLVStateEnum.PDU_DECODED );
         
         // Check the decoded PDU
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();