Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 76809 invoked from network); 4 Sep 2006 20:35:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 Sep 2006 20:35:09 -0000 Received: (qmail 23756 invoked by uid 500); 4 Sep 2006 20:35:08 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 23697 invoked by uid 500); 4 Sep 2006 20:35:08 -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 23685 invoked by uid 99); 4 Sep 2006 20:35:08 -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:35:08 -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:35:07 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 7673F1A981A; Mon, 4 Sep 2006 13:34:47 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r440178 - in /directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/test/java/org/apache/directory/shared/ldap: codec/ codec/asn1ber/ codec/asn1ber/messages/ codec/asn1ber/messages/bind/ messages/bind/ Date: Mon, 04 Sep 2006 20:34:47 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20060904203447.7673F1A981A@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:34:46 2006 New Revision: 440178 URL: http://svn.apache.org/viewvc?view=rev&rev=440178 Log: Moved the BindRequest BER decorator to the correct directory Added: directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/ directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/asn1ber/ directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/ directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/bind/ directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/bind/BindRequestDecoratorTest.java Removed: 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/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=auto&rev=440178 ============================================================================== --- directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/bind/BindRequestDecoratorTest.java (added) +++ directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/bind/BindRequestDecoratorTest.java Mon Sep 4 13:34:46 2006 @@ -0,0 +1,63 @@ +/* + * 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.codec.asn1ber.messages.bind; + +import org.apache.directory.shared.ldap.codec.asn1ber.messages.bind.BindRequestAsn1Ber; +import org.apache.directory.shared.ldap.messages.bind.BindRequest; +import org.apache.directory.shared.ldap.messages.bind.BindRequestOperation; +import org.apache.directory.shared.ldap.messages.bind.SimpleAuthentication; +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 ); + } +}