Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 80969 invoked from network); 31 Dec 2009 11:14:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 31 Dec 2009 11:14:03 -0000 Received: (qmail 69244 invoked by uid 500); 31 Dec 2009 11:14:03 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 69183 invoked by uid 500); 31 Dec 2009 11:14:03 -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 69172 invoked by uid 99); 31 Dec 2009 11:14:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Dec 2009 11:14:03 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.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; Thu, 31 Dec 2009 11:14:01 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id BF26D23889ED; Thu, 31 Dec 2009 11:13:40 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r894816 - /directory/apacheds/branches/apacheds-schema/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java Date: Thu, 31 Dec 2009 11:13:40 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091231111340.BF26D23889ED@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: elecharny Date: Thu Dec 31 11:13:40 2009 New Revision: 894816 URL: http://svn.apache.org/viewvc?rev=894816&view=rev Log: Using AttributeUtils to create new entries Modified: directory/apacheds/branches/apacheds-schema/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java Modified: directory/apacheds/branches/apacheds-schema/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java?rev=894816&r1=894815&r2=894816&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-schema/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java (original) +++ directory/apacheds/branches/apacheds-schema/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java Thu Dec 31 11:13:40 2009 @@ -79,6 +79,7 @@ import org.apache.directory.shared.ldap.message.ResultCodeEnum; import org.apache.directory.shared.ldap.name.LdapDN; import org.apache.directory.shared.ldap.schema.SchemaUtils; +import org.apache.directory.shared.ldap.util.AttributeUtils; import org.apache.directory.shared.ldap.util.StringTools; import org.junit.Test; import org.junit.runner.RunWith; @@ -133,7 +134,6 @@ { @CreateTransport( protocol = "LDAP" ) }) - @ApplyLdifs( { // Entry # 0 "dn: cn=The Person,ou=system", @@ -166,7 +166,7 @@ "objectClass: referral", "objectClass: top", "uid: akarasuluref", - "ref: ldap://localhost:10389/uid=akarasulu,ou=users,ou=system", + "ref: ldap://localhost:10389/uid=akarasulu,ou=users,ou=system", "ref: ldap://foo:10389/uid=akarasulu,ou=users,ou=system", "ref: ldap://bar:10389/uid=akarasulu,ou=users,ou=system" } @@ -179,7 +179,6 @@ private static final String BASE = "ou=system"; private static final String BASE_EXAMPLE_COM = "dc=example,dc=com"; private static final String BASE_DIRECTORY_APACHE_ORG = "dc=directory,dc=apache,dc=org"; - /** * This is the original defect as in JIRA DIREVE-216. @@ -192,11 +191,9 @@ DirContext ctx = ( DirContext ) getWiredContext( ldapServer ).lookup( BASE ); // modify object classes, add two more - Attributes attributes = new BasicAttributes( true ); - Attribute ocls = new BasicAttribute( "objectClass" ); - ocls.add( "organizationalPerson" ); - ocls.add( "inetOrgPerson" ); - attributes.put( ocls ); + Attributes attributes = AttributeUtils.createAttributes( + "objectClass: organizationalPerson", + "objectClass: inetOrgPerson" ); DirContext person = ( DirContext ) ctx.lookup( RDN ); person.modifyAttributes( "", DirContext.ADD_ATTRIBUTE, attributes );