directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1071132 [2/3] - in /directory/shared/branches/m1: ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/ ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/abandon/ ldap-codec-standalone/src/tes...
Date Wed, 16 Feb 2011 03:18:13 GMT
Modified: directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java Wed Feb 16 03:17:49 2011
@@ -35,10 +35,9 @@ 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.api.DefaultLdapCodecService;
-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.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.message.BindRequest;
 import org.apache.directory.shared.ldap.model.message.Message;
 import org.apache.directory.shared.util.Strings;
@@ -59,10 +58,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class LdapDecoderTest
+public class LdapDecoderTest extends AbstractCodecServiceTest
 {
-    LdapCodecService codec = new DefaultLdapCodecService();
-    
     
     private static class LdapProtocolDecoderOutput extends AbstractProtocolDecoderOutput 
     {

Modified: directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java Wed Feb 16 03:17:49 2011
@@ -32,10 +32,9 @@ 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.api.DefaultLdapCodecService;
-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.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.message.Message;
 import org.apache.directory.shared.ldap.model.message.UnbindRequest;
 import org.apache.directory.shared.ldap.model.message.UnbindRequestImpl;
@@ -51,17 +50,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class LdapMessageTest
+public class LdapMessageTest extends AbstractCodecServiceTest
 {
-    LdapCodecService codec = new DefaultLdapCodecService();
-
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder( codec );
-
-    
-    // ~ Methods
-    // ------------------------------------------------------------------------------------
-
     /**
      * Test the decoding of null length messageId
      */

Modified: directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java Wed Feb 16 03:17:49 2011
@@ -35,17 +35,14 @@ 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.api.DefaultLdapCodecService;
-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.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.message.AddResponse;
 import org.apache.directory.shared.ldap.model.message.Message;
 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;
 
@@ -58,33 +55,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class LdapResultTest
+public class LdapResultTest extends AbstractCodecServiceTest
 {
-    static LdapCodecService codec;
-
-    /** The encoder instance */
-    static LdapEncoder encoder;
-
-    
-    @BeforeClass
-    public static void setupLdapCodecService()
-    {
-        codec = new DefaultLdapCodecService();
-        encoder = new LdapEncoder( codec );
-    }
-    
-    
-    @AfterClass
-    public static void tearDownLdapCodecService()
-    {
-        codec = null;
-        encoder = null;
-    }
-    
-
-    // ~ Methods
-    // ------------------------------------------------------------------------------------
-
     /**
      * Test the decoding of a AddResponse with no LdapResult
      */

Modified: directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java Wed Feb 16 03:17:49 2011
@@ -33,13 +33,11 @@ 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.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-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.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.message.AbandonRequest;
 import org.apache.directory.shared.ldap.model.message.AbandonRequestImpl;
 import org.apache.directory.shared.ldap.model.message.Control;
@@ -56,14 +54,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class AbandonRequestTest
+public class AbandonRequestTest extends AbstractCodecServiceTest
 {
-    LdapCodecService codec = new DefaultLdapCodecService();
-
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder( codec );
-
-    
     /**
      * Test the decoding of a AbandonRequest with controls
      */

Modified: directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java Wed Feb 16 03:17:49 2011
@@ -38,14 +38,12 @@ 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.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-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.AddRequestDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.MessageDecorator;
+import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.model.entry.Value;
@@ -62,14 +60,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class AddRequestTest
+public class AddRequestTest extends AbstractCodecServiceTest
 {
-    LdapCodecService codec = new DefaultLdapCodecService();
-
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder( codec );
-
-    
     /**
      * Test the decoding of a AddRequest
      */

Modified: directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java Wed Feb 16 03:17:49 2011
@@ -33,13 +33,11 @@ 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.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-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.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.message.AddResponse;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.Message;
@@ -54,14 +52,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class AddResponseTest
+public class AddResponseTest extends AbstractCodecServiceTest
 {
-    LdapCodecService codec = new DefaultLdapCodecService();
-
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder( codec );
-
-    
     /**
      * Test the decoding of a AddResponse
      */

Modified: directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java Wed Feb 16 03:17:49 2011
@@ -32,12 +32,10 @@ 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.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-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.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.message.BindRequest;
 import org.apache.directory.shared.ldap.model.message.BindRequestImpl;
 import org.apache.directory.shared.ldap.model.message.Control;
@@ -55,14 +53,8 @@ import org.junit.runner.RunWith;
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
 @Ignore( "Ignore performance tests: should not be with integration tests" )
-public class BindRequestPerfTest
+public class BindRequestPerfTest extends AbstractCodecServiceTest
 {
-    LdapCodecService codec = new DefaultLdapCodecService();
-
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder( codec );
-
-    
     /**
      * Test the decoding of a BindRequest with Simple authentication and no
      * controls

Modified: directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java Wed Feb 16 03:17:49 2011
@@ -20,7 +20,7 @@
 package org.apache.directory.shared.ldap.codec.bind;
 
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertEquals; 
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
@@ -34,14 +34,12 @@ 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.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-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;
+import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.message.BindRequest;
 import org.apache.directory.shared.ldap.model.message.BindResponseImpl;
 import org.apache.directory.shared.ldap.model.message.Control;
@@ -57,14 +55,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class BindRequestTest
+public class BindRequestTest extends AbstractCodecServiceTest
 {
-    LdapCodecService codec = new DefaultLdapCodecService();
-
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder( codec );
-
-    
     /**
      * Test the decoding of a BindRequest with Simple authentication and no
      * controls

Modified: directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java Wed Feb 16 03:17:49 2011
@@ -34,14 +34,12 @@ 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.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-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;
+import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.message.BindResponse;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.Message;
@@ -56,14 +54,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class BindResponseTest
+public class BindResponseTest extends AbstractCodecServiceTest
 {
-    LdapCodecService codec = new DefaultLdapCodecService();
-
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder( codec );
-
-    
     /**
      * Test the decoding of a BindResponse
      */

Modified: directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java Wed Feb 16 03:17:49 2011
@@ -35,12 +35,10 @@ import org.apache.directory.shared.asn1.
 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.api.DefaultLdapCodecService;
-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.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.Message;
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
@@ -56,14 +54,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class CompareRequestTest
+public class CompareRequestTest extends AbstractCodecServiceTest
 {
-    LdapCodecService codec = new DefaultLdapCodecService();
-
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder( codec );
-
-    
     /**
      * Test the decoding of a full CompareRequest
      */

Modified: directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java Wed Feb 16 03:17:49 2011
@@ -32,12 +32,10 @@ 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.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.CompareResponseDecorator;
+import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.message.CompareResponse;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
@@ -53,14 +51,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class CompareResponseTest
+public class CompareResponseTest extends AbstractCodecServiceTest
 {
-    LdapCodecService codec = new DefaultLdapCodecService();
-
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder( codec );
-
-    
     /**
      * Test the decoding of a CompareResponse
      */

Modified: directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java Wed Feb 16 03:17:49 2011
@@ -32,13 +32,11 @@ 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.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-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.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.message.*;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
@@ -52,14 +50,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class DelRequestTest
+public class DelRequestTest extends AbstractCodecServiceTest
 {
-    LdapCodecService codec = new DefaultLdapCodecService();
-
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder( codec );
-
-    
     /**
      * Test the decoding of a full DelRequest
      */

Modified: directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java Wed Feb 16 03:17:49 2011
@@ -32,12 +32,10 @@ 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.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.DeleteResponseDecorator;
+import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.DeleteResponse;
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
@@ -53,14 +51,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class DelResponseTest
+public class DelResponseTest extends AbstractCodecServiceTest
 {
-    LdapCodecService codec = new DefaultLdapCodecService();
-
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder( codec );
-
-    
     /**
      * Test the decoding of a DelResponse
      */

Modified: directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestTest.java Wed Feb 16 03:17:49 2011
@@ -32,12 +32,10 @@ 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.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.ExtendedRequestDecorator;
+import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.ExtendedRequest;
 import org.apache.directory.shared.util.Strings;
@@ -52,14 +50,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class ExtendedRequestTest
+public class ExtendedRequestTest extends AbstractCodecServiceTest
 {
-    LdapCodecService codec = new DefaultLdapCodecService();
-
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder( codec );
-
-    
     /**
      * Test the decoding of a full ExtendedRequest
      */

Modified: directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java Wed Feb 16 03:17:49 2011
@@ -32,12 +32,10 @@ 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.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.ExtendedResponseDecorator;
+import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.ExtendedResponse;
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
@@ -53,14 +51,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class ExtendedResponseTest
+public class ExtendedResponseTest extends AbstractCodecServiceTest
 {
-    LdapCodecService codec = new DefaultLdapCodecService();
-
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder( codec );
-
-    
     /**
      * Test the decoding of a full ExtendedResponse
      */

Modified: directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/intermediate/IntermediateResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/intermediate/IntermediateResponseTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/intermediate/IntermediateResponseTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/intermediate/IntermediateResponseTest.java Wed Feb 16 03:17:49 2011
@@ -32,12 +32,10 @@ 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.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.IntermediateResponseDecorator;
+import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.IntermediateResponse;
 import org.apache.directory.shared.util.Strings;
@@ -52,14 +50,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class IntermediateResponseTest
+public class IntermediateResponseTest extends AbstractCodecServiceTest
 {
-    LdapCodecService codec = new DefaultLdapCodecService();
-
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder( codec );
-
-    
     /**
      * Test the decoding of a full IntermediateResponse
      */
@@ -181,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()) );
@@ -262,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/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java Wed Feb 16 03:17:49 2011
@@ -33,13 +33,11 @@ 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.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-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.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.model.entry.Modification;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
@@ -60,14 +58,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class ModifyRequestTest
+public class ModifyRequestTest extends AbstractCodecServiceTest
 {
-    LdapCodecService codec = new DefaultLdapCodecService();
-
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder( codec );
-
-    
     /**
      * Test the decoding of a ModifyRequest
      */
@@ -1205,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/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java Wed Feb 16 03:17:49 2011
@@ -32,12 +32,10 @@ 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.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.ModifyResponseDecorator;
+import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.ModifyResponse;
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
@@ -53,14 +51,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class ModifyResponseTest
+public class ModifyResponseTest extends AbstractCodecServiceTest
 {
-    LdapCodecService codec = new DefaultLdapCodecService();
-
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder( codec );
-
-    
     /**
      * Test the decoding of a ModifyResponse
      */
@@ -198,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/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java Wed Feb 16 03:17:49 2011
@@ -32,13 +32,11 @@ 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.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-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.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.Message;
 import org.apache.directory.shared.ldap.model.message.ModifyDnRequest;
@@ -56,14 +54,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class ModifyDNRequestTest
+public class ModifyDNRequestTest extends AbstractCodecServiceTest
 {
-    LdapCodecService codec = new DefaultLdapCodecService();
-
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder( codec );
-
-    
     /**
      * Test the decoding of a full ModifyDNRequest
      */
@@ -366,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()) );
@@ -528,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/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNResponseTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNResponseTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNResponseTest.java Wed Feb 16 03:17:49 2011
@@ -32,12 +32,10 @@ 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.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.ModifyDnResponseDecorator;
+import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.ModifyDnResponse;
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
@@ -53,14 +51,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class ModifyDNResponseTest
+public class ModifyDNResponseTest extends AbstractCodecServiceTest
 {
-    LdapCodecService codec = new DefaultLdapCodecService();
-
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder( codec );
-
-    
     /**
      * Test the decoding of a ModifyDNResponse
      */
@@ -201,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()) );

Copied: directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/osgi/AbstractCodecServiceTest.java (from r1070976, directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/AbstractCodecServiceTest.java)
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/osgi/AbstractCodecServiceTest.java?p2=directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/osgi/AbstractCodecServiceTest.java&p1=directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/AbstractCodecServiceTest.java&r1=1070976&r2=1071132&rev=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/AbstractCodecServiceTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/osgi/AbstractCodecServiceTest.java Wed Feb 16 03:17:49 2011
@@ -17,10 +17,11 @@
  *  under the License.
  *
  */
-package org.apache.directory.shared.ldap.codec;
+package org.apache.directory.shared.ldap.codec.osgi;
 
 
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
+import org.apache.directory.shared.ldap.codec.LdapEncoder;
+import org.apache.directory.shared.ldap.codec.osgi.DefaultLdapCodecService;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 

Modified: directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java Wed Feb 16 03:17:49 2011
@@ -37,11 +37,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.LdapMessageContainer;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
+import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.filter.ExprNode;
 import org.apache.directory.shared.ldap.model.filter.ExtensibleNode;
@@ -63,14 +61,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class SearchRequestMatchingRuleAssertionTest
+public class SearchRequestMatchingRuleAssertionTest extends AbstractCodecServiceTest
 {
-    LdapCodecService codec = new DefaultLdapCodecService();
-
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder( codec );
-
-    
     /** An oid normalizer map */
     static Map<String, OidNormalizer> oids = new HashMap<String, OidNormalizer>();
 

Modified: directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java Wed Feb 16 03:17:49 2011
@@ -35,12 +35,10 @@ 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.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
+import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.filter.ExprNode;
 import org.apache.directory.shared.ldap.model.filter.SearchScope;
@@ -63,14 +61,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class SearchRequestSubstringTest
+public class SearchRequestSubstringTest extends AbstractCodecServiceTest
 {
-    /** The codec service */
-    LdapCodecService codec = new DefaultLdapCodecService();
-
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder( codec );
-
     /** 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/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java Wed Feb 16 03:17:49 2011
@@ -38,13 +38,11 @@ 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.LdapMessageContainer;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-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;
+import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.filter.AndNode;
 import org.apache.directory.shared.ldap.model.filter.ApproximateNode;
@@ -79,15 +77,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class SearchRequestTest
+public class SearchRequestTest extends AbstractCodecServiceTest
 {
-    /** The codec service */
-    LdapCodecService codec = new DefaultLdapCodecService();
-
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder( codec );
-
-    
     /** An oid normalizer map */
     static Map<String, OidNormalizer> oids = new HashMap<String, OidNormalizer>();
 

Modified: directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultDoneTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultDoneTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultDoneTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultDoneTest.java Wed Feb 16 03:17:49 2011
@@ -32,12 +32,10 @@ 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.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.SearchResultDoneDecorator;
+import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.model.message.SearchResultDone;
@@ -53,15 +51,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class SearchResultDoneTest
+public class SearchResultDoneTest extends AbstractCodecServiceTest
 {
-    /** The codec service */
-    LdapCodecService codec = new DefaultLdapCodecService();
-
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder( codec );
-
-    
     /**
      * 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/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java Wed Feb 16 03:17:49 2011
@@ -34,12 +34,10 @@ 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.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.SearchResultEntryDecorator;
+import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.model.message.Control;
@@ -56,15 +54,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class SearchResultEntryTest
+public class SearchResultEntryTest extends AbstractCodecServiceTest
 {
-    /** The codec service */
-    LdapCodecService codec = new DefaultLdapCodecService();
-
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder( codec );
-
-    
     /**
      * 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/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultReferenceTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultReferenceTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultReferenceTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultReferenceTest.java Wed Feb 16 03:17:49 2011
@@ -35,12 +35,10 @@ 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.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.SearchResultReferenceDecorator;
+import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.Referral;
 import org.apache.directory.shared.ldap.model.message.SearchResultReference;
@@ -56,15 +54,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class SearchResultReferenceTest
+public class SearchResultReferenceTest extends AbstractCodecServiceTest
 {
-    /** The codec service */
-    LdapCodecService codec = new DefaultLdapCodecService();
-
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder( codec );
-
-    
     /**
      * 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/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/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java Wed Feb 16 03:17:49 2011
@@ -28,9 +28,8 @@ 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.api.DefaultLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.controls.search.entryChange.EntryChangeDecorator;
+import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.message.controls.ChangeType;
 import org.apache.directory.shared.ldap.model.message.controls.EntryChange;
 import org.apache.directory.shared.ldap.model.name.Dn;
@@ -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 DefaultLdapCodecService();
-
     /**
      * Test the decoding of a EntryChangeControl
      */

Modified: directory/shared/branches/m1/ldap-codec/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/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlTest.java Wed Feb 16 03:17:49 2011
@@ -28,9 +28,8 @@ 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.api.DefaultLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.controls.search.persistentSearch.PersistentSearchDecorator;
+import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.message.controls.ChangeType;
 import org.apache.directory.shared.ldap.model.message.controls.PersistentSearch;
 import org.apache.directory.shared.util.Strings;
@@ -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 DefaultLdapCodecService();
-
     /**
      * Test encoding of a PSearchControl.
      * @throws Exception on error

Modified: directory/shared/branches/m1/ldap-codec/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/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java Wed Feb 16 03:17:49 2011
@@ -30,9 +30,8 @@ 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.api.DefaultLdapCodecService;
-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.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.message.controls.PagedResults;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
@@ -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 DefaultLdapCodecService();
-
     /**
      * Test encoding of a PagedSearchControl.
      */

Modified: directory/shared/branches/m1/ldap-codec/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/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlTest.java Wed Feb 16 03:17:49 2011
@@ -31,9 +31,8 @@ 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.api.DefaultLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.controls.search.subentries.SubentriesDecorator;
+import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.message.controls.Subentries;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
@@ -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 DefaultLdapCodecService();
-
     /**
      * Test the decoding of a SubEntryControl with a true visibility
      */

Modified: directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/unbind/UnBindRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/unbind/UnBindRequestTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/unbind/UnBindRequestTest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/unbind/UnBindRequestTest.java Wed Feb 16 03:17:49 2011
@@ -32,12 +32,10 @@ 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.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.UnbindRequestDecorator;
+import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.UnbindRequest;
 import org.apache.directory.shared.ldap.model.message.UnbindRequestImpl;
@@ -51,15 +49,8 @@ import org.junit.runner.RunWith;
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class UnBindRequestTest
+public class UnBindRequestTest extends AbstractCodecServiceTest
 {
-    /** The codec service */
-    LdapCodecService codec = new DefaultLdapCodecService();
-
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder( codec );
-
-    
     /**
      * Test the decoding of a UnBindRequest with no controls
      */
@@ -165,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()) );

Modified: directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyGrammar.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyGrammar.java (original)
+++ directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyGrammar.java Wed Feb 16 03:17:49 2011
@@ -49,7 +49,7 @@ import org.apache.directory.shared.asn1.
  *          
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class PasswordPolicyGrammar extends AbstractGrammar
+public class PasswordPolicyGrammar extends AbstractGrammar<PasswordPolicyContainer>
 {
     /** PasswordPolicyResponseControlGrammar singleton instance */
     private static final PasswordPolicyGrammar INSTANCE = new PasswordPolicyGrammar();

Modified: directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyStates.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyStates.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyStates.java (original)
+++ directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyStates.java Wed Feb 16 03:17:49 2011
@@ -50,7 +50,7 @@ public enum PasswordPolicyStates impleme
     /**
      * {@inheritDoc}
      */
-    public String getGrammarName( Grammar grammar )
+    public String getGrammarName( Grammar<?> grammar )
     {
         if( grammar instanceof PasswordPolicyGrammar )
         {

Modified: directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/StoreError.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/StoreError.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/StoreError.java (original)
+++ directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/StoreError.java Wed Feb 16 03:17:49 2011
@@ -30,6 +30,7 @@ import org.apache.directory.shared.ldap.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
+@SuppressWarnings("rawtypes")
 public class StoreError extends AbstractReadInteger
 {
 

Added: directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/codec/osgi/AbstractCodecServiceTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/codec/osgi/AbstractCodecServiceTest.java?rev=1071132&view=auto
==============================================================================
--- directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/codec/osgi/AbstractCodecServiceTest.java (added)
+++ directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/codec/osgi/AbstractCodecServiceTest.java Wed Feb 16 03:17:49 2011
@@ -0,0 +1,63 @@
+package org.apache.directory.shared.ldap.codec.osgi;
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+
+
+
+import org.apache.directory.shared.ldap.codec.LdapEncoder;
+import org.apache.directory.shared.ldap.codec.osgi.DefaultLdapCodecService;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+
+
+/**
+ * Initialize the Codec service. This can later be removed.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public abstract class AbstractCodecServiceTest
+{
+    protected static DefaultLdapCodecService codec;
+
+    /** The encoder instance */
+    protected static LdapEncoder encoder;
+
+
+    /**
+     * Initialize the codec service
+     */
+    @BeforeClass
+    public static void setupLdapCodecService()
+    {
+        codec = new DefaultLdapCodecService();
+        encoder = new LdapEncoder( codec );
+    }
+
+
+    /**
+     * Shutdown the codec service
+     */
+    @AfterClass
+    public static void tearDownLdapCodecService()
+    {
+        codec = null;
+        encoder = null;
+    }
+}

Modified: directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyTest.java (original)
+++ directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyTest.java Wed Feb 16 03:17:49 2011
@@ -27,12 +27,9 @@ import static org.junit.Assert.assertTru
 
 import java.nio.ByteBuffer;
 
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
+import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.extras.controls.PasswordPolicy;
 import org.apache.directory.shared.util.Strings;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
 import org.junit.Test;
 
 
@@ -41,26 +38,8 @@ import org.junit.Test;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class PasswordPolicyTest
+public class PasswordPolicyTest extends AbstractCodecServiceTest
 {
-    /** the codec for all tests */
-    private static LdapCodecService codec;
-    
-    
-    @BeforeClass
-    public static void setup()
-    {
-        codec = new DefaultLdapCodecService();
-    }
-    
-    
-    @AfterClass
-    public static void tearDown()
-    {
-        codec = null;
-    }
-    
-    
     @Test
     public void testDecodeRespWithExpiryWarningAndError() throws Exception
     {

Modified: directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncDoneValueControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncDoneValueControlTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncDoneValueControlTest.java (original)
+++ directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncDoneValueControlTest.java Wed Feb 16 03:17:49 2011
@@ -29,8 +29,7 @@ import static org.junit.Assert.fail;
 import java.nio.ByteBuffer;
 
 import org.apache.directory.shared.asn1.EncoderException;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
+import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.extras.controls.SyncDoneValue;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
@@ -48,12 +47,8 @@ import com.mycila.junit.concurrent.Concu
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class SyncDoneValueControlTest
+public class SyncDoneValueControlTest extends AbstractCodecServiceTest
 {
-    /** the codec service used for tests */
-    private LdapCodecService codec = new DefaultLdapCodecService();
-
-    
     @Test
     public void testSyncDoneValueControl() throws Exception
     {

Modified: directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncInfoValueControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncInfoValueControlTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncInfoValueControlTest.java (original)
+++ directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncInfoValueControlTest.java Wed Feb 16 03:17:49 2011
@@ -29,8 +29,7 @@ import java.nio.ByteBuffer;
 
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
+import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.extras.controls.SyncInfoValue;
 import org.apache.directory.shared.ldap.extras.controls.SynchronizationInfoEnum;
 import org.apache.directory.shared.util.Strings;
@@ -48,15 +47,12 @@ import com.mycila.junit.concurrent.Concu
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class SyncInfoValueControlTest
+public class SyncInfoValueControlTest extends AbstractCodecServiceTest
 {
-    /** the codec service used for tests */
-    private LdapCodecService codec = new DefaultLdapCodecService();
-
-    
     //--------------------------------------------------------------------------------
     // NewCookie choice tests
     //--------------------------------------------------------------------------------
+
     /**
      * Test the decoding of a SyncInfoValue control, newCookie choice
      */

Modified: directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncModifyDnControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncModifyDnControlTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncModifyDnControlTest.java (original)
+++ directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncModifyDnControlTest.java Wed Feb 16 03:17:49 2011
@@ -29,8 +29,7 @@ import java.nio.ByteBuffer;
 
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
+import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.extras.controls.SyncModifyDn;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
@@ -47,12 +46,8 @@ import com.mycila.junit.concurrent.Concu
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class SyncModifyDnControlTest
+public class SyncModifyDnControlTest extends AbstractCodecServiceTest
 {
-    /** the codec service used for tests */
-    private LdapCodecService codec = new DefaultLdapCodecService();
-    
-    
     @Test
     public void testDecodeSyncModifyDnControlWithMoveOperation() throws Exception
     {

Modified: directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncRequestValueControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncRequestValueControlTest.java?rev=1071132&r1=1071131&r2=1071132&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncRequestValueControlTest.java (original)
+++ directory/shared/branches/m1/ldap-extras/codec/src/test/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncRequestValueControlTest.java Wed Feb 16 03:17:49 2011
@@ -29,8 +29,7 @@ import java.nio.ByteBuffer;
 
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
-import org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
+import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
 import org.apache.directory.shared.ldap.extras.controls.SyncRequestValue;
 import org.apache.directory.shared.ldap.extras.controls.SynchronizationModeEnum;
 import org.apache.directory.shared.util.Strings;
@@ -48,12 +47,8 @@ import com.mycila.junit.concurrent.Concu
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class SyncRequestValueControlTest
+public class SyncRequestValueControlTest extends AbstractCodecServiceTest
 {
-    /** the codec service used for tests */
-    private LdapCodecService codec = new DefaultLdapCodecService();
-    
-    
     /**
      * Test the decoding of a SyncRequestValue control with a refreshOnly mode
      */



Mime
View raw message