directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r986999 [4/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/main/java/org/apache/directory/shared/dsmlv2/request/SearchRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/SearchRequestDsml.java?rev=986999&r1=986998&r2=986999&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/SearchRequestDsml.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/SearchRequestDsml.java Thu Aug 19 01:23:41 2010
@@ -26,18 +26,19 @@ import org.apache.directory.shared.dsmlv
 import org.apache.directory.shared.ldap.codec.AttributeValueAssertion;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
 import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
-import org.apache.directory.shared.ldap.codec.search.AndFilter;
 import org.apache.directory.shared.ldap.codec.search.AttributeValueAssertionFilter;
 import org.apache.directory.shared.ldap.codec.search.ExtensibleMatchFilter;
-import org.apache.directory.shared.ldap.codec.search.Filter;
-import org.apache.directory.shared.ldap.codec.search.NotFilter;
-import org.apache.directory.shared.ldap.codec.search.OrFilter;
 import org.apache.directory.shared.ldap.codec.search.PresentFilter;
-import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
-import org.apache.directory.shared.ldap.codec.search.SubstringFilter;
-import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.filter.AndNode;
+import org.apache.directory.shared.ldap.filter.ExprNode;
+import org.apache.directory.shared.ldap.filter.NotNode;
+import org.apache.directory.shared.ldap.filter.OrNode;
 import org.apache.directory.shared.ldap.filter.SearchScope;
+import org.apache.directory.shared.ldap.filter.SubstringNode;
+import org.apache.directory.shared.ldap.message.AliasDerefMode;
+import org.apache.directory.shared.ldap.message.SearchRequest;
+import org.apache.directory.shared.ldap.message.SearchRequestImpl;
 import org.dom4j.Element;
 import org.dom4j.Namespace;
 import org.dom4j.QName;
@@ -55,7 +56,7 @@ public class SearchRequestDsml extends A
      */
     public SearchRequestDsml()
     {
-        super( new SearchRequestCodec() );
+        super( new SearchRequestImpl() );
     }
 
 
@@ -65,7 +66,7 @@ public class SearchRequestDsml extends A
      * @param ldapMessage
      *      the message to decorate
      */
-    public SearchRequestDsml( SearchRequestCodec ldapMessage )
+    public SearchRequestDsml( SearchRequest ldapMessage )
     {
         super( ldapMessage );
     }
@@ -74,9 +75,9 @@ public class SearchRequestDsml extends A
     /**
      * {@inheritDoc}
      */
-    public MessageTypeEnum getMessageType()
+    public MessageTypeEnum getType()
     {
-        return instance.getMessageType();
+        return instance.getType();
     }
 
 
@@ -87,12 +88,12 @@ public class SearchRequestDsml extends A
     {
         Element element = super.toDsml( root );
 
-        SearchRequestCodec request = ( SearchRequestCodec ) instance;
+        SearchRequest request = ( SearchRequest ) instance;
 
         // DN
-        if ( request.getBaseObject() != null )
+        if ( request.getBase() != null )
         {
-            element.addAttribute( "dn", request.getBaseObject().getName() );
+            element.addAttribute( "dn", request.getBase().getName() );
         }
 
         // Scope
@@ -114,22 +115,26 @@ public class SearchRequestDsml extends A
         }
 
         // DerefAliases
-        int derefAliases = request.getDerefAliases();
-        if ( derefAliases == LdapConstants.NEVER_DEREF_ALIASES )
-        {
-            element.addAttribute( "derefAliases", "neverDerefAliases" );
-        }
-        else if ( derefAliases == LdapConstants.DEREF_IN_SEARCHING )
-        {
-            element.addAttribute( "derefAliases", "derefInSearching" );
-        }
-        else if ( derefAliases == LdapConstants.DEREF_FINDING_BASE_OBJ )
-        {
-            element.addAttribute( "derefAliases", "derefFindingBaseObj" );
-        }
-        else if ( derefAliases == LdapConstants.DEREF_ALWAYS )
+        AliasDerefMode derefAliases = request.getDerefAliases();
+
+        switch ( derefAliases )
         {
-            element.addAttribute( "derefAliases", "derefAlways" );
+            case NEVER_DEREF_ALIASES:
+                element.addAttribute( "derefAliases", "neverDerefAliases" );
+                break;
+
+            case DEREF_ALWAYS:
+                element.addAttribute( "derefAliases", "derefAlways" );
+                break;
+
+            case DEREF_FINDING_BASE_OBJ:
+                element.addAttribute( "derefAliases", "derefFindingBaseObj" );
+                break;
+
+            case DEREF_IN_SEARCHING:
+                element.addAttribute( "derefAliases", "derefInSearching" );
+                break;
+
         }
 
         // SizeLimit
@@ -145,7 +150,7 @@ public class SearchRequestDsml extends A
         }
 
         // TypesOnly
-        if ( request.isTypesOnly() )
+        if ( request.getTypesOnly() )
         {
             element.addAttribute( "typesOnly", "true" );
         }
@@ -155,14 +160,15 @@ public class SearchRequestDsml extends A
         toDsml( filterElement, request.getFilter() );
 
         // Attributes
-        List<EntryAttribute> attributes = request.getAttributes();
+        List<String> attributes = request.getAttributes();
+
         if ( attributes.size() > 0 )
         {
             Element attributesElement = element.addElement( "attributes" );
 
-            for ( EntryAttribute entryAttribute : attributes )
+            for ( String entryAttribute : attributes )
             {
-                attributesElement.addElement( "attribute" ).addAttribute( "name", entryAttribute.getId() );
+                attributesElement.addElement( "attribute" ).addAttribute( "name", entryAttribute );
             }
         }
 
@@ -179,14 +185,15 @@ public class SearchRequestDsml extends A
      * @param filter
      *      the filter to convert
      */
-    private void toDsml( Element element, Filter filter )
+    private void toDsml( Element element, ExprNode filter )
     {
         // AND FILTER
-        if ( filter instanceof AndFilter )
+        if ( filter instanceof AndNode )
         {
             Element newElement = element.addElement( "and" );
 
-            List<Filter> filterList = ( ( AndFilter ) filter ).getAndFilter();
+            List<ExprNode> filterList = ( ( AndNode ) filter ).getChildren();
+
             for ( int i = 0; i < filterList.size(); i++ )
             {
                 toDsml( newElement, filterList.get( i ) );
@@ -194,11 +201,12 @@ public class SearchRequestDsml extends A
         }
 
         // OR FILTER
-        else if ( filter instanceof OrFilter )
+        else if ( filter instanceof OrNode )
         {
             Element newElement = element.addElement( "or" );
 
-            List<Filter> filterList = ( ( OrFilter ) filter ).getOrFilter();
+            List<ExprNode> filterList = ( ( OrNode ) filter ).getChildren();
+
             for ( int i = 0; i < filterList.size(); i++ )
             {
                 toDsml( newElement, filterList.get( i ) );
@@ -206,35 +214,38 @@ public class SearchRequestDsml extends A
         }
 
         // NOT FILTER
-        else if ( filter instanceof NotFilter )
+        else if ( filter instanceof NotNode )
         {
             Element newElement = element.addElement( "not" );
 
-            toDsml( newElement, ( ( NotFilter ) filter ).getNotFilter() );
+            toDsml( newElement, ( ( NotNode ) filter ).getFirstChild() );
         }
 
         // SUBSTRING FILTER
-        else if ( filter instanceof SubstringFilter )
+        else if ( filter instanceof SubstringNode )
         {
             Element newElement = element.addElement( "substrings" );
 
-            SubstringFilter substringFilter = ( SubstringFilter ) filter;
+            SubstringNode substringFilter = ( SubstringNode ) filter;
+
+            newElement.addAttribute( "name", substringFilter.getAttribute() );
 
-            newElement.addAttribute( "name", substringFilter.getType() );
+            String initial = substringFilter.getInitial();
 
-            String initial = substringFilter.getInitialSubstrings();
             if ( ( initial != null ) && ( !"".equals( initial ) ) )
             {
                 newElement.addElement( "initial" ).setText( initial );
             }
 
-            List<String> anyList = substringFilter.getAnySubstrings();
+            List<String> anyList = substringFilter.getAny();
+
             for ( int i = 0; i < anyList.size(); i++ )
             {
                 newElement.addElement( "any" ).setText( anyList.get( i ) );
             }
 
-            String finalString = substringFilter.getFinalSubstrings();
+            String finalString = substringFilter.getFinal();
+
             if ( ( finalString != null ) && ( !"".equals( finalString ) ) )
             {
                 newElement.addElement( "final" ).setText( finalString );

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/abandonRequest/AbandonRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/abandonRequest/AbandonRequestTest.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/abandonRequest/AbandonRequestTest.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/abandonRequest/AbandonRequestTest.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.abandon.AbandonRequestCodec;
+import org.apache.directory.shared.ldap.message.AbandonRequest;
 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 Abandon Request parsing
  *
@@ -76,9 +77,9 @@ public class AbandonRequestTest extends 
             fail( e.getMessage() );
         }
 
-        AbandonRequestCodec abandonRequest = ( AbandonRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        AbandonRequest abandonRequest = ( AbandonRequest ) parser.getBatchRequest().getCurrentRequest();
 
-        assertEquals( 123, abandonRequest.getAbandonedMessageId() );
+        assertEquals( 123, abandonRequest.getAbandoned() );
     }
 
 
@@ -113,7 +114,7 @@ public class AbandonRequestTest extends 
             fail( e.getMessage() );
         }
 
-        AbandonRequestCodec abandonRequest = ( AbandonRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        AbandonRequest abandonRequest = ( AbandonRequest ) parser.getBatchRequest().getCurrentRequest();
 
         assertEquals( 456, abandonRequest.getMessageId() );
     }
@@ -141,7 +142,7 @@ public class AbandonRequestTest extends 
             fail( e.getMessage() );
         }
 
-        AbandonRequestCodec abandonRequest = ( AbandonRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        AbandonRequest abandonRequest = ( AbandonRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = abandonRequest.getCurrentControl();
 
         assertEquals( 1, abandonRequest.getControls().size() );
@@ -173,7 +174,7 @@ public class AbandonRequestTest extends 
             fail( e.getMessage() );
         }
 
-        AbandonRequestCodec abandonRequest = ( AbandonRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        AbandonRequest abandonRequest = ( AbandonRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = abandonRequest.getCurrentControl();
 
         assertEquals( 1, abandonRequest.getControls().size() );
@@ -205,7 +206,7 @@ public class AbandonRequestTest extends 
             fail( e.getMessage() );
         }
 
-        AbandonRequestCodec abandonRequest = ( AbandonRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        AbandonRequest abandonRequest = ( AbandonRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = abandonRequest.getCurrentControl();
 
         assertEquals( 1, abandonRequest.getControls().size() );
@@ -237,7 +238,7 @@ public class AbandonRequestTest extends 
             fail( e.getMessage() );
         }
 
-        AbandonRequestCodec abandonRequest = ( AbandonRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        AbandonRequest abandonRequest = ( AbandonRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = abandonRequest.getCurrentControl();
 
         assertEquals( 2, abandonRequest.getControls().size() );
@@ -269,7 +270,7 @@ public class AbandonRequestTest extends 
             fail( e.getMessage() );
         }
 
-        AbandonRequestCodec abandonRequest = ( AbandonRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        AbandonRequest abandonRequest = ( AbandonRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = abandonRequest.getCurrentControl();
 
         assertEquals( 3, abandonRequest.getControls().size() );

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/addRequest/AddRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/addRequest/AddRequestTest.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/addRequest/AddRequestTest.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/addRequest/AddRequestTest.java Thu Aug 19 01:23:41 2010
@@ -32,15 +32,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.add.AddRequestCodec;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.message.AddRequest;
 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 Add Request parsing
  *
@@ -80,7 +81,7 @@ public class AddRequestTest extends Abst
             fail( e.getMessage() );
         }
 
-        AddRequestCodec addRequest = ( AddRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest();
 
         assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", addRequest.getEntryDn().getNormName() );
     }
@@ -107,7 +108,7 @@ public class AddRequestTest extends Abst
             fail( e.getMessage() );
         }
 
-        AddRequestCodec addRequest = ( AddRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest();
 
         assertEquals( 456, addRequest.getMessageId() );
     }
@@ -143,7 +144,7 @@ public class AddRequestTest extends Abst
             fail( e.getMessage() );
         }
 
-        AddRequestCodec addRequest = ( AddRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest();
 
         assertEquals( 1, addRequest.getControls().size() );
 
@@ -178,7 +179,7 @@ public class AddRequestTest extends Abst
             fail( e.getMessage() );
         }
 
-        AddRequestCodec addRequest = ( AddRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = addRequest.getCurrentControl();
 
         assertEquals( 1, addRequest.getControls().size() );
@@ -209,7 +210,7 @@ public class AddRequestTest extends Abst
             fail( e.getMessage() );
         }
 
-        AddRequestCodec addRequest = ( AddRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = addRequest.getCurrentControl();
 
         assertEquals( 1, addRequest.getControls().size() );
@@ -239,7 +240,7 @@ public class AddRequestTest extends Abst
             fail( e.getMessage() );
         }
 
-        AddRequestCodec addRequest = ( AddRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = addRequest.getCurrentControl();
 
         assertEquals( 2, addRequest.getControls().size() );
@@ -270,7 +271,7 @@ public class AddRequestTest extends Abst
             fail( e.getMessage() );
         }
 
-        AddRequestCodec addRequest = ( AddRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = addRequest.getCurrentControl();
 
         assertEquals( 3, addRequest.getControls().size() );
@@ -301,7 +302,7 @@ public class AddRequestTest extends Abst
             fail( e.getMessage() );
         }
 
-        AddRequestCodec addRequest = ( AddRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest();
 
         Entry entry = addRequest.getEntry();
         assertEquals( 1, entry.size() );
@@ -338,7 +339,7 @@ public class AddRequestTest extends Abst
             fail( e.getMessage() );
         }
 
-        AddRequestCodec addRequest = ( AddRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest();
 
         Entry entry = addRequest.getEntry();
         assertEquals( 1, entry.size() );
@@ -375,7 +376,7 @@ public class AddRequestTest extends Abst
             fail( e.getMessage() );
         }
 
-        AddRequestCodec addRequest = ( AddRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest();
 
         Entry entry = addRequest.getEntry();
         assertEquals( 1, entry.size() );
@@ -414,7 +415,7 @@ public class AddRequestTest extends Abst
             fail( e.getMessage() );
         }
 
-        AddRequestCodec addRequest = ( AddRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest();
 
         Entry entry = addRequest.getEntry();
         assertEquals( 1, entry.size() );
@@ -454,7 +455,7 @@ public class AddRequestTest extends Abst
             fail( e.getMessage() );
         }
 
-        AddRequestCodec addRequest = ( AddRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest();
 
         Entry entry = addRequest.getEntry();
         assertEquals( 1, entry.size() );
@@ -507,7 +508,7 @@ public class AddRequestTest extends Abst
             fail( e.getMessage() );
         }
 
-        AddRequestCodec addRequest = ( AddRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest();
 
         Entry entry = addRequest.getEntry();
         assertEquals( 1, entry.size() );

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/addResponse/AddResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/addResponse/AddResponseTest.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/addResponse/AddResponseTest.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/addResponse/AddResponseTest.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.add.AddResponseCodec;
 import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.message.AddResponse;
+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;
@@ -75,7 +75,7 @@ public class AddResponseTest extends Abs
             fail( e.getMessage() );
         }
 
-        AddResponseCodec addResponse = ( AddResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        AddResponse addResponse = ( AddResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 456, addResponse.getMessageId() );
     }
@@ -111,7 +111,7 @@ public class AddResponseTest extends Abs
             fail( e.getMessage() );
         }
 
-        AddResponseCodec addResponse = ( AddResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        AddResponse addResponse = ( AddResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 1, addResponse.getControls().size() );
 
@@ -146,7 +146,7 @@ public class AddResponseTest extends Abs
             fail( e.getMessage() );
         }
 
-        AddResponseCodec addResponse = ( AddResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        AddResponse addResponse = ( AddResponse ) parser.getBatchResponse().getCurrentResponse();
         Control control = addResponse.getCurrentControl();
 
         assertEquals( 1, addResponse.getControls().size() );
@@ -176,7 +176,7 @@ public class AddResponseTest extends Abs
             fail( e.getMessage() );
         }
 
-        AddResponseCodec addResponse = ( AddResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        AddResponse addResponse = ( AddResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 2, addResponse.getControls().size() );
 
@@ -211,7 +211,7 @@ public class AddResponseTest extends Abs
             fail( e.getMessage() );
         }
 
-        AddResponseCodec addResponse = ( AddResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        AddResponse addResponse = ( AddResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 3, addResponse.getControls().size() );
 
@@ -266,9 +266,9 @@ public class AddResponseTest extends Abs
             fail( e.getMessage() );
         }
 
-        AddResponseCodec addResponse = ( AddResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        AddResponse addResponse = ( AddResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = addResponse.getLdapResult();
+        LdapResult ldapResult = addResponse.getLdapResult();
 
         assertEquals( ResultCodeEnum.PROTOCOL_ERROR, ldapResult.getResultCode() );
     }
@@ -295,9 +295,9 @@ public class AddResponseTest extends Abs
             fail( e.getMessage() );
         }
 
-        AddResponseCodec addResponse = ( AddResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        AddResponse addResponse = ( AddResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = addResponse.getLdapResult();
+        LdapResult ldapResult = addResponse.getLdapResult();
 
         assertEquals( "Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2", ldapResult
             .getErrorMessage() );
@@ -325,9 +325,9 @@ public class AddResponseTest extends Abs
             fail( e.getMessage() );
         }
 
-        AddResponseCodec addResponse = ( AddResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        AddResponse addResponse = ( AddResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = addResponse.getLdapResult();
+        LdapResult ldapResult = addResponse.getLdapResult();
 
         assertNull( ldapResult.getErrorMessage() );
     }
@@ -340,6 +340,7 @@ public class AddResponseTest extends Abs
     public void testResponseWith1Referral()
     {
         Dsmlv2ResponseParser parser = null;
+
         try
         {
             parser = new Dsmlv2ResponseParser();
@@ -353,24 +354,15 @@ public class AddResponseTest extends Abs
             fail( e.getMessage() );
         }
 
-        AddResponseCodec addResponse = ( AddResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        AddResponse addResponse = ( AddResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = addResponse.getLdapResult();
+        LdapResult ldapResult = addResponse.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() );
-        }
-        catch ( LdapURLEncodingException e )
-        {
-            fail();
-        }
+        assertTrue( referrals.contains( "ldap://www.apache.org/" ) );
     }
 
 
@@ -395,11 +387,11 @@ public class AddResponseTest extends Abs
             fail( e.getMessage() );
         }
 
-        AddResponseCodec addResponse = ( AddResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        AddResponse addResponse = ( AddResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = addResponse.getLdapResult();
+        LdapResult ldapResult = addResponse.getLdapResult();
 
-        List<org.apache.directory.shared.ldap.util.LdapURL> referrals = ldapResult.getReferrals();
+        Collection<String> referrals = ldapResult.getReferral().getLdapUrls();
 
         assertEquals( 0, referrals.size() );
     }
@@ -426,35 +418,16 @@ public class AddResponseTest extends Abs
             fail( e.getMessage() );
         }
 
-        AddResponseCodec addResponse = ( AddResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        AddResponse addResponse = ( AddResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = addResponse.getLdapResult();
+        LdapResult ldapResult = addResponse.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() );
-        }
-        catch ( LdapURLEncodingException e )
-        {
-            fail();
-        }
-
-        Object referral2 = referrals.get( 1 );
-
-        try
-        {
-            assertEquals( new LdapURL( "ldap://www.apple.com/" ).toString(), referral2.toString() );
-        }
-        catch ( LdapURLEncodingException e )
-        {
-            fail();
-        }
+        assertTrue( referrals.contains( "ldap://www.apache.org/" ) );
+        assertTrue( referrals.contains( "ldap://www.apple.com/" ) );
     }
 
 
@@ -479,19 +452,17 @@ public class AddResponseTest extends Abs
             fail( e.getMessage() );
         }
 
-        AddResponseCodec addResponse = ( AddResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        AddResponse addResponse = ( AddResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = addResponse.getLdapResult();
+        LdapResult ldapResult = addResponse.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 )
         {
@@ -521,11 +492,11 @@ public class AddResponseTest extends Abs
             fail( e.getMessage() );
         }
 
-        AddResponseCodec addResponse = ( AddResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        AddResponse addResponse = ( AddResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = addResponse.getLdapResult();
+        LdapResult ldapResult = addResponse.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/authRequest/AuthRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/authRequest/AuthRequestTest.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/authRequest/AuthRequestTest.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/authRequest/AuthRequestTest.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.bind.BindRequestCodec;
+import org.apache.directory.shared.ldap.message.BindRequest;
 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 Auth Request parsing
  *
@@ -76,7 +77,7 @@ public class AuthRequestTest extends Abs
             fail( e.getMessage() );
         }
 
-        BindRequestCodec bindRequest = ( BindRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        BindRequest bindRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest();
 
         assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", bindRequest.getName().getNormName() );
     }
@@ -103,7 +104,7 @@ public class AuthRequestTest extends Abs
             fail( e.getMessage() );
         }
 
-        BindRequestCodec abandonRequest = ( BindRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        BindRequest abandonRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest();
 
         assertEquals( 456, abandonRequest.getMessageId() );
     }
@@ -139,7 +140,7 @@ public class AuthRequestTest extends Abs
             fail( e.getMessage() );
         }
 
-        BindRequestCodec abandonRequest = ( BindRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        BindRequest abandonRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = abandonRequest.getCurrentControl();
 
         assertEquals( 1, abandonRequest.getControls().size() );
@@ -170,7 +171,7 @@ public class AuthRequestTest extends Abs
             fail( e.getMessage() );
         }
 
-        BindRequestCodec abandonRequest = ( BindRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        BindRequest abandonRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = abandonRequest.getCurrentControl();
 
         assertEquals( 1, abandonRequest.getControls().size() );
@@ -201,7 +202,7 @@ public class AuthRequestTest extends Abs
             fail( e.getMessage() );
         }
 
-        BindRequestCodec abandonRequest = ( BindRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        BindRequest abandonRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = abandonRequest.getCurrentControl();
 
         assertEquals( 1, abandonRequest.getControls().size() );
@@ -231,7 +232,7 @@ public class AuthRequestTest extends Abs
             fail( e.getMessage() );
         }
 
-        BindRequestCodec abandonRequest = ( BindRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        BindRequest abandonRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = abandonRequest.getCurrentControl();
 
         assertEquals( 2, abandonRequest.getControls().size() );
@@ -262,7 +263,7 @@ public class AuthRequestTest extends Abs
             fail( e.getMessage() );
         }
 
-        BindRequestCodec abandonRequest = ( BindRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        BindRequest abandonRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = abandonRequest.getCurrentControl();
 
         assertEquals( 3, abandonRequest.getControls().size() );

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/authResponse/AuthResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/authResponse/AuthResponseTest.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/authResponse/AuthResponseTest.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/authResponse/AuthResponseTest.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.bind.BindResponseCodec;
 import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.message.BindResponse;
+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;
@@ -75,7 +75,7 @@ public class AuthResponseTest extends Ab
             fail( e.getMessage() );
         }
 
-        BindResponseCodec bindResponse = ( BindResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 456, bindResponse.getMessageId() );
     }
@@ -111,7 +111,7 @@ public class AuthResponseTest extends Ab
             fail( e.getMessage() );
         }
 
-        BindResponseCodec bindResponse = ( BindResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 1, bindResponse.getControls().size() );
 
@@ -146,7 +146,7 @@ public class AuthResponseTest extends Ab
             fail( e.getMessage() );
         }
 
-        BindResponseCodec bindResponse = ( BindResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse();
         Control control = bindResponse.getCurrentControl();
 
         assertEquals( 1, bindResponse.getControls().size() );
@@ -177,7 +177,7 @@ public class AuthResponseTest extends Ab
             fail( e.getMessage() );
         }
 
-        BindResponseCodec bindResponse = ( BindResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 2, bindResponse.getControls().size() );
 
@@ -212,7 +212,7 @@ public class AuthResponseTest extends Ab
             fail( e.getMessage() );
         }
 
-        BindResponseCodec bindResponse = ( BindResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 3, bindResponse.getControls().size() );
 
@@ -267,9 +267,9 @@ public class AuthResponseTest extends Ab
             fail( e.getMessage() );
         }
 
-        BindResponseCodec bindResponse = ( BindResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = bindResponse.getLdapResult();
+        LdapResult ldapResult = bindResponse.getLdapResult();
 
         assertEquals( ResultCodeEnum.PROTOCOL_ERROR, ldapResult.getResultCode() );
     }
@@ -296,9 +296,9 @@ public class AuthResponseTest extends Ab
             fail( e.getMessage() );
         }
 
-        BindResponseCodec bindResponse = ( BindResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = bindResponse.getLdapResult();
+        LdapResult ldapResult = bindResponse.getLdapResult();
 
         assertEquals( "Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2", ldapResult
             .getErrorMessage() );
@@ -326,9 +326,9 @@ public class AuthResponseTest extends Ab
             fail( e.getMessage() );
         }
 
-        BindResponseCodec bindResponse = ( BindResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = bindResponse.getLdapResult();
+        LdapResult ldapResult = bindResponse.getLdapResult();
 
         assertNull( ldapResult.getErrorMessage() );
     }
@@ -355,19 +355,17 @@ public class AuthResponseTest extends Ab
             fail( e.getMessage() );
         }
 
-        BindResponseCodec bindResponse = ( BindResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = bindResponse.getLdapResult();
+        LdapResult ldapResult = bindResponse.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 )
         {
@@ -397,11 +395,11 @@ public class AuthResponseTest extends Ab
             fail( e.getMessage() );
         }
 
-        BindResponseCodec bindResponse = ( BindResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = bindResponse.getLdapResult();
+        LdapResult ldapResult = bindResponse.getLdapResult();
 
-        List<org.apache.directory.shared.ldap.util.LdapURL> referrals = ldapResult.getReferrals();
+        Collection<String> referrals = ldapResult.getReferral().getLdapUrls();
 
         assertEquals( 0, referrals.size() );
     }
@@ -428,30 +426,26 @@ public class AuthResponseTest extends Ab
             fail( e.getMessage() );
         }
 
-        BindResponseCodec bindResponse = ( BindResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = bindResponse.getLdapResult();
+        LdapResult ldapResult = bindResponse.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 )
         {
@@ -481,19 +475,17 @@ public class AuthResponseTest extends Ab
             fail( e.getMessage() );
         }
 
-        BindResponseCodec bindResponse = ( BindResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = bindResponse.getLdapResult();
+        LdapResult ldapResult = bindResponse.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 )
         {
@@ -523,11 +515,11 @@ public class AuthResponseTest extends Ab
             fail( e.getMessage() );
         }
 
-        BindResponseCodec bindResponse = ( BindResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = bindResponse.getLdapResult();
+        LdapResult ldapResult = bindResponse.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/batchRequest/BatchRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/batchRequest/BatchRequestTest.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/batchRequest/BatchRequestTest.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/batchRequest/BatchRequestTest.java Thu Aug 19 01:23:41 2010
@@ -21,6 +21,10 @@
 package org.apache.directory.shared.dsmlv2.batchRequest;
 
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.util.List;
 
 import org.apache.directory.junit.tools.Concurrent;
@@ -28,22 +32,19 @@ import org.apache.directory.junit.tools.
 import org.apache.directory.shared.dsmlv2.AbstractTest;
 import org.apache.directory.shared.dsmlv2.Dsmlv2Parser;
 import org.apache.directory.shared.dsmlv2.request.BatchRequest;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
-import org.apache.directory.shared.ldap.codec.abandon.AbandonRequestCodec;
-import org.apache.directory.shared.ldap.codec.add.AddRequestCodec;
-import org.apache.directory.shared.ldap.codec.bind.BindRequestCodec;
-import org.apache.directory.shared.ldap.codec.compare.CompareRequestCodec;
-import org.apache.directory.shared.ldap.codec.del.DelRequestCodec;
-import org.apache.directory.shared.ldap.codec.extended.ExtendedRequestCodec;
-import org.apache.directory.shared.ldap.codec.modify.ModifyRequestCodec;
-import org.apache.directory.shared.ldap.codec.modifyDn.ModifyDNRequestCodec;
-import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
+import org.apache.directory.shared.ldap.message.AbandonRequest;
+import org.apache.directory.shared.ldap.message.AddRequest;
+import org.apache.directory.shared.ldap.message.BindRequest;
+import org.apache.directory.shared.ldap.message.CompareRequest;
+import org.apache.directory.shared.ldap.message.DeleteRequest;
+import org.apache.directory.shared.ldap.message.ExtendedRequest;
+import org.apache.directory.shared.ldap.message.Message;
+import org.apache.directory.shared.ldap.message.ModifyDnRequest;
+import org.apache.directory.shared.ldap.message.ModifyRequest;
+import org.apache.directory.shared.ldap.message.SearchRequest;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
 
 /**
  * Tests for the Compare Response parsing
@@ -143,9 +144,9 @@ public class BatchRequestTest extends Ab
 
         assertEquals( 1, batchRequest.getRequests().size() );
 
-        LdapMessageCodec request = batchRequest.getCurrentRequest();
+        Message request = batchRequest.getCurrentRequest();
 
-        if ( request instanceof BindRequestCodec )
+        if ( request instanceof BindRequest )
         {
             assertTrue( true );
         }
@@ -181,9 +182,9 @@ public class BatchRequestTest extends Ab
 
         assertEquals( 1, batchRequest.getRequests().size() );
 
-        LdapMessageCodec request = batchRequest.getCurrentRequest();
+        Message request = batchRequest.getCurrentRequest();
 
-        if ( request instanceof AddRequestCodec )
+        if ( request instanceof AddRequest )
         {
             assertTrue( true );
         }
@@ -219,9 +220,9 @@ public class BatchRequestTest extends Ab
 
         assertEquals( 1, batchRequest.getRequests().size() );
 
-        LdapMessageCodec request = batchRequest.getCurrentRequest();
+        Message request = batchRequest.getCurrentRequest();
 
-        if ( request instanceof CompareRequestCodec )
+        if ( request instanceof CompareRequest )
         {
             assertTrue( true );
         }
@@ -257,9 +258,9 @@ public class BatchRequestTest extends Ab
 
         assertEquals( 1, batchRequest.getRequests().size() );
 
-        LdapMessageCodec request = batchRequest.getCurrentRequest();
+        Message request = batchRequest.getCurrentRequest();
 
-        if ( request instanceof AbandonRequestCodec )
+        if ( request instanceof AbandonRequest )
         {
             assertTrue( true );
         }
@@ -295,9 +296,9 @@ public class BatchRequestTest extends Ab
 
         assertEquals( 1, batchRequest.getRequests().size() );
 
-        LdapMessageCodec request = batchRequest.getCurrentRequest();
+        Message request = batchRequest.getCurrentRequest();
 
-        if ( request instanceof DelRequestCodec )
+        if ( request instanceof DeleteRequest )
         {
             assertTrue( true );
         }
@@ -333,9 +334,9 @@ public class BatchRequestTest extends Ab
 
         assertEquals( 1, batchRequest.getRequests().size() );
 
-        LdapMessageCodec request = batchRequest.getCurrentRequest();
+        Message request = batchRequest.getCurrentRequest();
 
-        if ( request instanceof ExtendedRequestCodec )
+        if ( request instanceof ExtendedRequest )
         {
             assertTrue( true );
         }
@@ -371,9 +372,9 @@ public class BatchRequestTest extends Ab
 
         assertEquals( 1, batchRequest.getRequests().size() );
 
-        LdapMessageCodec request = batchRequest.getCurrentRequest();
+        Message request = batchRequest.getCurrentRequest();
 
-        if ( request instanceof ModifyDNRequestCodec )
+        if ( request instanceof ModifyDnRequest )
         {
             assertTrue( true );
         }
@@ -409,9 +410,9 @@ public class BatchRequestTest extends Ab
 
         assertEquals( 1, batchRequest.getRequests().size() );
 
-        LdapMessageCodec request = batchRequest.getCurrentRequest();
+        Message request = batchRequest.getCurrentRequest();
 
-        if ( request instanceof ModifyRequestCodec )
+        if ( request instanceof ModifyRequest )
         {
             assertTrue( true );
         }
@@ -447,9 +448,9 @@ public class BatchRequestTest extends Ab
 
         assertEquals( 1, batchRequest.getRequests().size() );
 
-        LdapMessageCodec request = batchRequest.getCurrentRequest();
+        Message request = batchRequest.getCurrentRequest();
 
-        if ( request instanceof SearchRequestCodec )
+        if ( request instanceof SearchRequest )
         {
             assertTrue( true );
         }
@@ -485,9 +486,9 @@ public class BatchRequestTest extends Ab
 
         assertEquals( 2, batchRequest.getRequests().size() );
 
-        LdapMessageCodec request = batchRequest.getCurrentRequest();
+        Message request = batchRequest.getCurrentRequest();
 
-        if ( request instanceof AddRequestCodec )
+        if ( request instanceof AddRequest )
         {
             assertTrue( true );
         }
@@ -523,9 +524,9 @@ public class BatchRequestTest extends Ab
 
         assertEquals( 2, batchRequest.getRequests().size() );
 
-        LdapMessageCodec request = batchRequest.getCurrentRequest();
+        Message request = batchRequest.getCurrentRequest();
 
-        if ( request instanceof CompareRequestCodec )
+        if ( request instanceof CompareRequest )
         {
             assertTrue( true );
         }
@@ -561,9 +562,9 @@ public class BatchRequestTest extends Ab
 
         assertEquals( 2, batchRequest.getRequests().size() );
 
-        LdapMessageCodec request = batchRequest.getCurrentRequest();
+        Message request = batchRequest.getCurrentRequest();
 
-        if ( request instanceof AbandonRequestCodec )
+        if ( request instanceof AbandonRequest )
         {
             assertTrue( true );
         }
@@ -599,9 +600,9 @@ public class BatchRequestTest extends Ab
 
         assertEquals( 2, batchRequest.getRequests().size() );
 
-        LdapMessageCodec request = batchRequest.getCurrentRequest();
+        Message request = batchRequest.getCurrentRequest();
 
-        if ( request instanceof DelRequestCodec )
+        if ( request instanceof DeleteRequest )
         {
             assertTrue( true );
         }
@@ -637,9 +638,9 @@ public class BatchRequestTest extends Ab
 
         assertEquals( 2, batchRequest.getRequests().size() );
 
-        LdapMessageCodec request = batchRequest.getCurrentRequest();
+        Message request = batchRequest.getCurrentRequest();
 
-        if ( request instanceof ExtendedRequestCodec )
+        if ( request instanceof ExtendedRequest )
         {
             assertTrue( true );
         }
@@ -675,9 +676,9 @@ public class BatchRequestTest extends Ab
 
         assertEquals( 2, batchRequest.getRequests().size() );
 
-        LdapMessageCodec request = batchRequest.getCurrentRequest();
+        Message request = batchRequest.getCurrentRequest();
 
-        if ( request instanceof ModifyDNRequestCodec )
+        if ( request instanceof ModifyDnRequest )
         {
             assertTrue( true );
         }
@@ -713,9 +714,9 @@ public class BatchRequestTest extends Ab
 
         assertEquals( 2, batchRequest.getRequests().size() );
 
-        LdapMessageCodec request = batchRequest.getCurrentRequest();
+        Message request = batchRequest.getCurrentRequest();
 
-        if ( request instanceof ModifyRequestCodec )
+        if ( request instanceof ModifyRequest )
         {
             assertTrue( true );
         }
@@ -751,9 +752,9 @@ public class BatchRequestTest extends Ab
 
         assertEquals( 2, batchRequest.getRequests().size() );
 
-        LdapMessageCodec request = batchRequest.getCurrentRequest();
+        Message request = batchRequest.getCurrentRequest();
 
-        if ( request instanceof SearchRequestCodec )
+        if ( request instanceof SearchRequest )
         {
             assertTrue( true );
         }
@@ -791,9 +792,9 @@ public class BatchRequestTest extends Ab
 
         assertEquals( 2, requests.size() );
 
-        LdapMessageCodec request = ( LdapMessageCodec ) requests.get( 0 );
+        Message request = ( Message ) requests.get( 0 );
 
-        if ( request instanceof BindRequestCodec )
+        if ( request instanceof BindRequest )
         {
             assertTrue( true );
         }
@@ -802,9 +803,9 @@ public class BatchRequestTest extends Ab
             fail();
         }
 
-        request = ( LdapMessageCodec ) requests.get( 1 );
+        request = ( Message ) requests.get( 1 );
 
-        if ( request instanceof AddRequestCodec )
+        if ( request instanceof AddRequest )
         {
             assertTrue( true );
         }

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/batchResponse/BatchResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/batchResponse/BatchResponseTest.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/batchResponse/BatchResponseTest.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/batchResponse/BatchResponseTest.java Thu Aug 19 01:23:41 2010
@@ -21,6 +21,10 @@
 package org.apache.directory.shared.dsmlv2.batchResponse;
 
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
@@ -28,20 +32,17 @@ import org.apache.directory.shared.dsmlv
 import org.apache.directory.shared.dsmlv2.reponse.BatchResponse;
 import org.apache.directory.shared.dsmlv2.reponse.ErrorResponse;
 import org.apache.directory.shared.dsmlv2.reponse.SearchResponse;
-import org.apache.directory.shared.ldap.codec.LdapResponseCodec;
-import org.apache.directory.shared.ldap.codec.add.AddResponseCodec;
-import org.apache.directory.shared.ldap.codec.bind.BindResponseCodec;
-import org.apache.directory.shared.ldap.codec.compare.CompareResponseCodec;
-import org.apache.directory.shared.ldap.codec.del.DelResponseCodec;
-import org.apache.directory.shared.ldap.codec.extended.ExtendedResponseCodec;
-import org.apache.directory.shared.ldap.codec.modify.ModifyResponseCodec;
-import org.apache.directory.shared.ldap.codec.modifyDn.ModifyDNResponseCodec;
+import org.apache.directory.shared.ldap.message.AddResponse;
+import org.apache.directory.shared.ldap.message.BindResponse;
+import org.apache.directory.shared.ldap.message.CompareResponse;
+import org.apache.directory.shared.ldap.message.DeleteResponse;
+import org.apache.directory.shared.ldap.message.ExtendedResponse;
+import org.apache.directory.shared.ldap.message.ModifyDnResponse;
+import org.apache.directory.shared.ldap.message.ModifyResponse;
+import org.apache.directory.shared.ldap.message.Response;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
 
 /**
  * Tests for the Compare Response parsing
@@ -141,9 +142,9 @@ public class BatchResponseTest extends A
 
         assertEquals( 1, batchResponse.getResponses().size() );
 
-        LdapResponseCodec response = batchResponse.getCurrentResponse();
+        Response response = batchResponse.getCurrentResponse();
 
-        if ( response instanceof AddResponseCodec )
+        if ( response instanceof AddResponse )
         {
             assertTrue( true );
         }
@@ -179,9 +180,9 @@ public class BatchResponseTest extends A
 
         assertEquals( 1, batchResponse.getResponses().size() );
 
-        LdapResponseCodec response = batchResponse.getCurrentResponse();
+        Response response = batchResponse.getCurrentResponse();
 
-        if ( response instanceof BindResponseCodec )
+        if ( response instanceof BindResponse )
         {
             assertTrue( true );
         }
@@ -217,9 +218,9 @@ public class BatchResponseTest extends A
 
         assertEquals( 1, batchResponse.getResponses().size() );
 
-        LdapResponseCodec response = batchResponse.getCurrentResponse();
+        Response response = batchResponse.getCurrentResponse();
 
-        if ( response instanceof CompareResponseCodec )
+        if ( response instanceof CompareResponse )
         {
             assertTrue( true );
         }
@@ -255,9 +256,9 @@ public class BatchResponseTest extends A
 
         assertEquals( 1, batchResponse.getResponses().size() );
 
-        LdapResponseCodec response = batchResponse.getCurrentResponse();
+        Response response = batchResponse.getCurrentResponse();
 
-        if ( response instanceof DelResponseCodec )
+        if ( response instanceof DeleteResponse )
         {
             assertTrue( true );
         }
@@ -293,7 +294,7 @@ public class BatchResponseTest extends A
 
         assertEquals( 1, batchResponse.getResponses().size() );
 
-        LdapResponseCodec response = batchResponse.getCurrentResponse();
+        Response response = batchResponse.getCurrentResponse();
 
         if ( response instanceof ErrorResponse )
         {
@@ -331,9 +332,9 @@ public class BatchResponseTest extends A
 
         assertEquals( 1, batchResponse.getResponses().size() );
 
-        LdapResponseCodec response = batchResponse.getCurrentResponse();
+        Response response = batchResponse.getCurrentResponse();
 
-        if ( response instanceof ExtendedResponseCodec )
+        if ( response instanceof ExtendedResponse )
         {
             assertTrue( true );
         }
@@ -369,9 +370,9 @@ public class BatchResponseTest extends A
 
         assertEquals( 1, batchResponse.getResponses().size() );
 
-        LdapResponseCodec response = batchResponse.getCurrentResponse();
+        Response response = batchResponse.getCurrentResponse();
 
-        if ( response instanceof ModifyDNResponseCodec )
+        if ( response instanceof ModifyDnResponse )
         {
             assertTrue( true );
         }
@@ -407,9 +408,9 @@ public class BatchResponseTest extends A
 
         assertEquals( 1, batchResponse.getResponses().size() );
 
-        LdapResponseCodec response = batchResponse.getCurrentResponse();
+        Response response = batchResponse.getCurrentResponse();
 
-        if ( response instanceof ModifyResponseCodec )
+        if ( response instanceof ModifyResponse )
         {
             assertTrue( true );
         }
@@ -445,7 +446,7 @@ public class BatchResponseTest extends A
 
         assertEquals( 1, batchResponse.getResponses().size() );
 
-        LdapResponseCodec response = batchResponse.getCurrentResponse();
+        Response response = batchResponse.getCurrentResponse();
 
         if ( response instanceof SearchResponse )
         {
@@ -483,9 +484,9 @@ public class BatchResponseTest extends A
 
         assertEquals( 2, batchResponse.getResponses().size() );
 
-        LdapResponseCodec response = batchResponse.getCurrentResponse();
+        Response response = batchResponse.getCurrentResponse();
 
-        if ( response instanceof AddResponseCodec )
+        if ( response instanceof AddResponse )
         {
             assertTrue( true );
         }
@@ -521,9 +522,9 @@ public class BatchResponseTest extends A
 
         assertEquals( 2, batchResponse.getResponses().size() );
 
-        LdapResponseCodec response = batchResponse.getCurrentResponse();
+        Response response = batchResponse.getCurrentResponse();
 
-        if ( response instanceof BindResponseCodec )
+        if ( response instanceof BindResponse )
         {
             assertTrue( true );
         }
@@ -559,9 +560,9 @@ public class BatchResponseTest extends A
 
         assertEquals( 2, batchResponse.getResponses().size() );
 
-        LdapResponseCodec response = batchResponse.getCurrentResponse();
+        Response response = batchResponse.getCurrentResponse();
 
-        if ( response instanceof CompareResponseCodec )
+        if ( response instanceof CompareResponse )
         {
             assertTrue( true );
         }
@@ -597,9 +598,9 @@ public class BatchResponseTest extends A
 
         assertEquals( 2, batchResponse.getResponses().size() );
 
-        LdapResponseCodec response = batchResponse.getCurrentResponse();
+        Response response = batchResponse.getCurrentResponse();
 
-        if ( response instanceof DelResponseCodec )
+        if ( response instanceof DeleteResponse )
         {
             assertTrue( true );
         }
@@ -635,7 +636,7 @@ public class BatchResponseTest extends A
 
         assertEquals( 2, batchResponse.getResponses().size() );
 
-        LdapResponseCodec response = batchResponse.getCurrentResponse();
+        Response response = batchResponse.getCurrentResponse();
 
         if ( response instanceof ErrorResponse )
         {
@@ -673,9 +674,9 @@ public class BatchResponseTest extends A
 
         assertEquals( 2, batchResponse.getResponses().size() );
 
-        LdapResponseCodec response = batchResponse.getCurrentResponse();
+        Response response = batchResponse.getCurrentResponse();
 
-        if ( response instanceof ExtendedResponseCodec )
+        if ( response instanceof ExtendedResponse )
         {
             assertTrue( true );
         }
@@ -711,9 +712,9 @@ public class BatchResponseTest extends A
 
         assertEquals( 2, batchResponse.getResponses().size() );
 
-        LdapResponseCodec response = batchResponse.getCurrentResponse();
+        Response response = batchResponse.getCurrentResponse();
 
-        if ( response instanceof ModifyDNResponseCodec )
+        if ( response instanceof ModifyDnResponse )
         {
             assertTrue( true );
         }
@@ -749,9 +750,9 @@ public class BatchResponseTest extends A
 
         assertEquals( 2, batchResponse.getResponses().size() );
 
-        LdapResponseCodec response = batchResponse.getCurrentResponse();
+        Response response = batchResponse.getCurrentResponse();
 
-        if ( response instanceof ModifyResponseCodec )
+        if ( response instanceof ModifyResponse )
         {
             assertTrue( true );
         }
@@ -787,7 +788,7 @@ public class BatchResponseTest extends A
 
         assertEquals( 2, batchResponse.getResponses().size() );
 
-        LdapResponseCodec response = batchResponse.getCurrentResponse();
+        Response response = batchResponse.getCurrentResponse();
 
         if ( response instanceof SearchResponse )
         {

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareRequest/CompareRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareRequest/CompareRequestTest.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/compareRequest/CompareRequestTest.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareRequest/CompareRequestTest.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.compare.CompareRequestCodec;
+import org.apache.directory.shared.ldap.message.CompareRequest;
 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 Compare Request parsing
  *
@@ -77,9 +78,9 @@ public class CompareRequestTest extends 
             fail( e.getMessage() );
         }
 
-        CompareRequestCodec compareRequest = ( CompareRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest();
 
-        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", compareRequest.getEntry().getNormName() );
+        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", compareRequest.getName().getNormName() );
     }
 
 
@@ -104,7 +105,7 @@ public class CompareRequestTest extends 
             fail( e.getMessage() );
         }
 
-        CompareRequestCodec compareRequest = ( CompareRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest();
 
         assertEquals( 456, compareRequest.getMessageId() );
     }
@@ -141,7 +142,7 @@ public class CompareRequestTest extends 
             fail( e.getMessage() );
         }
 
-        CompareRequestCodec compareRequest = ( CompareRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest();
 
         assertEquals( 1, compareRequest.getControls().size() );
 
@@ -176,7 +177,7 @@ public class CompareRequestTest extends 
             fail( e.getMessage() );
         }
 
-        CompareRequestCodec compareRequest = ( CompareRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest();
 
         assertEquals( 1, compareRequest.getControls().size() );
 
@@ -211,7 +212,7 @@ public class CompareRequestTest extends 
             fail( e.getMessage() );
         }
 
-        CompareRequestCodec compareRequest = ( CompareRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest();
 
         assertEquals( 1, compareRequest.getControls().size() );
 
@@ -246,7 +247,7 @@ public class CompareRequestTest extends 
             fail( e.getMessage() );
         }
 
-        CompareRequestCodec compareRequest = ( CompareRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest();
 
         assertEquals( 2, compareRequest.getControls().size() );
 
@@ -281,7 +282,7 @@ public class CompareRequestTest extends 
             fail( e.getMessage() );
         }
 
-        CompareRequestCodec compareRequest = ( CompareRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest();
 
         assertEquals( 3, compareRequest.getControls().size() );
 
@@ -316,13 +317,13 @@ public class CompareRequestTest extends 
             fail( e.getMessage() );
         }
 
-        CompareRequestCodec compareRequest = ( CompareRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest();
 
-        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", compareRequest.getEntry().getNormName() );
+        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", compareRequest.getName().getNormName() );
 
-        assertEquals( "sn", ( String ) compareRequest.getAttributeDesc() );
+        assertEquals( "sn", compareRequest.getAttributeId() );
 
-        assertEquals( "Johnson", ( String ) compareRequest.getAssertionValue() );
+        assertEquals( "Johnson", compareRequest.getAssertionValue().get() );
     }
 
 
@@ -347,13 +348,13 @@ public class CompareRequestTest extends 
             fail( e.getMessage() );
         }
 
-        CompareRequestCodec compareRequest = ( CompareRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest();
 
-        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", compareRequest.getEntry().getNormName() );
+        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", compareRequest.getName().getNormName() );
 
-        assertEquals( "sn", ( String ) compareRequest.getAttributeDesc() );
+        assertEquals( "sn", ( String ) compareRequest.getAttributeId() );
 
-        assertEquals( "DSMLv2.0 rocks!!", new String( ( byte[] ) compareRequest.getAssertionValue() ) );
+        assertEquals( "DSMLv2.0 rocks!!", new String( compareRequest.getAssertionValue().getBytes() ) );
     }
 
 
@@ -378,11 +379,11 @@ public class CompareRequestTest extends 
             fail( e.getMessage() );
         }
 
-        CompareRequestCodec compareRequest = ( CompareRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest();
 
-        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", compareRequest.getEntry().getNormName() );
+        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", compareRequest.getName().getNormName() );
 
-        assertEquals( "sn", ( String ) compareRequest.getAttributeDesc() );
+        assertEquals( "sn", compareRequest.getAttributeId() );
 
         assertNull( compareRequest.getAssertionValue() );
     }

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareResponse/CompareResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareResponse/CompareResponseTest.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/compareResponse/CompareResponseTest.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareResponse/CompareResponseTest.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.compare.CompareResponseCodec;
 import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.message.CompareResponse;
+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;
@@ -75,7 +75,7 @@ public class CompareResponseTest extends
             fail( e.getMessage() );
         }
 
-        CompareResponseCodec compareResponse = ( CompareResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 456, compareResponse.getMessageId() );
     }
@@ -112,7 +112,7 @@ public class CompareResponseTest extends
             fail( e.getMessage() );
         }
 
-        CompareResponseCodec compareResponse = ( CompareResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 1, compareResponse.getControls().size() );
 
@@ -147,7 +147,7 @@ public class CompareResponseTest extends
             fail( e.getMessage() );
         }
 
-        CompareResponseCodec compareResponse = ( CompareResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();
         Control control = compareResponse.getCurrentControl();
 
         assertEquals( 1, compareResponse.getControls().size() );
@@ -178,7 +178,7 @@ public class CompareResponseTest extends
             fail( e.getMessage() );
         }
 
-        CompareResponseCodec compareResponse = ( CompareResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 2, compareResponse.getControls().size() );
 
@@ -213,7 +213,7 @@ public class CompareResponseTest extends
             fail( e.getMessage() );
         }
 
-        CompareResponseCodec compareResponse = ( CompareResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();
 
         assertEquals( 3, compareResponse.getControls().size() );
 
@@ -268,9 +268,9 @@ public class CompareResponseTest extends
             fail( e.getMessage() );
         }
 
-        CompareResponseCodec compareResponse = ( CompareResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = compareResponse.getLdapResult();
+        LdapResult ldapResult = compareResponse.getLdapResult();
 
         assertEquals( ResultCodeEnum.PROTOCOL_ERROR, ldapResult.getResultCode() );
     }
@@ -297,9 +297,9 @@ public class CompareResponseTest extends
             fail( e.getMessage() );
         }
 
-        CompareResponseCodec compareResponse = ( CompareResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = compareResponse.getLdapResult();
+        LdapResult ldapResult = compareResponse.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 CompareResponseTest extends
             fail( e.getMessage() );
         }
 
-        CompareResponseCodec compareResponse = ( CompareResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = compareResponse.getLdapResult();
+        LdapResult ldapResult = compareResponse.getLdapResult();
 
         assertNull( ldapResult.getErrorMessage() );
     }
@@ -356,19 +356,17 @@ public class CompareResponseTest extends
             fail( e.getMessage() );
         }
 
-        CompareResponseCodec compareResponse = ( CompareResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = compareResponse.getLdapResult();
+        LdapResult ldapResult = compareResponse.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 CompareResponseTest extends
             fail( e.getMessage() );
         }
 
-        CompareResponseCodec compareResponse = ( CompareResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = compareResponse.getLdapResult();
+        LdapResult ldapResult = compareResponse.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 CompareResponseTest extends
             fail( e.getMessage() );
         }
 
-        CompareResponseCodec compareResponse = ( CompareResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = compareResponse.getLdapResult();
+        LdapResult ldapResult = compareResponse.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 CompareResponseTest extends
             fail( e.getMessage() );
         }
 
-        CompareResponseCodec compareResponse = ( CompareResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = compareResponse.getLdapResult();
+        LdapResult ldapResult = compareResponse.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 CompareResponseTest extends
             fail( e.getMessage() );
         }
 
-        CompareResponseCodec compareResponse = ( CompareResponseCodec ) parser.getBatchResponse().getCurrentResponse();
+        CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        LdapResultCodec ldapResult = compareResponse.getLdapResult();
+        LdapResult ldapResult = compareResponse.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/delRequest/DelRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delRequest/DelRequestTest.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/delRequest/DelRequestTest.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delRequest/DelRequestTest.java Thu Aug 19 01:23:41 2010
@@ -30,7 +30,7 @@ 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.del.DelRequestCodec;
+import org.apache.directory.shared.ldap.message.DeleteRequest;
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.junit.Test;
@@ -76,9 +76,9 @@ public class DelRequestTest extends Abst
             fail( e.getMessage() );
         }
 
-        DelRequestCodec delRequest = ( DelRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        DeleteRequest delRequest = ( DeleteRequest ) parser.getBatchRequest().getCurrentRequest();
 
-        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", delRequest.getEntry().getNormName() );
+        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", delRequest.getName().getNormName() );
     }
 
 
@@ -103,7 +103,7 @@ public class DelRequestTest extends Abst
             fail( e.getMessage() );
         }
 
-        DelRequestCodec delRequest = ( DelRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        DeleteRequest delRequest = ( DeleteRequest ) parser.getBatchRequest().getCurrentRequest();
 
         assertEquals( 456, delRequest.getMessageId() );
     }
@@ -139,7 +139,7 @@ public class DelRequestTest extends Abst
             fail( e.getMessage() );
         }
 
-        DelRequestCodec delRequest = ( DelRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        DeleteRequest delRequest = ( DeleteRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = delRequest.getCurrentControl();
 
         assertEquals( 1, delRequest.getControls().size() );
@@ -170,7 +170,7 @@ public class DelRequestTest extends Abst
             fail( e.getMessage() );
         }
 
-        DelRequestCodec delRequest = ( DelRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        DeleteRequest delRequest = ( DeleteRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = delRequest.getCurrentControl();
 
         assertEquals( 1, delRequest.getControls().size() );
@@ -201,7 +201,7 @@ public class DelRequestTest extends Abst
             fail( e.getMessage() );
         }
 
-        DelRequestCodec delRequest = ( DelRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        DeleteRequest delRequest = ( DeleteRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = delRequest.getCurrentControl();
 
         assertEquals( 1, delRequest.getControls().size() );
@@ -231,7 +231,7 @@ public class DelRequestTest extends Abst
             fail( e.getMessage() );
         }
 
-        DelRequestCodec delRequest = ( DelRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        DeleteRequest delRequest = ( DeleteRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = delRequest.getCurrentControl();
 
         assertEquals( 2, delRequest.getControls().size() );
@@ -262,7 +262,7 @@ public class DelRequestTest extends Abst
             fail( e.getMessage() );
         }
 
-        DelRequestCodec delRequest = ( DelRequestCodec ) parser.getBatchRequest().getCurrentRequest();
+        DeleteRequest delRequest = ( DeleteRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = delRequest.getCurrentControl();
 
         assertEquals( 3, delRequest.getControls().size() );



Mime
View raw message