You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ka...@apache.org on 2012/05/01 10:48:43 UTC
svn commit: r1332574 - in /directory:
apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/
shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/shared/ldap/codec/decorators/
Author: kayyagari
Date: Tue May 1 08:48:42 2012
New Revision: 1332574
URL: http://svn.apache.org/viewvc?rev=1332574&view=rev
Log:
fix for DIRAPI-84
Modified:
directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAddRequestTest.java
directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/shared/ldap/codec/decorators/AddRequestDecorator.java
Modified: directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAddRequestTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAddRequestTest.java?rev=1332574&r1=1332573&r2=1332574&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAddRequestTest.java (original)
+++ directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAddRequestTest.java Tue May 1 08:48:42 2012
@@ -57,7 +57,6 @@ import org.apache.directory.shared.ldap.
import org.apache.directory.shared.util.DateUtils;
import org.junit.After;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -356,7 +355,6 @@ public class ClientAddRequestTest extend
* when the DN is schema-aware
*/
@Test
- @Ignore("see DIRAPI-84")
public void testPreserveRdnUpName() throws Exception
{
Dn dn = new Dn( getService().getSchemaManager(), "cn=testadd,ou=system" );
Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/shared/ldap/codec/decorators/AddRequestDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/shared/ldap/codec/decorators/AddRequestDecorator.java?rev=1332574&r1=1332573&r2=1332574&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/shared/ldap/codec/decorators/AddRequestDecorator.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/shared/ldap/codec/decorators/AddRequestDecorator.java Tue May 1 08:48:42 2012
@@ -41,6 +41,7 @@ import org.apache.directory.shared.ldap.
import org.apache.directory.shared.ldap.model.message.AddResponse;
import org.apache.directory.shared.ldap.model.message.Control;
import org.apache.directory.shared.ldap.model.name.Dn;
+import org.apache.directory.shared.util.Strings;
/**
@@ -350,8 +351,10 @@ public final class AddRequestDecorator e
throw new IllegalArgumentException( I18n.err( I18n.ERR_04481_ENTRY_NULL_VALUE ) );
}
+ int dnLen = Strings.getBytesUtf8( entry.getDn().getName() ).length;
+
// The entry Dn
- int addRequestLength = 1 + TLV.getNbBytes( Dn.getNbBytes( entry.getDn() ) ) + Dn.getNbBytes( entry.getDn() );
+ int addRequestLength = 1 + TLV.getNbBytes( dnLen ) + dnLen;
// The attributes sequence
int entryLength = 0;
@@ -438,7 +441,7 @@ public final class AddRequestDecorator e
buffer.put( TLV.getBytes( getAddRequestLength() ) );
// The entry
- org.apache.directory.shared.asn1.ber.tlv.Value.encode( buffer, Dn.getBytes( getEntryDn() ) );
+ org.apache.directory.shared.asn1.ber.tlv.Value.encode( buffer, Strings.getBytesUtf8( getDecorated().getEntryDn().getName() ) );
// The attributes sequence
buffer.put( UniversalTag.SEQUENCE.getValue() );