Return-Path: X-Original-To: apmail-directory-commits-archive@www.apache.org Delivered-To: apmail-directory-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6DC83980A for ; Mon, 23 Apr 2012 11:51:19 +0000 (UTC) Received: (qmail 23993 invoked by uid 500); 23 Apr 2012 11:51:19 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 23834 invoked by uid 500); 23 Apr 2012 11:51:15 -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 23788 invoked by uid 99); 23 Apr 2012 11:51:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Apr 2012 11:51:13 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Apr 2012 11:51:11 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id E79662388962 for ; Mon, 23 Apr 2012 11:50:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1329194 - /directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAddRequestTest.java Date: Mon, 23 Apr 2012 11:50:49 -0000 To: commits@directory.apache.org From: kayyagari@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120423115049.E79662388962@eris.apache.org> Author: kayyagari Date: Mon Apr 23 11:50:49 2012 New Revision: 1329194 URL: http://svn.apache.org/viewvc?rev=1329194&view=rev Log: test for DIRAPI-84 Modified: directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAddRequestTest.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=1329194&r1=1329193&r2=1329194&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 Mon Apr 23 11:50:49 2012 @@ -47,6 +47,7 @@ import org.apache.directory.shared.ldap. import org.apache.directory.shared.ldap.model.entry.Entry; import org.apache.directory.shared.ldap.model.entry.Value; import org.apache.directory.shared.ldap.model.exception.LdapNoPermissionException; +import org.apache.directory.shared.ldap.model.ldif.LdifUtils; import org.apache.directory.shared.ldap.model.message.AddRequest; import org.apache.directory.shared.ldap.model.message.AddRequestImpl; import org.apache.directory.shared.ldap.model.message.AddResponse; @@ -56,6 +57,7 @@ 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; @@ -347,4 +349,31 @@ public class ClientAddRequestTest extend assertEquals( 2, count ); } + + /** + * the below test fails cause the API is failing to + * preserve the UP name of the attribute of RDN + * 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" ); + Entry entry = new DefaultEntry( dn ); + entry.add( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.PERSON_OC ); + entry.add( SchemaConstants.CN_AT, "testadd" ); + entry.add( SchemaConstants.SN_AT, "testadd_sn" ); + + connection.add( entry ); + + assertTrue( session.exists( dn ) ); + + entry = connection.lookup(dn); + + String ldif = LdifUtils.convertToLdif(entry); + + assertTrue( ldif.contains(dn.getName()) ); + } + }