directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1068929 [2/4] - in /directory/shared/branches/m1/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec: ./ abandon/ add/ bind/ compare/ del/ extended/ intermediate/ modify/ modifyDn/ search/ search/controls/
Date Wed, 09 Feb 2011 15:10:53 GMT
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=1068929&r1=1068928&r2=1068929&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  9 15:10:51 2011
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.ldap.codec.extended;
 
@@ -27,16 +27,12 @@ import static org.junit.Assert.fail;
 import java.nio.ByteBuffer;
 import java.util.Map;
 
-import com.mycila.junit.concurrent.Concurrency;
-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.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.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.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.ExtendedRequest;
@@ -44,22 +40,19 @@ import org.apache.directory.shared.util.
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import com.mycila.junit.concurrent.Concurrency;
+import com.mycila.junit.concurrent.ConcurrentJunitRunner;
+
 
 /**
  * Test the ExtendedRequest codec
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class ExtendedRequestTest
+public class ExtendedRequestTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
-
-    LdapCodecService codec = new DefaultLdapCodecService();
-    
-
     /**
      * Test the decoding of a full ExtendedRequest
      */
@@ -84,7 +77,7 @@ public class ExtendedRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedRequestDecorator> container = 
+        LdapMessageContainer<ExtendedRequestDecorator> container =
             new LdapMessageContainer<ExtendedRequestDecorator>(  codec );
 
         // Decode the ExtendedRequest PDU
@@ -156,7 +149,7 @@ public class ExtendedRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedRequestDecorator> container = 
+        LdapMessageContainer<ExtendedRequestDecorator> container =
             new LdapMessageContainer<ExtendedRequestDecorator>(  codec );
 
         // Decode the ExtendedRequest PDU
@@ -185,7 +178,7 @@ public class ExtendedRequestTest
 
         @SuppressWarnings("unchecked")
         CodecControl<Control> control = (org.apache.directory.shared.ldap.codec.api.CodecControl<Control> ) extendedRequest.getControl( "2.16.840.1.113730.3.4.2" );
-        assertEquals( "", Strings.dumpBytes( ( byte[] ) control.getValue() ) );
+        assertEquals( "", Strings.dumpBytes( control.getValue() ) );
 
         // Check the encoding
         try
@@ -238,7 +231,7 @@ public class ExtendedRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedRequestDecorator> container = 
+        LdapMessageContainer<ExtendedRequestDecorator> container =
             new LdapMessageContainer<ExtendedRequestDecorator>(  codec );
 
         // Decode the ExtendedRequest PDU
@@ -268,7 +261,7 @@ public class ExtendedRequestTest
 
         @SuppressWarnings("unchecked")
         CodecControl<Control> control = (org.apache.directory.shared.ldap.codec.api.CodecControl<Control> ) extendedRequest.getControl( "2.16.840.1.113730.3.4.2" );
-        assertEquals( "", Strings.dumpBytes( ( byte[] ) control.getValue() ) );
+        assertEquals( "", Strings.dumpBytes( control.getValue() ) );
 
         // Check the encoding
         try
@@ -310,7 +303,7 @@ public class ExtendedRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedRequestDecorator> container = 
+        LdapMessageContainer<ExtendedRequestDecorator> container =
             new LdapMessageContainer<ExtendedRequestDecorator>(  codec );
 
         // Decode a ExtendedRequest PDU
@@ -346,7 +339,7 @@ public class ExtendedRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedRequestDecorator> container = 
+        LdapMessageContainer<ExtendedRequestDecorator> container =
             new LdapMessageContainer<ExtendedRequestDecorator>(  codec );
 
         // Decode a ExtendedRequest PDU
@@ -363,7 +356,7 @@ public class ExtendedRequestTest
 
 
     /**
-     * Test the decoding of a bad name 
+     * Test the decoding of a bad name
      */
     @Test
     public void testDecodeExtendedBadRequestName()
@@ -383,7 +376,7 @@ public class ExtendedRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedRequestDecorator> container = 
+        LdapMessageContainer<ExtendedRequestDecorator> container =
             new LdapMessageContainer<ExtendedRequestDecorator>(  codec );
 
         // Decode a ExtendedRequest PDU
@@ -421,7 +414,7 @@ public class ExtendedRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedRequestDecorator> container = 
+        LdapMessageContainer<ExtendedRequestDecorator> container =
             new LdapMessageContainer<ExtendedRequestDecorator>(  codec );
 
         // Decode the ExtendedRequest PDU
@@ -487,7 +480,7 @@ public class ExtendedRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedRequestDecorator> container = 
+        LdapMessageContainer<ExtendedRequestDecorator> container =
             new LdapMessageContainer<ExtendedRequestDecorator>(  codec );
 
         // Decode the ExtendedRequest PDU

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=1068929&r1=1068928&r2=1068929&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  9 15:10:51 2011
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.ldap.codec.extended;
 
@@ -27,16 +27,12 @@ import static org.junit.Assert.fail;
 import java.nio.ByteBuffer;
 import java.util.Map;
 
-import com.mycila.junit.concurrent.Concurrency;
-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.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.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.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.ExtendedResponse;
@@ -45,22 +41,19 @@ import org.apache.directory.shared.util.
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import com.mycila.junit.concurrent.Concurrency;
+import com.mycila.junit.concurrent.ConcurrentJunitRunner;
+
 
 /**
  * Test the ExtendedResponse codec
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class ExtendedResponseTest
+public class ExtendedResponseTest extends AbstractCodecServiceTest
 {
-    /** The encoder instance */
-    LdapEncoder encoder = new LdapEncoder();
-
-    LdapCodecService codec = new DefaultLdapCodecService();
-    
-
     /**
      * Test the decoding of a full ExtendedResponse
      */
@@ -93,7 +86,7 @@ public class ExtendedResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
+        LdapMessageContainer<ExtendedResponseDecorator> container =
             new LdapMessageContainer<ExtendedResponseDecorator>( codec );
 
         // Decode the ExtendedResponse PDU
@@ -115,7 +108,7 @@ public class ExtendedResponseTest
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
         assertEquals( "1.3.6.1.5.5.2", extendedResponse.getID() );
-        assertEquals( "value", Strings.utf8ToString((byte[]) extendedResponse.getEncodedValue()) );
+        assertEquals( "value", Strings.utf8ToString(extendedResponse.getEncodedValue()) );
 
         // Check the encoding
         try
@@ -154,9 +147,9 @@ public class ExtendedResponseTest
                 0x02,
                 0x01,
                 0x01, // messageID MessageID
-                // CHOICE { 
-                //    ..., 
-                //    extendedResp ExtendedResponse, 
+                // CHOICE {
+                //    ...,
+                //    extendedResp ExtendedResponse,
                 //    ...
                 0x78,
                 0x1D, // ExtendedResponse ::= [APPLICATION 23] SEQUENCE {
@@ -175,7 +168,7 @@ public class ExtendedResponseTest
                 ( byte ) 0x8A,
                 0x0D, //   responseName [10] LDAPOID OPTIONAL,
                 '1', '.', '3', '.', '6', '.', '1', '.', '5', '.', '5', '.', '2', ( byte ) 0x8B,
-                0x05, // response [11] OCTET STRING OPTIONAL } 
+                0x05, // response [11] OCTET STRING OPTIONAL }
                 'v', 'a', 'l', 'u', 'e', ( byte ) 0xA0,
                 0x1B, // A control
                 0x30, 0x19, 0x04, 0x17, '2', '.', '1', '6', '.', '8', '4', '0', '.', '1', '.', '1', '1', '3', '7', '3',
@@ -185,7 +178,7 @@ public class ExtendedResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
+        LdapMessageContainer<ExtendedResponseDecorator> container =
             new LdapMessageContainer<ExtendedResponseDecorator>( codec );
 
         // Decode the ExtendedResponse PDU
@@ -207,7 +200,7 @@ public class ExtendedResponseTest
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
         assertEquals( "1.3.6.1.5.5.2", extendedResponse.getID() );
-        assertEquals( "value", Strings.utf8ToString((byte[]) extendedResponse.getEncodedValue()) );
+        assertEquals( "value", Strings.utf8ToString(extendedResponse.getEncodedValue()) );
 
         // Check the Control
         Map<String, Control> controls = extendedResponse.getControls();
@@ -217,7 +210,7 @@ public class ExtendedResponseTest
         @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()) );
+        assertEquals( "", Strings.dumpBytes(control.getValue()) );
 
         // Check the encoding
         try
@@ -269,7 +262,7 @@ public class ExtendedResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
+        LdapMessageContainer<ExtendedResponseDecorator> container =
             new LdapMessageContainer<ExtendedResponseDecorator>( codec );
 
         // Decode the ExtendedResponse PDU
@@ -352,7 +345,7 @@ public class ExtendedResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
+        LdapMessageContainer<ExtendedResponseDecorator> container =
             new LdapMessageContainer<ExtendedResponseDecorator>( codec );
 
         // Decode the ExtendedResponse PDU
@@ -381,7 +374,7 @@ public class ExtendedResponseTest
         @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()) );
+        assertEquals( "", Strings.dumpBytes(control.getValue()) );
 
         // Check the encoding
         try
@@ -423,7 +416,7 @@ public class ExtendedResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
+        LdapMessageContainer<ExtendedResponseDecorator> container =
             new LdapMessageContainer<ExtendedResponseDecorator>( codec );
 
         // Decode a DelRequest PDU
@@ -468,7 +461,7 @@ public class ExtendedResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
+        LdapMessageContainer<ExtendedResponseDecorator> container =
             new LdapMessageContainer<ExtendedResponseDecorator>( codec );
 
         // Decode a DelRequest PDU
@@ -513,7 +506,7 @@ public class ExtendedResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
+        LdapMessageContainer<ExtendedResponseDecorator> container =
             new LdapMessageContainer<ExtendedResponseDecorator>( codec );
 
         // Decode a DelRequest PDU
@@ -559,7 +552,7 @@ public class ExtendedResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
+        LdapMessageContainer<ExtendedResponseDecorator> container =
             new LdapMessageContainer<ExtendedResponseDecorator>( codec );
 
         // Decode the ExtendedResponse PDU
@@ -581,7 +574,7 @@ public class ExtendedResponseTest
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
         assertEquals( "1.3.6.1.5.5.2", extendedResponse.getID() );
-        assertEquals( "", Strings.utf8ToString((byte[]) extendedResponse.getEncodedValue()) );
+        assertEquals( "", Strings.utf8ToString(extendedResponse.getEncodedValue()) );
 
         // Check the encoding
         try
@@ -646,7 +639,7 @@ public class ExtendedResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
+        LdapMessageContainer<ExtendedResponseDecorator> container =
             new LdapMessageContainer<ExtendedResponseDecorator>( codec );
 
         // Decode the ExtendedResponse PDU
@@ -668,7 +661,7 @@ public class ExtendedResponseTest
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
         assertEquals( "1.3.6.1.5.5.2", extendedResponse.getID() );
-        assertEquals( "", Strings.utf8ToString((byte[]) extendedResponse.getEncodedValue()) );
+        assertEquals( "", Strings.utf8ToString(extendedResponse.getEncodedValue()) );
 
         // Check the Control
         Map<String, Control> controls = extendedResponse.getControls();
@@ -678,7 +671,7 @@ public class ExtendedResponseTest
         @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() ) );
+        assertEquals( "", Strings.dumpBytes( control.getValue() ) );
 
         // Check the encoding
         try
@@ -739,7 +732,7 @@ public class ExtendedResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
+        LdapMessageContainer<ExtendedResponseDecorator> container =
             new LdapMessageContainer<ExtendedResponseDecorator>( codec );
 
         // Decode the ExtendedResponse PDU
@@ -761,7 +754,7 @@ public class ExtendedResponseTest
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
         assertEquals( "1.3.6.1.5.5.2", extendedResponse.getID() );
-        assertEquals( "", Strings.utf8ToString((byte[]) extendedResponse.getEncodedValue()) );
+        assertEquals( "", Strings.utf8ToString(extendedResponse.getEncodedValue()) );
 
         // Check the encoding
         try
@@ -827,7 +820,7 @@ public class ExtendedResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
+        LdapMessageContainer<ExtendedResponseDecorator> container =
             new LdapMessageContainer<ExtendedResponseDecorator>( codec );
 
         // Decode the ExtendedResponse PDU
@@ -849,7 +842,7 @@ public class ExtendedResponseTest
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
         assertEquals( "1.3.6.1.5.5.2", extendedResponse.getID() );
-        assertEquals( "", Strings.utf8ToString((byte[]) extendedResponse.getEncodedValue()) );
+        assertEquals( "", Strings.utf8ToString(extendedResponse.getEncodedValue()) );
 
         // Check the Control
         Map<String, Control> controls = extendedResponse.getControls();
@@ -859,7 +852,7 @@ public class ExtendedResponseTest
         @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() ) );
+        assertEquals( "", Strings.dumpBytes( control.getValue() ) );
 
         // Check the encoding
         try

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=1068929&r1=1068928&r2=1068929&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  9 15:10:51 2011
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.ldap.codec.intermediate;
 
@@ -27,16 +27,12 @@ import static org.junit.Assert.fail;
 import java.nio.ByteBuffer;
 import java.util.Map;
 
-import com.mycila.junit.concurrent.Concurrency;
-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.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.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.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.IntermediateResponse;
@@ -44,23 +40,19 @@ import org.apache.directory.shared.util.
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import com.mycila.junit.concurrent.Concurrency;
+import com.mycila.junit.concurrent.ConcurrentJunitRunner;
+
 
 /**
  * Test the IntermediateResponse codec
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @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 DefaultLdapCodecService();
-
-
     /**
      * Test the decoding of a full IntermediateResponse
      */
@@ -85,7 +77,7 @@ public class IntermediateResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode the IntermediateResponse PDU
@@ -156,7 +148,7 @@ public class IntermediateResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode the IntermediateResponse PDU
@@ -184,7 +176,7 @@ public class IntermediateResponseTest
 
         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()) );
+        assertEquals( "", Strings.dumpBytes(control.getValue()) );
 
         // Check the encoding
         try
@@ -237,7 +229,7 @@ public class IntermediateResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode the IntermediateResponse PDU
@@ -265,7 +257,7 @@ public class IntermediateResponseTest
 
         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()) );
+        assertEquals( "", Strings.dumpBytes(control.getValue()) );
 
         // Check the encoding
         try
@@ -307,7 +299,7 @@ public class IntermediateResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode a IntermediateResponse PDU
@@ -343,7 +335,7 @@ public class IntermediateResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode a IntermediateResponse PDU
@@ -360,7 +352,7 @@ public class IntermediateResponseTest
 
 
     /**
-     * Test the decoding of a bad name 
+     * Test the decoding of a bad name
      */
     @Test
     public void testDecodeExtendedBadRequestName()
@@ -380,7 +372,7 @@ public class IntermediateResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode a IntermediateResponse PDU
@@ -418,7 +410,7 @@ public class IntermediateResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode the IntermediateResponse PDU
@@ -484,7 +476,7 @@ public class IntermediateResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode the IntermediateResponse PDU
@@ -547,7 +539,7 @@ public class IntermediateResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode the IntermediateResponse PDU
@@ -610,7 +602,7 @@ public class IntermediateResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode the IntermediateResponse PDU

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=1068929&r1=1068928&r2=1068929&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  9 15:10:51 2011
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.ldap.codec.modify;
 
@@ -28,16 +28,12 @@ import java.nio.ByteBuffer;
 import java.util.Collection;
 import java.util.Map;
 
-import com.mycila.junit.concurrent.Concurrency;
-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.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.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.model.entry.EntryAttribute;
@@ -52,23 +48,19 @@ import org.apache.directory.shared.util.
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import com.mycila.junit.concurrent.Concurrency;
+import com.mycila.junit.concurrent.ConcurrentJunitRunner;
+
 
 /**
  * Test the ModifyRequest codec
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @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 DefaultLdapCodecService();
-
-
     /**
      * Test the decoding of a ModifyRequest
      */
@@ -116,7 +108,7 @@ public class ModifyRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -222,7 +214,7 @@ public class ModifyRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -287,7 +279,7 @@ public class ModifyRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -421,7 +413,7 @@ public class ModifyRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -549,7 +541,7 @@ public class ModifyRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -633,7 +625,7 @@ public class ModifyRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -668,7 +660,7 @@ public class ModifyRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -707,7 +699,7 @@ public class ModifyRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -746,7 +738,7 @@ public class ModifyRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -785,7 +777,7 @@ public class ModifyRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -827,7 +819,7 @@ public class ModifyRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -869,7 +861,7 @@ public class ModifyRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -912,7 +904,7 @@ public class ModifyRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -955,7 +947,7 @@ public class ModifyRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -998,7 +990,7 @@ public class ModifyRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -1046,7 +1038,7 @@ public class ModifyRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -1090,7 +1082,7 @@ public class ModifyRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -1171,7 +1163,7 @@ public class ModifyRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -1208,7 +1200,7 @@ public class ModifyRequestTest
 
         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()) );
+        assertEquals( "", Strings.dumpBytes(control.getValue()) );
 
         // Check the encoding
         try
@@ -1258,7 +1250,7 @@ public class ModifyRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU

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=1068929&r1=1068928&r2=1068929&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  9 15:10:51 2011
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.ldap.codec.modify;
 
@@ -27,16 +27,12 @@ import static org.junit.Assert.fail;
 import java.nio.ByteBuffer;
 import java.util.Map;
 
-import com.mycila.junit.concurrent.Concurrency;
-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.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.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.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.ModifyResponse;
@@ -45,23 +41,19 @@ import org.apache.directory.shared.util.
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import com.mycila.junit.concurrent.Concurrency;
+import com.mycila.junit.concurrent.ConcurrentJunitRunner;
+
 
 /**
  * Test the ModifyResponse codec
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @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 DefaultLdapCodecService();
-
-
     /**
      * Test the decoding of a ModifyResponse
      */
@@ -91,7 +83,7 @@ public class ModifyResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyResponseDecorator>( codec );
 
         // Decode a ModifyResponse PDU
@@ -172,7 +164,7 @@ public class ModifyResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyResponseDecorator>( codec );
 
         // Decode a ModifyResponse PDU
@@ -201,7 +193,7 @@ public class ModifyResponseTest
 
         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()) );
+        assertEquals( "", Strings.dumpBytes(control.getValue()) );
 
         // Check the encoding
         try
@@ -242,7 +234,7 @@ public class ModifyResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyResponseDecorator>( codec );
 
         // Decode a ModifyResponse message

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=1068929&r1=1068928&r2=1068929&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  9 15:10:51 2011
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.ldap.codec.modifyDn;
 
@@ -27,16 +27,12 @@ import static org.junit.Assert.fail;
 import java.nio.ByteBuffer;
 import java.util.Map;
 
-import com.mycila.junit.concurrent.Concurrency;
-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.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.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.model.message.Control;
@@ -48,23 +44,19 @@ import org.apache.directory.shared.util.
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import com.mycila.junit.concurrent.Concurrency;
+import com.mycila.junit.concurrent.ConcurrentJunitRunner;
+
 
 /**
  * Test the ModifyDNRequest codec
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @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 DefaultLdapCodecService();
-
-
     /**
      * Test the decoding of a full ModifyDNRequest
      */
@@ -99,7 +91,7 @@ public class ModifyDNRequestTest
         stream.flip();
 
         // Allocate a ModifyRequest Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         try
@@ -173,7 +165,7 @@ public class ModifyDNRequestTest
         stream.flip();
 
         // Allocate a ModifyRequest Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         try
@@ -227,7 +219,7 @@ public class ModifyDNRequestTest
         stream.flip();
 
         // Allocate a ModifyRequest Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         try
@@ -281,7 +273,7 @@ public class ModifyDNRequestTest
         stream.flip();
 
         // Allocate a ModifyRequest Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         try
@@ -341,7 +333,7 @@ public class ModifyDNRequestTest
         stream.flip();
 
         // Allocate a ModifyRequest Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         try
@@ -369,7 +361,7 @@ public class ModifyDNRequestTest
 
         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()) );
+        assertEquals( "", Strings.dumpBytes(control.getValue()) );
 
         // Check the encoding
         try
@@ -423,7 +415,7 @@ public class ModifyDNRequestTest
         stream.flip();
 
         // Allocate a ModifyRequest Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         try
@@ -502,7 +494,7 @@ public class ModifyDNRequestTest
         stream.flip();
 
         // Allocate a ModifyRequest Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         try
@@ -531,7 +523,7 @@ public class ModifyDNRequestTest
 
         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()) );
+        assertEquals( "", Strings.dumpBytes(control.getValue()) );
 
         // Check the encoding
         try
@@ -575,7 +567,7 @@ public class ModifyDNRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         // Decode a ModifyDNRequest PDU
@@ -611,7 +603,7 @@ public class ModifyDNRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         // Decode a ModifyDNRequest PDU
@@ -651,7 +643,7 @@ public class ModifyDNRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         // Decode a ModifyDNRequest PDU
@@ -695,7 +687,7 @@ public class ModifyDNRequestTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         // Decode a ModifyDNRequest PDU

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=1068929&r1=1068928&r2=1068929&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  9 15:10:51 2011
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.ldap.codec.modifyDn;
 
@@ -27,16 +27,12 @@ import static org.junit.Assert.fail;
 import java.nio.ByteBuffer;
 import java.util.Map;
 
-import com.mycila.junit.concurrent.Concurrency;
-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.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.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.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.ModifyDnResponse;
@@ -45,23 +41,19 @@ import org.apache.directory.shared.util.
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import com.mycila.junit.concurrent.Concurrency;
+import com.mycila.junit.concurrent.ConcurrentJunitRunner;
+
 
 /**
  * Test the ModifyDNResponse codec
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @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 DefaultLdapCodecService();
-
-
     /**
      * Test the decoding of a ModifyDNResponse
      */
@@ -92,7 +84,7 @@ public class ModifyDNResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyDnResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyDnResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyDnResponseDecorator>( codec );
 
         // Decode the ModifyDNResponse PDU
@@ -175,7 +167,7 @@ public class ModifyDNResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyDnResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyDnResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyDnResponseDecorator>( codec );
 
         // Decode the ModifyDNResponse PDU
@@ -204,7 +196,7 @@ public class ModifyDNResponseTest
 
         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()) );
+        assertEquals( "", Strings.dumpBytes(control.getValue()) );
 
         // Check the encoding
         try
@@ -246,7 +238,7 @@ public class ModifyDNResponseTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyDnResponseDecorator> ldapMessageContainer = 
+        LdapMessageContainer<ModifyDnResponseDecorator> ldapMessageContainer =
             new LdapMessageContainer<ModifyDnResponseDecorator>( codec );
 
         // Decode a ModifyDNResponse message

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=1068929&r1=1068928&r2=1068929&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  9 15:10:51 2011
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.ldap.codec.search;
 
@@ -32,15 +32,11 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import com.mycila.junit.concurrent.Concurrency;
-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.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.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.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.filter.ExprNode;
@@ -51,32 +47,29 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.normalizers.DeepTrimToLowerNormalizer;
 import org.apache.directory.shared.ldap.model.schema.normalizers.OidNormalizer;
 import org.apache.directory.shared.util.Strings;
-import org.junit.BeforeClass;
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import com.mycila.junit.concurrent.Concurrency;
+import com.mycila.junit.concurrent.ConcurrentJunitRunner;
+
 
 /**
  * A test case for SearchRequest messages
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @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 DefaultLdapCodecService();
-
     /** An oid normalizer map */
     static Map<String, OidNormalizer> oids = new HashMap<String, OidNormalizer>();
 
 
-    @BeforeClass
-    public static void setUp() throws Exception
+    @Before
+    public void setUp() throws Exception
     {
         // DC normalizer
         OidNormalizer dcOidNormalizer = new OidNormalizer( "dc", new DeepTrimToLowerNormalizer(
@@ -179,7 +172,7 @@ public class SearchRequestMatchingRuleAs
         stream.flip();
 
         // Allocate a BindRequest Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         try
@@ -256,7 +249,7 @@ public class SearchRequestMatchingRuleAs
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         // Decode a SearchRequest message
@@ -301,7 +294,7 @@ public class SearchRequestMatchingRuleAs
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         // Decode a SearchRequest message
@@ -346,7 +339,7 @@ public class SearchRequestMatchingRuleAs
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         // Decode a SearchRequest message
@@ -394,7 +387,7 @@ public class SearchRequestMatchingRuleAs
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         // Decode a SearchRequest message
@@ -464,7 +457,7 @@ public class SearchRequestMatchingRuleAs
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         // Decode a SearchRequest message
@@ -559,7 +552,7 @@ public class SearchRequestMatchingRuleAs
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         // Decode a SearchRequest message
@@ -606,7 +599,7 @@ public class SearchRequestMatchingRuleAs
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         // Decode a SearchRequest message
@@ -653,7 +646,7 @@ public class SearchRequestMatchingRuleAs
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         // Decode a SearchRequest message
@@ -700,7 +693,7 @@ public class SearchRequestMatchingRuleAs
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         // Decode a SearchRequest message

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=1068929&r1=1068928&r2=1068929&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  9 15:10:51 2011
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.ldap.codec.search;
 
@@ -30,16 +30,12 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import com.mycila.junit.concurrent.Concurrency;
-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.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.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.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.filter.ExprNode;
@@ -51,32 +47,29 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.normalizers.DeepTrimToLowerNormalizer;
 import org.apache.directory.shared.ldap.model.schema.normalizers.OidNormalizer;
 import org.apache.directory.shared.util.Strings;
-import org.junit.BeforeClass;
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import com.mycila.junit.concurrent.Concurrency;
+import com.mycila.junit.concurrent.ConcurrentJunitRunner;
+
 
 /**
  * A test case for SearchRequest messages
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @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 DefaultLdapCodecService();
-
     /** An oid normalizer map */
     static Map<String, OidNormalizer> oids = new HashMap<String, OidNormalizer>();
 
 
-    @BeforeClass
-    public static void setUp() throws Exception
+    @Before
+    public void setUp() throws Exception
     {
         // DC normalizer
         OidNormalizer dcOidNormalizer = new OidNormalizer( "dc", new DeepTrimToLowerNormalizer(
@@ -119,7 +112,7 @@ public class SearchRequestSubstringTest
                 0x02, 0x01,
                 0x01, //      messageID MessageID
                 0x63,
-                0x5D, //      CHOICE { ..., 
+                0x5D, //      CHOICE { ...,
                 //          searchRequest SearchRequest, ...
                 // SearchRequest ::= APPLICATION[3] SEQUENCE {
                 0x04,
@@ -135,7 +128,7 @@ public class SearchRequestSubstringTest
                 //          derefFindingBaseObj (2),
                 //          derefAlways         (3) },
                 0x02, 0x02, 0x03, ( byte ) 0xE8, //      sizeLimit INTEGER (0 .. maxInt), (1000)
-                0x02, 0x02, 0x03, ( byte ) 0xE8, // timeLimit INTEGER (0 .. maxInt), (1000) 
+                0x02, 0x02, 0x03, ( byte ) 0xE8, // timeLimit INTEGER (0 .. maxInt), (1000)
                 0x01, 0x01, ( byte ) 0xFF, // typesOnly
                 // BOOLEAN,
                 // (TRUE)
@@ -160,7 +153,7 @@ public class SearchRequestSubstringTest
         stream.flip();
 
         // Allocate a BindRequest Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         try
@@ -307,7 +300,7 @@ public class SearchRequestSubstringTest
         stream.flip();
 
         // Allocate a BindRequest Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         try
@@ -353,7 +346,7 @@ public class SearchRequestSubstringTest
 
         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()) );
+        assertEquals( "", Strings.dumpBytes(control.getValue()) );
 
         // Check the encoding
         // We won't check the whole PDU, as it may differs because
@@ -436,7 +429,7 @@ public class SearchRequestSubstringTest
         stream.flip();
 
         // Allocate a BindRequest Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         try
@@ -559,7 +552,7 @@ public class SearchRequestSubstringTest
         stream.flip();
 
         // Allocate a BindRequest Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         try
@@ -683,7 +676,7 @@ public class SearchRequestSubstringTest
         stream.flip();
 
         // Allocate a BindRequest Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         try
@@ -806,7 +799,7 @@ public class SearchRequestSubstringTest
         stream.flip();
 
         // Allocate a BindRequest Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         try
@@ -932,7 +925,7 @@ public class SearchRequestSubstringTest
         stream.flip();
 
         // Allocate a BindRequest Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         try
@@ -1056,7 +1049,7 @@ public class SearchRequestSubstringTest
         stream.flip();
 
         // Allocate a BindRequest Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         try
@@ -1179,7 +1172,7 @@ public class SearchRequestSubstringTest
         stream.flip();
 
         // Allocate a BindRequest Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         try
@@ -1323,7 +1316,7 @@ public class SearchRequestSubstringTest
         stream.flip();
 
         // Allocate a BindRequest Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         try
@@ -1411,7 +1404,7 @@ public class SearchRequestSubstringTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         // Decode a SearchRequest message
@@ -1455,7 +1448,7 @@ public class SearchRequestSubstringTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         // Decode a SearchRequest message
@@ -1502,7 +1495,7 @@ public class SearchRequestSubstringTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         // Decode a SearchRequest message
@@ -1549,7 +1542,7 @@ public class SearchRequestSubstringTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         // Decode a SearchRequest message
@@ -1596,7 +1589,7 @@ public class SearchRequestSubstringTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         // Decode a SearchRequest message
@@ -1643,7 +1636,7 @@ public class SearchRequestSubstringTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         // Decode a SearchRequest message
@@ -1690,7 +1683,7 @@ public class SearchRequestSubstringTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         // Decode a SearchRequest message
@@ -1741,7 +1734,7 @@ public class SearchRequestSubstringTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         // Decode a SearchRequest message
@@ -1792,7 +1785,7 @@ public class SearchRequestSubstringTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         // Decode a SearchRequest message
@@ -1843,7 +1836,7 @@ public class SearchRequestSubstringTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         // Decode a SearchRequest message
@@ -1893,7 +1886,7 @@ public class SearchRequestSubstringTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         // Decode a SearchRequest message
@@ -1943,7 +1936,7 @@ public class SearchRequestSubstringTest
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer = 
+        LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
             new LdapMessageContainer<SearchRequestDecorator>( codec );
 
         // Decode a SearchRequest message



Mime
View raw message