directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r985411 [7/11] - in /directory: apacheds/branches/apacheds-codec-merge/core-api/src/main/java/org/apache/directory/server/core/ apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/admin/ apacheds...
Date Sat, 14 Aug 2010 00:22:40 GMT
Modified: directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceIT.java?rev=985411&r1=985410&r2=985411&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceIT.java (original)
+++ directory/apacheds/branches/apacheds-codec-merge/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceIT.java Sat Aug 14 00:22:38 2010
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.server.core.subtree;
 
+
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSystemContext;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
@@ -41,11 +42,7 @@ import javax.naming.directory.SearchResu
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.ldap.client.api.LdapConnection;
-import org.apache.directory.ldap.client.api.message.AddResponse;
-import org.apache.directory.ldap.client.api.message.DeleteResponse;
 import org.apache.directory.ldap.client.api.message.ModifyRequest;
-import org.apache.directory.ldap.client.api.message.SearchResponse;
-import org.apache.directory.ldap.client.api.message.SearchResultEntry;
 import org.apache.directory.server.core.annotations.ApplyLdifs;
 import org.apache.directory.server.core.annotations.CreateDS;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
@@ -61,6 +58,10 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.ldif.LdifUtils;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.control.Control;
+import org.apache.directory.shared.ldap.message.internal.InternalAddResponse;
+import org.apache.directory.shared.ldap.message.internal.InternalDeleteResponse;
+import org.apache.directory.shared.ldap.message.internal.InternalResponse;
+import org.apache.directory.shared.ldap.message.internal.InternalSearchResultEntry;
 import org.apache.directory.shared.ldap.name.DN;
 import org.junit.Ignore;
 import org.junit.Test;
@@ -72,8 +73,8 @@ import org.junit.runner.RunWith;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-@RunWith ( FrameworkRunner.class )
-@CreateDS( name="SubentryServiceIT-class" )
+@RunWith(FrameworkRunner.class)
+@CreateDS(name = "SubentryServiceIT-class")
 @ApplyLdifs(
     {
         // A test branch
@@ -82,83 +83,57 @@ import org.junit.runner.RunWith;
         "objectClass: domain",
         "dc: test",
         "",
-            // The first level AP
-            "dn: dc=AP-A,dc=test,ou=system",
-            "objectClass: top",
-            "objectClass: domain",
-            "administrativeRole: collectiveAttributeSpecificArea",
-            "dc: AP-A",
-            "",
-                // entry A1
-                "dn: cn=A1,dc=AP-A,dc=test,ou=system",
-                "objectClass: top",
-                "objectClass: person",
-                "cn: A1",
-                "sn: a1",
-                "",
-                    // entry A1-1
-                    "dn: cn=A1-1,cn=A1,dc=AP-A,dc=test,ou=system",
-                    "objectClass: top",
-                    "objectClass: person",
-                    "cn: A1-1",
-                    "sn: a1-1",
-                    "",
-                    // entry A1-2
-                    "dn: cn=A1-2,cn=A1,dc=AP-A,dc=test,ou=system",
-                    "objectClass: top",
-                    "objectClass: person",
-                    "cn: A1-2",
-                    "sn: a1-2",
-                    "",
-                // entry A2
-                "dn: cn=A2,dc=AP-A,dc=test,ou=system",
-                "objectClass: top",
-                "objectClass: person",
-                "cn: A2",
-                "sn: a2",
-                "",
-                    // entry A2-1
-                    "dn: cn=A2-1,cn=A2,dc=AP-A,dc=test,ou=system",
-                    "objectClass: top",
-                    "objectClass: person",
-                    "cn: A2-1",
-                    "sn: a2-1",
-                    "",
-                    // The second level AP
-                    "dn: dc=AP-B,cn=A2,dc=AP-A,dc=test,ou=system",
-                    "objectClass: top",
-                    "objectClass: domain",
-                    "administrativeRole: collectiveAttributeSpecificArea",
-                    "dc: AP-B",
-                    "",
-                        // entry B1
-                        "dn: cn=B1,dc=AP-B,cn=A2,dc=AP-A,dc=test,ou=system",
-                        "objectClass: top",
-                        "objectClass: person",
-                        "cn: B1",
-                        "sn: b1",
-                        "",
-                        // entry B2
-                        "dn: cn=B2,dc=AP-B,cn=A2,dc=AP-A,dc=test,ou=system",
-                        "objectClass: top",
-                        "objectClass: person",
-                        "cn: B2",
-                        "sn: b2",
-                        "",
-            // The first level non AP
-            "dn: dc=not-AP,dc=test,ou=system",
-            "objectClass: top",
-            "objectClass: domain",
-            "dc: not-AP",
-            "",
-                // An entry under non-AP
-                "dn: cn=C,dc=not-AP,dc=test,ou=system",
-                "objectClass: top",
-                "objectClass: person",
-                "cn: C",
-                "sn: entry-C",
-                ""
-    })
+        // The first level AP
+        "dn: dc=AP-A,dc=test,ou=system",
+        "objectClass: top",
+        "objectClass: domain",
+        "administrativeRole: collectiveAttributeSpecificArea",
+        "dc: AP-A",
+        "",
+        // entry A1
+        "dn: cn=A1,dc=AP-A,dc=test,ou=system",
+        "objectClass: top",
+        "objectClass: person",
+        "cn: A1",
+        "sn: a1",
+        "",
+        // entry A1-1
+        "dn: cn=A1-1,cn=A1,dc=AP-A,dc=test,ou=system",
+        "objectClass: top",
+        "objectClass: person",
+        "cn: A1-1",
+        "sn: a1-1",
+        "",
+        // entry A1-2
+        "dn: cn=A1-2,cn=A1,dc=AP-A,dc=test,ou=system", "objectClass: top",
+        "objectClass: person",
+        "cn: A1-2",
+        "sn: a1-2",
+        "",
+        // entry A2
+        "dn: cn=A2,dc=AP-A,dc=test,ou=system", "objectClass: top", "objectClass: person",
+        "cn: A2",
+        "sn: a2",
+        "",
+        // entry A2-1
+        "dn: cn=A2-1,cn=A2,dc=AP-A,dc=test,ou=system", "objectClass: top", "objectClass: person",
+        "cn: A2-1",
+        "sn: a2-1",
+        "",
+        // The second level AP
+        "dn: dc=AP-B,cn=A2,dc=AP-A,dc=test,ou=system", "objectClass: top", "objectClass: domain",
+        "administrativeRole: collectiveAttributeSpecificArea", "dc: AP-B",
+        "",
+        // entry B1
+        "dn: cn=B1,dc=AP-B,cn=A2,dc=AP-A,dc=test,ou=system", "objectClass: top", "objectClass: person", "cn: B1",
+        "sn: b1", "",
+        // entry B2
+        "dn: cn=B2,dc=AP-B,cn=A2,dc=AP-A,dc=test,ou=system", "objectClass: top", "objectClass: person", "cn: B2",
+        "sn: b2", "",
+        // The first level non AP
+        "dn: dc=not-AP,dc=test,ou=system", "objectClass: top", "objectClass: domain", "dc: not-AP", "",
+        // An entry under non-AP
+        "dn: cn=C,dc=not-AP,dc=test,ou=system", "objectClass: top", "objectClass: person", "cn: C", "sn: entry-C", "" })
 public class SubentryServiceIT extends AbstractLdapTestUnit
 {
 
@@ -192,13 +167,9 @@ public class SubentryServiceIT extends A
 
     public Entry getSubentry( String dn ) throws Exception
     {
-        Entry subentry = LdifUtils.createEntry( new DN( dn ),
-            "objectClass: top",
-            "objectClass: subentry",
-            "objectClass: collectiveAttributeSubentry",
-            "subtreeSpecification: { base \"ou=configuration\" }",
-            "c-o: Test Org",
-            "cn: testsubentry" );
+        Entry subentry = LdifUtils.createEntry( new DN( dn ), "objectClass: top", "objectClass: subentry",
+            "objectClass: collectiveAttributeSubentry", "subtreeSpecification: { base \"ou=configuration\" }",
+            "c-o: Test Org", "cn: testsubentry" );
 
         return subentry;
     }
@@ -263,17 +234,17 @@ public class SubentryServiceIT extends A
     {
         Map<String, Entry> results = new HashMap<String, Entry>();
 
-        Cursor<SearchResponse> responses = connection.search( dn, "(objectClass=*)", SearchScope.SUBTREE, "+", "*" );
+        Cursor<InternalResponse> responses = connection.search( dn, "(objectClass=*)", SearchScope.SUBTREE, "+", "*" );
 
         while ( responses.next() )
         {
-            SearchResponse response = responses.get();
+            InternalResponse response = responses.get();
 
-            if ( response instanceof SearchResultEntry )
+            if ( response instanceof InternalSearchResultEntry )
             {
-                Entry entry = ((SearchResultEntry)response).getEntry();
+                Entry entry = ( ( InternalSearchResultEntry ) response ).getEntry();
 
-                results.put(  entry.getDn().getName(), entry );
+                results.put( entry.getDn().getName(), entry );
             }
         }
 
@@ -362,14 +333,11 @@ public class SubentryServiceIT extends A
 
         // Add the subentry
         Entry subEntryA = LdifUtils.createEntry( new DN( "cn=testsubentryA,dc=AP-A,dc=test,ou=system" ),
-            "objectClass: top",
-            "objectClass: subentry",
-            "objectClass: collectiveAttributeSubentry",
-            "subtreeSpecification: {}",  // All the entry from the AP, including the AP
-            "c-o: Test Org",
-            "cn: testsubentryA" );
+            "objectClass: top", "objectClass: subentry", "objectClass: collectiveAttributeSubentry",
+            "subtreeSpecification: {}", // All the entry from the AP, including the AP
+            "c-o: Test Org", "cn: testsubentryA" );
 
-        AddResponse response = connection.add( subEntryA );
+        InternalAddResponse response = connection.add( subEntryA );
 
         assertTrue( response.getLdapResult().getResultCode() == ResultCodeEnum.SUCCESS );
 
@@ -382,17 +350,11 @@ public class SubentryServiceIT extends A
         String subEntryAPADn = "2.5.4.3=testsubentrya,0.9.2342.19200300.100.1.25=ap-a,0.9.2342.19200300.100.1.25=test,2.5.4.11=system";
 
         String[] modifiedEntriesA = new String[]
-            {
-                "dc=AP-A,dc=test,ou=system",
-                  "cn=A1,dc=AP-A,dc=test,ou=system",
-                    "cn=A1-1,cn=A1,dc=AP-A,dc=test,ou=system",
-                    "cn=A1-2,cn=A1,dc=AP-A,dc=test,ou=system",
-                  "cn=A2,dc=AP-A,dc=test,ou=system",
-                    "cn=A2-1,cn=A2,dc=AP-A,dc=test,ou=system",
-                    "dc=AP-B,cn=A2,dc=AP-A,dc=test,ou=system",
-                      "cn=B1,dc=AP-B,cn=A2,dc=AP-A,dc=test,ou=system",
-                      "cn=B2,dc=AP-B,cn=A2,dc=AP-A,dc=test,ou=system",
-            };
+            { "dc=AP-A,dc=test,ou=system", "cn=A1,dc=AP-A,dc=test,ou=system",
+                "cn=A1-1,cn=A1,dc=AP-A,dc=test,ou=system", "cn=A1-2,cn=A1,dc=AP-A,dc=test,ou=system",
+                "cn=A2,dc=AP-A,dc=test,ou=system", "cn=A2-1,cn=A2,dc=AP-A,dc=test,ou=system",
+                "dc=AP-B,cn=A2,dc=AP-A,dc=test,ou=system", "cn=B1,dc=AP-B,cn=A2,dc=AP-A,dc=test,ou=system",
+                "cn=B2,dc=AP-B,cn=A2,dc=AP-A,dc=test,ou=system", };
 
         for ( String dn : modifiedEntriesA )
         {
@@ -403,11 +365,7 @@ public class SubentryServiceIT extends A
         // Make sure entries not selected by subentryA do not have the mark
         // --------------------------------------------------------------------
         String[] unchangedEntriesA = new String[]
-            {
-                "dc=test,ou=system",
-                  "dc=not-AP,dc=test,ou=system",
-                    "cn=C,dc=not-AP,dc=test,ou=system",
-            };
+            { "dc=test,ou=system", "dc=not-AP,dc=test,ou=system", "cn=C,dc=not-AP,dc=test,ou=system", };
 
         for ( String dn : unchangedEntriesA )
         {
@@ -417,12 +375,9 @@ public class SubentryServiceIT extends A
         // Now add another subentry on AP-B
         // Add the subentry
         Entry subEntryB = LdifUtils.createEntry( new DN( "cn=testsubentryB,dc=AP-B,cn=A2,dc=AP-A,dc=test,ou=system" ),
-            "objectClass: top",
-            "objectClass: subentry",
-            "objectClass: collectiveAttributeSubentry",
-            "subtreeSpecification: {}",  // All the entry from the AP, including the AP
-            "c-o: Test Org",
-            "cn: testsubentryB" );
+            "objectClass: top", "objectClass: subentry", "objectClass: collectiveAttributeSubentry",
+            "subtreeSpecification: {}", // All the entry from the AP, including the AP
+            "c-o: Test Org", "cn: testsubentryB" );
 
         response = connection.add( subEntryB );
 
@@ -434,14 +389,9 @@ public class SubentryServiceIT extends A
         // the subentry A
         // --------------------------------------------------------------------
         String[] modifiedEntriesAB = new String[]
-            {
-                "dc=AP-A,dc=test,ou=system",
-                  "cn=A1,dc=AP-A,dc=test,ou=system",
-                    "cn=A1-1,cn=A1,dc=AP-A,dc=test,ou=system",
-                    "cn=A1-2,cn=A1,dc=AP-A,dc=test,ou=system",
-                  "cn=A2,dc=AP-A,dc=test,ou=system",
-                    "cn=A2-1,cn=A2,dc=AP-A,dc=test,ou=system",
-            };
+            { "dc=AP-A,dc=test,ou=system", "cn=A1,dc=AP-A,dc=test,ou=system",
+                "cn=A1-1,cn=A1,dc=AP-A,dc=test,ou=system", "cn=A1-2,cn=A1,dc=AP-A,dc=test,ou=system",
+                "cn=A2,dc=AP-A,dc=test,ou=system", "cn=A2-1,cn=A2,dc=AP-A,dc=test,ou=system", };
 
         for ( String dn : modifiedEntriesAB )
         {
@@ -455,11 +405,8 @@ public class SubentryServiceIT extends A
         String subEntryAPBDn = "2.5.4.3=testsubentryb,0.9.2342.19200300.100.1.25=ap-b,2.5.4.3=a2,0.9.2342.19200300.100.1.25=ap-a,0.9.2342.19200300.100.1.25=test,2.5.4.11=system";
 
         String[] modifiedEntriesB = new String[]
-            {
-                "dc=AP-B,cn=A2,dc=AP-A,dc=test,ou=system",
-                  "cn=B1,dc=AP-B,cn=A2,dc=AP-A,dc=test,ou=system",
-                  "cn=B2,dc=AP-B,cn=A2,dc=AP-A,dc=test,ou=system",
-            };
+            { "dc=AP-B,cn=A2,dc=AP-A,dc=test,ou=system", "cn=B1,dc=AP-B,cn=A2,dc=AP-A,dc=test,ou=system",
+                "cn=B2,dc=AP-B,cn=A2,dc=AP-A,dc=test,ou=system", };
 
         for ( String dn : modifiedEntriesB )
         {
@@ -470,11 +417,7 @@ public class SubentryServiceIT extends A
         // Make sure entries not selected by subentryA do not have the mark
         // --------------------------------------------------------------------
         String[] unchangedEntriesB = new String[]
-            {
-                "dc=test,ou=system",
-                  "dc=not-AP,dc=test,ou=system",
-                    "cn=C,dc=not-AP,dc=test,ou=system",
-            };
+            { "dc=test,ou=system", "dc=not-AP,dc=test,ou=system", "cn=C,dc=not-AP,dc=test,ou=system", };
 
         for ( String dn : unchangedEntriesB )
         {
@@ -482,7 +425,8 @@ public class SubentryServiceIT extends A
         }
 
         // Now delete the AP-B subentry
-        DeleteResponse deleteResponse = connection.delete( "cn=testsubentryB,dc=AP-B,cn=A2,dc=AP-A,dc=test,ou=system" );
+        InternalDeleteResponse deleteResponse = connection
+            .delete( "cn=testsubentryB,dc=AP-B,cn=A2,dc=AP-A,dc=test,ou=system" );
 
         // --------------------------------------------------------------------
         // Check that we are back to where we were before the addition of the B
@@ -509,9 +453,10 @@ public class SubentryServiceIT extends A
         LdapConnection connection = IntegrationUtils.getAdminConnection( service );
 
         Entry subEntry = getSubentry( "cn=testsubentry,ou=system" );
-        AddResponse response = connection.add( subEntry );
+        InternalAddResponse response = connection.add( subEntry );
 
-        assertTrue( "should never get here: cannot create subentry under regular entries", response.getLdapResult().getResultCode() == ResultCodeEnum.NO_SUCH_ATTRIBUTE );
+        assertTrue( "should never get here: cannot create subentry under regular entries", response.getLdapResult()
+            .getResultCode() == ResultCodeEnum.NO_SUCH_ATTRIBUTE );
 
         addAdministrativeRole( connection, "ou=system", "collectiveAttributeSpecificArea" );
         connection.add( subEntry );
@@ -527,13 +472,9 @@ public class SubentryServiceIT extends A
         String subEntryDn = "2.5.4.3=testsubentry,2.5.4.11=system";
 
         String[] modifiedEntries = new String[]
-            {
-                "ou=configuration,ou=system",
-                "ou=interceptors,ou=configuration,ou=system",
-                "ou=partitions,ou=configuration,ou=system",
-                "ou=configuration,ou=system",
-                "ou=services,ou=configuration,ou=system"
-            };
+            { "ou=configuration,ou=system", "ou=interceptors,ou=configuration,ou=system",
+                "ou=partitions,ou=configuration,ou=system", "ou=configuration,ou=system",
+                "ou=services,ou=configuration,ou=system" };
 
         for ( String dn : modifiedEntries )
         {
@@ -544,13 +485,8 @@ public class SubentryServiceIT extends A
         // Make sure entries not selected by subentry do not have the mark
         // --------------------------------------------------------------------
         String[] unchangedEntries = new String[]
-            {
-                "ou=system",
-                "ou=users,ou=system",
-                "ou=groups,ou=system",
-                "uid=admin,ou=system",
-                "prefNodeName=sysPrefRoot,ou=system"
-            };
+            { "ou=system", "ou=users,ou=system", "ou=groups,ou=system", "uid=admin,ou=system",
+                "prefNodeName=sysPrefRoot,ou=system" };
 
         for ( String dn : unchangedEntries )
         {
@@ -574,7 +510,8 @@ public class SubentryServiceIT extends A
         // --------------------------------------------------------------------
 
         Attributes configuration = results.get( "ou=configuration,ou=system" );
-        Attribute collectiveAttributeSubentries = configuration.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
+        Attribute collectiveAttributeSubentries = configuration
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
         assertNotNull( "ou=configuration,ou=system should be marked", collectiveAttributeSubentries );
         assertEquals( "2.5.4.3=testsubentry,2.5.4.11=system", collectiveAttributeSubentries.get() );
         assertEquals( 1, collectiveAttributeSubentries.size() );
@@ -605,13 +542,16 @@ public class SubentryServiceIT extends A
         assertNull( "ou=system should not be marked", system.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes users = results.get( "ou=users,ou=system" );
-        assertNull( "ou=users,ou=system should not be marked", users.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
+        assertNull( "ou=users,ou=system should not be marked", users
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes groups = results.get( "ou=groups,ou=system" );
-        assertNull( "ou=groups,ou=system should not be marked", groups.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
+        assertNull( "ou=groups,ou=system should not be marked", groups
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes admin = results.get( "uid=admin,ou=system" );
-        assertNull( "uid=admin,ou=system should not be marked", admin.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
+        assertNull( "uid=admin,ou=system should not be marked", admin
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes sysPrefRoot = results.get( "prefNodeName=sysPrefRoot,ou=system" );
         assertNull( "prefNode=sysPrefRoot,ou=system should not be marked", sysPrefRoot
@@ -658,13 +598,16 @@ public class SubentryServiceIT extends A
         assertNull( "ou=system should not be marked", system.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         users = results.get( "ou=users,ou=system" );
-        assertNull( "ou=users,ou=system should not be marked", users.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
+        assertNull( "ou=users,ou=system should not be marked", users
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         groups = results.get( "ou=groups,ou=system" );
-        assertNull( "ou=groups,ou=system should not be marked", groups.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
+        assertNull( "ou=groups,ou=system should not be marked", groups
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         admin = results.get( "uid=admin,ou=system" );
-        assertNull( "uid=admin,ou=system should not be marked", admin.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
+        assertNull( "uid=admin,ou=system should not be marked", admin
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         sysPrefRoot = results.get( "prefNodeName=sysPrefRoot,ou=system" );
         assertNull( "prefNode=sysPrefRoot,ou=system should not be marked", sysPrefRoot
@@ -674,7 +617,8 @@ public class SubentryServiceIT extends A
         collectiveAttributeSubentries = services.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
         if ( collectiveAttributeSubentries != null )
         {
-            assertEquals( "ou=services,ou=configuration,ou=system should not be marked", 0, collectiveAttributeSubentries.size() );
+            assertEquals( "ou=services,ou=configuration,ou=system should not be marked", 0,
+                collectiveAttributeSubentries.size() );
         }
     }
 
@@ -692,7 +636,8 @@ public class SubentryServiceIT extends A
         // --------------------------------------------------------------------
 
         Attributes configuration = results.get( "ou=configuration,ou=system" );
-        Attribute collectiveAttributeSubentries = configuration.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
+        Attribute collectiveAttributeSubentries = configuration
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
         assertNotNull( "ou=configuration,ou=system should be marked", collectiveAttributeSubentries );
         assertEquals( "2.5.4.3=testsubentry,2.5.4.11=system", collectiveAttributeSubentries.get() );
         assertEquals( 1, collectiveAttributeSubentries.size() );
@@ -723,13 +668,16 @@ public class SubentryServiceIT extends A
         assertNull( "ou=system should not be marked", system.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes users = results.get( "ou=users,ou=system" );
-        assertNull( "ou=users,ou=system should not be marked", users.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
+        assertNull( "ou=users,ou=system should not be marked", users
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes groups = results.get( "ou=groups,ou=system" );
-        assertNull( "ou=groups,ou=system should not be marked", groups.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
+        assertNull( "ou=groups,ou=system should not be marked", groups
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes admin = results.get( "uid=admin,ou=system" );
-        assertNull( "uid=admin,ou=system should not be marked", admin.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
+        assertNull( "uid=admin,ou=system should not be marked", admin
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes sysPrefRoot = results.get( "prefNodeName=sysPrefRoot,ou=system" );
         assertNull( "prefNode=sysPrefRoot,ou=system should not be marked", sysPrefRoot
@@ -775,13 +723,16 @@ public class SubentryServiceIT extends A
         assertNull( "ou=system should not be marked", system.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         users = results.get( "ou=users,ou=system" );
-        assertNull( "ou=users,ou=system should not be marked", users.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
+        assertNull( "ou=users,ou=system should not be marked", users
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         groups = results.get( "ou=groups,ou=system" );
-        assertNull( "ou=groups,ou=system should not be marked", groups.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
+        assertNull( "ou=groups,ou=system should not be marked", groups
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         admin = results.get( "uid=admin,ou=system" );
-        assertNull( "uid=admin,ou=system should not be marked", admin.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
+        assertNull( "uid=admin,ou=system should not be marked", admin
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         sysPrefRoot = results.get( "prefNodeName=sysPrefRoot,ou=system" );
         assertNull( "prefNode=sysPrefRoot,ou=system should not be marked", sysPrefRoot
@@ -791,7 +742,8 @@ public class SubentryServiceIT extends A
         collectiveAttributeSubentries = services.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
         if ( collectiveAttributeSubentries != null )
         {
-            assertEquals( "ou=services,ou=configuration,ou=system should not be marked", 0, collectiveAttributeSubentries.size() );
+            assertEquals( "ou=services,ou=configuration,ou=system should not be marked", 0,
+                collectiveAttributeSubentries.size() );
         }
     }
 
@@ -811,7 +763,8 @@ public class SubentryServiceIT extends A
         // --------------------------------------------------------------------
 
         Attributes configuration = results.get( "ou=configuration,ou=system" );
-        Attribute collectiveAttributeSubentries = configuration.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
+        Attribute collectiveAttributeSubentries = configuration
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
 
         if ( collectiveAttributeSubentries != null )
         {
@@ -823,8 +776,8 @@ public class SubentryServiceIT extends A
 
         if ( collectiveAttributeSubentries != null )
         {
-            assertEquals( "ou=interceptors,ou=configuration,ou=system should not be marked", 0, collectiveAttributeSubentries
-                .size() );
+            assertEquals( "ou=interceptors,ou=configuration,ou=system should not be marked", 0,
+                collectiveAttributeSubentries.size() );
         }
 
         Attributes partitions = results.get( "ou=partitions,ou=configuration,ou=system" );
@@ -832,7 +785,8 @@ public class SubentryServiceIT extends A
 
         if ( collectiveAttributeSubentries != null )
         {
-            assertEquals( "ou=partitions,ou=configuration,ou=system should not be marked", 0, collectiveAttributeSubentries.size() );
+            assertEquals( "ou=partitions,ou=configuration,ou=system should not be marked", 0,
+                collectiveAttributeSubentries.size() );
         }
 
         Attributes services = results.get( "ou=services,ou=configuration,ou=system" );
@@ -840,17 +794,20 @@ public class SubentryServiceIT extends A
 
         if ( collectiveAttributeSubentries != null )
         {
-            assertEquals( "ou=services,ou=configuration,ou=system should not be marked", 0, collectiveAttributeSubentries.size() );
+            assertEquals( "ou=services,ou=configuration,ou=system should not be marked", 0,
+                collectiveAttributeSubentries.size() );
         }
 
         Attributes system = results.get( "ou=system" );
         assertNull( "ou=system should not be marked", system.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes users = results.get( "ou=users,ou=system" );
-        assertNull( "ou=users,ou=system should not be marked", users.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
+        assertNull( "ou=users,ou=system should not be marked", users
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes admin = results.get( "uid=admin,ou=system" );
-        assertNull( "uid=admin,ou=system should not be marked", admin.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
+        assertNull( "uid=admin,ou=system should not be marked", admin
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes sysPrefRoot = results.get( "prefNodeName=sysPrefRoot,ou=system" );
         assertNull( "prefNode=sysPrefRoot,ou=system should not be marked", sysPrefRoot
@@ -874,7 +831,8 @@ public class SubentryServiceIT extends A
         // --------------------------------------------------------------------
 
         Attributes configuration = results.get( "ou=configuration,ou=system" );
-        Attribute collectiveAttributeSubentries = configuration.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
+        Attribute collectiveAttributeSubentries = configuration
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
         assertNotNull( "ou=configuration,ou=system should be marked", collectiveAttributeSubentries );
         assertEquals( "2.5.4.3=newname,2.5.4.11=system", collectiveAttributeSubentries.get() );
         assertEquals( 1, collectiveAttributeSubentries.size() );
@@ -905,13 +863,16 @@ public class SubentryServiceIT extends A
         assertNull( "ou=system should not be marked", system.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes users = results.get( "ou=users,ou=system" );
-        assertNull( "ou=users,ou=system should not be marked", users.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
+        assertNull( "ou=users,ou=system should not be marked", users
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes groups = results.get( "ou=groups,ou=system" );
-        assertNull( "ou=groups,ou=system should not be marked", groups.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
+        assertNull( "ou=groups,ou=system should not be marked", groups
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes admin = results.get( "uid=admin,ou=system" );
-        assertNull( "uid=admin,ou=system should not be marked", admin.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
+        assertNull( "uid=admin,ou=system should not be marked", admin
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes sysPrefRoot = results.get( "prefNodeName=sysPrefRoot,ou=system" );
         assertNull( "prefNode=sysPrefRoot,ou=system should not be marked", sysPrefRoot
@@ -935,7 +896,8 @@ public class SubentryServiceIT extends A
         // --------------------------------------------------------------------
 
         Attributes configuration = results.get( "ou=configuration,ou=system" );
-        Attribute collectiveAttributeSubentries = configuration.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
+        Attribute collectiveAttributeSubentries = configuration
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
         assertNotNull( "ou=configuration,ou=system should be marked", collectiveAttributeSubentries );
         assertEquals( "2.5.4.3=testsubentry,2.5.4.11=system", collectiveAttributeSubentries.get() );
         assertEquals( 1, collectiveAttributeSubentries.size() );
@@ -972,13 +934,16 @@ public class SubentryServiceIT extends A
         assertNull( "ou=system should not be marked", system.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes users = results.get( "ou=users,ou=system" );
-        assertNull( "ou=users,ou=system should not be marked", users.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
+        assertNull( "ou=users,ou=system should not be marked", users
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes groups = results.get( "ou=groups,ou=system" );
-        assertNull( "ou=groups,ou=system should not be marked", groups.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
+        assertNull( "ou=groups,ou=system should not be marked", groups
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes admin = results.get( "uid=admin,ou=system" );
-        assertNull( "uid=admin,ou=system should not be marked", admin.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
+        assertNull( "uid=admin,ou=system should not be marked", admin
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes sysPrefRoot = results.get( "prefNodeName=sysPrefRoot,ou=system" );
         assertNull( "prefNode=sysPrefRoot,ou=system should not be marked", sysPrefRoot
@@ -1018,7 +983,7 @@ public class SubentryServiceIT extends A
 
 
     @Test
-    @Ignore ( "Ignored until DIRSERVER-1223 is fixed" )
+    @Ignore("Ignored until DIRSERVER-1223 is fixed")
     public void testEntryMoveWithRdnChange() throws Exception
     {
         LdapContext sysRoot = getSystemContext( service );
@@ -1033,7 +998,8 @@ public class SubentryServiceIT extends A
         // --------------------------------------------------------------------
 
         Attributes configuration = results.get( "ou=configuration,ou=system" );
-        Attribute collectiveAttributeSubentries = configuration.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
+        Attribute collectiveAttributeSubentries = configuration
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
         assertNotNull( "ou=configuration,ou=system should be marked", collectiveAttributeSubentries );
         assertEquals( "2.5.4.3=testsubentry,2.5.4.11=system", collectiveAttributeSubentries.get() );
         assertEquals( 1, collectiveAttributeSubentries.size() );
@@ -1070,13 +1036,16 @@ public class SubentryServiceIT extends A
         assertNull( "ou=system should not be marked", system.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes users = results.get( "ou=users,ou=system" );
-        assertNull( "ou=users,ou=system should not be marked", users.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
+        assertNull( "ou=users,ou=system should not be marked", users
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes groups = results.get( "ou=groups,ou=system" );
-        assertNull( "ou=groups,ou=system should not be marked", groups.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
+        assertNull( "ou=groups,ou=system should not be marked", groups
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes admin = results.get( "uid=admin,ou=system" );
-        assertNull( "uid=admin,ou=system should not be marked", admin.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
+        assertNull( "uid=admin,ou=system should not be marked", admin
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes sysPrefRoot = results.get( "prefNodeName=sysPrefRoot,ou=system" );
         assertNull( "prefNode=sysPrefRoot,ou=system should not be marked", sysPrefRoot
@@ -1116,7 +1085,7 @@ public class SubentryServiceIT extends A
 
 
     @Test
-    @Ignore ( "Ignored until DIRSERVER-1223 is fixed" )
+    @Ignore("Ignored until DIRSERVER-1223 is fixed")
     public void testEntryMove() throws Exception
     {
         LdapContext sysRoot = getSystemContext( service );
@@ -1131,7 +1100,8 @@ public class SubentryServiceIT extends A
         // --------------------------------------------------------------------
 
         Attributes configuration = results.get( "ou=configuration,ou=system" );
-        Attribute collectiveAttributeSubentries = configuration.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
+        Attribute collectiveAttributeSubentries = configuration
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
         assertNotNull( "ou=configuration,ou=system should be marked", collectiveAttributeSubentries );
         assertEquals( "2.5.4.3=testsubentry,2.5.4.11=system", collectiveAttributeSubentries.get() );
         assertEquals( 1, collectiveAttributeSubentries.size() );
@@ -1168,13 +1138,16 @@ public class SubentryServiceIT extends A
         assertNull( "ou=system should not be marked", system.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes users = results.get( "ou=users,ou=system" );
-        assertNull( "ou=users,ou=system should not be marked", users.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
+        assertNull( "ou=users,ou=system should not be marked", users
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes groups = results.get( "ou=groups,ou=system" );
-        assertNull( "ou=groups,ou=system should not be marked", groups.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
+        assertNull( "ou=groups,ou=system should not be marked", groups
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes admin = results.get( "uid=admin,ou=system" );
-        assertNull( "uid=admin,ou=system should not be marked", admin.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
+        assertNull( "uid=admin,ou=system should not be marked", admin
+            .get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
 
         Attributes sysPrefRoot = results.get( "prefNodeName=sysPrefRoot,ou=system" );
         assertNull( "prefNode=sysPrefRoot,ou=system should not be marked", sysPrefRoot
@@ -1206,7 +1179,7 @@ public class SubentryServiceIT extends A
 
 
     @Test
-    @Ignore ( "Ignored until DIRSERVER-1223 is fixed" )
+    @Ignore("Ignored until DIRSERVER-1223 is fixed")
     public void testSubentriesControl() throws Exception
     {
         LdapContext sysRoot = getSystemContext( service );
@@ -1232,7 +1205,8 @@ public class SubentryServiceIT extends A
         // except subentries disappear
         SubentriesControl ctl = new SubentriesControl();
         ctl.setVisibility( true );
-        sysRoot.setRequestControls( JndiUtils.toJndiControls( new Control[] { ctl } ) );
+        sysRoot.setRequestControls( JndiUtils.toJndiControls( new Control[]
+            { ctl } ) );
         list = sysRoot.search( "", "(objectClass=*)", searchControls );
         SearchResult result = list.next();
         assertFalse( list.hasMore() );
@@ -1250,7 +1224,8 @@ public class SubentryServiceIT extends A
         searchControls.setSearchScope( SearchControls.OBJECT_SCOPE );
 
         Map<String, SearchResult> entries = new HashMap<String, SearchResult>();
-        NamingEnumeration<SearchResult> list = sysRoot.search( "cn=testsubentry", "(objectClass=subentry)", searchControls );
+        NamingEnumeration<SearchResult> list = sysRoot.search( "cn=testsubentry", "(objectClass=subentry)",
+            searchControls );
 
         while ( list.hasMore() )
         {

Modified: directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java?rev=985411&r1=985410&r2=985411&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java (original)
+++ directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java Sat Aug 14 00:22:38 2010
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.shared.client.api;
 
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
@@ -32,9 +33,6 @@ import java.util.List;
 
 import org.apache.directory.ldap.client.api.LdapConnection;
 import org.apache.directory.ldap.client.api.LdapNetworkConnection;
-import org.apache.directory.ldap.client.api.message.BindResponse;
-import org.apache.directory.ldap.client.api.message.SearchResponse;
-import org.apache.directory.ldap.client.api.message.SearchResultEntry;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
@@ -46,24 +44,24 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.filter.EqualityNode;
 import org.apache.directory.shared.ldap.filter.SearchScope;
+import org.apache.directory.shared.ldap.message.internal.InternalBindResponse;
+import org.apache.directory.shared.ldap.message.internal.InternalResponse;
+import org.apache.directory.shared.ldap.message.internal.InternalSearchResultEntry;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+
 /**
  * Test the LdapConnection class
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-@RunWith ( FrameworkRunner.class )
-@CreateLdapServer (
-    transports =
-    {
-        @CreateTransport( protocol = "LDAP" ),
-        @CreateTransport( protocol = "LDAPS" )
-    })
+@RunWith(FrameworkRunner.class)
+@CreateLdapServer(transports =
+    { @CreateTransport(protocol = "LDAP"), @CreateTransport(protocol = "LDAPS") })
 public class LdapConnectionTest extends AbstractLdapTestUnit
 {
 
@@ -101,7 +99,7 @@ public class LdapConnectionTest extends 
         LdapConnection connection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );
         try
         {
-            BindResponse bindResponse = connection.bind( ADMIN_DN, "secret" );
+            InternalBindResponse bindResponse = connection.bind( ADMIN_DN, "secret" );
 
             assertNotNull( bindResponse );
 
@@ -121,7 +119,7 @@ public class LdapConnectionTest extends 
             {
                 connection.close();
             }
-            catch( IOException ioe )
+            catch ( IOException ioe )
             {
                 fail();
             }
@@ -141,15 +139,15 @@ public class LdapConnectionTest extends 
     @Test
     public void testLookup() throws Exception
     {
-        SearchResponse resp = connection.lookup( ADMIN_DN );
+        InternalResponse resp = connection.lookup( ADMIN_DN );
         assertNotNull( resp );
 
-        Entry entry = ( ( SearchResultEntry ) resp ).getEntry();
+        Entry entry = ( ( InternalSearchResultEntry ) resp ).getEntry();
         assertNull( entry.get( SchemaConstants.ENTRY_UUID_AT ) );
 
         // perform lookup with operational attributes
         resp = connection.lookup( ADMIN_DN, "+", "*" );
-        entry = ( ( SearchResultEntry ) resp ).getEntry();
+        entry = ( ( InternalSearchResultEntry ) resp ).getEntry();
         assertNotNull( entry.get( SchemaConstants.ENTRY_UUID_AT ) );
     }
 
@@ -157,17 +155,17 @@ public class LdapConnectionTest extends 
     @Test
     public void searchByEntryUuid() throws Exception
     {
-        SearchResponse resp = connection.lookup( ADMIN_DN, "+" );
-        Entry entry = ( ( SearchResultEntry ) resp ).getEntry();
+        InternalResponse resp = connection.lookup( ADMIN_DN, "+" );
+        Entry entry = ( ( InternalSearchResultEntry ) resp ).getEntry();
 
         String uuid = entry.get( SchemaConstants.ENTRY_UUID_AT ).getString();
 
         EqualityNode<String> filter = new EqualityNode<String>( SchemaConstants.ENTRY_UUID_AT, new StringValue( uuid ) );
 
-        Cursor<SearchResponse> cursor = connection.search( ADMIN_DN, filter.toString(), SearchScope.SUBTREE, "+" );
+        Cursor<InternalResponse> cursor = connection.search( ADMIN_DN, filter.toString(), SearchScope.SUBTREE, "+" );
         cursor.next();
 
-        Entry readEntry = ( ( SearchResultEntry ) cursor.get() ).getEntry();
+        Entry readEntry = ( ( InternalSearchResultEntry ) cursor.get() ).getEntry();
         assertEquals( uuid, readEntry.get( SchemaConstants.ENTRY_UUID_AT ).getString() );
 
         cursor.close();
@@ -177,12 +175,12 @@ public class LdapConnectionTest extends 
     @Test
     public void testRetrieveBinaryAttibute() throws Exception
     {
-        Entry entry = ( ( SearchResultEntry ) connection.lookup( "uid=admin,ou=system" ) ).getEntry();
+        Entry entry = ( ( InternalSearchResultEntry ) connection.lookup( "uid=admin,ou=system" ) ).getEntry();
         assertFalse( entry.get( SchemaConstants.USER_PASSWORD_AT ).get().isBinary() );
 
         connection.loadSchema();
 
-        entry = ( ( SearchResultEntry ) connection.lookup( "uid=admin,ou=system" ) ).getEntry();
+        entry = ( ( InternalSearchResultEntry ) connection.lookup( "uid=admin,ou=system" ) ).getEntry();
         assertTrue( entry.get( SchemaConstants.USER_PASSWORD_AT ).get().isBinary() );
     }
 
@@ -206,12 +204,12 @@ public class LdapConnectionTest extends 
     @Test
     public void testSearchEmptyDNWithOneLevelScopeAndNoObjectClassPresenceFilter() throws Exception
     {
-        Cursor<SearchResponse> cursor = connection.search( "", "(objectClass=*)", SearchScope.ONELEVEL, "*", "+" );
+        Cursor<InternalResponse> cursor = connection.search( "", "(objectClass=*)", SearchScope.ONELEVEL, "*", "+" );
         HashMap<String, Entry> map = new HashMap<String, Entry>();
 
         while ( cursor.next() )
         {
-            Entry result = ( ( SearchResultEntry ) cursor.get() ).getEntry();
+            Entry result = ( ( InternalSearchResultEntry ) cursor.get() ).getEntry();
             map.put( result.getDn().getName(), result );
         }
 

Modified: directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapSSLConnectionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapSSLConnectionTest.java?rev=985411&r1=985410&r2=985411&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapSSLConnectionTest.java (original)
+++ directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapSSLConnectionTest.java Sat Aug 14 00:22:38 2010
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.shared.client.api;
 
+
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
@@ -34,7 +35,6 @@ import javax.net.ssl.X509TrustManager;
 import org.apache.directory.ldap.client.api.LdapConnection;
 import org.apache.directory.ldap.client.api.LdapConnectionConfig;
 import org.apache.directory.ldap.client.api.LdapNetworkConnection;
-import org.apache.directory.ldap.client.api.message.BindResponse;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.annotations.SaslMechanism;
@@ -47,37 +47,28 @@ import org.apache.directory.server.ldap.
 import org.apache.directory.server.ldap.handlers.bind.plain.PlainMechanismHandler;
 import org.apache.directory.server.ldap.handlers.extended.StoredProcedureExtendedOperationHandler;
 import org.apache.directory.shared.ldap.constants.SupportedSaslMechanisms;
+import org.apache.directory.shared.ldap.message.internal.InternalBindResponse;
 import org.apache.directory.shared.ldap.name.DN;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+
 /**
  * Test the LdapConnection class with SSL enabled
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-@RunWith ( FrameworkRunner.class )
-@CreateLdapServer (
-    transports =
-    {
-        @CreateTransport( protocol = "LDAP" ),
-        @CreateTransport( protocol = "LDAPS" )
-    },
-    saslHost="localhost",
-    saslMechanisms =
-    {
-        @SaslMechanism( name=SupportedSaslMechanisms.PLAIN, implClass=PlainMechanismHandler.class ),
-        @SaslMechanism( name=SupportedSaslMechanisms.CRAM_MD5, implClass=CramMd5MechanismHandler.class),
-        @SaslMechanism( name=SupportedSaslMechanisms.DIGEST_MD5, implClass=DigestMd5MechanismHandler.class),
-        @SaslMechanism( name=SupportedSaslMechanisms.GSSAPI, implClass=GssapiMechanismHandler.class),
-        @SaslMechanism( name=SupportedSaslMechanisms.NTLM, implClass=NtlmMechanismHandler.class),
-        @SaslMechanism( name=SupportedSaslMechanisms.GSS_SPNEGO, implClass=NtlmMechanismHandler.class)
-    },
-    extendedOpHandlers =
-    {
-        StoredProcedureExtendedOperationHandler.class
-    })
+@RunWith(FrameworkRunner.class)
+@CreateLdapServer(transports =
+    { @CreateTransport(protocol = "LDAP"), @CreateTransport(protocol = "LDAPS") }, saslHost = "localhost", saslMechanisms =
+    { @SaslMechanism(name = SupportedSaslMechanisms.PLAIN, implClass = PlainMechanismHandler.class),
+        @SaslMechanism(name = SupportedSaslMechanisms.CRAM_MD5, implClass = CramMd5MechanismHandler.class),
+        @SaslMechanism(name = SupportedSaslMechanisms.DIGEST_MD5, implClass = DigestMd5MechanismHandler.class),
+        @SaslMechanism(name = SupportedSaslMechanisms.GSSAPI, implClass = GssapiMechanismHandler.class),
+        @SaslMechanism(name = SupportedSaslMechanisms.NTLM, implClass = NtlmMechanismHandler.class),
+        @SaslMechanism(name = SupportedSaslMechanisms.GSS_SPNEGO, implClass = NtlmMechanismHandler.class) }, extendedOpHandlers =
+    { StoredProcedureExtendedOperationHandler.class })
 public class LdapSSLConnectionTest extends AbstractLdapTestUnit
 {
     private static LdapConnectionConfig config;
@@ -92,10 +83,12 @@ public class LdapSSLConnectionTest exten
             {
             }
 
+
             public void checkServerTrusted( X509Certificate[] x509Certificates, String s ) throws CertificateException
             {
             }
 
+
             public X509Certificate[] getAcceptedIssuers()
             {
                 return new X509Certificate[0];
@@ -106,7 +99,8 @@ public class LdapSSLConnectionTest exten
         config.setLdapHost( "localhost" );
         config.setUseSsl( true );
         config.setLdapPort( ldapServer.getPortSSL() );
-        config.setTrustManagers( new TrustManager[]{ X509 } );
+        config.setTrustManagers( new TrustManager[]
+            { X509 } );
     }
 
 
@@ -122,7 +116,7 @@ public class LdapSSLConnectionTest exten
         try
         {
             connection = new LdapNetworkConnection( config );
-            BindResponse bindResponse = connection.bind( "uid=admin,ou=system", "secret" );
+            InternalBindResponse bindResponse = connection.bind( "uid=admin,ou=system", "secret" );
 
             assertNotNull( bindResponse );
 

Modified: directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAbandonRequestTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAbandonRequestTest.java?rev=985411&r1=985410&r2=985411&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAbandonRequestTest.java (original)
+++ directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAbandonRequestTest.java Sat Aug 14 00:22:38 2010
@@ -29,8 +29,6 @@ import org.apache.directory.ldap.client.
 import org.apache.directory.ldap.client.api.LdapNetworkConnection;
 import org.apache.directory.ldap.client.api.future.SearchFuture;
 import org.apache.directory.ldap.client.api.message.SearchRequest;
-import org.apache.directory.ldap.client.api.message.SearchResponse;
-import org.apache.directory.ldap.client.api.message.SearchResultDone;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.CoreSession;
@@ -42,6 +40,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
+import org.apache.directory.shared.ldap.message.internal.InternalResponse;
+import org.apache.directory.shared.ldap.message.internal.InternalSearchResultDone;
 import org.apache.directory.shared.ldap.name.DN;
 import org.junit.After;
 import org.junit.Before;
@@ -55,12 +55,8 @@ import org.junit.runner.RunWith;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @RunWith(FrameworkRunner.class)
-@CreateLdapServer (
-    transports =
-    {
-        @CreateTransport( protocol = "LDAP" ),
-        @CreateTransport( protocol = "LDAPS" )
-    })
+@CreateLdapServer(transports =
+    { @CreateTransport(protocol = "LDAP"), @CreateTransport(protocol = "LDAPS") })
 public class ClientAbandonRequestTest extends AbstractLdapTestUnit
 {
 
@@ -68,6 +64,7 @@ public class ClientAbandonRequestTest ex
 
     private CoreSession session;
 
+
     @Before
     public void setup() throws Exception
     {
@@ -76,7 +73,7 @@ public class ClientAbandonRequestTest ex
         connection.setTimeOut( 0L );
         connection.bind( bindDn.getName(), "secret" );
 
-//        session = ldapServer.getDirectoryService().getSession();
+        //        session = ldapServer.getDirectoryService().getSession();
     }
 
 
@@ -93,7 +90,7 @@ public class ClientAbandonRequestTest ex
                 connection.close();
             }
         }
-        catch( Exception ioe )
+        catch ( Exception ioe )
         {
             fail();
         }
@@ -128,7 +125,7 @@ public class ClientAbandonRequestTest ex
         // Launch the search now
         SearchFuture searchFuture = connection.searchAsync( sr );
 
-        SearchResponse searchResponse = null;
+        InternalResponse searchResponse = null;
         int count = 0;
 
         do
@@ -142,13 +139,13 @@ public class ClientAbandonRequestTest ex
                 break;
             }
         }
-        while ( !(searchResponse instanceof SearchResultDone ) );
+        while ( !( searchResponse instanceof InternalSearchResultDone ) );
 
         assertTrue( numEntries > count );
         assertTrue( searchFuture.isCancelled() );
 
         // Now do a simple synchronous search
-        Cursor<SearchResponse> results = connection.search( sr );
+        Cursor<InternalResponse> results = connection.search( sr );
 
         int n = -1;
 

Modified: directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAddRequestTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAddRequestTest.java?rev=985411&r1=985410&r2=985411&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAddRequestTest.java (original)
+++ directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAddRequestTest.java Sat Aug 14 00:22:38 2010
@@ -34,9 +34,6 @@ import org.apache.directory.ldap.client.
 import org.apache.directory.ldap.client.api.LdapNetworkConnection;
 import org.apache.directory.ldap.client.api.future.AddFuture;
 import org.apache.directory.ldap.client.api.message.AddRequest;
-import org.apache.directory.ldap.client.api.message.AddResponse;
-import org.apache.directory.ldap.client.api.message.BindResponse;
-import org.apache.directory.ldap.client.api.message.SearchResultEntry;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.CoreSession;
@@ -48,6 +45,9 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.message.internal.InternalAddResponse;
+import org.apache.directory.shared.ldap.message.internal.InternalBindResponse;
+import org.apache.directory.shared.ldap.message.internal.InternalSearchResultEntry;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.util.DateUtils;
 import org.junit.After;
@@ -55,23 +55,21 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+
 /**
  * Tests the add operation
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @RunWith(FrameworkRunner.class)
-@CreateLdapServer ( 
-    transports = 
-    {
-        @CreateTransport( protocol = "LDAP" ), 
-        @CreateTransport( protocol = "LDAPS" ) 
-    })
+@CreateLdapServer(transports =
+    { @CreateTransport(protocol = "LDAP"), @CreateTransport(protocol = "LDAPS") })
 public class ClientAddRequestTest extends AbstractLdapTestUnit
 {
     private LdapAsyncConnection connection;
     private CoreSession session;
-    
+
+
     @Before
     public void setup() throws Exception
     {
@@ -79,11 +77,11 @@ public class ClientAddRequestTest extend
         connection.setTimeOut( 0 );
         DN bindDn = new DN( "uid=admin,ou=system" );
         connection.bind( bindDn.getName(), "secret" );
-        
+
         session = ldapServer.getDirectoryService().getSession();
     }
 
-    
+
     /**
      * Close the LdapConnection
      */
@@ -97,49 +95,49 @@ public class ClientAddRequestTest extend
                 connection.close();
             }
         }
-        catch( Exception ioe )
+        catch ( Exception ioe )
         {
             fail();
         }
     }
-    
-    
+
+
     @Test
     public void testAdd() throws Exception
     {
         DN dn = new DN( "cn=testadd,ou=system" );
-        Entry entry = new DefaultEntry( dn ); 
+        Entry entry = new DefaultEntry( dn );
         entry.add( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.PERSON_OC );
         entry.add( SchemaConstants.CN_AT, "testadd_cn" );
         entry.add( SchemaConstants.SN_AT, "testadd_sn" );
-        
+
         assertFalse( session.exists( dn ) );
-        
-        AddResponse response = connection.add( entry );
+
+        InternalAddResponse response = connection.add( entry );
         assertNotNull( response );
         assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
-        
+
         assertTrue( session.exists( dn ) );
     }
 
-    
+
     @Test
     public void testAddAsync() throws Exception
     {
         DN dn = new DN( "cn=testAsyncAdd,ou=system" );
-        Entry entry = new DefaultEntry( dn ); 
+        Entry entry = new DefaultEntry( dn );
         entry.add( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.PERSON_OC );
         entry.add( SchemaConstants.CN_AT, "testAsyncAdd_cn" );
         entry.add( SchemaConstants.SN_AT, "testAsyncAdd_sn" );
-        
+
         assertFalse( session.exists( dn ) );
 
-        AddFuture addFuture = connection.addAsync( new AddRequest( entry ));
+        AddFuture addFuture = connection.addAsync( new AddRequest( entry ) );
 
         try
         {
-            AddResponse addResponse = addFuture.get( 1000, TimeUnit.MILLISECONDS );
-            
+            InternalAddResponse addResponse = addFuture.get( 1000, TimeUnit.MILLISECONDS );
+
             assertNotNull( addResponse );
             assertEquals( ResultCodeEnum.SUCCESS, addResponse.getLdapResult().getResultCode() );
             assertTrue( connection.isAuthenticated() );
@@ -150,18 +148,11 @@ public class ClientAddRequestTest extend
             fail();
         }
     }
-    
-    
+
+
     @ApplyLdifs(
-        {
-            "dn: cn=kayyagari,ou=system",
-            "objectClass: person",
-            "objectClass: top",
-            "cn: kayyagari",
-            "description: dbugger",
-            "sn: dbugger",
-            "userPassword: secret"
-        })
+        { "dn: cn=kayyagari,ou=system", "objectClass: person", "objectClass: top", "cn: kayyagari",
+            "description: dbugger", "sn: dbugger", "userPassword: secret" })
     @Test
     /**
      * tests adding entryUUID, entryCSN, creatorsName and createTimestamp attributes
@@ -174,7 +165,7 @@ public class ClientAddRequestTest extend
         String csn = new CsnFactory( 0 ).newInstance().toString();
         String creator = dn.getName();
         String createdTime = DateUtils.getGeneralizedTime();
-        
+
         Entry entry = new DefaultEntry( dn );
         entry.add( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.PERSON_OC );
         entry.add( SchemaConstants.CN_AT, "x" );
@@ -183,26 +174,26 @@ public class ClientAddRequestTest extend
         entry.add( SchemaConstants.ENTRY_CSN_AT, csn );
         entry.add( SchemaConstants.CREATORS_NAME_AT, creator );
         entry.add( SchemaConstants.CREATE_TIMESTAMP_AT, createdTime );
-        
+
         connection.add( entry );
-        
-        Entry loadedEntry = ( ( SearchResultEntry ) connection.lookup( dn.getName(), "+" ) ).getEntry();
-        
+
+        Entry loadedEntry = ( ( InternalSearchResultEntry ) connection.lookup( dn.getName(), "+" ) ).getEntry();
+
         // successful for admin
         assertEquals( uuid, loadedEntry.get( SchemaConstants.ENTRY_UUID_AT ).getString() );
         assertEquals( csn, loadedEntry.get( SchemaConstants.ENTRY_CSN_AT ).getString() );
         assertEquals( creator, loadedEntry.get( SchemaConstants.CREATORS_NAME_AT ).getString() );
         assertEquals( createdTime, loadedEntry.get( SchemaConstants.CREATE_TIMESTAMP_AT ).getString() );
-        
+
         connection.delete( dn );
         connection.unBind();
-        
+
         // connect as non admin user and try to add entry with uuid and csn
-        BindResponse bindResp = connection.bind( "cn=kayyagari,ou=system", "secret" );
+        InternalBindResponse bindResp = connection.bind( "cn=kayyagari,ou=system", "secret" );
         assertEquals( ResultCodeEnum.SUCCESS, bindResp.getLdapResult().getResultCode() );
-        
-        AddResponse resp = connection.add( entry );
+
+        InternalAddResponse resp = connection.add( entry );
         assertEquals( ResultCodeEnum.INSUFFICIENT_ACCESS_RIGHTS, resp.getLdapResult().getResultCode() );
     }
-    
+
 }

Modified: directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientCompareRequestTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientCompareRequestTest.java?rev=985411&r1=985410&r2=985411&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientCompareRequestTest.java (original)
+++ directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientCompareRequestTest.java Sat Aug 14 00:22:38 2010
@@ -32,7 +32,6 @@ import org.apache.directory.ldap.client.
 import org.apache.directory.ldap.client.api.LdapNetworkConnection;
 import org.apache.directory.ldap.client.api.future.CompareFuture;
 import org.apache.directory.ldap.client.api.message.CompareRequest;
-import org.apache.directory.ldap.client.api.message.CompareResponse;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.CoreSession;
@@ -40,41 +39,40 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.message.internal.InternalCompareResponse;
 import org.apache.directory.shared.ldap.name.DN;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+
 /**
  * Tests the compare operation
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @RunWith(FrameworkRunner.class)
-@CreateLdapServer ( 
-    transports = 
-    {
-        @CreateTransport( protocol = "LDAP" ), 
-        @CreateTransport( protocol = "LDAPS" ) 
-    })
+@CreateLdapServer(transports =
+    { @CreateTransport(protocol = "LDAP"), @CreateTransport(protocol = "LDAPS") })
 public class ClientCompareRequestTest extends AbstractLdapTestUnit
 {
     private LdapAsyncConnection connection;
-    
+
     private CoreSession session;
-    
+
+
     @Before
     public void setup() throws Exception
     {
         connection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );
         DN bindDn = new DN( "uid=admin,ou=system" );
         connection.bind( bindDn.getName(), "secret" );
-        
+
         session = ldapServer.getDirectoryService().getSession();
     }
 
-    
+
     /**
      * Close the LdapConnection
      */
@@ -88,28 +86,28 @@ public class ClientCompareRequestTest ex
                 connection.close();
             }
         }
-        catch( Exception ioe )
+        catch ( Exception ioe )
         {
             fail();
         }
     }
-    
-    
+
+
     @Test
     public void testCompare() throws Exception
     {
         DN dn = new DN( "uid=admin,ou=system" );
-        
-        CompareResponse response = connection.compare( dn, SchemaConstants.UID_AT, "admin" );
+
+        InternalCompareResponse response = connection.compare( dn, SchemaConstants.UID_AT, "admin" );
         assertNotNull( response );
         assertTrue( response.isTrue() );
-        
+
         response = connection.compare( dn.getName(), SchemaConstants.USER_PASSWORD_AT, "secret".getBytes() );
         assertNotNull( response );
         assertTrue( response.isTrue() );
     }
 
-    
+
     @Test
     public void testCompareAsync() throws Exception
     {
@@ -119,17 +117,17 @@ public class ClientCompareRequestTest ex
         compareRequest.setEntryDn( dn );
         compareRequest.setAttrName( SchemaConstants.UID_AT );
         compareRequest.setValue( "admin" );
-        
-        connection.compare( compareRequest);
+
+        connection.compare( compareRequest );
 
         assertTrue( session.exists( dn ) );
 
         CompareFuture compareFuture = connection.compareAsync( compareRequest );
-        
+
         try
         {
-            CompareResponse compareResponse = compareFuture.get( 1000, TimeUnit.MILLISECONDS );
-            
+            InternalCompareResponse compareResponse = compareFuture.get( 1000, TimeUnit.MILLISECONDS );
+
             assertNotNull( compareResponse );
             assertEquals( ResultCodeEnum.COMPARE_TRUE, compareResponse.getLdapResult().getResultCode() );
         }

Modified: directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientDeleteRequestTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientDeleteRequestTest.java?rev=985411&r1=985410&r2=985411&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientDeleteRequestTest.java (original)
+++ directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientDeleteRequestTest.java Sat Aug 14 00:22:38 2010
@@ -20,6 +20,7 @@
 
 package org.apache.directory.shared.client.api.operations;
 
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
@@ -37,7 +38,6 @@ import org.apache.directory.ldap.client.
 import org.apache.directory.ldap.client.api.future.DeleteFuture;
 import org.apache.directory.ldap.client.api.listener.DeleteListener;
 import org.apache.directory.ldap.client.api.message.DeleteRequest;
-import org.apache.directory.ldap.client.api.message.DeleteResponse;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.CoreSession;
@@ -46,6 +46,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.message.internal.InternalDeleteResponse;
 import org.apache.directory.shared.ldap.name.DN;
 import org.junit.After;
 import org.junit.Before;
@@ -53,59 +54,42 @@ import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+
 /**
  * Test case for client delete operation.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @RunWith(FrameworkRunner.class)
-@CreateLdapServer ( 
-    transports = 
-    {
-        @CreateTransport( protocol = "LDAP" ), 
-        @CreateTransport( protocol = "LDAPS" ) 
-    })
-@ApplyLdifs( {
-    "dn: cn=parent,ou=system",
-    "objectClass: person",
-    "cn: parent_cn",
-    "sn: parent_sn", 
-    
-    "",
-    
-    "dn: cn=child1,cn=parent,ou=system",
-    "objectClass: person",
-    "cn: child1_cn",
-    "sn: child1_sn", 
-    
+@CreateLdapServer(transports =
+    { @CreateTransport(protocol = "LDAP"), @CreateTransport(protocol = "LDAPS") })
+@ApplyLdifs(
+    { "dn: cn=parent,ou=system", "objectClass: person", "cn: parent_cn", "sn: parent_sn",
+
     "",
-    
-    "dn: cn=child2,cn=parent,ou=system",
-    "objectClass: person",
-    "cn: child2_cn",
-    "sn: child2_sn", 
-    
+
+    "dn: cn=child1,cn=parent,ou=system", "objectClass: person", "cn: child1_cn", "sn: child1_sn",
+
     "",
-    
-    "dn: cn=grand_child11,cn=child1,cn=parent,ou=system",
-    "objectClass: person",
-    "cn: grand_child11_cn",
-    "sn: grand_child11_sn", 
-    
+
+    "dn: cn=child2,cn=parent,ou=system", "objectClass: person", "cn: child2_cn", "sn: child2_sn",
+
     "",
-    
-    "dn: cn=grand_child12,cn=child1,cn=parent,ou=system",
-    "objectClass: person",
-    "cn: grand_child12_cn",
-    "sn: grand_child12_sn"
-})
+
+    "dn: cn=grand_child11,cn=child1,cn=parent,ou=system", "objectClass: person", "cn: grand_child11_cn",
+        "sn: grand_child11_sn",
+
+        "",
+
+        "dn: cn=grand_child12,cn=child1,cn=parent,ou=system", "objectClass: person", "cn: grand_child12_cn",
+        "sn: grand_child12_sn" })
 public class ClientDeleteRequestTest extends AbstractLdapTestUnit
 {
     private LdapNetworkConnection connection;
-    
+
     private CoreSession session;
-    
-    
+
+
     @Before
     public void setup() throws Exception
     {
@@ -113,11 +97,11 @@ public class ClientDeleteRequestTest ext
 
         DN bindDn = new DN( "uid=admin,ou=system" );
         connection.bind( bindDn.getName(), "secret" );
-        
+
         session = ldapServer.getDirectoryService().getAdminSession();
     }
 
-    
+
     /**
      * Close the LdapConnection
      */
@@ -131,61 +115,61 @@ public class ClientDeleteRequestTest ext
                 connection.close();
             }
         }
-        catch( Exception ioe )
+        catch ( Exception ioe )
         {
             fail();
         }
     }
-    
-    
+
+
     @Test
     public void testDeleteLeafNode() throws Exception
     {
         DN dn = new DN( "cn=grand_child12,cn=child1,cn=parent,ou=system" );
-        
+
         assertTrue( session.exists( dn ) );
-        
-        DeleteResponse response = connection.delete( dn.getName() );
+
+        InternalDeleteResponse response = connection.delete( dn.getName() );
         assertNotNull( response );
         assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
-        
+
         assertFalse( session.exists( dn ) );
     }
-    
-    
+
+
     @Test
     public void testDeleteNonLeafFailure() throws Exception
     {
         DN dn = new DN( "cn=child1,cn=parent,ou=system" ); // has children
         assertTrue( session.exists( dn ) );
- 
-        DeleteResponse response = connection.delete( dn.getName() );
+
+        InternalDeleteResponse response = connection.delete( dn.getName() );
         assertNotNull( response );
         assertEquals( ResultCodeEnum.NOT_ALLOWED_ON_NON_LEAF, response.getLdapResult().getResultCode() );
-        
+
         assertTrue( session.exists( dn ) );
     }
-    
+
 
     @Test
     @Ignore
     public void testDeleteWithCascadeControl() throws Exception
     {
         DN dn = new DN( "cn=parent,ou=system" );
-        
+
         assertTrue( session.exists( dn ) );
-        
+
         if ( connection.isControlSupported( "1.2.840.113556.1.4.805" ) )
         {
-            DeleteResponse response = connection.deleteTree( dn );
+            InternalDeleteResponse response = connection.deleteTree( dn );
             assertNotNull( response );
             assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
-            
+
             assertFalse( session.exists( dn ) );
         }
     }
-    
-    
+
+
     /**
      * this method uses reflection to test deleteChildren method without using the
      * convenient method delete( dn, true ), cause the convenient method checks 
@@ -202,20 +186,22 @@ public class ClientDeleteRequestTest ext
     public void testDeleteWithoutCascadeControl() throws Exception
     {
         DN dn = new DN( "cn=parent,ou=system" );
-        
+
         assertTrue( session.exists( dn ) );
 
-        Method deleteChildrenMethod = connection.getClass().getDeclaredMethod( "deleteRecursive", DN.class, Map.class, DeleteListener.class );
+        Method deleteChildrenMethod = connection.getClass().getDeclaredMethod( "deleteRecursive", DN.class, Map.class,
+            DeleteListener.class );
         deleteChildrenMethod.setAccessible( true );
-        
-        DeleteResponse response = ( DeleteResponse ) deleteChildrenMethod.invoke( connection, dn, null, null );
+
+        InternalDeleteResponse response = ( InternalDeleteResponse ) deleteChildrenMethod.invoke( connection, dn, null,
+            null );
         assertNotNull( response );
         assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
-        
+
         assertFalse( session.exists( dn ) );
     }
 
-    
+
     /**
      * @see #testDeleteWithoutCascadeControl()
      */
@@ -224,24 +210,26 @@ public class ClientDeleteRequestTest ext
     public void testDeleteAsyncWithoutCascadeControl() throws Exception
     {
         DN dn = new DN( "cn=parent,ou=system" );
-        
+
         assertTrue( session.exists( dn ) );
 
-        Method deleteChildrenMethod = connection.getClass().getDeclaredMethod( "deleteRecursive", DN.class, Map.class, DeleteListener.class );
+        Method deleteChildrenMethod = connection.getClass().getDeclaredMethod( "deleteRecursive", DN.class, Map.class,
+            DeleteListener.class );
         deleteChildrenMethod.setAccessible( true );
-    
+
         final AtomicInteger count = new AtomicInteger();
-        
+
         DeleteListener listener = new DeleteListener()
         {
-            public void entryDeleted( LdapAsyncConnection connection, DeleteResponse response ) throws LdapException
+            public void entryDeleted( LdapAsyncConnection connection, InternalDeleteResponse response )
+                throws LdapException
             {
                 assertNotNull( response );
                 assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
                 count.incrementAndGet();
             }
         };
-        
+
         try
         {
             connection.deleteTree( dn );
@@ -253,20 +241,20 @@ public class ClientDeleteRequestTest ext
         }
     }
 
-    
+
     @Test
     public void testDeleteAsync() throws Exception
     {
         DN dn = new DN( "cn=grand_child12,cn=child1,cn=parent,ou=system" );
-        
+
         assertTrue( session.exists( dn ) );
-        
-        DeleteFuture deleteFuture = connection.deleteAsync( new DeleteRequest( dn ));
-        
+
+        DeleteFuture deleteFuture = connection.deleteAsync( new DeleteRequest( dn ) );
+
         try
         {
-            DeleteResponse deleteResponse = deleteFuture.get( 1000, TimeUnit.MILLISECONDS );
-            
+            InternalDeleteResponse deleteResponse = deleteFuture.get( 1000, TimeUnit.MILLISECONDS );
+
             assertNotNull( deleteResponse );
             assertEquals( ResultCodeEnum.SUCCESS, deleteResponse.getLdapResult().getResultCode() );
             assertTrue( connection.isAuthenticated() );

Modified: directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientExtendedRequestTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientExtendedRequestTest.java?rev=985411&r1=985410&r2=985411&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientExtendedRequestTest.java (original)
+++ directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientExtendedRequestTest.java Sat Aug 14 00:22:38 2010
@@ -34,7 +34,6 @@ import org.apache.directory.ldap.client.
 import org.apache.directory.ldap.client.api.LdapNetworkConnection;
 import org.apache.directory.ldap.client.api.future.ExtendedFuture;
 import org.apache.directory.ldap.client.api.message.ExtendedRequest;
-import org.apache.directory.ldap.client.api.message.ExtendedResponse;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.CoreSession;
@@ -42,91 +41,88 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.server.ldap.handlers.extended.StartTlsHandler;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.message.internal.InternalExtendedResponse;
 import org.apache.directory.shared.ldap.name.DN;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+
 /**
  * Tests the extended operation
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @RunWith(FrameworkRunner.class)
-@CreateLdapServer (
-   transports =
-   {
-       @CreateTransport( protocol = "LDAP" ),
-       @CreateTransport( protocol = "LDAPS" )
-   },
-   extendedOpHandlers =
-   {
-       StartTlsHandler.class
-   })
+@CreateLdapServer(transports =
+    { @CreateTransport(protocol = "LDAP"), @CreateTransport(protocol = "LDAPS") }, extendedOpHandlers =
+    { StartTlsHandler.class })
 public class ClientExtendedRequestTest extends AbstractLdapTestUnit
 {
-   private LdapAsyncConnection connection;
-   private CoreSession session;
+    private LdapAsyncConnection connection;
+    private CoreSession session;
+
 
-   @Before
-   public void setup() throws Exception
-   {
-       connection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );
-       DN bindDn = new DN( "uid=admin,ou=system" );
-       connection.bind( bindDn.getName(), "secret" );
-
-       session = ldapServer.getDirectoryService().getSession();
-   }
-
-
-   /**
-    * Close the LdapConnection
-    */
-   @After
-   public void shutdown()
-   {
-       try
-       {
-           if ( connection != null )
-           {
-               connection.close();
-           }
-       }
-       catch( Exception ioe )
-       {
-           fail();
-       }
-   }
-
-
-   @Test
-   public void testExtended() throws Exception
-   {
-       ExtendedResponse response = connection.extended( StartTlsRequest.OID );
-       assertNotNull( response );
-       assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
-   }
-
-
-   @Test
-   public void testExtendedAsync() throws Exception
-   {
-       ExtendedRequest extendedRequest = new ExtendedRequest( StartTlsRequest.OID );
-
-       ExtendedFuture extendedFuture = connection.extendedAsync( extendedRequest );
-
-       try
-       {
-           ExtendedResponse extendedResponse = extendedFuture.get( 1000, TimeUnit.MILLISECONDS );
-
-           assertNotNull( extendedResponse );
-           assertEquals( ResultCodeEnum.SUCCESS, extendedResponse.getLdapResult().getResultCode() );
-           assertTrue( connection.isAuthenticated() );
-       }
-       catch ( TimeoutException toe )
-       {
-           fail();
-       }
-   }
+    @Before
+    public void setup() throws Exception
+    {
+        connection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );
+        DN bindDn = new DN( "uid=admin,ou=system" );
+        connection.bind( bindDn.getName(), "secret" );
+
+        session = ldapServer.getDirectoryService().getSession();
+    }
+
+
+    /**
+     * Close the LdapConnection
+     */
+    @After
+    public void shutdown()
+    {
+        try
+        {
+            if ( connection != null )
+            {
+                connection.close();
+            }
+        }
+        catch ( Exception ioe )
+        {
+            fail();
+        }
+    }
+
+
+    @Test
+    public void testExtended() throws Exception
+    {
+        InternalExtendedResponse response = connection.extended( StartTlsRequest.OID );
+        assertNotNull( response );
+        assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
+    }
+
+
+    @Test
+    public void testExtendedAsync() throws Exception
+    {
+        ExtendedRequest extendedRequest = new ExtendedRequest( StartTlsRequest.OID );
+
+        ExtendedFuture extendedFuture = connection.extendedAsync( extendedRequest );
+
+        try
+        {
+            InternalExtendedResponse extendedResponse = ( InternalExtendedResponse ) extendedFuture.get( 1000,
+                TimeUnit.MILLISECONDS );
+
+            assertNotNull( extendedResponse );
+            assertEquals( ResultCodeEnum.SUCCESS, extendedResponse.getLdapResult().getResultCode() );
+            assertTrue( connection.isAuthenticated() );
+        }
+        catch ( TimeoutException toe )
+        {
+            fail();
+        }
+    }
 }
\ No newline at end of file



Mime
View raw message