Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 76318 invoked from network); 4 Sep 2006 20:32:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 Sep 2006 20:32:48 -0000 Received: (qmail 21290 invoked by uid 500); 4 Sep 2006 20:32:48 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 21242 invoked by uid 500); 4 Sep 2006 20:32:48 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 21231 invoked by uid 99); 4 Sep 2006 20:32:48 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Sep 2006 13:32:48 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Sep 2006 13:32:47 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 493531A9820; Mon, 4 Sep 2006 13:32:27 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r440176 - /directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/test/java/org/apache/directory/shared/ldap/messages/bind/BindRequestDecoratorTest.java Date: Mon, 04 Sep 2006 20:32:27 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20060904203227.493531A9820@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: elecharny Date: Mon Sep 4 13:32:26 2006 New Revision: 440176 URL: http://svn.apache.org/viewvc?view=rev&rev=440176 Log: Added a test for the Ber decorator Added: directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/test/java/org/apache/directory/shared/ldap/messages/bind/BindRequestDecoratorTest.java Added: directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/test/java/org/apache/directory/shared/ldap/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/messages/bind/BindRequestDecoratorTest.java?view=auto&rev=440176 ============================================================================== --- directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/test/java/org/apache/directory/shared/ldap/messages/bind/BindRequestDecoratorTest.java (added) +++ directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/test/java/org/apache/directory/shared/ldap/messages/bind/BindRequestDecoratorTest.java Mon Sep 4 13:32:26 2006 @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.directory.shared.ldap.messages.bind; + +import org.apache.directory.shared.ldap.codec.asn1ber.messages.bind.BindRequestAsn1Ber; +import org.apache.directory.shared.ldap.name.LdapDN; +import org.apache.directory.shared.ldap.utils.StringTools; + +import junit.framework.TestCase; + +/** + * + * Test the BindRequest decorator class + * + * @author Apache Directory Project + */ +public class BindRequestDecoratorTest extends TestCase +{ + /** + * + * Test that the BER decorator correctly compute the length + * of a SimpleAuthentication BindRequest + * + */ + public void testBindRequestDecoratorSimple() + { + BindRequestOperation bindRequest = new BindRequest( 1 ); + + bindRequest.setName( new LdapDN() ); + bindRequest.setVersion( 3 ); + + SimpleAuthentication simpleAuthentication = new SimpleAuthentication(); + simpleAuthentication.setSimple( StringTools.getBytesUtf8( "test" ) ); + + bindRequest.setAuthentication( simpleAuthentication ); + + BindRequestAsn1Ber bindRequestDecorator = new BindRequestAsn1Ber( bindRequest ); + + int length = bindRequestDecorator.computeLength(); + + assertEquals( 13, length ); + } +}