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 2006/09/04 22:34:47 UTC
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/
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 <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+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 );
+ }
+}