directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r986088 - /directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyRequestTest.java
Date Mon, 16 Aug 2010 18:31:29 GMT
Author: elecharny
Date: Mon Aug 16 18:31:29 2010
New Revision: 986088

URL: http://svn.apache.org/viewvc?rev=986088&view=rev
Log:
Merged the modifyRequest classes

Modified:
    directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyRequestTest.java

Modified: directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyRequestTest.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/ClientModifyRequestTest.java?rev=986088&r1=986087&r2=986088&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyRequestTest.java
(original)
+++ directory/apacheds/branches/apacheds-codec-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyRequestTest.java
Mon Aug 16 18:31:29 2010
@@ -33,7 +33,6 @@ import java.util.concurrent.TimeoutExcep
 import org.apache.directory.ldap.client.api.LdapAsyncConnection;
 import org.apache.directory.ldap.client.api.LdapNetworkConnection;
 import org.apache.directory.ldap.client.api.future.ModifyFuture;
-import org.apache.directory.ldap.client.api.message.ModifyRequest;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.CoreSession;
@@ -45,7 +44,9 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
+import org.apache.directory.shared.ldap.message.ModifyRequestImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.message.internal.InternalModifyRequest;
 import org.apache.directory.shared.ldap.message.internal.ModifyResponse;
 import org.apache.directory.shared.ldap.message.internal.SearchResultEntry;
 import org.apache.directory.shared.ldap.name.DN;
@@ -110,7 +111,8 @@ public class ClientModifyRequestTest ext
         DN dn = new DN( "uid=admin,ou=system" );
 
         String expected = String.valueOf( System.currentTimeMillis() );
-        ModifyRequest modRequest = new ModifyRequest( dn );
+        InternalModifyRequest modRequest = new ModifyRequestImpl();
+        modRequest.setName( dn );
         modRequest.replace( SchemaConstants.SN_AT, expected );
 
         connection.modify( modRequest );
@@ -166,7 +168,8 @@ public class ClientModifyRequestTest ext
         assertEquals( "test", gn );
 
         // Now, replace the givenName
-        ModifyRequest modifyRequest = new ModifyRequest( dn );
+        InternalModifyRequest modifyRequest = new ModifyRequestImpl();
+        modifyRequest.setName( dn );
         modifyRequest.replace( "givenName" );
         connection.modify( modifyRequest );
 
@@ -182,12 +185,13 @@ public class ClientModifyRequestTest ext
         DN dn = new DN( "uid=admin,ou=system" );
 
         String expected = String.valueOf( System.currentTimeMillis() );
-        ModifyRequest modRequest = new ModifyRequest( dn );
-        modRequest.replace( SchemaConstants.SN_AT, expected );
+        InternalModifyRequest modifyRequest = new ModifyRequestImpl();
+        modifyRequest.setName( dn );
+        modifyRequest.replace( SchemaConstants.SN_AT, expected );
 
         assertTrue( session.exists( dn ) );
 
-        ModifyFuture modifyFuture = connection.modifyAsync( modRequest );
+        ModifyFuture modifyFuture = connection.modifyAsync( modifyRequest );
 
         try
         {
@@ -219,16 +223,18 @@ public class ClientModifyRequestTest ext
     {
         DN dn = new DN( "uid=admin,ou=system" );
 
-        ModifyRequest modReq = new ModifyRequest( dn );
-        modReq.replace( SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString() );
+        InternalModifyRequest modifyRequest = new ModifyRequestImpl();
+        modifyRequest.setName( dn );
+        modifyRequest.replace( SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString()
);
 
-        ModifyResponse modResp = connection.modify( modReq );
+        ModifyResponse modResp = connection.modify( modifyRequest );
         assertEquals( ResultCodeEnum.INSUFFICIENT_ACCESS_RIGHTS, modResp.getLdapResult().getResultCode()
);
 
-        modReq = new ModifyRequest( dn );
-        modReq.replace( SchemaConstants.ENTRY_CSN_AT, new CsnFactory( 0 ).newInstance().toString()
);
+        modifyRequest = new ModifyRequestImpl();
+        modifyRequest.setName( dn );
+        modifyRequest.replace( SchemaConstants.ENTRY_CSN_AT, new CsnFactory( 0 ).newInstance().toString()
);
 
-        modResp = connection.modify( modReq );
+        modResp = connection.modify( modifyRequest );
         assertEquals( ResultCodeEnum.INSUFFICIENT_ACCESS_RIGHTS, modResp.getLdapResult().getResultCode()
);
     }
 
@@ -244,11 +250,12 @@ public class ClientModifyRequestTest ext
         String modifierName = "uid=x,ou=system";
         String modifiedTime = DateUtils.getGeneralizedTime();
 
-        ModifyRequest modReq = new ModifyRequest( dn );
-        modReq.replace( SchemaConstants.MODIFIERS_NAME_AT, modifierName );
-        modReq.replace( SchemaConstants.MODIFY_TIMESTAMP_AT, modifiedTime );
+        InternalModifyRequest modifyRequest = new ModifyRequestImpl();
+        modifyRequest.setName( dn );
+        modifyRequest.replace( SchemaConstants.MODIFIERS_NAME_AT, modifierName );
+        modifyRequest.replace( SchemaConstants.MODIFY_TIMESTAMP_AT, modifiedTime );
 
-        ModifyResponse modResp = connection.modify( modReq );
+        ModifyResponse modResp = connection.modify( modifyRequest );
         assertEquals( ResultCodeEnum.SUCCESS, modResp.getLdapResult().getResultCode() );
 
         Entry loadedEntry = ( ( SearchResultEntry ) connection.lookup( dn.getName(), "+"
) ).getEntry();



Mime
View raw message