directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r498848 [4/4] - in /directory/apacheds/branches/1.0: core-unit/src/main/java/org/apache/directory/server/core/unit/ core-unit/src/test/java/org/apache/directory/server/core/ core-unit/src/test/java/org/apache/directory/server/core/authn/ co...
Date Mon, 22 Jan 2007 23:25:59 GMT
Modified: directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyRemoveTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyRemoveTest.java?view=diff&rev=498848&r1=498847&r2=498848
==============================================================================
--- directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyRemoveTest.java
(original)
+++ directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyRemoveTest.java
Mon Jan 22 15:25:45 2007
@@ -37,8 +37,8 @@
 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.LockableAttributeImpl;
+import org.apache.directory.shared.ldap.message.LockableAttributesImpl;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 
 
@@ -62,8 +62,8 @@
      */
     protected Attributes getPersonAttributes( String sn, String cn )
     {
-        Attributes attributes = new AttributesImpl();
-        Attribute attribute = new AttributeImpl( "objectClass" );
+        Attributes attributes = new LockableAttributesImpl();
+        Attribute attribute = new LockableAttributeImpl( "objectClass" );
         attribute.add( "top" );
         attribute.add( "person" );
         attributes.put( attribute );
@@ -79,8 +79,8 @@
      */
     protected Attributes getInetOrgPersonAttributes( String sn, String cn )
     {
-        Attributes attrs = new AttributesImpl();
-        Attribute ocls = new AttributeImpl( "objectClass" );
+        Attributes attrs = new LockableAttributesImpl();
+        Attribute ocls = new LockableAttributeImpl( "objectClass" );
         ocls.add( "top" );
         ocls.add( "person" );
         ocls.add( "organizationalPerson" );
@@ -153,8 +153,8 @@
     public void testRemoveNotRequiredAttribute() throws NamingException
     {
         // Remove description Attribute
-        Attribute attr = new AttributeImpl( "description" );
-        Attributes attrs = new AttributesImpl();
+        Attribute attr = new LockableAttributeImpl( "description" );
+        Attributes attrs = new LockableAttributesImpl();
         attrs.put( attr );
         ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, attrs );
 
@@ -176,13 +176,13 @@
     public void testRemoveTwoNotRequiredAttributes() throws NamingException
     {
         // add telephoneNumber to entry
-        Attributes tn = new AttributesImpl( "telephoneNumber", "12345678" );
+        Attributes tn = new LockableAttributesImpl( "telephoneNumber", "12345678" );
         ctx.modifyAttributes( RDN, DirContext.ADD_ATTRIBUTE, tn );
 
         // Remove description and telephoneNumber to Attribute
-        Attributes attrs = new AttributesImpl();
-        attrs.put( new AttributeImpl( "description" ) );
-        attrs.put( new AttributeImpl( "telephoneNumber" ) );
+        Attributes attrs = new LockableAttributesImpl();
+        attrs.put( new LockableAttributeImpl( "description" ) );
+        attrs.put( new LockableAttributeImpl( "telephoneNumber" ) );
         ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, attrs );
 
         // Verify, that attributes are deleted
@@ -205,8 +205,8 @@
     public void testRemoveRequiredAttribute() throws NamingException
     {
         // Remove sn attribute
-        Attribute attr = new AttributeImpl( "sn" );
-        Attributes attrs = new AttributesImpl();
+        Attribute attr = new LockableAttributeImpl( "sn" );
+        Attributes attrs = new LockableAttributesImpl();
         attrs.put( attr );
 
         try
@@ -231,8 +231,8 @@
     public void testRemovePartOfRdn() throws NamingException
     {
         // Remove sn attribute
-        Attribute attr = new AttributeImpl( "cn" );
-        Attributes attrs = new AttributesImpl();
+        Attribute attr = new LockableAttributeImpl( "cn" );
+        Attributes attrs = new LockableAttributesImpl();
         attrs.put( attr );
 
         try
@@ -262,8 +262,8 @@
         ctx.rename( RDN, newRdn );
 
         // Remove description, which is now RDN attribute
-        Attribute attr = new AttributeImpl( "description" );
-        Attributes attrs = new AttributesImpl();
+        Attribute attr = new LockableAttributeImpl( "description" );
+        Attributes attrs = new LockableAttributesImpl();
         attrs.put( attr );
 
         try
@@ -293,8 +293,8 @@
     public void testRemoveAttributeNotPresent() throws NamingException
     {
         // Remove telephoneNumber Attribute
-        Attribute attr = new AttributeImpl( "telephoneNumber" );
-        Attributes attrs = new AttributesImpl();
+        Attribute attr = new LockableAttributeImpl( "telephoneNumber" );
+        Attributes attrs = new LockableAttributesImpl();
         attrs.put( attr );
 
         try
@@ -319,8 +319,8 @@
     public void testRemoveAttributeNotValid() throws NamingException
     {
         // Remove phantasy attribute
-        Attribute attr = new AttributeImpl( "XXX" );
-        Attributes attrs = new AttributesImpl();
+        Attribute attr = new LockableAttributeImpl( "XXX" );
+        Attributes attrs = new LockableAttributesImpl();
         attrs.put( attr );
 
         try
@@ -351,7 +351,7 @@
         ctx.createSubcontext( rdn, attrs );
 
         // replace attribute givenName with empty value (=> deletion)
-        Attribute attr = new AttributeImpl( "givenname" );
+        Attribute attr = new LockableAttributeImpl( "givenname" );
         ModificationItemImpl item = new ModificationItemImpl( DirContext.REPLACE_ATTRIBUTE,
attr );
         ctx.modifyAttributes( rdn, new ModificationItemImpl[] { item } );
 
@@ -394,7 +394,7 @@
         ctx.createSubcontext( rdn, attrs );
 
         // replace attribute cn with empty value (=> deletion)
-        Attribute attr = new AttributeImpl( "cn" );
+        Attribute attr = new LockableAttributeImpl( "cn" );
         ModificationItemImpl item = new ModificationItemImpl( DirContext.REPLACE_ATTRIBUTE,
attr );
 
         try
@@ -424,7 +424,7 @@
         ctx.createSubcontext( rdn, attrs );
 
         // replace attribute cn with empty value (=> deletion)
-        Attribute attr = new AttributeImpl( "cn" );
+        Attribute attr = new LockableAttributeImpl( "cn" );
         ModificationItemImpl item = new ModificationItemImpl( DirContext.REMOVE_ATTRIBUTE,
attr );
 
         try
@@ -454,7 +454,7 @@
         ctx.createSubcontext( rdn, attrs );
 
         // replace attribute cn with empty value (=> deletion)
-        Attribute attr = new AttributeImpl( "cn", "Kate Bush" );
+        Attribute attr = new LockableAttributeImpl( "cn", "Kate Bush" );
         ModificationItemImpl item = new ModificationItemImpl( DirContext.REMOVE_ATTRIBUTE,
attr );
 
         try
@@ -481,7 +481,7 @@
         String rdn = "cn=Kate Bush";
         ctx.createSubcontext(rdn, attrs);
 
-        ModificationItemImpl delModOp = new ModificationItemImpl(DirContext.REMOVE_ATTRIBUTE,
new AttributeImpl("objectclass", ""));
+        ModificationItemImpl delModOp = new ModificationItemImpl(DirContext.REMOVE_ATTRIBUTE,
new LockableAttributeImpl("objectclass", ""));
 
         try {
             ctx.modifyAttributes(rdn, new ModificationItemImpl[] { delModOp });
@@ -508,7 +508,7 @@
         String rdn = "cn=Kate Bush";
         ctx.createSubcontext(rdn, attrs);
 
-        ModificationItemImpl delModOp = new ModificationItemImpl(DirContext.REMOVE_ATTRIBUTE,
new AttributeImpl("objectclass"));
+        ModificationItemImpl delModOp = new ModificationItemImpl(DirContext.REMOVE_ATTRIBUTE,
new LockableAttributeImpl("objectclass"));
 
         try {
             ctx.modifyAttributes(rdn, new ModificationItemImpl[] { delModOp });

Modified: directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyReplaceITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyReplaceITest.java?view=diff&rev=498848&r1=498847&r2=498848
==============================================================================
--- directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyReplaceITest.java
(original)
+++ directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyReplaceITest.java
Mon Jan 22 15:25:45 2007
@@ -33,8 +33,8 @@
 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.LockableAttributeImpl;
+import org.apache.directory.shared.ldap.message.LockableAttributesImpl;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 
 
@@ -51,8 +51,8 @@
 
     protected Attributes getPersonAttributes( String sn, String cn )
     {
-        Attributes attrs = new AttributesImpl();
-        Attribute ocls = new AttributeImpl( "objectClass" );
+        Attributes attrs = new LockableAttributesImpl();
+        Attribute ocls = new LockableAttributeImpl( "objectClass" );
         ocls.add( "top" );
         ocls.add( "person" );
         attrs.put( ocls );
@@ -94,7 +94,7 @@
         String rdn = "cn=Kate Bush";
         ctx.createSubcontext( rdn, attrs );
 
-        Attribute attr = new AttributeImpl( "description" );
+        Attribute attr = new LockableAttributeImpl( "description" );
         ModificationItemImpl item = new ModificationItemImpl( DirContext.REPLACE_ATTRIBUTE,
attr );
 
         ctx.modifyAttributes( rdn, new ModificationItemImpl[]
@@ -128,7 +128,7 @@
         String rdn = "cn=Kate Bush";
         ctx.createSubcontext( rdn, attrs );
 
-        Attribute attr = new AttributeImpl( "numberOfOctaves" );
+        Attribute attr = new LockableAttributeImpl( "numberOfOctaves" );
         ModificationItemImpl item = new ModificationItemImpl( DirContext.REPLACE_ATTRIBUTE,
attr );
 
         ctx.modifyAttributes( rdn, new ModificationItemImpl[]

Modified: directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java?view=diff&rev=498848&r1=498847&r2=498848
==============================================================================
--- directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java
(original)
+++ directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java
Mon Jan 22 15:25:45 2007
@@ -44,8 +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.LockableAttributeImpl;
+import org.apache.directory.shared.ldap.message.LockableAttributesImpl;
 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 AttributesImpl();
-        Attribute attribute = new AttributeImpl( "objectClass" );
+        Attributes attributes = new LockableAttributesImpl();
+        Attribute attribute = new LockableAttributeImpl( "objectClass" );
         attribute.add( "top" );
         attribute.add( "person" );
         attributes.put( attribute );
@@ -139,7 +139,7 @@
         }
         Thread.sleep( 250 );
 
-        ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, new AttributesImpl( "description",
PERSON_DESCRIPTION,
+        ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, new LockableAttributesImpl(
"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 AttributesImpl( "description",
PERSON_DESCRIPTION,
+        ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, new LockableAttributesImpl(
"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 AttributesImpl( "description",
PERSON_DESCRIPTION,
+        ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, new LockableAttributesImpl(
"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 AttributesImpl( "description",
PERSON_DESCRIPTION,
+        ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, new LockableAttributesImpl(
"description", PERSON_DESCRIPTION,
             true ) );
         start = System.currentTimeMillis();
         while ( t.isAlive() )

Modified: directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/ReferralITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/ReferralITest.java?view=diff&rev=498848&r1=498847&r2=498848
==============================================================================
--- directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/ReferralITest.java
(original)
+++ directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/ReferralITest.java
Mon Jan 22 15:25:45 2007
@@ -39,8 +39,8 @@
 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.LockableAttributeImpl;
+import org.apache.directory.shared.ldap.message.LockableAttributesImpl;
 
 
 /**
@@ -59,8 +59,8 @@
      */
     protected Attributes getPersonAttributes( String sn, String cn )
     {
-        Attributes attributes = new AttributesImpl();
-        Attribute attribute = new AttributeImpl( "objectClass" );
+        Attributes attributes = new LockableAttributesImpl();
+        Attribute attribute = new LockableAttributeImpl( "objectClass" );
         attribute.add( "top" );
         attribute.add( "person" );
         attributes.put( attribute );
@@ -142,14 +142,14 @@
         // -------------------------------------------------------------------
 
         // Add a referral entry for europ
-        Attributes europ = new AttributesImpl( "objectClass", "top", true );
+        Attributes europ = new LockableAttributesImpl( "objectClass", "top", true );
         europ.get( "objectClass" ).add( "referral" );
         europ.get( "objectClass" ).add( "extensibleObject" );
         europ.put( "ref", europURL );
         europ.put( "c", "europ" );
 
         // Add a referral entry for america
-        Attributes america = new AttributesImpl( "objectClass", "top", true );
+        Attributes america = new LockableAttributesImpl( "objectClass", "top", true );
         america.get( "objectClass" ).add( "referral" );
         america.get( "objectClass" ).add( "extensibleObject" );
         america.put( "ref", americaURL );
@@ -184,12 +184,12 @@
         // -------------------------------------------------------------------
 
         // Add a referral entry for europ
-        Attributes france = new AttributesImpl( "objectClass", "top", true );
+        Attributes france = new LockableAttributesImpl( "objectClass", "top", true );
         france.get( "objectClass" ).add( "country" );
         france.put( "c", "France" );
 
         // Add a referral entry for america
-        Attributes usa = new AttributesImpl( "objectClass", "top", true );
+        Attributes usa = new LockableAttributesImpl( "objectClass", "top", true );
         usa.get( "objectClass" ).add( "country" );
         usa.put( "c", "USA" );
 
@@ -219,12 +219,12 @@
         // -------------------------------------------------------------------
 
         // Add a referral entry for europ
-        Attributes paris = new AttributesImpl( "objectClass", "top", true );
+        Attributes paris = new LockableAttributesImpl( "objectClass", "top", true );
         paris.get( "objectClass" ).add( "locality" );
         paris.put( "l", "Paris" );
 
         // Add a referral entry for america
-        Attributes jacksonville = new AttributesImpl( "objectClass", "top", true );
+        Attributes jacksonville = new LockableAttributesImpl( "objectClass", "top", true
);
         jacksonville.get( "objectClass" ).add( "locality" );
         jacksonville.put( "l", "jacksonville" );
 
@@ -254,7 +254,7 @@
         // -------------------------------------------------------------------
 
         // Add a referral entry for europ
-        Attributes emmanuel = new AttributesImpl( "objectClass", "top", true );
+        Attributes emmanuel = new LockableAttributesImpl( "objectClass", "top", true );
         emmanuel.get( "objectClass" ).add( "person" );
         emmanuel.get( "objectClass" ).add( "residentialperson" );
         emmanuel.put( "cn", "emmanuel lecharny" );
@@ -262,7 +262,7 @@
         emmanuel.put( "l", "Paris" );
 
         // Add a referral entry for america
-        Attributes alex = new AttributesImpl( "objectClass", "top", true );
+        Attributes alex = new LockableAttributesImpl( "objectClass", "top", true );
         alex.get( "objectClass" ).add( "person" );
         alex.get( "objectClass" ).add( "residentialperson" );
         alex.put( "cn", "alex karasulu" );
@@ -505,7 +505,7 @@
 
         td.refEurop.addToEnvironment( Context.REFERRAL, "throw" );
         
-        Attributes userEntry = new AttributesImpl( "objectClass", "top", true );
+        Attributes userEntry = new LockableAttributesImpl( "objectClass", "top", true );
         userEntry.get( "objectClass" ).add( "person" );
         userEntry.put( "sn", "marcelot" );
         userEntry.put( "cn", "pierre-arnaud marcelot" );
@@ -541,7 +541,7 @@
 
         td.refEurop.addToEnvironment( Context.REFERRAL, "follow" );
         
-        Attributes userEntry = new AttributesImpl( "objectClass", "top", true );
+        Attributes userEntry = new LockableAttributesImpl( "objectClass", "top", true );
         userEntry.get( "objectClass" ).add( "person" );
         userEntry.put( "sn", "marcelot" );
         userEntry.put( "cn", "pierre-arnaud marcelot" );
@@ -568,7 +568,7 @@
         // -------------------------------------------------------------------
 
         td.refUsa.addToEnvironment( Context.REFERRAL, "throw" );
-        Attributes userEntry = new AttributesImpl( "objectClass", "top", true );
+        Attributes userEntry = new LockableAttributesImpl( "objectClass", "top", true );
         userEntry.get( "objectClass" ).add( "person" );
         userEntry.put( "sn", "karasulu" );
         userEntry.put( "cn", "alex karasulu" );
@@ -656,7 +656,7 @@
         td.refCtx.addToEnvironment( Context.REFERRAL, "throw" );
         try
         {
-            td.refCtx.modifyAttributes( "cn=alex karasulu", DirContext.ADD_ATTRIBUTE, new
AttributesImpl(
+            td.refCtx.modifyAttributes( "cn=alex karasulu", DirContext.ADD_ATTRIBUTE, new
LockableAttributesImpl(
                 "description", "just some text", true ) );
             fail( "Should fail here throwing a ReferralException" );
         }
@@ -684,7 +684,7 @@
         td.refCtx.addToEnvironment( Context.REFERRAL, "throw" );
         try
         {
-            td.refCtx.modifyAttributes( "cn=alex karasulu,ou=apache", DirContext.ADD_ATTRIBUTE,
new AttributesImpl(
+            td.refCtx.modifyAttributes( "cn=alex karasulu,ou=apache", DirContext.ADD_ATTRIBUTE,
new LockableAttributesImpl(
                 "description", "just some text", true ) );
             fail( "Should fail here throwing a ReferralException" );
         }
@@ -713,7 +713,7 @@
         try
         {
             ModificationItemImpl[] mods = new ModificationItemImpl[]
-                { new ModificationItemImpl( DirContext.ADD_ATTRIBUTE, new AttributeImpl(
"description", "just some text" ) ) };
+                { new ModificationItemImpl( DirContext.ADD_ATTRIBUTE, new LockableAttributeImpl(
"description", "just some text" ) ) };
             td.refCtx.modifyAttributes( "cn=alex karasulu", mods );
             fail( "Should fail here throwing a ReferralException" );
         }
@@ -742,7 +742,7 @@
         try
         {
             ModificationItemImpl[] mods = new ModificationItemImpl[]
-                { new ModificationItemImpl( DirContext.ADD_ATTRIBUTE, new AttributeImpl(
"description", "just some text" ) ) };
+                { new ModificationItemImpl( DirContext.ADD_ATTRIBUTE, new LockableAttributeImpl(
"description", "just some text" ) ) };
             td.refCtx.modifyAttributes( "cn=alex karasulu,ou=apache", mods );
             fail( "Should fail here throwing a ReferralException" );
         }
@@ -1060,7 +1060,7 @@
     public void createLocalUser() throws Exception
     {
         LdapContext userCtx = null;
-        Attributes referral = new AttributesImpl( "objectClass", "top", true );
+        Attributes referral = new LockableAttributesImpl( "objectClass", "top", true );
         referral.get( "objectClass" ).add( "person" );
         referral.put( "cn", "akarasulu" );
         referral.put( "sn", "karasulu" );
@@ -1089,7 +1089,7 @@
     public void createDeepLocalUser() throws Exception
     {
         LdapContext userCtx = null;
-        Attributes referral = new AttributesImpl( "objectClass", "top", true );
+        Attributes referral = new LockableAttributesImpl( "objectClass", "top", true );
         referral.get( "objectClass" ).add( "person" );
         referral.put( "cn", "akarasulu" );
         referral.put( "sn", "karasulu" );
@@ -1110,7 +1110,7 @@
         }
         try
         {
-            Attributes ouAttrs = new AttributesImpl( "objectClass", "top", true );
+            Attributes ouAttrs = new LockableAttributesImpl( "objectClass", "top", true );
             ouAttrs.get( "objectClass" ).add( "organizationalUnit" );
             ouAttrs.put( "ou", "deep" );
             td.rootCtx.createSubcontext( "ou=deep", ouAttrs );

Modified: directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/ReferralTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/ReferralTest.java?view=diff&rev=498848&r1=498847&r2=498848
==============================================================================
--- directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/ReferralTest.java
(original)
+++ directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/ReferralTest.java
Mon Jan 22 15:25:45 2007
@@ -42,8 +42,8 @@
 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.LockableAttributeImpl;
+import org.apache.directory.shared.ldap.message.LockableAttributesImpl;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 
 
@@ -63,8 +63,8 @@
      */
     protected Attributes getPersonAttributes( String sn, String cn )
     {
-        Attributes attributes = new AttributesImpl();
-        Attribute attribute = new AttributeImpl( "objectClass" );
+        Attributes attributes = new LockableAttributesImpl();
+        Attribute attribute = new LockableAttributeImpl( "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 AttributesImpl( "objectClass", "top", true );
+        Attributes referral = new LockableAttributesImpl( "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 AttributesImpl( "objectClass", "top", true );
+        Attributes userEntry = new LockableAttributesImpl( "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 AttributesImpl( "objectClass", "top", true );
+        Attributes userEntry = new LockableAttributesImpl( "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
AttributesImpl(
+            td.refCtx.modifyAttributes( "cn=alex karasulu", DirContext.ADD_ATTRIBUTE, new
LockableAttributesImpl(
                 "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 AttributesImpl(
+            td.refCtx.modifyAttributes( "cn=alex karasulu,ou=apache", DirContext.ADD_ATTRIBUTE,
new LockableAttributesImpl(
                 "description", "just some text", true ) );
             fail( "Should fail here throwing a ReferralException" );
         }
@@ -381,7 +381,7 @@
         try
         {
             ModificationItemImpl[] mods = new ModificationItemImpl[]
-                { new ModificationItemImpl( DirContext.ADD_ATTRIBUTE, new AttributeImpl(
"description", "just some text" ) ) };
+                { new ModificationItemImpl( DirContext.ADD_ATTRIBUTE, new LockableAttributeImpl(
"description", "just some text" ) ) };
             td.refCtx.modifyAttributes( "cn=alex karasulu", mods );
             fail( "Should fail here throwing a ReferralException" );
         }
@@ -410,7 +410,7 @@
         try
         {
             ModificationItemImpl[] mods = new ModificationItemImpl[]
-                { new ModificationItemImpl( DirContext.ADD_ATTRIBUTE, new AttributeImpl(
"description", "just some text" ) ) };
+                { new ModificationItemImpl( DirContext.ADD_ATTRIBUTE, new LockableAttributeImpl(
"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 AttributesImpl( "objectClass", "top", true );
+        Attributes referral = new LockableAttributesImpl( "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 AttributesImpl( "objectClass", "top", true );
+        Attributes referral = new LockableAttributesImpl( "objectClass", "top", true );
         referral.get( "objectClass" ).add( "person" );
         referral.put( "cn", "akarasulu" );
         referral.put( "sn", "karasulu" );
@@ -778,7 +778,7 @@
         }
         try
         {
-            Attributes ouAttrs = new AttributesImpl( "objectClass", "top", true );
+            Attributes ouAttrs = new LockableAttributesImpl( "objectClass", "top", true );
             ouAttrs.get( "objectClass" ).add( "organizationalUnit" );
             ouAttrs.put( "ou", "deep" );
             td.rootCtx.createSubcontext( "ou=deep", ouAttrs );

Modified: directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/SearchTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/SearchTest.java?view=diff&rev=498848&r1=498847&r2=498848
==============================================================================
--- directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/SearchTest.java
(original)
+++ directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/SearchTest.java
Mon Jan 22 15:25:45 2007
@@ -38,8 +38,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.LockableAttributeImpl;
+import org.apache.directory.shared.ldap.message.LockableAttributesImpl;
 import org.apache.directory.shared.ldap.message.SubentriesControl;
 
 
@@ -109,8 +109,8 @@
      */
     protected Attributes getPersonAttributes( String sn, String cn )
     {
-        Attributes attributes = new AttributesImpl();
-        Attribute attribute = new AttributeImpl( "objectClass" );
+        Attributes attributes = new LockableAttributesImpl();
+        Attribute attribute = new LockableAttributeImpl( "objectClass" );
         attribute.add( "top" );
         attribute.add( "person" );
         attribute.add( "organizationalPerson" );
@@ -476,13 +476,13 @@
         Attribute administrativeRole = ap.get( "administrativeRole" );
         if ( administrativeRole == null || !administrativeRole.contains( SubentryService.AC_AREA
) )
         {
-            Attributes changes = new AttributesImpl( "administrativeRole", SubentryService.AC_AREA,
true );
+            Attributes changes = new LockableAttributesImpl( "administrativeRole", SubentryService.AC_AREA,
true );
             adminCtx.modifyAttributes( "", DirContext.ADD_ATTRIBUTE, changes );
         }
 
         // now add the A/C subentry below ou=system
-        Attributes subentry = new AttributesImpl( "cn", cn, true );
-        Attribute objectClass = new AttributeImpl( "objectClass" );
+        Attributes subentry = new LockableAttributesImpl( "cn", cn, true );
+        Attribute objectClass = new LockableAttributeImpl( "objectClass" );
         subentry.put( objectClass );
         objectClass.add( "top" );
         objectClass.add( "subentry" );
@@ -501,8 +501,8 @@
     {
 
         // Create entry
-        Attributes heather = new AttributesImpl();
-        Attribute ocls = new AttributeImpl( "objectClass" );
+        Attributes heather = new LockableAttributesImpl();
+        Attribute ocls = new LockableAttributeImpl( "objectClass" );
         ocls.add( "top" );
         ocls.add( "person" );
         heather.put( ocls );
@@ -544,7 +544,7 @@
     {
 
         // Create entry
-        Attributes kate = new AttributesImpl();
+        Attributes kate = new LockableAttributesImpl();
         kate.put( "objectClass", "organizationalperson" );
         kate.put( "cn", "Kate Bush" );
         kate.put( "sn", "Bush" );

Modified: directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java?view=diff&rev=498848&r1=498847&r2=498848
==============================================================================
--- directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java
(original)
+++ directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java
Mon Jan 22 15:25:45 2007
@@ -34,8 +34,8 @@
 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;
+import org.apache.directory.shared.ldap.message.LockableAttributeImpl;
+import org.apache.directory.shared.ldap.message.LockableAttributesImpl;
 
 
 /**
@@ -69,13 +69,13 @@
         indexedAttrs.add( "objectClass" );
         pcfg.setIndexedAttributes( indexedAttrs );
 
-        attrs = new AttributesImpl( true );
-        Attribute attr = new AttributeImpl( "objectClass" );
+        attrs = new LockableAttributesImpl( true );
+        Attribute attr = new LockableAttributeImpl( "objectClass" );
         attr.add( "top" );
         attr.add( "organizationalUnit" );
         attr.add( "extensibleObject" );
         attrs.put( attr );
-        attr = new AttributeImpl( "ou" );
+        attr = new LockableAttributeImpl( "ou" );
         attr.add( "testing" );
         attrs.put( attr );
         pcfg.setContextEntry( attrs );
@@ -93,13 +93,13 @@
         indexedAttrs.add( "objectClass" );
         pcfg.setIndexedAttributes( indexedAttrs );
 
-        attrs = new AttributesImpl( true );
-        attr = new AttributeImpl( "objectClass" );
+        attrs = new LockableAttributesImpl( true );
+        attr = new LockableAttributeImpl( "objectClass" );
         attr.add( "top" );
         attr.add( "domain" );
         attr.add( "extensibleObject" );
         attrs.put( attr );
-        attr = new AttributeImpl( "dc" );
+        attr = new LockableAttributeImpl( "dc" );
         attr.add( "example" );
         attrs.put( attr );
         pcfg.setContextEntry( attrs );
@@ -116,13 +116,13 @@
         indexedAttrs.add( "objectClass" );
         pcfg.setIndexedAttributes( indexedAttrs );
 
-        attrs = new AttributesImpl( true );
-        attr = new AttributeImpl( "objectClass" );
+        attrs = new LockableAttributesImpl( true );
+        attr = new LockableAttributeImpl( "objectClass" );
         attr.add( "top" );
         attr.add( "domain" );
         attr.add( "extensibleObject" );
         attrs.put( attr );
-        attr = new AttributeImpl( "dc" );
+        attr = new LockableAttributeImpl( "dc" );
         attr.add( "MixedCase" );
         attrs.put( attr );
         pcfg.setContextEntry( attrs );



Mime
View raw message