directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1069913 [1/2] - in /directory: apacheds/branches/m1/protocol-ldap/src/main/java/org/apache/directory/server/ldap/ apacheds/branches/m1/server-integ/src/test/java/org/apache/directory/server/operations/bind/ shared/branches/m1/ shared/branc...
Date Fri, 11 Feb 2011 18:20:50 GMT
Author: akarasulu
Date: Fri Feb 11 18:20:47 2011
New Revision: 1069913

URL: http://svn.apache.org/viewvc?rev=1069913&view=rev
Log:
DIRSHARED-91: work in progress

  o making tests use the AbstractCodecServiceTest to properly shutdown standalone 
    LdapCodecService implementation
  o making protocol codec factory and LdapEncoder take a service handle so we can
    swap in and out the proper implementation based on the environment


Removed:
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/standalone/
Modified:
    directory/apacheds/branches/m1/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolCodecFactory.java
    directory/apacheds/branches/m1/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java
    directory/shared/branches/m1/ldap-client-api/pom.xml
    directory/shared/branches/m1/ldap-codec-standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/AbstractCodecServiceTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/LdapControlTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/intermediate/IntermediateResponseTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNResponseTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultDoneTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultReferenceTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlTest.java
    directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/unbind/UnBindRequestTest.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/LdapEncoder.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/api/DefaultLdapCodecService.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/protocol/mina/LdapProtocolCodecFactory.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/protocol/mina/LdapProtocolEncoder.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/AbstractCodecServiceTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/LdapControlTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/intermediate/IntermediateResponseTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNResponseTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultDoneTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultReferenceTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlTest.java
    directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/unbind/UnBindRequestTest.java
    directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyTest.java
    directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncDoneValueControlTest.java
    directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncInfoValueControlTest.java
    directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncModifyDnControlTest.java
    directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncRequestValueControlTest.java
    directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncStateValueControlTest.java
    directory/shared/branches/m1/ldap/pom.xml
    directory/shared/branches/m1/pom.xml

Modified: directory/apacheds/branches/m1/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolCodecFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolCodecFactory.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/apacheds/branches/m1/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolCodecFactory.java (original)
+++ directory/apacheds/branches/m1/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolCodecFactory.java Fri Feb 11 18:20:47 2011
@@ -51,7 +51,7 @@ final class LdapProtocolCodecFactory imp
      */
     public LdapProtocolCodecFactory( final DirectoryService directoryService )
     {
-        encoder = new LdapProtocolEncoder();
+        encoder = new LdapProtocolEncoder( directoryService.getLdapCodecService() );
         decoder = new LdapDecoder();
     }
 

Modified: directory/apacheds/branches/m1/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/apacheds/branches/m1/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java (original)
+++ directory/apacheds/branches/m1/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java Fri Feb 11 18:20:47 2011
@@ -525,7 +525,7 @@ public class SaslBindIT extends Abstract
             LdapDecoder decoder = new LdapDecoder();
 
             // Send encoded request to server
-            LdapEncoder encoder = new LdapEncoder();
+            LdapEncoder encoder = new LdapEncoder( ldapServer.getDirectoryService().getLdapCodecService() );
             ByteBuffer bb = encoder.encodeMessage( request );
 
             bb.flip();
@@ -565,7 +565,7 @@ public class SaslBindIT extends Abstract
             LdapDecoder decoder = new LdapDecoder();
 
             // Send encoded request to server
-            LdapEncoder encoder = new LdapEncoder();
+            LdapEncoder encoder = new LdapEncoder( ldapServer.getDirectoryService().getLdapCodecService() );
             ByteBuffer bb = encoder.encodeMessage( request );
             bb.flip();
 

Modified: directory/shared/branches/m1/ldap-client-api/pom.xml
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-client-api/pom.xml?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-client-api/pom.xml (original)
+++ directory/shared/branches/m1/ldap-client-api/pom.xml Fri Feb 11 18:20:47 2011
@@ -60,6 +60,11 @@
 
     <dependency>
       <groupId>${project.groupId}</groupId>
+      <artifactId>shared-ldap-codec-standalone</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>${project.groupId}</groupId>
       <artifactId>shared-ldap-extras-codec</artifactId>
     </dependency>
 

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java Fri Feb 11 18:20:47 2011
@@ -575,7 +575,7 @@ public class StandaloneLdapCodecService 
     {
         if ( client )
         {
-            return new LdapProtocolCodecFactory();
+            return new LdapProtocolCodecFactory( this );
         }
         else
         {

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/AbstractCodecServiceTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/AbstractCodecServiceTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/AbstractCodecServiceTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/AbstractCodecServiceTest.java Fri Feb 11 18:20:47 2011
@@ -19,10 +19,12 @@
  */
 package org.apache.directory.shared.ldap.codec;
 
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
+
+import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 
+
 /**
  * Initialize the Codec service
  *
@@ -30,18 +32,21 @@ import org.junit.BeforeClass;
  */
 public abstract class AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    protected static LdapEncoder encoder = new LdapEncoder();
+    /** The codec service */
+    protected static StandaloneLdapCodecService codec;
 
-    protected static DefaultLdapCodecService codec;
+    /** The encoder instance */
+    protected static LdapEncoder encoder;
 
+    
     /**
      * Initialize the codec service
      */
     @BeforeClass
     public static void setupLdapCodecService()
     {
-        codec = new DefaultLdapCodecService();
+        codec = new StandaloneLdapCodecService();
+        encoder = new LdapEncoder( codec );
     }
 
 
@@ -53,5 +58,6 @@ public abstract class AbstractCodecServi
     {
         codec.shutdown();
         codec = null;
+        encoder = null;
     }
 }

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/LdapControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/LdapControlTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/LdapControlTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/LdapControlTest.java Fri Feb 11 18:20:47 2011
@@ -35,8 +35,6 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.AbandonRequestDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.MessageDecorator;
 import org.apache.directory.shared.ldap.model.message.AbandonRequest;
@@ -50,13 +48,9 @@ import org.junit.runner.RunWith;
 
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class LdapControlTest
+public class LdapControlTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
-    LdapCodecService codec = new StandaloneLdapCodecService();
-
-
+    
     /**
      * Test the decoding of a Request with controls
      */

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java Fri Feb 11 18:20:47 2011
@@ -35,8 +35,6 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.tlv.TLVStateEnum;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.BindRequestDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.MessageDecorator;
 import org.apache.directory.shared.ldap.model.message.BindRequest;
@@ -59,9 +57,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class LdapDecoderTest
+public class LdapDecoderTest extends AbstractCodecServiceTest
 {
-    LdapCodecService codec = new StandaloneLdapCodecService();
     
     private static class LdapProtocolDecoderOutput extends AbstractProtocolDecoderOutput 
     {

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java Fri Feb 11 18:20:47 2011
@@ -32,8 +32,6 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.EncoderException;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.MessageDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.UnbindRequestDecorator;
 import org.apache.directory.shared.ldap.model.message.Message;
@@ -51,13 +49,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class LdapMessageTest
+public class LdapMessageTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
-    
-    LdapCodecService codec = new StandaloneLdapCodecService();
-
 
     // ~ Methods
     // ------------------------------------------------------------------------------------

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java Fri Feb 11 18:20:47 2011
@@ -35,7 +35,6 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.Asn1Container;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.AddResponseDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.MessageDecorator;
 import org.apache.directory.shared.ldap.model.message.AddResponse;
@@ -43,8 +42,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.Referral;
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
 import org.apache.directory.shared.util.Strings;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -57,28 +54,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class LdapResultTest
+public class LdapResultTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    private static LdapEncoder encoder = new LdapEncoder();
-    
-    private static StandaloneLdapCodecService codec = new StandaloneLdapCodecService();
-    
-    
-    @BeforeClass
-    public static void setupLdapCodecService()
-    {
-        codec = new StandaloneLdapCodecService();
-    }
-    
-    
-    @AfterClass
-    public static void tearDownLdapCodecService()
-    {
-        codec.shutdown();
-        codec = null;
-    }
-    
 
     // ~ Methods
     // ------------------------------------------------------------------------------------

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java Fri Feb 11 18:20:47 2011
@@ -33,11 +33,9 @@ import com.mycila.junit.concurrent.Concu
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
-import org.apache.directory.shared.ldap.codec.LdapEncoder;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.AbandonRequestDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.MessageDecorator;
 import org.apache.directory.shared.ldap.model.message.AbandonRequest;
@@ -56,14 +54,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class AbandonRequestTest
+public class AbandonRequestTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
-    
-    LdapCodecService codec = new StandaloneLdapCodecService();
-
-
     /**
      * Test the decoding of a AbandonRequest with controls
      */

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java Fri Feb 11 18:20:47 2011
@@ -38,6 +38,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.Asn1Container;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.LdapEncoder;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
@@ -62,13 +63,15 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class AddRequestTest
+public class AddRequestTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
+    /** the codec service used for tests */
+    private LdapCodecService codec = new StandaloneLdapCodecService();
 
-    LdapCodecService codec = new StandaloneLdapCodecService();
+    /** The encoder instance */
+    private LdapEncoder encoder = new LdapEncoder( codec );
 
+    
     /**
      * Test the decoding of a AddRequest
      */

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java Fri Feb 11 18:20:47 2011
@@ -33,11 +33,9 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.Asn1Container;
-import org.apache.directory.shared.ldap.codec.LdapEncoder;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.AddResponseDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.MessageDecorator;
 import org.apache.directory.shared.ldap.model.message.AddResponse;
@@ -54,14 +52,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class AddResponseTest
+public class AddResponseTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
-
-    LdapCodecService codec = new StandaloneLdapCodecService();
-    
-
     /**
      * Test the decoding of a AddResponse
      */

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java Fri Feb 11 18:20:47 2011
@@ -32,11 +32,9 @@ import com.mycila.junit.concurrent.Concu
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.DecoderException;
-import org.apache.directory.shared.ldap.codec.LdapEncoder;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.BindRequestDecorator;
 import org.apache.directory.shared.ldap.model.message.BindRequest;
 import org.apache.directory.shared.ldap.model.message.BindRequestImpl;
@@ -54,13 +52,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class BindRequestPerfTest
+public class BindRequestPerfTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
-
-    LdapCodecService codec = new StandaloneLdapCodecService();
-
     /**
      * Test the decoding of a BindRequest with Simple authentication and no
      * controls

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java Fri Feb 11 18:20:47 2011
@@ -34,11 +34,9 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
-import org.apache.directory.shared.ldap.codec.LdapEncoder;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.api.ResponseCarryingException;
 import org.apache.directory.shared.ldap.codec.decorators.BindRequestDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.MessageDecorator;
@@ -57,13 +55,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class BindRequestTest
+public class BindRequestTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
-
-    LdapCodecService codec = new StandaloneLdapCodecService();
-
     /**
      * Test the decoding of a BindRequest with Simple authentication and no
      * controls

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java Fri Feb 11 18:20:47 2011
@@ -34,11 +34,9 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
-import org.apache.directory.shared.ldap.codec.LdapEncoder;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.controls.search.pagedSearch.PagedResultsDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.BindResponseDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.MessageDecorator;
@@ -56,13 +54,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class BindResponseTest
+public class BindResponseTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
-
-    LdapCodecService codec = new StandaloneLdapCodecService();
-
     /**
      * Test the decoding of a BindResponse
      */

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java Fri Feb 11 18:20:47 2011
@@ -32,13 +32,11 @@ import com.mycila.junit.concurrent.Concu
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.EncoderException;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.model.message.CompareRequest;
 import org.apache.directory.shared.ldap.model.message.CompareResponseImpl;
-import org.apache.directory.shared.ldap.codec.LdapEncoder;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.api.ResponseCarryingException;
 import org.apache.directory.shared.ldap.codec.decorators.CompareRequestDecorator;
 import org.apache.directory.shared.ldap.model.message.Control;
@@ -56,14 +54,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class CompareRequestTest
+public class CompareRequestTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
-    
-    LdapCodecService codec = new StandaloneLdapCodecService();
-
-
     /**
      * Test the decoding of a full CompareRequest
      */

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java Fri Feb 11 18:20:47 2011
@@ -32,11 +32,9 @@ import com.mycila.junit.concurrent.Concu
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
-import org.apache.directory.shared.ldap.codec.LdapEncoder;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.CompareResponseDecorator;
 import org.apache.directory.shared.ldap.model.message.CompareResponse;
 import org.apache.directory.shared.ldap.model.message.Control;
@@ -53,13 +51,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class CompareResponseTest
+public class CompareResponseTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
-
-    LdapCodecService codec = new StandaloneLdapCodecService();
-
     /**
      * Test the decoding of a CompareResponse
      */

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java Fri Feb 11 18:20:47 2011
@@ -32,11 +32,9 @@ import com.mycila.junit.concurrent.Concu
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
-import org.apache.directory.shared.ldap.codec.LdapEncoder;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.api.ResponseCarryingException;
 import org.apache.directory.shared.ldap.codec.decorators.DeleteRequestDecorator;
 import org.apache.directory.shared.ldap.model.message.*;
@@ -52,14 +50,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class DelRequestTest
+public class DelRequestTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
-
-    LdapCodecService codec = new StandaloneLdapCodecService();
-    
-
     /**
      * Test the decoding of a full DelRequest
      */

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java Fri Feb 11 18:20:47 2011
@@ -32,11 +32,9 @@ import com.mycila.junit.concurrent.Concu
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
-import org.apache.directory.shared.ldap.codec.LdapEncoder;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.DeleteResponseDecorator;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.DeleteResponse;
@@ -53,13 +51,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class DelResponseTest
+public class DelResponseTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
-
-    LdapCodecService codec = new StandaloneLdapCodecService();
-
     /**
      * Test the decoding of a DelResponse
      */

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestTest.java Fri Feb 11 18:20:47 2011
@@ -32,11 +32,9 @@ import com.mycila.junit.concurrent.Concu
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
-import org.apache.directory.shared.ldap.codec.LdapEncoder;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.ExtendedRequestDecorator;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.ExtendedRequest;
@@ -52,14 +50,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class ExtendedRequestTest
+public class ExtendedRequestTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
-
-    LdapCodecService codec = new StandaloneLdapCodecService();
-    
-
     /**
      * Test the decoding of a full ExtendedRequest
      */

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java Fri Feb 11 18:20:47 2011
@@ -20,7 +20,7 @@
 package org.apache.directory.shared.ldap.codec.extended;
 
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertEquals; 
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -32,11 +32,9 @@ import com.mycila.junit.concurrent.Concu
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
-import org.apache.directory.shared.ldap.codec.LdapEncoder;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.ExtendedResponseDecorator;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.ExtendedResponse;
@@ -53,14 +51,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class ExtendedResponseTest
+public class ExtendedResponseTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
-
-    LdapCodecService codec = new StandaloneLdapCodecService();
-    
-
     /**
      * Test the decoding of a full ExtendedResponse
      */

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/intermediate/IntermediateResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/intermediate/IntermediateResponseTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/intermediate/IntermediateResponseTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/intermediate/IntermediateResponseTest.java Fri Feb 11 18:20:47 2011
@@ -20,7 +20,7 @@
 package org.apache.directory.shared.ldap.codec.intermediate;
 
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertEquals; 
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -32,11 +32,9 @@ import com.mycila.junit.concurrent.Concu
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
-import org.apache.directory.shared.ldap.codec.LdapEncoder;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.IntermediateResponseDecorator;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.IntermediateResponse;
@@ -52,15 +50,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class IntermediateResponseTest
+public class IntermediateResponseTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
-
-    /** The codec service */
-    LdapCodecService codec = new StandaloneLdapCodecService();
-
-
     /**
      * Test the decoding of a full IntermediateResponse
      */
@@ -182,6 +173,7 @@ public class IntermediateResponseTest
 
         assertEquals( 1, controls.size() );
 
+        @SuppressWarnings("unchecked")
         CodecControl<Control> control = (org.apache.directory.shared.ldap.codec.api.CodecControl<Control> )controls.get( "2.16.840.1.113730.3.4.2" );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", Strings.dumpBytes((byte[]) control.getValue()) );
@@ -263,6 +255,7 @@ public class IntermediateResponseTest
 
         assertEquals( 1, controls.size() );
 
+        @SuppressWarnings("unchecked")
         CodecControl<Control> control = (org.apache.directory.shared.ldap.codec.api.CodecControl<Control> )controls.get( "2.16.840.1.113730.3.4.2" );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", Strings.dumpBytes((byte[]) control.getValue()) );

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java Fri Feb 11 18:20:47 2011
@@ -33,11 +33,9 @@ import com.mycila.junit.concurrent.Concu
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
-import org.apache.directory.shared.ldap.codec.LdapEncoder;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.api.ResponseCarryingException;
 import org.apache.directory.shared.ldap.codec.decorators.ModifyRequestDecorator;
 import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
@@ -60,15 +58,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class ModifyRequestTest
+public class ModifyRequestTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
-
-    /** The codec service */
-    LdapCodecService codec = new StandaloneLdapCodecService();
-
-
     /**
      * Test the decoding of a ModifyRequest
      */
@@ -1206,6 +1197,7 @@ public class ModifyRequestTest
 
         assertEquals( 1, controls.size() );
 
+        @SuppressWarnings("unchecked")
         CodecControl<Control> control = (org.apache.directory.shared.ldap.codec.api.CodecControl<Control> )modifyRequest.getControl( "2.16.840.1.113730.3.4.2" );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", Strings.dumpBytes((byte[]) control.getValue()) );

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java Fri Feb 11 18:20:47 2011
@@ -32,11 +32,9 @@ import com.mycila.junit.concurrent.Concu
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
-import org.apache.directory.shared.ldap.codec.LdapEncoder;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.ModifyResponseDecorator;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.ModifyResponse;
@@ -53,15 +51,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class ModifyResponseTest
+public class ModifyResponseTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
-
-    /** The codec service */
-    LdapCodecService codec = new StandaloneLdapCodecService();
-
-
     /**
      * Test the decoding of a ModifyResponse
      */
@@ -199,6 +190,7 @@ public class ModifyResponseTest
 
         assertEquals( 1, controls.size() );
 
+        @SuppressWarnings("unchecked")
         CodecControl<Control> control = (org.apache.directory.shared.ldap.codec.api.CodecControl<Control> )controls.get( "2.16.840.1.113730.3.4.2" );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", Strings.dumpBytes((byte[]) control.getValue()) );

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java Fri Feb 11 18:20:47 2011
@@ -32,11 +32,9 @@ import com.mycila.junit.concurrent.Concu
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
-import org.apache.directory.shared.ldap.codec.LdapEncoder;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.api.ResponseCarryingException;
 import org.apache.directory.shared.ldap.codec.decorators.ModifyDnRequestDecorator;
 import org.apache.directory.shared.ldap.model.message.Control;
@@ -56,15 +54,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class ModifyDNRequestTest
+public class ModifyDNRequestTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
-
-    /** The codec service */
-    LdapCodecService codec = new StandaloneLdapCodecService();
-
-
     /**
      * Test the decoding of a full ModifyDNRequest
      */
@@ -367,6 +358,7 @@ public class ModifyDNRequestTest
 
         assertEquals( 1, controls.size() );
 
+        @SuppressWarnings("unchecked")
         CodecControl<Control> control = (org.apache.directory.shared.ldap.codec.api.CodecControl<Control> )modifyDnRequest.getControl( "2.16.840.1.113730.3.4.2" );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", Strings.dumpBytes((byte[]) control.getValue()) );
@@ -529,6 +521,7 @@ public class ModifyDNRequestTest
 
         assertTrue( modifyDnRequest.hasControl( "2.16.840.1.113730.3.4.2" ) );
 
+        @SuppressWarnings("unchecked")
         CodecControl<Control> control = (org.apache.directory.shared.ldap.codec.api.CodecControl<Control> )modifyDnRequest.getControl( "2.16.840.1.113730.3.4.2" );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", Strings.dumpBytes((byte[]) control.getValue()) );

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNResponseTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNResponseTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNResponseTest.java Fri Feb 11 18:20:47 2011
@@ -32,11 +32,9 @@ import com.mycila.junit.concurrent.Concu
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
-import org.apache.directory.shared.ldap.codec.LdapEncoder;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.ModifyDnResponseDecorator;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.ModifyDnResponse;
@@ -53,15 +51,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class ModifyDNResponseTest
+public class ModifyDNResponseTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
-
-    /** The codec service */
-    LdapCodecService codec = new StandaloneLdapCodecService();
-
-
     /**
      * Test the decoding of a ModifyDNResponse
      */
@@ -202,6 +193,7 @@ public class ModifyDNResponseTest
 
         assertEquals( 1, controls.size() );
 
+        @SuppressWarnings("unchecked")
         CodecControl<Control> control = (org.apache.directory.shared.ldap.codec.api.CodecControl<Control> )controls.get( "2.16.840.1.113730.3.4.2" );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", Strings.dumpBytes((byte[]) control.getValue()) );

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java Fri Feb 11 18:20:47 2011
@@ -37,10 +37,8 @@ import com.mycila.junit.concurrent.Concu
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
-import org.apache.directory.shared.ldap.codec.LdapEncoder;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.filter.ExprNode;
@@ -63,14 +61,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class SearchRequestMatchingRuleAssertionTest
+public class SearchRequestMatchingRuleAssertionTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
-
-    /** The codec service */
-    LdapCodecService codec = new StandaloneLdapCodecService();
-
     /** An oid normalizer map */
     static Map<String, OidNormalizer> oids = new HashMap<String, OidNormalizer>();
 

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java Fri Feb 11 18:20:47 2011
@@ -35,11 +35,9 @@ import com.mycila.junit.concurrent.Concu
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
-import org.apache.directory.shared.ldap.codec.LdapEncoder;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.filter.ExprNode;
@@ -63,14 +61,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class SearchRequestSubstringTest
+public class SearchRequestSubstringTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
-
-    /** The codec service */
-    LdapCodecService codec = new StandaloneLdapCodecService();
-
     /** An oid normalizer map */
     static Map<String, OidNormalizer> oids = new HashMap<String, OidNormalizer>();
 
@@ -351,6 +343,7 @@ public class SearchRequestSubstringTest
 
         assertEquals( 1, controls.size() );
 
+        @SuppressWarnings("unchecked")
         CodecControl<Control> control = (org.apache.directory.shared.ldap.codec.api.CodecControl<Control> )searchRequest.getControl( "2.16.840.1.113730.3.4.2" );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", Strings.dumpBytes((byte[]) control.getValue()) );

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java Fri Feb 11 18:20:47 2011
@@ -38,10 +38,8 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.tlv.TLVStateEnum;
-import org.apache.directory.shared.ldap.codec.LdapEncoder;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.api.ResponseCarryingException;
 import org.apache.directory.shared.ldap.codec.controls.search.subentries.SubentriesDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
@@ -79,14 +77,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class SearchRequestTest
+public class SearchRequestTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
-
-    /** The codec service */
-    LdapCodecService codec = new StandaloneLdapCodecService();
-
     /** An oid normalizer map */
     static Map<String, OidNormalizer> oids = new HashMap<String, OidNormalizer>();
 

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultDoneTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultDoneTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultDoneTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultDoneTest.java Fri Feb 11 18:20:47 2011
@@ -32,11 +32,9 @@ import com.mycila.junit.concurrent.Concu
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
-import org.apache.directory.shared.ldap.codec.LdapEncoder;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.SearchResultDoneDecorator;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
@@ -53,15 +51,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class SearchResultDoneTest
+public class SearchResultDoneTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
-
-    /** The codec service */
-    LdapCodecService codec = new StandaloneLdapCodecService();
-
-
     /**
      * Test the decoding of a SearchResultDone
      */
@@ -197,6 +188,7 @@ public class SearchResultDoneTest
 
         assertEquals( 1, controls.size() );
 
+        @SuppressWarnings("unchecked")
         CodecControl<Control> control = (org.apache.directory.shared.ldap.codec.api.CodecControl<Control> )controls.get( "2.16.840.1.113730.3.4.2" );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", Strings.dumpBytes((byte[]) control.getValue()) );

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java Fri Feb 11 18:20:47 2011
@@ -34,11 +34,9 @@ import com.mycila.junit.concurrent.Concu
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
-import org.apache.directory.shared.ldap.codec.LdapEncoder;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.SearchResultEntryDecorator;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
@@ -56,15 +54,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class SearchResultEntryTest
+public class SearchResultEntryTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
-
-    /** The codec service */
-    LdapCodecService codec = new StandaloneLdapCodecService();
-
-
     /**
      * Test the decoding of a SearchResultEntry
      */
@@ -1032,6 +1023,7 @@ public class SearchResultEntryTest
 
         assertEquals( 1, controls.size() );
 
+        @SuppressWarnings("unchecked")
         CodecControl<Control> control = (org.apache.directory.shared.ldap.codec.api.CodecControl<Control> )controls.get( "2.16.840.1.113730.3.4.2" );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", Strings.dumpBytes((byte[]) control.getValue()) );
@@ -1223,6 +1215,7 @@ public class SearchResultEntryTest
 
         assertEquals( 1, controls.size() );
 
+        @SuppressWarnings("unchecked")
         CodecControl<Control> control = (org.apache.directory.shared.ldap.codec.api.CodecControl<Control> )controls.get( "2.16.840.1.113730.3.4.2" );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", Strings.dumpBytes((byte[]) control.getValue()) );

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultReferenceTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultReferenceTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultReferenceTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultReferenceTest.java Fri Feb 11 18:20:47 2011
@@ -35,11 +35,9 @@ import com.mycila.junit.concurrent.Concu
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
-import org.apache.directory.shared.ldap.codec.LdapEncoder;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.SearchResultReferenceDecorator;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.Referral;
@@ -56,15 +54,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class SearchResultReferenceTest
+public class SearchResultReferenceTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
-
-    /** The codec service */
-    LdapCodecService codec = new StandaloneLdapCodecService();
-
-
     /**
      * Test the decoding of a SearchResultReference
      */
@@ -296,6 +287,7 @@ public class SearchResultReferenceTest
 
         assertEquals( 1, controls.size() );
 
+        @SuppressWarnings("unchecked")
         CodecControl<Control> control = (org.apache.directory.shared.ldap.codec.api.CodecControl<Control> )controls.get( "2.16.840.1.113730.3.4.2" );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", Strings.dumpBytes((byte[]) control.getValue()) );

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java Fri Feb 11 18:20:47 2011
@@ -28,8 +28,7 @@ import java.nio.ByteBuffer;
 import com.mycila.junit.concurrent.Concurrency;
 import com.mycila.junit.concurrent.ConcurrentJunitRunner;
 import org.apache.directory.shared.asn1.DecoderException;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.controls.search.entryChange.EntryChangeDecorator;
 import org.apache.directory.shared.ldap.model.message.controls.ChangeType;
 import org.apache.directory.shared.ldap.model.message.controls.EntryChange;
@@ -46,10 +45,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class EntryChangeControlTest
+public class EntryChangeControlTest extends AbstractCodecServiceTest
 {
-    private LdapCodecService codec = new StandaloneLdapCodecService();
-
     /**
      * Test the decoding of a EntryChangeControl
      */

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlTest.java Fri Feb 11 18:20:47 2011
@@ -20,7 +20,7 @@
 package org.apache.directory.shared.ldap.codec.search.controls;
 
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertEquals; 
 import static org.junit.Assert.assertTrue;
 
 import java.nio.ByteBuffer;
@@ -28,8 +28,7 @@ import java.nio.ByteBuffer;
 import com.mycila.junit.concurrent.Concurrency;
 import com.mycila.junit.concurrent.ConcurrentJunitRunner;
 import org.apache.directory.shared.asn1.DecoderException;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.controls.search.persistentSearch.PersistentSearchDecorator;
 import org.apache.directory.shared.ldap.model.message.controls.ChangeType;
 import org.apache.directory.shared.ldap.model.message.controls.PersistentSearch;
@@ -45,10 +44,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class PSearchControlTest
+public class PSearchControlTest extends AbstractCodecServiceTest
 {
-    private LdapCodecService codec = new StandaloneLdapCodecService();
-
     /**
      * Test encoding of a PSearchControl.
      * @throws Exception on error

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java Fri Feb 11 18:20:47 2011
@@ -30,8 +30,7 @@ import java.util.Arrays;
 import com.mycila.junit.concurrent.Concurrency;
 import com.mycila.junit.concurrent.ConcurrentJunitRunner;
 import org.apache.directory.shared.asn1.DecoderException;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.controls.search.pagedSearch.PagedResultsDecorator;
 import org.apache.directory.shared.ldap.model.message.controls.PagedResults;
 import org.apache.directory.shared.util.Strings;
@@ -46,10 +45,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class PagedSearchControlTest
+public class PagedSearchControlTest extends AbstractCodecServiceTest
 {
-    private LdapCodecService codec = new StandaloneLdapCodecService();
-
     /**
      * Test encoding of a PagedSearchControl.
      */

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlTest.java Fri Feb 11 18:20:47 2011
@@ -31,8 +31,7 @@ import com.mycila.junit.concurrent.Concu
 import com.mycila.junit.concurrent.ConcurrentJunitRunner;
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.controls.search.subentries.SubentriesDecorator;
 import org.apache.directory.shared.ldap.model.message.controls.Subentries;
 import org.apache.directory.shared.util.Strings;
@@ -47,10 +46,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class SubEntryControlTest
+public class SubEntryControlTest extends AbstractCodecServiceTest
 {
-    private LdapCodecService codec = new StandaloneLdapCodecService();
-
     /**
      * Test the decoding of a SubEntryControl with a true visibility
      */

Modified: directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/unbind/UnBindRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/unbind/UnBindRequestTest.java?rev=1069913&r1=1069912&r2=1069913&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/unbind/UnBindRequestTest.java (original)
+++ directory/shared/branches/m1/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/unbind/UnBindRequestTest.java Fri Feb 11 18:20:47 2011
@@ -32,11 +32,9 @@ import com.mycila.junit.concurrent.Concu
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
-import org.apache.directory.shared.ldap.codec.LdapEncoder;
+import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.UnbindRequestDecorator;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.UnbindRequest;
@@ -51,14 +49,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class UnBindRequestTest
+public class UnBindRequestTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    private LdapEncoder encoder = new LdapEncoder();
-
-    /** The codec service */
-    private LdapCodecService codec = new StandaloneLdapCodecService();
-
     /**
      * Test the decoding of a UnBindRequest with no controls
      */
@@ -164,6 +156,7 @@ public class UnBindRequestTest
 
         assertEquals( 1, controls.size() );
 
+        @SuppressWarnings("unchecked")
         CodecControl<Control> control = (org.apache.directory.shared.ldap.codec.api.CodecControl<Control> ) controls.get( "2.16.840.1.113730.3.4.2" );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", Strings.dumpBytes((byte[]) control.getValue()) );



Mime
View raw message