directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r494163 - in /directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server: ./ jndi/
Date Mon, 08 Jan 2007 19:39:52 GMT
Author: elecharny
Date: Mon Jan  8 11:39:51 2007
New Revision: 494163

URL: http://svn.apache.org/viewvc?view=rev&rev=494163
Log:
Patch for DIRSERVER-783.
- No more BasicAttribute and BasicAttributes. Use AttributeImpl and AttributesImpl now.
- No more ModificationItem. use ModificationItemImpl now
- lot of refactoring of imports : no more import xxx.*;

Modified:
    directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AbstractServerTriggerServiceTest.java
    directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AddITest.java
    directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AddingEntriesWithSpecialCharactersInRDNTest.java
    directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/BinarySearchTest.java
    directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java
    directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/MatchingRuleCompareTest.java
    directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/MiscTest.java
    directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyAddTest.java
    directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyRdnTest.java
    directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyRemoveTest.java
    directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyReplaceITest.java
    directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java
    directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ReferralTest.java
    directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/SearchTest.java
    directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java

Modified: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AbstractServerTriggerServiceTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AbstractServerTriggerServiceTest.java?view=diff&rev=494163&r1=494162&r2=494163
==============================================================================
--- directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AbstractServerTriggerServiceTest.java (original)
+++ directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AbstractServerTriggerServiceTest.java Mon Jan  8 11:39:51 2007
@@ -27,8 +27,6 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.InitialDirContext;
 import javax.naming.ldap.LdapContext;
@@ -36,6 +34,8 @@
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.core.subtree.SubentryService;
 import org.apache.directory.server.unit.AbstractServerTest;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
 
 
 /**
@@ -149,13 +149,13 @@
         Attribute administrativeRole = ap.get( "administrativeRole" );
         if ( administrativeRole == null || !administrativeRole.contains( SubentryService.TRIGGER_AREA ) )
         {
-            Attributes changes = new BasicAttributes( "administrativeRole", SubentryService.TRIGGER_AREA, true );
+            Attributes changes = new AttributesImpl( "administrativeRole", SubentryService.TRIGGER_AREA, true );
             adminCtx.modifyAttributes( "", DirContext.ADD_ATTRIBUTE, changes );
         }
 
         // now add the Trigger subentry below ou=system
-        Attributes subentry = new BasicAttributes( "cn", cn, true );
-        Attribute objectClass = new BasicAttribute( "objectClass" );
+        Attributes subentry = new AttributesImpl( "cn", cn, true );
+        Attribute objectClass = new AttributeImpl( "objectClass" );
         subentry.put( objectClass );
         objectClass.add( "top" );
         objectClass.add( "subentry" );
@@ -176,7 +176,7 @@
      */
     public void addEntryTrigger( LdapContext adminCtx, Name rdn, String triggerSpec ) throws NamingException
     {
-        Attributes changes = new BasicAttributes( "entryTriggerSpecification", triggerSpec, true );
+        Attributes changes = new AttributesImpl( "entryTriggerSpecification", triggerSpec, true );
         adminCtx.modifyAttributes( rdn, DirContext.ADD_ATTRIBUTE, changes );
     }
 

Modified: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AddITest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AddITest.java?view=diff&rev=494163&r1=494162&r2=494163
==============================================================================
--- directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AddITest.java (original)
+++ directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AddITest.java Mon Jan  8 11:39:51 2007
@@ -20,9 +20,16 @@
 package org.apache.directory.server;
 
 
-import javax.naming.directory.*;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.InitialDirContext;
+import javax.naming.directory.InvalidAttributeValueException;
+import javax.naming.directory.SchemaViolationException;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 
 import netscape.ldap.LDAPAttribute;
 import netscape.ldap.LDAPAttributeSet;
@@ -31,6 +38,8 @@
 import netscape.ldap.LDAPException;
 
 import org.apache.directory.server.unit.AbstractServerTest;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
 
 import java.util.Hashtable;
 
@@ -64,8 +73,8 @@
         ctx = new InitialDirContext( env );
 
         // Create a person
-        Attributes attributes = new BasicAttributes( true );
-        Attribute attribute = new BasicAttribute( "objectClass" );
+        Attributes attributes = new AttributesImpl( true );
+        Attribute attribute = new AttributeImpl( "objectClass" );
         attribute.add( "top" );
         attribute.add( "person" );
         attributes.put( attribute );
@@ -125,8 +134,8 @@
     {
 
         // modify object classes, add two more
-        Attributes attributes = new BasicAttributes( true );
-        Attribute ocls = new BasicAttribute( "objectClass" );
+        Attributes attributes = new AttributesImpl( true );
+        Attribute ocls = new AttributeImpl( "objectClass" );
         ocls.add( "organizationalPerson" );
         ocls.add( "inetOrgPerson" );
         attributes.put( ocls );
@@ -159,8 +168,8 @@
         String newDescription = "More info on the user ...";
 
         // modify object classes, add two more
-        Attributes attributes = new BasicAttributes( true );
-        Attribute desc = new BasicAttribute( "description", newDescription );
+        Attributes attributes = new AttributesImpl( true );
+        Attribute desc = new AttributeImpl( "description", newDescription );
         attributes.put( desc );
 
         DirContext person = ( DirContext ) ctx.lookup( RDN );
@@ -181,8 +190,8 @@
     public void testAddWithMissingRequiredAttributes() throws NamingException
     {
         // person without sn
-        Attributes attrs = new BasicAttributes();
-        Attribute ocls = new BasicAttribute( "objectClass" );
+        Attributes attrs = new AttributesImpl();
+        Attribute ocls = new AttributeImpl( "objectClass" );
         ocls.add( "top" );
         ocls.add( "person" );
         attrs.put( ocls );
@@ -335,14 +344,14 @@
     public void testAddWithInvalidNumberOfAttributeValues() throws NamingException
     {
         // add inetOrgPerson with two displayNames
-        Attributes attrs = new BasicAttributes();
-        Attribute ocls = new BasicAttribute( "objectClass" );
+        Attributes attrs = new AttributesImpl();
+        Attribute ocls = new AttributeImpl( "objectClass" );
         ocls.add( "top" );
         ocls.add( "inetOrgPerson" );
         attrs.put( ocls );
         attrs.put( "cn", "Fiona Apple" );
         attrs.put( "sn", "Apple" );
-        Attribute displayName = new BasicAttribute( "displayName" );
+        Attribute displayName = new AttributeImpl( "displayName" );
         displayName.add( "Fiona" );
         displayName.add( "Fiona A." );
         attrs.put( displayName );
@@ -366,8 +375,8 @@
     {
 
         // Create entry
-        Attributes entry = new BasicAttributes();
-        Attribute entryOcls = new BasicAttribute( "objectclass" );
+        Attributes entry = new AttributesImpl();
+        Attribute entryOcls = new AttributeImpl( "objectclass" );
         entryOcls.add( "top" );
         entryOcls.add( "organizationalUnit" );
         entry.put( entryOcls );
@@ -377,8 +386,8 @@
 
         // Create Alias
         String aliasedObjectName = entryRdn + "," + ctx.getNameInNamespace();
-        Attributes alias = new BasicAttributes();
-        Attribute aliasOcls = new BasicAttribute( "objectclass" );
+        Attributes alias = new AttributesImpl();
+        Attribute aliasOcls = new AttributeImpl( "objectclass" );
         aliasOcls.add( "top" );
         aliasOcls.add( "alias" );
         alias.put( aliasOcls );
@@ -401,8 +410,8 @@
     {
 
         // Create container
-        Attributes container = new BasicAttributes();
-        Attribute containerOcls = new BasicAttribute( "objectclass" );
+        Attributes container = new AttributesImpl();
+        Attribute containerOcls = new AttributeImpl( "objectclass" );
         containerOcls.add( "top" );
         containerOcls.add( "organizationalUnit" );
         container.put( containerOcls );
@@ -411,8 +420,8 @@
         DirContext containerCtx = ctx.createSubcontext( containerRdn, container );
 
         // Create entry
-        Attributes entry = new BasicAttributes();
-        Attribute entryOcls = new BasicAttribute( "objectclass" );
+        Attributes entry = new AttributesImpl();
+        Attribute entryOcls = new AttributeImpl( "objectclass" );
         entryOcls.add( "top" );
         entryOcls.add( "organizationalUnit" );
         entry.put( entryOcls );
@@ -422,8 +431,8 @@
 
         // Create alias ou=bestFruit,ou=Fruits to entry ou=favorite,ou=Fruits
         String aliasedObjectName = entryRdn + "," + containerCtx.getNameInNamespace();
-        Attributes alias = new BasicAttributes();
-        Attribute aliasOcls = new BasicAttribute( "objectclass" );
+        Attributes alias = new AttributesImpl();
+        Attribute aliasOcls = new AttributeImpl( "objectclass" );
         aliasOcls.add( "top" );
         aliasOcls.add( "alias" );
         alias.put( aliasOcls );

Modified: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AddingEntriesWithSpecialCharactersInRDNTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AddingEntriesWithSpecialCharactersInRDNTest.java?view=diff&rev=494163&r1=494162&r2=494163
==============================================================================
--- directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AddingEntriesWithSpecialCharactersInRDNTest.java (original)
+++ directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AddingEntriesWithSpecialCharactersInRDNTest.java Mon Jan  8 11:39:51 2007
@@ -26,14 +26,14 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.InitialDirContext;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.unit.AbstractServerTest;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
 
 
 /**
@@ -74,8 +74,8 @@
 
    protected Attributes getPersonAttributes(String sn, String cn) {
 
-       Attributes attrs = new BasicAttributes();
-       Attribute ocls = new BasicAttribute("objectClass");
+       Attributes attrs = new AttributesImpl();
+       Attribute ocls = new AttributeImpl("objectClass");
        ocls.add("top");
        ocls.add("person");
        attrs.put(ocls);
@@ -87,8 +87,8 @@
 
    protected Attributes getOrgUnitAttributes(String ou) {
 
-       Attributes attrs = new BasicAttributes();
-       Attribute ocls = new BasicAttribute("objectClass");
+       Attributes attrs = new AttributesImpl();
+       Attribute ocls = new AttributeImpl("objectClass");
        ocls.add("top");
        ocls.add("organizationalUnit");
        attrs.put(ocls);

Modified: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/BinarySearchTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/BinarySearchTest.java?view=diff&rev=494163&r1=494162&r2=494163
==============================================================================
--- directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/BinarySearchTest.java (original)
+++ directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/BinarySearchTest.java Mon Jan  8 11:39:51 2007
@@ -25,14 +25,14 @@
 import javax.naming.NamingEnumeration;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.server.unit.AbstractServerTest;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
 
 
 /**
@@ -52,8 +52,8 @@
      */
     protected Attributes getPersonAttributes( String sn, String cn )
     {
-        Attributes attributes = new BasicAttributes();
-        Attribute attribute = new BasicAttribute( "objectClass" );
+        Attributes attributes = new AttributesImpl();
+        Attribute attribute = new AttributeImpl( "objectClass" );
         attribute.add( "top" );
         attribute.add( "person" );
         attributes.put( attribute );

Modified: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java?view=diff&rev=494163&r1=494162&r2=494163
==============================================================================
--- directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java (original)
+++ directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java Mon Jan  8 11:39:51 2007
@@ -28,12 +28,12 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.server.ldap.support.extended.StoredProcedureExtendedOperationHandler;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.sp.JavaStoredProcedureUtils;
 
 
@@ -78,8 +78,8 @@
         JavaStoredProcedureUtils.loadStoredProcedureClass( ctx, BackupUtilities.class );
         
         // Create a container for backing up deleted entries.
-        Attributes backupContext = new BasicAttributes( "ou", "backupContext", true );
-        Attribute objectClass = new BasicAttribute( "objectClass" );
+        Attributes backupContext = new AttributesImpl( "ou", "backupContext", true );
+        Attribute objectClass = new AttributeImpl( "objectClass" );
         backupContext.put( objectClass );
         objectClass.add( "top" );
         objectClass.add( "organizationalUnit" );
@@ -90,8 +90,8 @@
             "AFTER Delete CALL \"" + BackupUtilities.class.getName() + ".backupDeleted\" ( $ldapContext \"\", $name, $operationPrincipal, $deletedEntry )" );
         
         // Create a test entry which is selected by the Trigger Subentry.
-        Attributes testEntry = new BasicAttributes( "ou", "testou", true );
-        objectClass = new BasicAttribute( "objectClass" );
+        Attributes testEntry = new AttributesImpl( "ou", "testou", true );
+        objectClass = new AttributeImpl( "objectClass" );
         testEntry.put( objectClass );
         objectClass.add( "top" );
         objectClass.add( "organizationalUnit" );

Modified: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/MatchingRuleCompareTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/MatchingRuleCompareTest.java?view=diff&rev=494163&r1=494162&r2=494163
==============================================================================
--- directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/MatchingRuleCompareTest.java (original)
+++ directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/MatchingRuleCompareTest.java Mon Jan  8 11:39:51 2007
@@ -26,14 +26,14 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.SearchControls;
 import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.server.unit.AbstractServerTest;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
 
 
 /**
@@ -60,8 +60,8 @@
 
     protected Attributes getPersonAttributes( String sn, String cn )
     {
-        Attributes attributes = new BasicAttributes();
-        Attribute attribute = new BasicAttribute( "objectClass" );
+        Attributes attributes = new AttributesImpl();
+        Attribute attribute = new AttributeImpl( "objectClass" );
         attribute.add( "top" );
         attribute.add( "person" );
         attributes.put( attribute );
@@ -74,8 +74,8 @@
 
     protected Attributes getGroupOfNamesAttributes( String cn, String member )
     {
-        Attributes attributes = new BasicAttributes();
-        Attribute attribute = new BasicAttribute( "objectClass" );
+        Attributes attributes = new AttributesImpl();
+        Attribute attribute = new AttributeImpl( "objectClass" );
         attribute.add( "top" );
         attribute.add( "groupOfNames" );
         attributes.put( attribute );

Modified: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/MiscTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/MiscTest.java?view=diff&rev=494163&r1=494162&r2=494163
==============================================================================
--- directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/MiscTest.java (original)
+++ directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/MiscTest.java Mon Jan  8 11:39:51 2007
@@ -28,6 +28,8 @@
 import org.apache.directory.server.core.configuration.PartitionConfiguration;
 import org.apache.directory.server.unit.AbstractServerTest;
 import org.apache.directory.shared.asn1.util.Asn1StringUtils;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.Control;
 import org.apache.directory.shared.ldap.util.ArrayUtils;
 import org.apache.directory.shared.ldap.util.EmptyEnumeration;
@@ -41,7 +43,12 @@
 import javax.naming.NoPermissionException;
 import javax.naming.NamingEnumeration;
 import javax.naming.OperationNotSupportedException;
-import javax.naming.directory.*;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.InitialDirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 import javax.naming.ldap.InitialLdapContext;
 
 
@@ -83,8 +90,8 @@
             partitions.addAll( configuration.getPartitionConfigurations() );
             MutablePartitionConfiguration partition = new MutablePartitionConfiguration();
             partition.setSuffix( "dc=aPache,dc=org" );
-            Attributes entry = new BasicAttributes( "dc", "aPache", true );
-            Attribute oc = new BasicAttribute( "objectClass" );
+            Attributes entry = new AttributesImpl( "dc", "aPache", true );
+            Attribute oc = new AttributeImpl( "objectClass" );
             entry.put( oc );
             oc.add( "top" );
             oc.add( "domain" );
@@ -104,8 +111,8 @@
             partitions.addAll( configuration.getPartitionConfigurations() );
             MutablePartitionConfiguration partition = new MutablePartitionConfiguration();
             partition.setSuffix( "dc=apache,dc=org" );
-            Attributes entry = new BasicAttributes( "dc", "apache", true );
-            Attribute oc = new BasicAttribute( "objectClass" );
+            Attributes entry = new AttributesImpl( "dc", "apache", true );
+            Attribute oc = new AttributeImpl( "objectClass" );
             entry.put( oc );
             oc.add( "top" );
             oc.add( "domain" );
@@ -175,8 +182,8 @@
         {
         }
 
-        Attributes attrs = new BasicAttributes( true );
-        Attribute oc = new BasicAttribute( "objectClass" );
+        Attributes attrs = new AttributesImpl( true );
+        Attribute oc = new AttributeImpl( "objectClass" );
         attrs.put( oc );
         oc.add( "top" );
         oc.add( "organizationalUnit" );
@@ -273,8 +280,8 @@
         env.put( "java.naming.ldap.version", "3" );
         env.put( Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory" );
 
-        Attributes attributes = new BasicAttributes();
-        Attribute objectClass = new BasicAttribute( "objectClass" );
+        Attributes attributes = new AttributesImpl();
+        Attribute objectClass = new AttributeImpl( "objectClass" );
         objectClass.add( "top" );
         objectClass.add( "organizationalUnit" );
         attributes.put( objectClass );
@@ -312,8 +319,8 @@
         Attributes attrs = ctx.getAttributes( "" );
         assertTrue( attrs.get( "dc" ).get().equals( "aPache" ) );
 
-        Attributes user = new BasicAttributes( "cn", "Kate Bush", true );
-        Attribute oc = new BasicAttribute( "objectClass" );
+        Attributes user = new AttributesImpl( "cn", "Kate Bush", true );
+        Attribute oc = new AttributeImpl( "objectClass" );
         oc.add( "top" );
         oc.add( "person" );
         oc.add( "organizationalPerson" );
@@ -425,8 +432,8 @@
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
         InitialLdapContext ctx = new InitialLdapContext( env, null );
 
-        Attributes user = new BasicAttributes( "cn", "Kate Bush", true );
-        Attribute oc = new BasicAttribute( "objectClass" );
+        Attributes user = new AttributesImpl( "cn", "Kate Bush", true );
+        Attribute oc = new AttributeImpl( "objectClass" );
         oc.add( "top" );
         oc.add( "person" );
         oc.add( "organizationalPerson" );

Modified: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyAddTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyAddTest.java?view=diff&rev=494163&r1=494162&r2=494163
==============================================================================
--- directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyAddTest.java (original)
+++ directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyAddTest.java Mon Jan  8 11:39:51 2007
@@ -27,18 +27,18 @@
 import javax.naming.directory.Attribute;
 import javax.naming.directory.AttributeInUseException;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.InvalidAttributeIdentifierException;
 import javax.naming.directory.InvalidAttributeValueException;
-import javax.naming.directory.ModificationItem;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.server.unit.AbstractServerTest;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
+import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 
 
 /**
@@ -61,8 +61,8 @@
      */
     protected Attributes getPersonAttributes( String sn, String cn )
     {
-        Attributes attributes = new BasicAttributes();
-        Attribute attribute = new BasicAttribute( "objectClass" );
+        Attributes attributes = new AttributesImpl();
+        Attribute attribute = new AttributeImpl( "objectClass" );
         attribute.add( "top" );
         attribute.add( "person" );
         attributes.put( attribute );
@@ -119,7 +119,7 @@
     {
         // Add telephoneNumber attribute
         String newValue = "1234567890";
-        Attributes attrs = new BasicAttributes( "telephoneNumber", newValue );
+        Attributes attrs = new AttributesImpl( "telephoneNumber", newValue );
         ctx.modifyAttributes( RDN, DirContext.ADD_ATTRIBUTE, attrs );
 
         // Verify, that attribute value is added
@@ -141,10 +141,10 @@
         // Add telephoneNumber attribute
         String[] newValues =
             { "1234567890", "999999999" };
-        Attribute attr = new BasicAttribute( "telephoneNumber" );
+        Attribute attr = new AttributeImpl( "telephoneNumber" );
         attr.add( newValues[0] );
         attr.add( newValues[1] );
-        Attributes attrs = new BasicAttributes();
+        Attributes attrs = new AttributesImpl();
         attrs.put( attr );
         ctx.modifyAttributes( RDN, DirContext.ADD_ATTRIBUTE, attrs );
 
@@ -168,7 +168,7 @@
         // A new description attribute value
         String newValue = "A new description for this person";
         assertFalse( newValue.equals( PERSON_DESCRIPTION ) );
-        Attributes attrs = new BasicAttributes( "description", newValue );
+        Attributes attrs = new AttributesImpl( "description", newValue );
 
         ctx.modifyAttributes( RDN, DirContext.ADD_ATTRIBUTE, attrs );
 
@@ -195,7 +195,7 @@
     public void testAddExistingAttributeValue() throws NamingException
     {
         // Change description attribute
-        Attributes attrs = new BasicAttributes( "description", PERSON_DESCRIPTION );
+        Attributes attrs = new AttributesImpl( "description", PERSON_DESCRIPTION );
         
         try
         {
@@ -230,23 +230,23 @@
     public void testAddExistingNthAttributesDirServer664() throws NamingException
     {
         // Change description attribute
-        Attributes attrs = new BasicAttributes( true );
-        attrs.put( new BasicAttribute( "attr1", "attr 1" ) );
-        attrs.put( new BasicAttribute( "attr2", "attr 2" ) );
-        attrs.put( new BasicAttribute( "attr3", "attr 3" ) );
-        attrs.put( new BasicAttribute( "attr4", "attr 4" ) );
-        attrs.put( new BasicAttribute( "attr5", "attr 5" ) );
-        attrs.put( new BasicAttribute( "attr6", "attr 6" ) );
-        attrs.put( new BasicAttribute( "attr7", "attr 7" ) );
-        attrs.put( new BasicAttribute( "attr8", "attr 8" ) );
-        attrs.put( new BasicAttribute( "attr9", "attr 9" ) );
-        attrs.put( new BasicAttribute( "attr10", "attr 10" ) );
-        attrs.put( new BasicAttribute( "attr11", "attr 11" ) );
-        attrs.put( new BasicAttribute( "attr12", "attr 12" ) );
-        attrs.put( new BasicAttribute( "attr13", "attr 13" ) );
-        attrs.put( new BasicAttribute( "attr14", "attr 14" ) );
+        Attributes attrs = new AttributesImpl( true );
+        attrs.put( new AttributeImpl( "attr1", "attr 1" ) );
+        attrs.put( new AttributeImpl( "attr2", "attr 2" ) );
+        attrs.put( new AttributeImpl( "attr3", "attr 3" ) );
+        attrs.put( new AttributeImpl( "attr4", "attr 4" ) );
+        attrs.put( new AttributeImpl( "attr5", "attr 5" ) );
+        attrs.put( new AttributeImpl( "attr6", "attr 6" ) );
+        attrs.put( new AttributeImpl( "attr7", "attr 7" ) );
+        attrs.put( new AttributeImpl( "attr8", "attr 8" ) );
+        attrs.put( new AttributeImpl( "attr9", "attr 9" ) );
+        attrs.put( new AttributeImpl( "attr10", "attr 10" ) );
+        attrs.put( new AttributeImpl( "attr11", "attr 11" ) );
+        attrs.put( new AttributeImpl( "attr12", "attr 12" ) );
+        attrs.put( new AttributeImpl( "attr13", "attr 13" ) );
+        attrs.put( new AttributeImpl( "attr14", "attr 14" ) );
         
-        Attribute attr = new BasicAttribute( "description", PERSON_DESCRIPTION );
+        Attribute attr = new AttributeImpl( "description", PERSON_DESCRIPTION );
 
         attrs.put( attr );
         
@@ -276,8 +276,8 @@
     public void testTwoDescriptionDirServer643() throws NamingException
     {
         // Change description attribute
-        Attributes attrs = new BasicAttributes( true );
-        Attribute attr = new BasicAttribute( "description", "a British singer-songwriter with an expressive four-octave voice" );
+        Attributes attrs = new AttributesImpl( true );
+        Attribute attr = new AttributeImpl( "description", "a British singer-songwriter with an expressive four-octave voice" );
         attr.add( "one of the most influential female artists of the twentieth century" );
         attrs.put( attr );
         
@@ -304,10 +304,10 @@
     public void testAddDuplicateValueToExistingAttribute() throws NamingException
     {
         // modify object classes, add a new value twice
-        Attribute ocls = new BasicAttribute( "objectClass", "organizationalPerson" );
-        ModificationItem[] modItems = new ModificationItem[2];
-        modItems[0] = new ModificationItem( DirContext.ADD_ATTRIBUTE, ocls );
-        modItems[1] = new ModificationItem( DirContext.ADD_ATTRIBUTE, ocls );
+        Attribute ocls = new AttributeImpl( "objectClass", "organizationalPerson" );
+        ModificationItemImpl[] modItems = new ModificationItemImpl[2];
+        modItems[0] = new ModificationItemImpl( DirContext.ADD_ATTRIBUTE, ocls );
+        modItems[1] = new ModificationItemImpl( DirContext.ADD_ATTRIBUTE, ocls );
         try
         {
             ctx.modifyAttributes( RDN, modItems );
@@ -336,10 +336,10 @@
     public void testAddDuplicateValueToNewAttribute() throws NamingException
     {
         // add the same description value twice
-        Attribute desc = new BasicAttribute( "description", "another description value besides songwriter" );
-        ModificationItem[] modItems = new ModificationItem[2];
-        modItems[0] = new ModificationItem( DirContext.ADD_ATTRIBUTE, desc );
-        modItems[1] = new ModificationItem( DirContext.ADD_ATTRIBUTE, desc );
+        Attribute desc = new AttributeImpl( "description", "another description value besides songwriter" );
+        ModificationItemImpl[] modItems = new ModificationItemImpl[2];
+        modItems[0] = new ModificationItemImpl( DirContext.ADD_ATTRIBUTE, desc );
+        modItems[1] = new ModificationItemImpl( DirContext.ADD_ATTRIBUTE, desc );
         try
         {
             ctx.modifyAttributes( RDN, modItems );
@@ -399,7 +399,7 @@
     {
         // Add a not existing attribute
         String newValue = "unbelievable";
-        Attributes attrs = new BasicAttributes( "voice", newValue );
+        Attributes attrs = new AttributesImpl( "voice", newValue );
 
         try
         {
@@ -431,19 +431,19 @@
         String[] descriptions = {
                 "Kate Bush is a British singer-songwriter.",
                 "She has become one of the most influential female artists of the twentieth century." };
-        Attribute desc1 = new BasicAttribute("description");
+        Attribute desc1 = new AttributeImpl("description");
         desc1.add(descriptions[0]);
         desc1.add(descriptions[1]);
 
-        ModificationItem addModOp = new ModificationItem(
+        ModificationItemImpl addModOp = new ModificationItemImpl(
                 DirContext.ADD_ATTRIBUTE, desc1);
 
-        Attribute desc2 = new BasicAttribute("description");
+        Attribute desc2 = new AttributeImpl("description");
         desc2.add(descriptions[1]);
-        ModificationItem delModOp = new ModificationItem(
+        ModificationItemImpl delModOp = new ModificationItemImpl(
                 DirContext.REMOVE_ATTRIBUTE, desc2);
 
-        ctx.modifyAttributes(rdn, new ModificationItem[] { addModOp,
+        ctx.modifyAttributes(rdn, new ModificationItemImpl[] { addModOp,
                         delModOp });
 
         SearchControls sctls = new SearchControls();
@@ -483,7 +483,7 @@
         ctx.createSubcontext(rdn, attrs);
 
         // Try to modify the cn attribute
-        Attribute desc1 = new BasicAttribute( "cn", "Georges Bush" );
+        Attribute desc1 = new AttributeImpl( "cn", "Georges Bush" );
 
         ModificationItem addModOp = new ModificationItem(
                 DirContext.REPLACE_ATTRIBUTE, desc1);
@@ -518,8 +518,8 @@
      */
     public void testModifyAddWithInvalidNumberOfAttributeValues() throws NamingException
     {
-        Attributes attrs = new BasicAttributes();
-        Attribute ocls = new BasicAttribute( "objectClass" );
+        Attributes attrs = new AttributesImpl();
+        Attribute ocls = new AttributeImpl( "objectClass" );
         ocls.add( "top" );
         ocls.add( "inetOrgPerson" );
         attrs.put( ocls );
@@ -528,8 +528,8 @@
         ctx.createSubcontext( "cn=Fiona Apple", attrs );
         
         // add two displayNames to an inetOrgPerson
-        attrs = new BasicAttributes();
-        Attribute displayName = new BasicAttribute( "displayName" );
+        attrs = new AttributesImpl();
+        Attribute displayName = new AttributeImpl( "displayName" );
         displayName.add( "Fiona" );
         displayName.add( "Fiona A." );
         attrs.put( displayName );

Modified: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyRdnTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyRdnTest.java?view=diff&rev=494163&r1=494162&r2=494163
==============================================================================
--- directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyRdnTest.java (original)
+++ directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyRdnTest.java Mon Jan  8 11:39:51 2007
@@ -26,13 +26,13 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
 import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.server.unit.AbstractServerTest;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
 
 
 /**
@@ -53,8 +53,8 @@
      */
     protected Attributes getPersonAttributes( String sn, String cn )
     {
-        Attributes attributes = new BasicAttributes();
-        Attribute attribute = new BasicAttribute( "objectClass" );
+        Attributes attributes = new AttributesImpl();
+        Attribute attribute = new AttributeImpl( "objectClass" );
         attribute.add( "top" );
         attribute.add( "person" );
         attributes.put( attribute );

Modified: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyRemoveTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyRemoveTest.java?view=diff&rev=494163&r1=494162&r2=494163
==============================================================================
--- directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyRemoveTest.java (original)
+++ directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyRemoveTest.java Mon Jan  8 11:39:51 2007
@@ -26,12 +26,9 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.InvalidAttributeIdentifierException;
 import javax.naming.directory.InvalidAttributeValueException;
-import javax.naming.directory.ModificationItem;
 import javax.naming.directory.NoSuchAttributeException;
 import javax.naming.directory.SchemaViolationException;
 import javax.naming.directory.SearchControls;
@@ -40,6 +37,9 @@
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.server.unit.AbstractServerTest;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
+import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 
 
 /**
@@ -62,8 +62,8 @@
      */
     protected Attributes getPersonAttributes( String sn, String cn )
     {
-        Attributes attributes = new BasicAttributes();
-        Attribute attribute = new BasicAttribute( "objectClass" );
+        Attributes attributes = new AttributesImpl();
+        Attribute attribute = new AttributeImpl( "objectClass" );
         attribute.add( "top" );
         attribute.add( "person" );
         attributes.put( attribute );
@@ -79,8 +79,8 @@
      */
     protected Attributes getInetOrgPersonAttributes( String sn, String cn )
     {
-        Attributes attrs = new BasicAttributes();
-        Attribute ocls = new BasicAttribute( "objectClass" );
+        Attributes attrs = new AttributesImpl();
+        Attribute ocls = new AttributeImpl( "objectClass" );
         ocls.add( "top" );
         ocls.add( "person" );
         ocls.add( "organizationalPerson" );
@@ -152,8 +152,8 @@
     public void testRemoveNotRequiredAttribute() throws NamingException
     {
         // Remove description Attribute
-        Attribute attr = new BasicAttribute( "description" );
-        Attributes attrs = new BasicAttributes();
+        Attribute attr = new AttributeImpl( "description" );
+        Attributes attrs = new AttributesImpl();
         attrs.put( attr );
         ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, attrs );
 
@@ -175,13 +175,13 @@
     public void testRemoveTwoNotRequiredAttributes() throws NamingException
     {
         // add telephoneNumber to entry
-        Attributes tn = new BasicAttributes( "telephoneNumber", "12345678" );
+        Attributes tn = new AttributesImpl( "telephoneNumber", "12345678" );
         ctx.modifyAttributes( RDN, DirContext.ADD_ATTRIBUTE, tn );
 
         // Remove description and telephoneNumber to Attribute
-        Attributes attrs = new BasicAttributes();
-        attrs.put( new BasicAttribute( "description" ) );
-        attrs.put( new BasicAttribute( "telephoneNumber" ) );
+        Attributes attrs = new AttributesImpl();
+        attrs.put( new AttributeImpl( "description" ) );
+        attrs.put( new AttributeImpl( "telephoneNumber" ) );
         ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, attrs );
 
         // Verify, that attributes are deleted
@@ -204,8 +204,8 @@
     public void testRemoveRequiredAttribute() throws NamingException
     {
         // Remove sn attribute
-        Attribute attr = new BasicAttribute( "sn" );
-        Attributes attrs = new BasicAttributes();
+        Attribute attr = new AttributeImpl( "sn" );
+        Attributes attrs = new AttributesImpl();
         attrs.put( attr );
 
         try
@@ -230,8 +230,8 @@
     public void testRemovePartOfRdn() throws NamingException
     {
         // Remove sn attribute
-        Attribute attr = new BasicAttribute( "cn" );
-        Attributes attrs = new BasicAttributes();
+        Attribute attr = new AttributeImpl( "cn" );
+        Attributes attrs = new AttributesImpl();
         attrs.put( attr );
 
         try
@@ -261,8 +261,8 @@
         ctx.rename( RDN, newRdn );
 
         // Remove description, which is now RDN attribute
-        Attribute attr = new BasicAttribute( "description" );
-        Attributes attrs = new BasicAttributes();
+        Attribute attr = new AttributeImpl( "description" );
+        Attributes attrs = new AttributesImpl();
         attrs.put( attr );
 
         try
@@ -292,8 +292,8 @@
     public void testRemoveAttributeNotPresent() throws NamingException
     {
         // Remove telephoneNumber Attribute
-        Attribute attr = new BasicAttribute( "telephoneNumber" );
-        Attributes attrs = new BasicAttributes();
+        Attribute attr = new AttributeImpl( "telephoneNumber" );
+        Attributes attrs = new AttributesImpl();
         attrs.put( attr );
 
         try
@@ -318,8 +318,8 @@
     public void testRemoveAttributeNotValid() throws NamingException
     {
         // Remove phantasy attribute
-        Attribute attr = new BasicAttribute( "XXX" );
-        Attributes attrs = new BasicAttributes();
+        Attribute attr = new AttributeImpl( "XXX" );
+        Attributes attrs = new AttributesImpl();
         attrs.put( attr );
 
         try
@@ -350,9 +350,9 @@
         ctx.createSubcontext( rdn, attrs );
 
         // replace attribute givenName with empty value (=> deletion)
-        Attribute attr = new BasicAttribute( "givenname" );
-        ModificationItem item = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr );
-        ctx.modifyAttributes( rdn, new ModificationItem[] { item } );
+        Attribute attr = new AttributeImpl( "givenname" );
+        ModificationItemImpl item = new ModificationItemImpl( DirContext.REPLACE_ATTRIBUTE, attr );
+        ctx.modifyAttributes( rdn, new ModificationItemImpl[] { item } );
 
         SearchControls sctls = new SearchControls();
         sctls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
@@ -393,12 +393,12 @@
         ctx.createSubcontext( rdn, attrs );
 
         // replace attribute cn with empty value (=> deletion)
-        Attribute attr = new BasicAttribute( "cn" );
-        ModificationItem item = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr );
+        Attribute attr = new AttributeImpl( "cn" );
+        ModificationItemImpl item = new ModificationItemImpl( DirContext.REPLACE_ATTRIBUTE, attr );
 
         try
         {
-            ctx.modifyAttributes( rdn, new ModificationItem[]
+            ctx.modifyAttributes( rdn, new ModificationItemImpl[]
                 { item } );
             fail( "modify should fail" );
         }
@@ -423,12 +423,12 @@
         ctx.createSubcontext( rdn, attrs );
 
         // replace attribute cn with empty value (=> deletion)
-        Attribute attr = new BasicAttribute( "cn" );
-        ModificationItem item = new ModificationItem( DirContext.REMOVE_ATTRIBUTE, attr );
+        Attribute attr = new AttributeImpl( "cn" );
+        ModificationItemImpl item = new ModificationItemImpl( DirContext.REMOVE_ATTRIBUTE, attr );
 
         try
         {
-            ctx.modifyAttributes( rdn, new ModificationItem[]
+            ctx.modifyAttributes( rdn, new ModificationItemImpl[]
                 { item } );
             fail( "modify should fail" );
         }
@@ -453,12 +453,12 @@
         ctx.createSubcontext( rdn, attrs );
 
         // replace attribute cn with empty value (=> deletion)
-        Attribute attr = new BasicAttribute( "cn", "Kate Bush" );
-        ModificationItem item = new ModificationItem( DirContext.REMOVE_ATTRIBUTE, attr );
+        Attribute attr = new AttributeImpl( "cn", "Kate Bush" );
+        ModificationItemImpl item = new ModificationItemImpl( DirContext.REMOVE_ATTRIBUTE, attr );
 
         try
         {
-            ctx.modifyAttributes( rdn, new ModificationItem[]
+            ctx.modifyAttributes( rdn, new ModificationItemImpl[]
                 { item } );
             fail( "modify should fail" );
         }
@@ -480,10 +480,10 @@
         String rdn = "cn=Kate Bush";
         ctx.createSubcontext(rdn, attrs);
 
-        ModificationItem delModOp = new ModificationItem(DirContext.REMOVE_ATTRIBUTE, new BasicAttribute("objectclass", ""));
+        ModificationItemImpl delModOp = new ModificationItemImpl(DirContext.REMOVE_ATTRIBUTE, new AttributeImpl("objectclass", ""));
 
         try {
-            ctx.modifyAttributes(rdn, new ModificationItem[] { delModOp });
+            ctx.modifyAttributes(rdn, new ModificationItemImpl[] { delModOp });
             fail("deletion of objectclass should fail");
         } catch (SchemaViolationException e) {
             // expected
@@ -507,10 +507,10 @@
         String rdn = "cn=Kate Bush";
         ctx.createSubcontext(rdn, attrs);
 
-        ModificationItem delModOp = new ModificationItem(DirContext.REMOVE_ATTRIBUTE, new BasicAttribute("objectclass"));
+        ModificationItemImpl delModOp = new ModificationItemImpl(DirContext.REMOVE_ATTRIBUTE, new AttributeImpl("objectclass"));
 
         try {
-            ctx.modifyAttributes(rdn, new ModificationItem[] { delModOp });
+            ctx.modifyAttributes(rdn, new ModificationItemImpl[] { delModOp });
             fail("deletion of objectclass should fail");
         } catch (SchemaViolationException e) {
             // expected

Modified: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyReplaceITest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyReplaceITest.java?view=diff&rev=494163&r1=494162&r2=494163
==============================================================================
--- directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyReplaceITest.java (original)
+++ directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyReplaceITest.java Mon Jan  8 11:39:51 2007
@@ -27,15 +27,15 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.InitialDirContext;
-import javax.naming.directory.ModificationItem;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.unit.AbstractServerTest;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
+import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 
 
 /**
@@ -51,8 +51,8 @@
 
     protected Attributes getPersonAttributes( String sn, String cn )
     {
-        Attributes attrs = new BasicAttributes();
-        Attribute ocls = new BasicAttribute( "objectClass" );
+        Attributes attrs = new AttributesImpl();
+        Attribute ocls = new AttributeImpl( "objectClass" );
         ocls.add( "top" );
         ocls.add( "person" );
         attrs.put( ocls );
@@ -94,10 +94,10 @@
         String rdn = "cn=Kate Bush";
         ctx.createSubcontext( rdn, attrs );
 
-        Attribute attr = new BasicAttribute( "description" );
-        ModificationItem item = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr );
+        Attribute attr = new AttributeImpl( "description" );
+        ModificationItemImpl item = new ModificationItemImpl( DirContext.REPLACE_ATTRIBUTE, attr );
 
-        ctx.modifyAttributes( rdn, new ModificationItem[]
+        ctx.modifyAttributes( rdn, new ModificationItemImpl[]
             { item } );
 
         SearchControls sctls = new SearchControls();
@@ -128,10 +128,10 @@
         String rdn = "cn=Kate Bush";
         ctx.createSubcontext( rdn, attrs );
 
-        Attribute attr = new BasicAttribute( "numberOfOctaves" );
-        ModificationItem item = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr );
+        Attribute attr = new AttributeImpl( "numberOfOctaves" );
+        ModificationItemImpl item = new ModificationItemImpl( DirContext.REPLACE_ATTRIBUTE, attr );
 
-        ctx.modifyAttributes( rdn, new ModificationItem[]
+        ctx.modifyAttributes( rdn, new ModificationItemImpl[]
             { item } );
 
         SearchControls sctls = new SearchControls();

Modified: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java?view=diff&rev=494163&r1=494162&r2=494163
==============================================================================
--- directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java (original)
+++ directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java Mon Jan  8 11:39:51 2007
@@ -26,8 +26,6 @@
 import javax.naming.NamingEnumeration;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.InitialDirContext;
 import javax.naming.directory.SearchResult;
@@ -46,6 +44,8 @@
 import org.apache.directory.shared.ldap.codec.search.controls.ChangeType;
 import org.apache.directory.shared.ldap.codec.search.controls.EntryChangeControl;
 import org.apache.directory.shared.ldap.codec.search.controls.EntryChangeControlDecoder;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.PersistentSearchControl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -70,8 +70,8 @@
      */
     protected Attributes getPersonAttributes( String sn, String cn )
     {
-        Attributes attributes = new BasicAttributes();
-        Attribute attribute = new BasicAttribute( "objectClass" );
+        Attributes attributes = new AttributesImpl();
+        Attribute attribute = new AttributeImpl( "objectClass" );
         attribute.add( "top" );
         attribute.add( "person" );
         attributes.put( attribute );
@@ -139,7 +139,7 @@
         }
         Thread.sleep( 250 );
 
-        ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, new BasicAttributes( "description", PERSON_DESCRIPTION,
+        ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, new AttributesImpl( "description", PERSON_DESCRIPTION,
             true ) );
         long start = System.currentTimeMillis();
         while ( t.isAlive() )
@@ -270,7 +270,7 @@
         }
         Thread.sleep( 250 );
 
-        ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, new BasicAttributes( "description", PERSON_DESCRIPTION,
+        ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, new AttributesImpl( "description", PERSON_DESCRIPTION,
             true ) );
         long start = System.currentTimeMillis();
         while ( t.isAlive() )
@@ -451,7 +451,7 @@
         assertNull( listener.result );
 
         // thread is still waiting for notifications try a modify
-        ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, new BasicAttributes( "description", PERSON_DESCRIPTION,
+        ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, new AttributesImpl( "description", PERSON_DESCRIPTION,
             true ) );
         start = System.currentTimeMillis();
         while ( t.isAlive() )
@@ -593,7 +593,7 @@
         // assertNull( listener.result );
 
         // thread is still waiting for notifications try a modify
-        ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, new BasicAttributes( "description", PERSON_DESCRIPTION,
+        ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, new AttributesImpl( "description", PERSON_DESCRIPTION,
             true ) );
         start = System.currentTimeMillis();
         while ( t.isAlive() )

Modified: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ReferralTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ReferralTest.java?view=diff&rev=494163&r1=494162&r2=494163
==============================================================================
--- directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ReferralTest.java (original)
+++ directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ReferralTest.java Mon Jan  8 11:39:51 2007
@@ -35,16 +35,16 @@
 import javax.naming.ReferralException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
-import javax.naming.directory.ModificationItem;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.server.unit.AbstractServerTest;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
+import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 
 
 /**
@@ -63,8 +63,8 @@
      */
     protected Attributes getPersonAttributes( String sn, String cn )
     {
-        Attributes attributes = new BasicAttributes();
-        Attribute attribute = new BasicAttribute( "objectClass" );
+        Attributes attributes = new AttributesImpl();
+        Attribute attribute = new AttributeImpl( "objectClass" );
         attribute.add( "top" );
         attribute.add( "person" );
         attributes.put( attribute );
@@ -131,7 +131,7 @@
         // -------------------------------------------------------------------
 
         // Add a referral entry ( should be fine with or without the control )
-        Attributes referral = new BasicAttributes( "objectClass", "top", true );
+        Attributes referral = new AttributesImpl( "objectClass", "top", true );
         referral.get( "objectClass" ).add( "referral" );
         referral.get( "objectClass" ).add( "extensibleObject" );
         referral.put( "ref", ref0 );
@@ -205,7 +205,7 @@
         // -------------------------------------------------------------------
 
         td.refCtx.addToEnvironment( Context.REFERRAL, "throw" );
-        Attributes userEntry = new BasicAttributes( "objectClass", "top", true );
+        Attributes userEntry = new AttributesImpl( "objectClass", "top", true );
         userEntry.get( "objectClass" ).add( "person" );
         userEntry.put( "sn", "karasulu" );
         userEntry.put( "cn", "alex karasulu" );
@@ -236,7 +236,7 @@
         // -------------------------------------------------------------------
 
         td.refCtx.addToEnvironment( Context.REFERRAL, "throw" );
-        Attributes userEntry = new BasicAttributes( "objectClass", "top", true );
+        Attributes userEntry = new AttributesImpl( "objectClass", "top", true );
         userEntry.get( "objectClass" ).add( "person" );
         userEntry.put( "sn", "karasulu" );
         userEntry.put( "cn", "alex karasulu" );
@@ -324,7 +324,7 @@
         td.refCtx.addToEnvironment( Context.REFERRAL, "throw" );
         try
         {
-            td.refCtx.modifyAttributes( "cn=alex karasulu", DirContext.ADD_ATTRIBUTE, new BasicAttributes(
+            td.refCtx.modifyAttributes( "cn=alex karasulu", DirContext.ADD_ATTRIBUTE, new AttributesImpl(
                 "description", "just some text", true ) );
             fail( "Should fail here throwing a ReferralException" );
         }
@@ -352,7 +352,7 @@
         td.refCtx.addToEnvironment( Context.REFERRAL, "throw" );
         try
         {
-            td.refCtx.modifyAttributes( "cn=alex karasulu,ou=apache", DirContext.ADD_ATTRIBUTE, new BasicAttributes(
+            td.refCtx.modifyAttributes( "cn=alex karasulu,ou=apache", DirContext.ADD_ATTRIBUTE, new AttributesImpl(
                 "description", "just some text", true ) );
             fail( "Should fail here throwing a ReferralException" );
         }
@@ -380,8 +380,8 @@
         td.refCtx.addToEnvironment( Context.REFERRAL, "throw" );
         try
         {
-            ModificationItem[] mods = new ModificationItem[]
-                { new ModificationItem( DirContext.ADD_ATTRIBUTE, new BasicAttribute( "description", "just some text" ) ) };
+            ModificationItemImpl[] mods = new ModificationItemImpl[]
+                { new ModificationItemImpl( DirContext.ADD_ATTRIBUTE, new AttributeImpl( "description", "just some text" ) ) };
             td.refCtx.modifyAttributes( "cn=alex karasulu", mods );
             fail( "Should fail here throwing a ReferralException" );
         }
@@ -409,8 +409,8 @@
         td.refCtx.addToEnvironment( Context.REFERRAL, "throw" );
         try
         {
-            ModificationItem[] mods = new ModificationItem[]
-                { new ModificationItem( DirContext.ADD_ATTRIBUTE, new BasicAttribute( "description", "just some text" ) ) };
+            ModificationItemImpl[] mods = new ModificationItemImpl[]
+                { new ModificationItemImpl( DirContext.ADD_ATTRIBUTE, new AttributeImpl( "description", "just some text" ) ) };
             td.refCtx.modifyAttributes( "cn=alex karasulu,ou=apache", mods );
             fail( "Should fail here throwing a ReferralException" );
         }
@@ -728,7 +728,7 @@
     public void createLocalUser() throws Exception
     {
         LdapContext userCtx = null;
-        Attributes referral = new BasicAttributes( "objectClass", "top", true );
+        Attributes referral = new AttributesImpl( "objectClass", "top", true );
         referral.get( "objectClass" ).add( "person" );
         referral.put( "cn", "akarasulu" );
         referral.put( "sn", "karasulu" );
@@ -757,7 +757,7 @@
     public void createDeepLocalUser() throws Exception
     {
         LdapContext userCtx = null;
-        Attributes referral = new BasicAttributes( "objectClass", "top", true );
+        Attributes referral = new AttributesImpl( "objectClass", "top", true );
         referral.get( "objectClass" ).add( "person" );
         referral.put( "cn", "akarasulu" );
         referral.put( "sn", "karasulu" );
@@ -778,7 +778,7 @@
         }
         try
         {
-            Attributes ouAttrs = new BasicAttributes( "objectClass", "top", true );
+            Attributes ouAttrs = new AttributesImpl( "objectClass", "top", true );
             ouAttrs.get( "objectClass" ).add( "organizationalUnit" );
             ouAttrs.put( "ou", "deep" );
             td.rootCtx.createSubcontext( "ou=deep", ouAttrs );

Modified: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/SearchTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/SearchTest.java?view=diff&rev=494163&r1=494162&r2=494163
==============================================================================
--- directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/SearchTest.java (original)
+++ directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/SearchTest.java Mon Jan  8 11:39:51 2007
@@ -30,8 +30,6 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
@@ -41,6 +39,8 @@
 
 import org.apache.directory.server.core.subtree.SubentryService;
 import org.apache.directory.server.unit.AbstractServerTest;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.SubentriesControl;
 
 
@@ -112,8 +112,8 @@
      */
     protected Attributes getPersonAttributes( String sn, String cn )
     {
-        Attributes attributes = new BasicAttributes();
-        Attribute attribute = new BasicAttribute( "objectClass" );
+        Attributes attributes = new AttributesImpl();
+        Attribute attribute = new AttributeImpl( "objectClass" );
         attribute.add( "top" );
         attribute.add( "person" );
         attributes.put( attribute );
@@ -477,13 +477,13 @@
         Attribute administrativeRole = ap.get( "administrativeRole" );
         if ( administrativeRole == null || !administrativeRole.contains( SubentryService.AC_AREA ) )
         {
-            Attributes changes = new BasicAttributes( "administrativeRole", SubentryService.AC_AREA, true );
+            Attributes changes = new AttributesImpl( "administrativeRole", SubentryService.AC_AREA, true );
             adminCtx.modifyAttributes( "", DirContext.ADD_ATTRIBUTE, changes );
         }
 
         // now add the A/C subentry below ou=system
-        Attributes subentry = new BasicAttributes( "cn", cn, true );
-        Attribute objectClass = new BasicAttribute( "objectClass" );
+        Attributes subentry = new AttributesImpl( "cn", cn, true );
+        Attribute objectClass = new AttributeImpl( "objectClass" );
         subentry.put( objectClass );
         objectClass.add( "top" );
         objectClass.add( "subentry" );
@@ -502,8 +502,8 @@
     {
 
         // Create entry
-        Attributes heather = new BasicAttributes();
-        Attribute ocls = new BasicAttribute( "objectClass" );
+        Attributes heather = new AttributesImpl();
+        Attribute ocls = new AttributeImpl( "objectClass" );
         ocls.add( "top" );
         ocls.add( "person" );
         heather.put( ocls );
@@ -545,7 +545,7 @@
     {
 
         // Create entry
-        Attributes kate = new BasicAttributes();
+        Attributes kate = new AttributesImpl();
         kate.put( "objectClass", "organizationalperson" );
         kate.put( "cn", "Kate Bush" );
         kate.put( "sn", "Bush" );
@@ -838,8 +838,8 @@
 //    public void testSearchAttrC_L() throws NamingException
 //    {
 //        // create administrative area
-//        Attributes aaAttrs = new BasicAttributes();
-//        Attribute aaObjectClass = new BasicAttribute( "objectClass" );
+//        Attributes aaAttrs = new AttributesImpl();
+//        Attribute aaObjectClass = new AttributeImpl( "objectClass" );
 //        aaObjectClass.add( "top" );
 //        aaObjectClass.add( "organizationalUnit" );
 //        aaObjectClass.add( "extensibleObject" );
@@ -849,8 +849,8 @@
 //        DirContext aaCtx = ctx.createSubcontext( "ou=Collective Area", aaAttrs );
 //        
 //        // create subentry
-//        Attributes subentry = new BasicAttributes();
-//        Attribute objectClass = new BasicAttribute( "objectClass" );
+//        Attributes subentry = new AttributesImpl();
+//        Attribute objectClass = new AttributeImpl( "objectClass" );
 //        objectClass.add( "top" );
 //        objectClass.add( "subentry" );
 //        objectClass.add( "collectiveAttributeSubentry" );

Modified: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java?view=diff&rev=494163&r1=494162&r2=494163
==============================================================================
--- directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java (original)
+++ directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java Mon Jan  8 11:39:51 2007
@@ -29,13 +29,13 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
 
 import org.apache.directory.server.core.configuration.MutablePartitionConfiguration;
 import org.apache.directory.server.core.unit.AbstractAdminTestCase;
 import org.apache.directory.shared.ldap.exception.LdapConfigurationException;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
 
 
 /**
@@ -53,7 +53,7 @@
 
     public void setUp() throws Exception
     {
-        BasicAttributes attrs;
+        Attributes attrs;
         Set indexedAttrs;
         Set pcfgs = new HashSet();
 
@@ -69,13 +69,13 @@
         indexedAttrs.add( "objectClass" );
         pcfg.setIndexedAttributes( indexedAttrs );
 
-        attrs = new BasicAttributes( true );
-        BasicAttribute attr = new BasicAttribute( "objectClass" );
+        attrs = new AttributesImpl( true );
+        Attribute attr = new AttributeImpl( "objectClass" );
         attr.add( "top" );
         attr.add( "organizationalUnit" );
         attr.add( "extensibleObject" );
         attrs.put( attr );
-        attr = new BasicAttribute( "ou" );
+        attr = new AttributeImpl( "ou" );
         attr.add( "testing" );
         attrs.put( attr );
         pcfg.setContextEntry( attrs );
@@ -93,13 +93,13 @@
         indexedAttrs.add( "objectClass" );
         pcfg.setIndexedAttributes( indexedAttrs );
 
-        attrs = new BasicAttributes( true );
-        attr = new BasicAttribute( "objectClass" );
+        attrs = new AttributesImpl( true );
+        attr = new AttributeImpl( "objectClass" );
         attr.add( "top" );
         attr.add( "domain" );
         attr.add( "extensibleObject" );
         attrs.put( attr );
-        attr = new BasicAttribute( "dc" );
+        attr = new AttributeImpl( "dc" );
         attr.add( "example" );
         attrs.put( attr );
         pcfg.setContextEntry( attrs );
@@ -116,13 +116,13 @@
         indexedAttrs.add( "objectClass" );
         pcfg.setIndexedAttributes( indexedAttrs );
 
-        attrs = new BasicAttributes( true );
-        attr = new BasicAttribute( "objectClass" );
+        attrs = new AttributesImpl( true );
+        attr = new AttributeImpl( "objectClass" );
         attr.add( "top" );
         attr.add( "domain" );
         attr.add( "extensibleObject" );
         attrs.put( attr );
-        attr = new BasicAttribute( "dc" );
+        attr = new AttributeImpl( "dc" );
         attr.add( "MixedCase" );
         attrs.put( attr );
         pcfg.setContextEntry( attrs );



Mime
View raw message