directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r440789 - /directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/bind/BindRequestDecoratorTest.java
Date Wed, 06 Sep 2006 16:50:03 GMT
Author: elecharny
Date: Wed Sep  6 09:50:02 2006
New Revision: 440789

URL: http://svn.apache.org/viewvc?view=rev&rev=440789
Log:
Added a test to check that a BindRequest with Saslcredential length is correctly computed

Modified:
    directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/bind/BindRequestDecoratorTest.java

Modified: directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/bind/BindRequestDecoratorTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/bind/BindRequestDecoratorTest.java?view=diff&rev=440789&r1=440788&r2=440789
==============================================================================
--- directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/bind/BindRequestDecoratorTest.java
(original)
+++ directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/bind/BindRequestDecoratorTest.java
Wed Sep  6 09:50:02 2006
@@ -23,6 +23,7 @@
 import org.apache.directory.shared.ldap.messages.Message;
 import org.apache.directory.shared.ldap.messages.bind.ConcreteBindRequest;
 import org.apache.directory.shared.ldap.messages.bind.BindRequest;
+import org.apache.directory.shared.ldap.messages.bind.ConcreteSaslCredentials;
 import org.apache.directory.shared.ldap.messages.bind.ConcreteSimpleAuthentication;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.utils.StringTools;
@@ -60,5 +61,31 @@
         int length = bindRequestDecorator.computeLength();
         
         assertEquals( 13, length );
+    }
+
+    /**
+     * 
+     * Test that the BER decorator correctly compute the length
+     * of a SaslCredentials BindRequest
+     *
+     */
+    public void testBindRequestDecoratorSasl() 
+    {
+        BindRequest bindRequest = new ConcreteBindRequest( 1 );
+        
+        bindRequest.setName( new LdapDN() );
+        bindRequest.setVersion( 3 );
+        
+        ConcreteSaslCredentials saslCredentials = new ConcreteSaslCredentials();
+        saslCredentials.setCredentials( StringTools.getBytesUtf8( "test" ) );
+        saslCredentials.setMechanism( "test" );
+        
+        bindRequest.setAuthentication( saslCredentials );
+        
+        BindRequestAsn1Ber bindRequestDecorator = new BindRequestAsn1Ber( (Message)bindRequest
);
+        
+        int length = bindRequestDecorator.computeLength();
+        
+        assertEquals( 21, length );
     }
 }



Mime
View raw message