directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r369476 - /directory/trunks/common/ldap/src/test/java/org/apache/ldap/common/codec/abandon/AbandonRequestTest.java
Date Mon, 16 Jan 2006 14:07:42 GMT
Author: elecharny
Date: Mon Jan 16 06:07:38 2006
New Revision: 369476

URL: http://svn.apache.org/viewcvs?rev=369476&view=rev
Log:
Added a test for Abandon Request without message Id

Modified:
    directory/trunks/common/ldap/src/test/java/org/apache/ldap/common/codec/abandon/AbandonRequestTest.java

Modified: directory/trunks/common/ldap/src/test/java/org/apache/ldap/common/codec/abandon/AbandonRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/trunks/common/ldap/src/test/java/org/apache/ldap/common/codec/abandon/AbandonRequestTest.java?rev=369476&r1=369475&r2=369476&view=diff
==============================================================================
--- directory/trunks/common/ldap/src/test/java/org/apache/ldap/common/codec/abandon/AbandonRequestTest.java
(original)
+++ directory/trunks/common/ldap/src/test/java/org/apache/ldap/common/codec/abandon/AbandonRequestTest.java
Mon Jan 16 06:07:38 2006
@@ -235,4 +235,39 @@
         }
     }
 
+    /**
+     * Test the decoding of a AbandonRequest with no controls
+     */
+    public void testDecodeAbandonRequestNoMessageId()
+    {
+        Asn1Decoder ldapDecoder = new LdapDecoder();
+
+        ByteBuffer  stream      = ByteBuffer.allocate( 0x0A );
+        stream.put(
+            new byte[]
+            {
+                0x30, 0x08,         // LDAPMessage ::=SEQUENCE {
+                0x02, 0x01, 0x01,	//        messageID MessageID
+                0x50, 0x00    		//        CHOICE { ..., abandonRequest AbandonRequest,...
+                                    // AbandonRequest ::= [APPLICATION 16] MessageID
+            } );
+
+        stream.flip();
+
+        // Allocate a LdapMessageContainer Container
+        IAsn1Container ldapMessageContainer = new LdapMessageContainer();
+
+        // Decode the PDU
+        try
+        {
+            ldapDecoder.decode( stream, ldapMessageContainer );
+        }
+        catch ( DecoderException de )
+        {
+        	assertTrue( true );
+        	return;
+        }
+        
+        fail( "We should not reach this point" );
+    }
 }



Mime
View raw message