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 2009/12/31 12:13:40 UTC
svn commit: r894816 -
/directory/apacheds/branches/apacheds-schema/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java
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 );