directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r986999 [5/6] - in /directory/shared/branches/shared-codec-merge/dsml-parser/src: main/java/org/apache/directory/shared/dsmlv2/ main/java/org/apache/directory/shared/dsmlv2/engine/ main/java/org/apache/directory/shared/dsmlv2/reponse/ main/...
Date Thu, 19 Aug 2010 01:23:43 GMT
Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delResponse/DelResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delResponse/DelResponseTest.java?rev=986999&r1=986998&r2=986999&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delResponse/DelResponseTest.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delResponse/DelResponseTest.java Thu Aug 19 01:23:41 2010
@@ -27,15 +27,15 @@ import static org.junit.Assert.assertNul
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import java.util.List;
+import java.util.Collection;
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
 import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
-import org.apache.directory.shared.ldap.codec.LdapResultCodec;
-import org.apache.directory.shared.ldap.codec.del.DelResponseCodec;
 import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.message.DeleteResponse;
+import org.apache.directory.shared.ldap.message.LdapResult;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.util.LdapURL;
@@ -44,7 +44,6 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 
 
-
 /**
  * Tests for the Del Response parsing
  *
@@ -76,7 +75,7 @@ public class DelResponseTest extends Abs
             fail( e.getMessage() );
         }
 
-        DelResponseCodec delResponse = ( DelResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 456, delResponse.getMessageId() );
     }
@@ -112,7 +111,7 @@ public class DelResponseTest extends Abs
             fail( e.getMessage() );
         }
 
-        DelResponseCodec delResponse = ( DelResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 1, delResponse.getControls().size() );
 
@@ -147,7 +146,7 @@ public class DelResponseTest extends Abs
             fail( e.getMessage() );
         }
 
-        DelResponseCodec delResponse = ( DelResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse();
         Control control = delResponse.getCurrentControl();
 
         assertEquals( 1, delResponse.getControls().size() );
@@ -177,7 +176,7 @@ public class DelResponseTest extends Abs
             fail( e.getMessage() );
         }
 
-        DelResponseCodec delResponse = ( DelResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 2, delResponse.getControls().size() );
 
@@ -212,7 +211,7 @@ public class DelResponseTest extends Abs
             fail( e.getMessage() );
         }
 
-        DelResponseCodec delResponse = ( DelResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 3, delResponse.getControls().size() );
 
@@ -267,9 +266,9 @@ public class DelResponseTest extends Abs
             fail( e.getMessage() );
         }
 
-        DelResponseCodec delResponse = ( DelResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = delResponse.getLdapResult();
+        LdapResult ldapResult = delResponse.getLdapResult();
 
         assertEquals( ResultCodeEnum.PROTOCOL_ERROR, ldapResult.getResultCode() );
     }
@@ -296,9 +295,9 @@ public class DelResponseTest extends Abs
             fail( e.getMessage() );
         }
 
-        DelResponseCodec delResponse = ( DelResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = delResponse.getLdapResult();
+        LdapResult ldapResult = delResponse.getLdapResult();
 
         assertEquals( "Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2", ldapResult
             .getErrorMessage() );
@@ -326,9 +325,9 @@ public class DelResponseTest extends Abs
             fail( e.getMessage() );
         }
 
-        DelResponseCodec delResponse = ( DelResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = delResponse.getLdapResult();
+        LdapResult ldapResult = delResponse.getLdapResult();
 
         assertNull( ldapResult.getErrorMessage() );
     }
@@ -354,19 +353,17 @@ public class DelResponseTest extends Abs
             fail( e.getMessage() );
         }
 
-        DelResponseCodec delResponse = ( DelResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = delResponse.getLdapResult();
+        LdapResult ldapResult = delResponse.getLdapResult();
 
-        List<org.apache.directory.shared.ldap.util.LdapURL> referrals = ldapResult.getReferrals();
+        Collection<String> referrals = ldapResult.getReferral().getLdapUrls();
 
         assertEquals( 1, referrals.size() );
 
-        Object referral = referrals.get( 0 );
-
         try
         {
-            assertEquals( new LdapURL( "ldap://www.apache.org/" ).toString(), referral.toString() );
+            assertTrue( referrals.contains( new LdapURL( "ldap://www.apache.org/" ).toString() ) );
         }
         catch ( LdapURLEncodingException e )
         {
@@ -396,11 +393,11 @@ public class DelResponseTest extends Abs
             fail( e.getMessage() );
         }
 
-        DelResponseCodec delResponse = ( DelResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = delResponse.getLdapResult();
+        LdapResult ldapResult = delResponse.getLdapResult();
 
-        List<org.apache.directory.shared.ldap.util.LdapURL> referrals = ldapResult.getReferrals();
+        Collection<String> referrals = ldapResult.getReferral().getLdapUrls();
 
         assertEquals( 0, referrals.size() );
     }
@@ -427,30 +424,26 @@ public class DelResponseTest extends Abs
             fail( e.getMessage() );
         }
 
-        DelResponseCodec delResponse = ( DelResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = delResponse.getLdapResult();
+        LdapResult ldapResult = delResponse.getLdapResult();
 
-        List<org.apache.directory.shared.ldap.util.LdapURL> referrals = ldapResult.getReferrals();
+        Collection<String> referrals = ldapResult.getReferral().getLdapUrls();
 
         assertEquals( 2, referrals.size() );
 
-        Object referral = referrals.get( 0 );
-
         try
         {
-            assertEquals( new LdapURL( "ldap://www.apache.org/" ).toString(), referral.toString() );
+            assertTrue( referrals.contains( new LdapURL( "ldap://www.apache.org/" ).toString() ) );
         }
         catch ( LdapURLEncodingException e )
         {
             fail();
         }
 
-        Object referral2 = referrals.get( 1 );
-
         try
         {
-            assertEquals( new LdapURL( "ldap://www.apple.com/" ).toString(), referral2.toString() );
+            assertTrue( referrals.contains( new LdapURL( "ldap://www.apple.com/" ).toString() ) );
         }
         catch ( LdapURLEncodingException e )
         {
@@ -480,19 +473,17 @@ public class DelResponseTest extends Abs
             fail( e.getMessage() );
         }
 
-        DelResponseCodec delResponse = ( DelResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = delResponse.getLdapResult();
+        LdapResult ldapResult = delResponse.getLdapResult();
 
-        List<org.apache.directory.shared.ldap.util.LdapURL> referrals = ldapResult.getReferrals();
+        Collection<String> referrals = ldapResult.getReferral().getLdapUrls();
 
         assertEquals( 1, referrals.size() );
 
-        Object referral = referrals.get( 0 );
-
         try
         {
-            assertEquals( new LdapURL( "ldap://www.apache.org/" ).toString(), referral.toString() );
+            assertTrue( referrals.contains( new LdapURL( "ldap://www.apache.org/" ).toString() ) );
         }
         catch ( LdapURLEncodingException e )
         {
@@ -522,11 +513,11 @@ public class DelResponseTest extends Abs
             fail( e.getMessage() );
         }
 
-        DelResponseCodec delResponse = ( DelResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = delResponse.getLdapResult();
+        LdapResult ldapResult = delResponse.getLdapResult();
 
-        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", ldapResult.getMatchedDN() );
+        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", ldapResult.getMatchedDn().getNormName() );
     }
 
 

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedRequest/ExtendedRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedRequest/ExtendedRequestTest.java?rev=986999&r1=986998&r2=986999&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedRequest/ExtendedRequestTest.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedRequest/ExtendedRequestTest.java Thu Aug 19 01:23:41 2010
@@ -31,12 +31,13 @@ import org.apache.directory.junit.tools.
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractTest;
 import org.apache.directory.shared.dsmlv2.Dsmlv2Parser;
-import org.apache.directory.shared.ldap.codec.extended.ExtendedRequestCodec;
+import org.apache.directory.shared.ldap.message.ExtendedRequest;
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+
 /**
  * Tests for the Extended Request parsing
  *
@@ -67,7 +68,7 @@ public class ExtendedRequestTest extends
             fail( e.getMessage() );
         }
 
-        ExtendedRequestCodec extendedRequest = ( ExtendedRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ExtendedRequest extendedRequest = ( ExtendedRequest ) parser.getBatchRequest().getCurrentRequest();
 
         assertEquals( 456, extendedRequest.getMessageId() );
     }
@@ -104,7 +105,7 @@ public class ExtendedRequestTest extends
             fail( e.getMessage() );
         }
 
-        ExtendedRequestCodec extendedRequest = ( ExtendedRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ExtendedRequest extendedRequest = ( ExtendedRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = extendedRequest.getCurrentControl();
 
         assertEquals( 1, extendedRequest.getControls().size() );
@@ -135,7 +136,7 @@ public class ExtendedRequestTest extends
             fail( e.getMessage() );
         }
 
-        ExtendedRequestCodec extendedRequest = ( ExtendedRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ExtendedRequest extendedRequest = ( ExtendedRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = extendedRequest.getCurrentControl();
 
         assertEquals( 1, extendedRequest.getControls().size() );
@@ -166,7 +167,7 @@ public class ExtendedRequestTest extends
             fail( e.getMessage() );
         }
 
-        ExtendedRequestCodec extendedRequest = ( ExtendedRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ExtendedRequest extendedRequest = ( ExtendedRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = extendedRequest.getCurrentControl();
 
         assertEquals( 1, extendedRequest.getControls().size() );
@@ -197,7 +198,7 @@ public class ExtendedRequestTest extends
             fail( e.getMessage() );
         }
 
-        ExtendedRequestCodec extendedRequest = ( ExtendedRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ExtendedRequest extendedRequest = ( ExtendedRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = extendedRequest.getCurrentControl();
 
         assertEquals( 2, extendedRequest.getControls().size() );
@@ -228,7 +229,7 @@ public class ExtendedRequestTest extends
             fail( e.getMessage() );
         }
 
-        ExtendedRequestCodec extendedRequest = ( ExtendedRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ExtendedRequest extendedRequest = ( ExtendedRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = extendedRequest.getCurrentControl();
 
         assertEquals( 3, extendedRequest.getControls().size() );
@@ -259,7 +260,7 @@ public class ExtendedRequestTest extends
             fail( e.getMessage() );
         }
 
-        ExtendedRequestCodec extendedRequest = ( ExtendedRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ExtendedRequest extendedRequest = ( ExtendedRequest ) parser.getBatchRequest().getCurrentRequest();
 
         assertEquals( "foobar", new String( extendedRequest.getRequestValue() ) );
     }
@@ -286,7 +287,7 @@ public class ExtendedRequestTest extends
             fail( e.getMessage() );
         }
 
-        ExtendedRequestCodec extendedRequest = ( ExtendedRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ExtendedRequest extendedRequest = ( ExtendedRequest ) parser.getBatchRequest().getCurrentRequest();
 
         assertEquals( "DSMLv2.0 rocks!!", new String( extendedRequest.getRequestValue() ) );
     }
@@ -343,7 +344,8 @@ public class ExtendedRequestTest extends
             fail( e.getMessage() );
         }
 
-        ExtendedRequestCodec extendedRequest = ( ExtendedRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        org.apache.directory.shared.ldap.message.ExtendedRequest extendedRequest = ( ExtendedRequest ) parser
+            .getBatchRequest().getCurrentRequest();
         assertNull( extendedRequest.getRequestValue() );
     }
 

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedResponse/ExtendedResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedResponse/ExtendedResponseTest.java?rev=986999&r1=986998&r2=986999&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedResponse/ExtendedResponseTest.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedResponse/ExtendedResponseTest.java Thu Aug 19 01:23:41 2010
@@ -27,7 +27,7 @@ import static org.junit.Assert.assertNul
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import java.util.List;
+import java.util.Collection;
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
@@ -35,9 +35,9 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.primitives.OID;
 import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
 import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
-import org.apache.directory.shared.ldap.codec.LdapResultCodec;
-import org.apache.directory.shared.ldap.codec.extended.ExtendedResponseCodec;
 import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.message.ExtendedResponse;
+import org.apache.directory.shared.ldap.message.LdapResult;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.util.LdapURL;
@@ -77,7 +77,7 @@ public class ExtendedResponseTest extend
             fail( e.getMessage() );
         }
 
-        ExtendedResponseCodec extendedResponse = ( ExtendedResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 456, extendedResponse.getMessageId() );
     }
@@ -114,7 +114,7 @@ public class ExtendedResponseTest extend
             fail( e.getMessage() );
         }
 
-        ExtendedResponseCodec extendedResponse = ( ExtendedResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 1, extendedResponse.getControls().size() );
 
@@ -149,7 +149,7 @@ public class ExtendedResponseTest extend
             fail( e.getMessage() );
         }
 
-        ExtendedResponseCodec extendedResponse = ( ExtendedResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse();
         Control control = extendedResponse.getCurrentControl();
 
         assertEquals( 1, extendedResponse.getControls().size() );
@@ -180,7 +180,7 @@ public class ExtendedResponseTest extend
             fail( e.getMessage() );
         }
 
-        ExtendedResponseCodec extendedResponse = ( ExtendedResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 2, extendedResponse.getControls().size() );
 
@@ -215,7 +215,7 @@ public class ExtendedResponseTest extend
             fail( e.getMessage() );
         }
 
-        ExtendedResponseCodec extendedResponse = ( ExtendedResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 3, extendedResponse.getControls().size() );
 
@@ -270,9 +270,9 @@ public class ExtendedResponseTest extend
             fail( e.getMessage() );
         }
 
-        ExtendedResponseCodec extendedResponse = ( ExtendedResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = extendedResponse.getLdapResult();
+        LdapResult ldapResult = extendedResponse.getLdapResult();
 
         assertEquals( ResultCodeEnum.PROTOCOL_ERROR, ldapResult.getResultCode() );
     }
@@ -299,9 +299,9 @@ public class ExtendedResponseTest extend
             fail( e.getMessage() );
         }
 
-        ExtendedResponseCodec extendedResponse = ( ExtendedResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = extendedResponse.getLdapResult();
+        LdapResult ldapResult = extendedResponse.getLdapResult();
 
         assertEquals( "Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2", ldapResult
             .getErrorMessage() );
@@ -329,9 +329,9 @@ public class ExtendedResponseTest extend
             fail( e.getMessage() );
         }
 
-        ExtendedResponseCodec extendedResponse = ( ExtendedResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = extendedResponse.getLdapResult();
+        LdapResult ldapResult = extendedResponse.getLdapResult();
 
         assertNull( ldapResult.getErrorMessage() );
     }
@@ -358,19 +358,17 @@ public class ExtendedResponseTest extend
             fail( e.getMessage() );
         }
 
-        ExtendedResponseCodec extendedResponse = ( ExtendedResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = extendedResponse.getLdapResult();
+        LdapResult ldapResult = extendedResponse.getLdapResult();
 
-        List<org.apache.directory.shared.ldap.util.LdapURL> referrals = ldapResult.getReferrals();
+        Collection<String> referrals = ldapResult.getReferral().getLdapUrls();
 
         assertEquals( 1, referrals.size() );
 
-        Object referral = referrals.get( 0 );
-
         try
         {
-            assertEquals( new LdapURL( "ldap://www.apache.org/" ).toString(), referral.toString() );
+            assertTrue( referrals.contains( new LdapURL( "ldap://www.apache.org/" ).toString() ) );
         }
         catch ( LdapURLEncodingException e )
         {
@@ -400,11 +398,11 @@ public class ExtendedResponseTest extend
             fail( e.getMessage() );
         }
 
-        ExtendedResponseCodec extendedResponse = ( ExtendedResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = extendedResponse.getLdapResult();
+        LdapResult ldapResult = extendedResponse.getLdapResult();
 
-        List<org.apache.directory.shared.ldap.util.LdapURL> referrals = ldapResult.getReferrals();
+        Collection<String> referrals = ldapResult.getReferral().getLdapUrls();
 
         assertEquals( 0, referrals.size() );
     }
@@ -431,30 +429,26 @@ public class ExtendedResponseTest extend
             fail( e.getMessage() );
         }
 
-        ExtendedResponseCodec extendedResponse = ( ExtendedResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = extendedResponse.getLdapResult();
+        LdapResult ldapResult = extendedResponse.getLdapResult();
 
-        List<org.apache.directory.shared.ldap.util.LdapURL> referrals = ldapResult.getReferrals();
+        Collection<String> referrals = ldapResult.getReferral().getLdapUrls();
 
         assertEquals( 2, referrals.size() );
 
-        Object referral = referrals.get( 0 );
-
         try
         {
-            assertEquals( new LdapURL( "ldap://www.apache.org/" ).toString(), referral.toString() );
+            assertTrue( referrals.contains( new LdapURL( "ldap://www.apache.org/" ).toString() ) );
         }
         catch ( LdapURLEncodingException e )
         {
             fail();
         }
 
-        Object referral2 = referrals.get( 1 );
-
         try
         {
-            assertEquals( new LdapURL( "ldap://www.apple.com/" ).toString(), referral2.toString() );
+            assertTrue( referrals.contains( new LdapURL( "ldap://www.apple.com/" ).toString() ) );
         }
         catch ( LdapURLEncodingException e )
         {
@@ -484,19 +478,17 @@ public class ExtendedResponseTest extend
             fail( e.getMessage() );
         }
 
-        ExtendedResponseCodec extendedResponse = ( ExtendedResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = extendedResponse.getLdapResult();
+        LdapResult ldapResult = extendedResponse.getLdapResult();
 
-        List<org.apache.directory.shared.ldap.util.LdapURL> referrals = ldapResult.getReferrals();
+        Collection<String> referrals = ldapResult.getReferral().getLdapUrls();
 
         assertEquals( 1, referrals.size() );
 
-        Object referral = referrals.get( 0 );
-
         try
         {
-            assertEquals( new LdapURL( "ldap://www.apache.org/" ).toString(), referral.toString() );
+            assertTrue( referrals.contains( new LdapURL( "ldap://www.apache.org/" ).toString() ) );
         }
         catch ( LdapURLEncodingException e )
         {
@@ -526,11 +518,11 @@ public class ExtendedResponseTest extend
             fail( e.getMessage() );
         }
 
-        ExtendedResponseCodec extendedResponse = ( ExtendedResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = extendedResponse.getLdapResult();
+        LdapResult ldapResult = extendedResponse.getLdapResult();
 
-        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", ldapResult.getMatchedDN() );
+        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", ldapResult.getMatchedDn().getName() );
     }
 
 
@@ -565,7 +557,7 @@ public class ExtendedResponseTest extend
             fail( e.getMessage() );
         }
 
-        ExtendedResponseCodec extendedResponse = ( ExtendedResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse();
 
         try
         {
@@ -599,7 +591,7 @@ public class ExtendedResponseTest extend
             fail( e.getMessage() );
         }
 
-        ExtendedResponseCodec extendedResponse = ( ExtendedResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( "", extendedResponse.getResponseName().toString() );
     }
@@ -636,9 +628,9 @@ public class ExtendedResponseTest extend
             fail( e.getMessage() );
         }
 
-        ExtendedResponseCodec extendedResponse = ( ExtendedResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        assertEquals( "This is a response", extendedResponse.getResponse() );
+        assertEquals( "This is a response", extendedResponse.getResponseValue() );
     }
 
 
@@ -663,9 +655,9 @@ public class ExtendedResponseTest extend
             fail( e.getMessage() );
         }
 
-        ExtendedResponseCodec extendedResponse = ( ExtendedResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        assertEquals( "DSMLv2.0 rocks!!", new String( ( byte[] ) extendedResponse.getResponse() ) );
+        assertEquals( "DSMLv2.0 rocks!!", new String( ( byte[] ) extendedResponse.getResponseValue() ) );
     }
 
 
@@ -690,9 +682,9 @@ public class ExtendedResponseTest extend
             fail( e.getMessage() );
         }
 
-        ExtendedResponseCodec extendedResponse = ( ExtendedResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        assertEquals( "", extendedResponse.getResponse() );
+        assertEquals( "", extendedResponse.getResponseValue() );
     }
 
 
@@ -717,9 +709,10 @@ public class ExtendedResponseTest extend
             fail( e.getMessage() );
         }
 
-        ExtendedResponseCodec extendedResponse = ( ExtendedResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        org.apache.directory.shared.ldap.message.ExtendedResponse extendedResponse = ( ExtendedResponse ) parser
+            .getBatchResponse().getCurrentResponse();
 
-        assertEquals( "This is a response", extendedResponse.getResponse() );
+        assertEquals( "This is a response", extendedResponse.getResponseValue() );
 
         try
         {

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNRequest/ModifyDNRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNRequest/ModifyDNRequestTest.java?rev=986999&r1=986998&r2=986999&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNRequest/ModifyDNRequestTest.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNRequest/ModifyDNRequestTest.java Thu Aug 19 01:23:41 2010
@@ -30,12 +30,13 @@ import org.apache.directory.junit.tools.
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractTest;
 import org.apache.directory.shared.dsmlv2.Dsmlv2Parser;
-import org.apache.directory.shared.ldap.codec.modifyDn.ModifyDNRequestCodec;
+import org.apache.directory.shared.ldap.message.ModifyDnRequest;
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+
 /**
  * Tests for the Modify DN Request parsing
  *
@@ -66,7 +67,7 @@ public class ModifyDNRequestTest extends
             fail( e.getMessage() );
         }
 
-        ModifyDNRequestCodec modifyDNRequest = ( ModifyDNRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest();
 
         assertEquals( 456, modifyDNRequest.getMessageId() );
     }
@@ -103,7 +104,7 @@ public class ModifyDNRequestTest extends
             fail( e.getMessage() );
         }
 
-        ModifyDNRequestCodec modifyDNRequest = ( ModifyDNRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = modifyDNRequest.getCurrentControl();
 
         assertEquals( 1, modifyDNRequest.getControls().size() );
@@ -134,7 +135,7 @@ public class ModifyDNRequestTest extends
             fail( e.getMessage() );
         }
 
-        ModifyDNRequestCodec modifyDNRequest = ( ModifyDNRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = modifyDNRequest.getCurrentControl();
 
         assertEquals( 1, modifyDNRequest.getControls().size() );
@@ -165,7 +166,7 @@ public class ModifyDNRequestTest extends
             fail( e.getMessage() );
         }
 
-        ModifyDNRequestCodec modifyDNRequest = ( ModifyDNRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = modifyDNRequest.getCurrentControl();
 
         assertEquals( 1, modifyDNRequest.getControls().size() );
@@ -196,7 +197,7 @@ public class ModifyDNRequestTest extends
             fail( e.getMessage() );
         }
 
-        ModifyDNRequestCodec modifyDNRequest = ( ModifyDNRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = modifyDNRequest.getCurrentControl();
 
         assertEquals( 2, modifyDNRequest.getControls().size() );
@@ -227,7 +228,7 @@ public class ModifyDNRequestTest extends
             fail( e.getMessage() );
         }
 
-        ModifyDNRequestCodec modifyDNRequest = ( ModifyDNRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = modifyDNRequest.getCurrentControl();
 
         assertEquals( 3, modifyDNRequest.getControls().size() );
@@ -278,11 +279,11 @@ public class ModifyDNRequestTest extends
             fail( e.getMessage() );
         }
 
-        ModifyDNRequestCodec modifyDNRequest = ( ModifyDNRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest();
 
-        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", modifyDNRequest.getEntry().getNormName() );
+        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", modifyDNRequest.getName().getNormName() );
 
-        assertEquals( "cn=Steve Jobs", modifyDNRequest.getNewRDN().getNormName() );
+        assertEquals( "cn=Steve Jobs", modifyDNRequest.getNewRdn().getNormName() );
     }
 
 
@@ -307,9 +308,9 @@ public class ModifyDNRequestTest extends
             fail( e.getMessage() );
         }
 
-        ModifyDNRequestCodec modifyDNRequest = ( ModifyDNRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest();
 
-        assertTrue( modifyDNRequest.isDeleteOldRDN() );
+        assertTrue( modifyDNRequest.getDeleteOldRdn() );
     }
 
 
@@ -334,9 +335,9 @@ public class ModifyDNRequestTest extends
             fail( e.getMessage() );
         }
 
-        ModifyDNRequestCodec modifyDNRequest = ( ModifyDNRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest();
 
-        assertTrue( modifyDNRequest.isDeleteOldRDN() );
+        assertTrue( modifyDNRequest.getDeleteOldRdn() );
     }
 
 
@@ -361,9 +362,9 @@ public class ModifyDNRequestTest extends
             fail( e.getMessage() );
         }
 
-        ModifyDNRequestCodec modifyDNRequest = ( ModifyDNRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest();
 
-        assertFalse( modifyDNRequest.isDeleteOldRDN() );
+        assertFalse( modifyDNRequest.getDeleteOldRdn() );
     }
 
 
@@ -388,9 +389,9 @@ public class ModifyDNRequestTest extends
             fail( e.getMessage() );
         }
 
-        ModifyDNRequestCodec modifyDNRequest = ( ModifyDNRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest();
 
-        assertFalse( modifyDNRequest.isDeleteOldRDN() );
+        assertFalse( modifyDNRequest.getDeleteOldRdn() );
     }
 
 
@@ -425,7 +426,7 @@ public class ModifyDNRequestTest extends
             fail( e.getMessage() );
         }
 
-        ModifyDNRequestCodec modifyDNRequest = ( ModifyDNRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest();
 
         assertEquals( "cn=Steve Jobs,ou=Dev,dc=apple,dc=com", modifyDNRequest.getNewSuperior().getNormName() );
     }

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNResponse/ModifyDNResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNResponse/ModifyDNResponseTest.java?rev=986999&r1=986998&r2=986999&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNResponse/ModifyDNResponseTest.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNResponse/ModifyDNResponseTest.java Thu Aug 19 01:23:41 2010
@@ -27,15 +27,15 @@ import static org.junit.Assert.assertNul
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import java.util.List;
+import java.util.Collection;
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
 import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
-import org.apache.directory.shared.ldap.codec.LdapResultCodec;
-import org.apache.directory.shared.ldap.codec.modifyDn.ModifyDNResponseCodec;
 import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.message.LdapResult;
+import org.apache.directory.shared.ldap.message.ModifyDnResponse;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.util.LdapURL;
@@ -75,7 +75,7 @@ public class ModifyDNResponseTest extend
             fail( e.getMessage() );
         }
 
-        ModifyDNResponseCodec modifyDNResponse = ( ModifyDNResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 456, modifyDNResponse.getMessageId() );
     }
@@ -112,7 +112,7 @@ public class ModifyDNResponseTest extend
             fail( e.getMessage() );
         }
 
-        ModifyDNResponseCodec modifyDNResponse = ( ModifyDNResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 1, modifyDNResponse.getControls().size() );
 
@@ -147,7 +147,7 @@ public class ModifyDNResponseTest extend
             fail( e.getMessage() );
         }
 
-        ModifyDNResponseCodec modifyDNResponse = ( ModifyDNResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse();
         Control control = modifyDNResponse.getCurrentControl();
 
         assertEquals( 1, modifyDNResponse.getControls().size() );
@@ -178,7 +178,7 @@ public class ModifyDNResponseTest extend
             fail( e.getMessage() );
         }
 
-        ModifyDNResponseCodec modifyDNResponse = ( ModifyDNResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 2, modifyDNResponse.getControls().size() );
 
@@ -213,7 +213,7 @@ public class ModifyDNResponseTest extend
             fail( e.getMessage() );
         }
 
-        ModifyDNResponseCodec modifyDNResponse = ( ModifyDNResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 3, modifyDNResponse.getControls().size() );
 
@@ -268,9 +268,9 @@ public class ModifyDNResponseTest extend
             fail( e.getMessage() );
         }
 
-        ModifyDNResponseCodec modifyDNResponse = ( ModifyDNResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = modifyDNResponse.getLdapResult();
+        LdapResult ldapResult = modifyDNResponse.getLdapResult();
 
         assertEquals( ResultCodeEnum.PROTOCOL_ERROR, ldapResult.getResultCode() );
     }
@@ -297,9 +297,9 @@ public class ModifyDNResponseTest extend
             fail( e.getMessage() );
         }
 
-        ModifyDNResponseCodec modifyDNResponse = ( ModifyDNResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = modifyDNResponse.getLdapResult();
+        LdapResult ldapResult = modifyDNResponse.getLdapResult();
 
         assertEquals( "Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2", ldapResult
             .getErrorMessage() );
@@ -327,9 +327,9 @@ public class ModifyDNResponseTest extend
             fail( e.getMessage() );
         }
 
-        ModifyDNResponseCodec modifyDNResponse = ( ModifyDNResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = modifyDNResponse.getLdapResult();
+        LdapResult ldapResult = modifyDNResponse.getLdapResult();
 
         assertNull( ldapResult.getErrorMessage() );
     }
@@ -356,19 +356,17 @@ public class ModifyDNResponseTest extend
             fail( e.getMessage() );
         }
 
-        ModifyDNResponseCodec modifyDNResponse = ( ModifyDNResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = modifyDNResponse.getLdapResult();
+        LdapResult ldapResult = modifyDNResponse.getLdapResult();
 
-        List<org.apache.directory.shared.ldap.util.LdapURL> referrals = ldapResult.getReferrals();
+        Collection<String> referrals = ldapResult.getReferral().getLdapUrls();
 
         assertEquals( 1, referrals.size() );
 
-        Object referral = referrals.get( 0 );
-
         try
         {
-            assertEquals( new LdapURL( "ldap://www.apache.org/" ).toString(), referral.toString() );
+            assertTrue( referrals.contains( new LdapURL( "ldap://www.apache.org/" ).toString() ) );
         }
         catch ( LdapURLEncodingException e )
         {
@@ -398,11 +396,11 @@ public class ModifyDNResponseTest extend
             fail( e.getMessage() );
         }
 
-        ModifyDNResponseCodec modifyDNResponse = ( ModifyDNResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = modifyDNResponse.getLdapResult();
+        LdapResult ldapResult = modifyDNResponse.getLdapResult();
 
-        List<org.apache.directory.shared.ldap.util.LdapURL> referrals = ldapResult.getReferrals();
+        Collection<String> referrals = ldapResult.getReferral().getLdapUrls();
 
         assertEquals( 0, referrals.size() );
     }
@@ -429,30 +427,26 @@ public class ModifyDNResponseTest extend
             fail( e.getMessage() );
         }
 
-        ModifyDNResponseCodec modifyDNResponse = ( ModifyDNResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = modifyDNResponse.getLdapResult();
+        LdapResult ldapResult = modifyDNResponse.getLdapResult();
 
-        List<org.apache.directory.shared.ldap.util.LdapURL> referrals = ldapResult.getReferrals();
+        Collection<String> referrals = ldapResult.getReferral().getLdapUrls();
 
         assertEquals( 2, referrals.size() );
 
-        Object referral = referrals.get( 0 );
-
         try
         {
-            assertEquals( new LdapURL( "ldap://www.apache.org/" ).toString(), referral.toString() );
+            assertTrue( referrals.contains( new LdapURL( "ldap://www.apache.org/" ).toString() ) );
         }
         catch ( LdapURLEncodingException e )
         {
             fail();
         }
 
-        Object referral2 = referrals.get( 1 );
-
         try
         {
-            assertEquals( new LdapURL( "ldap://www.apple.com/" ).toString(), referral2.toString() );
+            assertTrue( referrals.contains( new LdapURL( "ldap://www.apple.com/" ).toString() ) );
         }
         catch ( LdapURLEncodingException e )
         {
@@ -482,19 +476,17 @@ public class ModifyDNResponseTest extend
             fail( e.getMessage() );
         }
 
-        ModifyDNResponseCodec modifyDNResponse = ( ModifyDNResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = modifyDNResponse.getLdapResult();
+        LdapResult ldapResult = modifyDNResponse.getLdapResult();
 
-        List<org.apache.directory.shared.ldap.util.LdapURL> referrals = ldapResult.getReferrals();
+        Collection<String> referrals = ldapResult.getReferral().getLdapUrls();
 
         assertEquals( 1, referrals.size() );
 
-        Object referral = referrals.get( 0 );
-
         try
         {
-            assertEquals( new LdapURL( "ldap://www.apache.org/" ).toString(), referral.toString() );
+            assertTrue( referrals.contains( new LdapURL( "ldap://www.apache.org/" ).toString() ) );
         }
         catch ( LdapURLEncodingException e )
         {
@@ -524,11 +516,11 @@ public class ModifyDNResponseTest extend
             fail( e.getMessage() );
         }
 
-        ModifyDNResponseCodec modifyDNResponse = ( ModifyDNResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = modifyDNResponse.getLdapResult();
+        LdapResult ldapResult = modifyDNResponse.getLdapResult();
 
-        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", ldapResult.getMatchedDN() );
+        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", ldapResult.getMatchedDn().getNormName() );
     }
 
 

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyRequest/ModifyRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyRequest/ModifyRequestTest.java?rev=986999&r1=986998&r2=986999&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyRequest/ModifyRequestTest.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyRequest/ModifyRequestTest.java Thu Aug 19 01:23:41 2010
@@ -27,7 +27,8 @@ import static org.junit.Assert.assertTru
 import static org.junit.Assert.fail;
 
 import java.io.UnsupportedEncodingException;
-import java.util.List;
+import java.util.Collection;
+import java.util.Iterator;
 
 import javax.naming.NamingException;
 
@@ -35,15 +36,16 @@ import org.apache.directory.junit.tools.
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractTest;
 import org.apache.directory.shared.dsmlv2.Dsmlv2Parser;
-import org.apache.directory.shared.ldap.codec.LdapConstants;
-import org.apache.directory.shared.ldap.codec.modify.ModifyRequestCodec;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Modification;
+import org.apache.directory.shared.ldap.entry.ModificationOperation;
+import org.apache.directory.shared.ldap.message.ModifyRequest;
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+
 /**
  * Tests for the Modify Request parsing
  *
@@ -74,7 +76,7 @@ public class ModifyRequestTest extends A
             fail( e.getMessage() );
         }
 
-        ModifyRequestCodec modifyRequest = ( ModifyRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest();
 
         assertEquals( 456, modifyRequest.getMessageId() );
     }
@@ -110,7 +112,7 @@ public class ModifyRequestTest extends A
             fail( e.getMessage() );
         }
 
-        ModifyRequestCodec modifyRequest = ( ModifyRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = modifyRequest.getCurrentControl();
 
         assertEquals( 1, modifyRequest.getControls().size() );
@@ -141,7 +143,7 @@ public class ModifyRequestTest extends A
             fail( e.getMessage() );
         }
 
-        ModifyRequestCodec modifyRequest = ( ModifyRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = modifyRequest.getCurrentControl();
 
         assertEquals( 1, modifyRequest.getControls().size() );
@@ -172,7 +174,7 @@ public class ModifyRequestTest extends A
             fail( e.getMessage() );
         }
 
-        ModifyRequestCodec modifyRequest = ( ModifyRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = modifyRequest.getCurrentControl();
 
         assertEquals( 1, modifyRequest.getControls().size() );
@@ -203,7 +205,7 @@ public class ModifyRequestTest extends A
             fail( e.getMessage() );
         }
 
-        ModifyRequestCodec modifyRequest = ( ModifyRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = modifyRequest.getCurrentControl();
 
         assertEquals( 2, modifyRequest.getControls().size() );
@@ -234,7 +236,7 @@ public class ModifyRequestTest extends A
             fail( e.getMessage() );
         }
 
-        ModifyRequestCodec modifyRequest = ( ModifyRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = modifyRequest.getCurrentControl();
 
         assertEquals( 3, modifyRequest.getControls().size() );
@@ -276,20 +278,17 @@ public class ModifyRequestTest extends A
             fail( e.getMessage() );
         }
 
-        ModifyRequestCodec modifyRequest = ( ModifyRequestCodec ) parser.getBatchRequest().getCurrentRequest();
-
-        assertEquals( LdapConstants.OPERATION_ADD, modifyRequest.getCurrentOperation() );
-
-        assertEquals( "directreport", modifyRequest.getCurrentAttributeType() );
-
-        List<Modification> modifications = modifyRequest.getModifications();
-
+        ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest();
+        Collection<Modification> modifications = modifyRequest.getModifications();
         assertEquals( 1, modifications.size() );
 
-        Modification modification = ( Modification ) modifications.get( 0 );
+        Modification modification = modifications.iterator().next();
+
+        assertEquals( ModificationOperation.ADD_ATTRIBUTE, modification.getOperation() );
 
         EntryAttribute attribute = modification.getAttribute();
 
+        assertEquals( "directreport", attribute.getId() );
         assertEquals( "CN=John Smith, DC=microsoft, DC=com", attribute.get( 0 ).getString() );
     }
 
@@ -317,20 +316,18 @@ public class ModifyRequestTest extends A
             fail( e.getMessage() );
         }
 
-        ModifyRequestCodec modifyRequest = ( ModifyRequestCodec ) parser.getBatchRequest().getCurrentRequest();
-
-        assertEquals( LdapConstants.OPERATION_ADD, modifyRequest.getCurrentOperation() );
-
-        assertEquals( "directreport", modifyRequest.getCurrentAttributeType() );
-
-        List<Modification> modifications = modifyRequest.getModifications();
+        ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest();
 
+        Collection<Modification> modifications = modifyRequest.getModifications();
         assertEquals( 1, modifications.size() );
 
-        Modification modification = ( Modification ) modifications.get( 0 );
-
+        Modification modification = modifications.iterator().next();
         EntryAttribute attribute = modification.getAttribute();
 
+        assertEquals( ModificationOperation.ADD_ATTRIBUTE, modification.getOperation() );
+
+        assertEquals( "directreport", attribute.getId() );
+
         String expected = new String( new byte[]
             { 'c', 'n', '=', 'E', 'm', 'm', 'a', 'n', 'u', 'e', 'l', ' ', 'L', ( byte ) 0xc3, ( byte ) 0xa9, 'c', 'h',
                 'a', 'r', 'n', 'y', ',', ' ', 'o', 'u', '=', 'p', 'e', 'o', 'p', 'l', 'e', ',', ' ', 'd', 'c', '=',
@@ -362,19 +359,27 @@ public class ModifyRequestTest extends A
             fail( e.getMessage() );
         }
 
-        ModifyRequestCodec modifyRequest = ( ModifyRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest();
 
-        assertEquals( LdapConstants.OPERATION_REPLACE, modifyRequest.getCurrentOperation() );
+        Collection<Modification> modifications = modifyRequest.getModifications();
+        assertEquals( 2, modifications.size() );
 
-        assertEquals( "sn", modifyRequest.getCurrentAttributeType() );
+        Iterator<Modification> iter = modifications.iterator();
 
-        List<Modification> modifications = modifyRequest.getModifications();
+        Modification modification = iter.next();
 
-        assertEquals( 2, modifications.size() );
+        assertEquals( ModificationOperation.ADD_ATTRIBUTE, modification.getOperation() );
+        EntryAttribute attribute = modification.getAttribute();
+        assertEquals( "directreport", attribute.getId() );
 
-        Modification modification = ( Modification ) modifications.get( 1 );
+        assertEquals( "CN=John Smith, DC=microsoft, DC=com", attribute.get( 0 ).getString() );
 
-        EntryAttribute attribute = modification.getAttribute();
+        modification = iter.next();
+
+        attribute = modification.getAttribute();
+
+        assertEquals( "sn", attribute.getId() );
+        assertEquals( ModificationOperation.REPLACE_ATTRIBUTE, modification.getOperation() );
 
         assertEquals( "CN=Steve Jobs, DC=apple, DC=com", attribute.get( 0 ).getString() );
     }
@@ -422,9 +427,14 @@ public class ModifyRequestTest extends A
             fail( e.getMessage() );
         }
 
-        ModifyRequestCodec modifyRequest = ( ModifyRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest();
 
-        assertEquals( LdapConstants.OPERATION_ADD, modifyRequest.getCurrentOperation() );
+        Collection<Modification> modifications = modifyRequest.getModifications();
+        assertEquals( 1, modifications.size() );
+
+        Modification modification = modifications.iterator().next();
+
+        assertEquals( ModificationOperation.ADD_ATTRIBUTE, modification.getOperation() );
     }
 
 
@@ -450,9 +460,14 @@ public class ModifyRequestTest extends A
             fail( e.getMessage() );
         }
 
-        ModifyRequestCodec modifyRequest = ( ModifyRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest();
+
+        Collection<Modification> modifications = modifyRequest.getModifications();
+        assertEquals( 1, modifications.size() );
+
+        Modification modification = modifications.iterator().next();
 
-        assertEquals( LdapConstants.OPERATION_DELETE, modifyRequest.getCurrentOperation() );
+        assertEquals( ModificationOperation.REMOVE_ATTRIBUTE, modification.getOperation() );
     }
 
 
@@ -478,9 +493,14 @@ public class ModifyRequestTest extends A
             fail( e.getMessage() );
         }
 
-        ModifyRequestCodec modifyRequest = ( ModifyRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest();
 
-        assertEquals( LdapConstants.OPERATION_REPLACE, modifyRequest.getCurrentOperation() );
+        Collection<Modification> modifications = modifyRequest.getModifications();
+        assertEquals( 1, modifications.size() );
+
+        Modification modification = modifications.iterator().next();
+
+        assertEquals( ModificationOperation.REPLACE_ATTRIBUTE, modification.getOperation() );
     }
 
 
@@ -516,18 +536,17 @@ public class ModifyRequestTest extends A
             fail( e.getMessage() );
         }
 
-        ModifyRequestCodec modifyRequest = ( ModifyRequestCodec ) parser.getBatchRequest().getCurrentRequest();
-
-        assertEquals( LdapConstants.OPERATION_ADD, modifyRequest.getCurrentOperation() );
-
-        assertEquals( "directreport", modifyRequest.getCurrentAttributeType() );
+        ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest();
 
-        List<Modification> modifications = modifyRequest.getModifications();
+        Collection<Modification> modifications = modifyRequest.getModifications();
+        assertEquals( 1, modifications.size() );
 
-        Modification modification = ( Modification ) modifications.get( 0 );
+        Modification modification = modifications.iterator().next();
 
+        assertEquals( ModificationOperation.ADD_ATTRIBUTE, modification.getOperation() );
         EntryAttribute attribute = modification.getAttribute();
 
+        assertEquals( "directreport", attribute.getId() );
         assertEquals( 0, attribute.size() );
     }
 
@@ -554,20 +573,18 @@ public class ModifyRequestTest extends A
             fail( e.getMessage() );
         }
 
-        ModifyRequestCodec modifyRequest = ( ModifyRequestCodec ) parser.getBatchRequest().getCurrentRequest();
-
-        assertEquals( LdapConstants.OPERATION_ADD, modifyRequest.getCurrentOperation() );
-
-        assertEquals( "directreport", modifyRequest.getCurrentAttributeType() );
-
-        List<Modification> modifications = modifyRequest.getModifications();
+        ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest();
 
+        Collection<Modification> modifications = modifyRequest.getModifications();
         assertEquals( 1, modifications.size() );
 
-        Modification modification = ( Modification ) modifications.get( 0 );
+        Modification modification = modifications.iterator().next();
 
+        assertEquals( ModificationOperation.ADD_ATTRIBUTE, modification.getOperation() );
         EntryAttribute attribute = modification.getAttribute();
 
+        assertEquals( "directreport", attribute.getId() );
+
         assertEquals( 2, attribute.size() );
         assertEquals( "CN=John Smith, DC=microsoft, DC=com", attribute.get( 0 ).getString() );
         assertEquals( "CN=Steve Jobs, DC=apple, DC=com", attribute.get( 1 ).getString() );
@@ -596,20 +613,18 @@ public class ModifyRequestTest extends A
             fail( e.getMessage() );
         }
 
-        ModifyRequestCodec modifyRequest = ( ModifyRequestCodec ) parser.getBatchRequest().getCurrentRequest();
-
-        assertEquals( LdapConstants.OPERATION_ADD, modifyRequest.getCurrentOperation() );
-
-        assertEquals( "directreport", modifyRequest.getCurrentAttributeType() );
-
-        List<Modification> modifications = modifyRequest.getModifications();
+        ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest();
 
+        Collection<Modification> modifications = modifyRequest.getModifications();
         assertEquals( 1, modifications.size() );
 
-        Modification modification = ( Modification ) modifications.get( 0 );
+        Modification modification = modifications.iterator().next();
 
+        assertEquals( ModificationOperation.ADD_ATTRIBUTE, modification.getOperation() );
         EntryAttribute attribute = modification.getAttribute();
 
+        assertEquals( "directreport", attribute.getId() );
+
         assertEquals( 1, attribute.size() );
         assertEquals( "", attribute.get( 0 ).getString() );
     }

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyResponse/ModifyResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyResponse/ModifyResponseTest.java?rev=986999&r1=986998&r2=986999&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyResponse/ModifyResponseTest.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyResponse/ModifyResponseTest.java Thu Aug 19 01:23:41 2010
@@ -27,15 +27,15 @@ import static org.junit.Assert.assertNul
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import java.util.List;
+import java.util.Collection;
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
 import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
-import org.apache.directory.shared.ldap.codec.LdapResultCodec;
-import org.apache.directory.shared.ldap.codec.modify.ModifyResponseCodec;
 import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.message.LdapResult;
+import org.apache.directory.shared.ldap.message.ModifyResponse;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.util.LdapURL;
@@ -75,7 +75,7 @@ public class ModifyResponseTest extends 
             fail( e.getMessage() );
         }
 
-        ModifyResponseCodec modifyResponse = ( ModifyResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 456, modifyResponse.getMessageId() );
     }
@@ -112,7 +112,7 @@ public class ModifyResponseTest extends 
             fail( e.getMessage() );
         }
 
-        ModifyResponseCodec modifyResponse = ( ModifyResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 1, modifyResponse.getControls().size() );
 
@@ -147,7 +147,7 @@ public class ModifyResponseTest extends 
             fail( e.getMessage() );
         }
 
-        ModifyResponseCodec modifyResponse = ( ModifyResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse();
         Control control = modifyResponse.getCurrentControl();
 
         assertEquals( 1, modifyResponse.getControls().size() );
@@ -178,7 +178,7 @@ public class ModifyResponseTest extends 
             fail( e.getMessage() );
         }
 
-        ModifyResponseCodec modifyResponse = ( ModifyResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 2, modifyResponse.getControls().size() );
 
@@ -213,7 +213,7 @@ public class ModifyResponseTest extends 
             fail( e.getMessage() );
         }
 
-        ModifyResponseCodec modifyResponse = ( ModifyResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 3, modifyResponse.getControls().size() );
 
@@ -268,9 +268,9 @@ public class ModifyResponseTest extends 
             fail( e.getMessage() );
         }
 
-        ModifyResponseCodec modifyResponse = ( ModifyResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = modifyResponse.getLdapResult();
+        LdapResult ldapResult = modifyResponse.getLdapResult();
 
         assertEquals( ResultCodeEnum.PROTOCOL_ERROR, ldapResult.getResultCode() );
     }
@@ -297,9 +297,9 @@ public class ModifyResponseTest extends 
             fail( e.getMessage() );
         }
 
-        ModifyResponseCodec modifyResponse = ( ModifyResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = modifyResponse.getLdapResult();
+        LdapResult ldapResult = modifyResponse.getLdapResult();
 
         assertEquals( "Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2", ldapResult
             .getErrorMessage() );
@@ -327,9 +327,9 @@ public class ModifyResponseTest extends 
             fail( e.getMessage() );
         }
 
-        ModifyResponseCodec modifyResponse = ( ModifyResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = modifyResponse.getLdapResult();
+        LdapResult ldapResult = modifyResponse.getLdapResult();
 
         assertNull( ldapResult.getErrorMessage() );
     }
@@ -356,19 +356,17 @@ public class ModifyResponseTest extends 
             fail( e.getMessage() );
         }
 
-        ModifyResponseCodec modifyResponse = ( ModifyResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = modifyResponse.getLdapResult();
+        LdapResult ldapResult = modifyResponse.getLdapResult();
 
-        List<org.apache.directory.shared.ldap.util.LdapURL> referrals = ldapResult.getReferrals();
+        Collection<String> referrals = ldapResult.getReferral().getLdapUrls();
 
         assertEquals( 1, referrals.size() );
 
-        Object referral = referrals.get( 0 );
-
         try
         {
-            assertEquals( new LdapURL( "ldap://www.apache.org/" ).toString(), referral.toString() );
+            assertTrue( referrals.contains( new LdapURL( "ldap://www.apache.org/" ).toString() ) );
         }
         catch ( LdapURLEncodingException e )
         {
@@ -398,11 +396,11 @@ public class ModifyResponseTest extends 
             fail( e.getMessage() );
         }
 
-        ModifyResponseCodec modifyResponse = ( ModifyResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = modifyResponse.getLdapResult();
+        LdapResult ldapResult = modifyResponse.getLdapResult();
 
-        List<org.apache.directory.shared.ldap.util.LdapURL> referrals = ldapResult.getReferrals();
+        Collection<String> referrals = ldapResult.getReferral().getLdapUrls();
 
         assertEquals( 0, referrals.size() );
     }
@@ -429,30 +427,26 @@ public class ModifyResponseTest extends 
             fail( e.getMessage() );
         }
 
-        ModifyResponseCodec modifyResponse = ( ModifyResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = modifyResponse.getLdapResult();
+        LdapResult ldapResult = modifyResponse.getLdapResult();
 
-        List<org.apache.directory.shared.ldap.util.LdapURL> referrals = ldapResult.getReferrals();
+        Collection<String> referrals = ldapResult.getReferral().getLdapUrls();
 
         assertEquals( 2, referrals.size() );
 
-        Object referral = referrals.get( 0 );
-
         try
         {
-            assertEquals( new LdapURL( "ldap://www.apache.org/" ).toString(), referral.toString() );
+            assertTrue( referrals.contains( new LdapURL( "ldap://www.apache.org/" ).toString() ) );
         }
         catch ( LdapURLEncodingException e )
         {
             fail();
         }
 
-        Object referral2 = referrals.get( 1 );
-
         try
         {
-            assertEquals( new LdapURL( "ldap://www.apple.com/" ).toString(), referral2.toString() );
+            assertTrue( referrals.contains( new LdapURL( "ldap://www.apple.com/" ).toString() ) );
         }
         catch ( LdapURLEncodingException e )
         {
@@ -482,19 +476,17 @@ public class ModifyResponseTest extends 
             fail( e.getMessage() );
         }
 
-        ModifyResponseCodec modifyResponse = ( ModifyResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = modifyResponse.getLdapResult();
+        LdapResult ldapResult = modifyResponse.getLdapResult();
 
-        List<org.apache.directory.shared.ldap.util.LdapURL> referrals = ldapResult.getReferrals();
+        Collection<String> referrals = ldapResult.getReferral().getLdapUrls();
 
         assertEquals( 1, referrals.size() );
 
-        Object referral = referrals.get( 0 );
-
         try
         {
-            assertEquals( new LdapURL( "ldap://www.apache.org/" ).toString(), referral.toString() );
+            assertTrue( referrals.contains( new LdapURL( "ldap://www.apache.org/" ).toString() ) );
         }
         catch ( LdapURLEncodingException e )
         {
@@ -524,11 +516,11 @@ public class ModifyResponseTest extends 
             fail( e.getMessage() );
         }
 
-        ModifyResponseCodec modifyResponse = ( ModifyResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = modifyResponse.getLdapResult();
+        LdapResult ldapResult = modifyResponse.getLdapResult();
 
-        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", ldapResult.getMatchedDN() );
+        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", ldapResult.getMatchedDn().getNormName() );
     }
 
 



Mime
View raw message