directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1069215 [2/4] - in /directory: apacheds/branches/m1/core-api/src/main/java/org/apache/directory/server/core/ apacheds/branches/m1/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/ apacheds/branches/m1/core-integ/src/...
Date Thu, 10 Feb 2011 03:35:34 GMT
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=1069215&r1=1069214&r2=1069215&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 Thu Feb 10 03:35:32 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.bind;
 
@@ -28,13 +28,17 @@ import java.nio.ByteBuffer;
 import java.util.Arrays;
 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.Asn1Container;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
-import org.apache.directory.shared.ldap.codec.AbstractCodecServiceTest;
+import org.apache.directory.shared.ldap.codec.LdapEncoder;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
+import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
+import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.controls.search.pagedSearch.PagedResultsDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.BindResponseDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.MessageDecorator;
@@ -46,17 +50,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;
-
 
 /**
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class BindResponseTest extends AbstractCodecServiceTest
+public class BindResponseTest
 {
+    /** The encoder instance */
+    LdapEncoder encoder = new LdapEncoder();
+
+    LdapCodecService codec = new StandaloneLdapCodecService();
+
     /**
      * Test the decoding of a BindResponse
      */
@@ -155,13 +161,13 @@ public class BindResponseTest extends Ab
                 ( byte ) 0xa0, 0x2C,                    // controls
                   0x30, 0x2A,                           // The PagedSearchControl
                     0x04, 0x16,                         // Oid : 1.2.840.113556.1.4.319
-                      0x31, 0x2e, 0x32, 0x2e, 0x38, 0x34, 0x30, 0x2e,
-                      0x31, 0x31, 0x33, 0x35, 0x35, 0x36, 0x2e, 0x31,
-                      0x2e, 0x34, 0x2e, 0x33, 0x31, 0x39,
+                      0x31, 0x2e, 0x32, 0x2e, 0x38, 0x34, 0x30, 0x2e, 
+                      0x31, 0x31, 0x33, 0x35, 0x35, 0x36, 0x2e, 0x31, 
+                      0x2e, 0x34, 0x2e, 0x33, 0x31, 0x39, 
                     0x01, 0x01, ( byte ) 0xff,          // criticality: false
-                    0x04, 0x0D,
-                      0x30, 0x0B,
-                        0x02, 0x01, 0x05,               // Size = 5, cookie = "abcdef"
+                    0x04, 0x0D, 
+                      0x30, 0x0B, 
+                        0x02, 0x01, 0x05,               // Size = 5, cookie = "abcdef" 
                         0x04, 0x06, 'a', 'b', 'c', 'd', 'e', 'f' } );
 
         String decodedPdu = Strings.dumpBytes(stream.array());
@@ -323,11 +329,11 @@ public class BindResponseTest extends Ab
                   ( byte ) 0x87, 0x00, // serverSaslCreds [7] OCTET STRING
                 // OPTIONAL }
                 ( byte ) 0xA0, 0x1B, // A control
-                  0x30, 0x19,
-                    0x04, 0x17,
+                  0x30, 0x19, 
+                    0x04, 0x17, 
                       0x32, 0x2E, 0x31, 0x36, 0x2E, 0x38, 0x34, 0x30,
-                      0x2E, 0x31, 0x2E, 0x31, 0x31, 0x33, 0x37, 0x33,
-                      0x30, 0x2E, 0x33, 0x2E, 0x34, 0x2E, 0x32
+                      0x2E, 0x31, 0x2E, 0x31, 0x31, 0x33, 0x37, 0x33, 
+                      0x30, 0x2E, 0x33, 0x2E, 0x34, 0x2E, 0x32 
               } );
 
         String decodedPdu = Strings.dumpBytes(stream.array());
@@ -364,7 +370,7 @@ public class BindResponseTest extends Ab
         @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( control.getValue() ) );
+        assertEquals( "", Strings.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the encoding
         try
@@ -417,7 +423,7 @@ public class BindResponseTest extends Ab
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<BindResponseDecorator> container =
+        LdapMessageContainer<BindResponseDecorator> container = 
             new LdapMessageContainer<BindResponseDecorator>( codec );
 
         // Decode the BindResponse PDU

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=1069215&r1=1069214&r2=1069215&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 Thu Feb 10 03:35:32 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.compare;
 
@@ -27,16 +27,20 @@ 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.AbstractCodecServiceTest;
+import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
+import org.apache.directory.shared.ldap.model.message.CompareRequest;
+import org.apache.directory.shared.ldap.model.message.CompareResponseImpl;
+import org.apache.directory.shared.ldap.codec.LdapEncoder;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
+import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
+import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.api.ResponseCarryingException;
 import org.apache.directory.shared.ldap.codec.decorators.CompareRequestDecorator;
-import org.apache.directory.shared.ldap.model.message.CompareRequest;
-import org.apache.directory.shared.ldap.model.message.CompareResponseImpl;
 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;
@@ -44,19 +48,22 @@ 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 CompareRequest codec
- *
+ * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class CompareRequestTest extends AbstractCodecServiceTest
+public class CompareRequestTest
 {
+    /** The encoder instance */
+    LdapEncoder encoder = new LdapEncoder();
+    
+    LdapCodecService codec = new StandaloneLdapCodecService();
+
+
     /**
      * Test the decoding of a full CompareRequest
      */
@@ -89,7 +96,7 @@ public class CompareRequestTest extends 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<CompareRequestDecorator> container
+        LdapMessageContainer<CompareRequestDecorator> container 
             = new LdapMessageContainer<CompareRequestDecorator>( codec );
 
         // Decode the CompareRequest PDU
@@ -151,7 +158,7 @@ public class CompareRequestTest extends 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<CompareRequestDecorator> container
+        LdapMessageContainer<CompareRequestDecorator> container 
         = new LdapMessageContainer<CompareRequestDecorator>( codec );
 
         // Decode the CompareRequest PDU
@@ -193,7 +200,7 @@ public class CompareRequestTest extends 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<CompareRequestDecorator> container
+        LdapMessageContainer<CompareRequestDecorator> container 
             = new LdapMessageContainer<CompareRequestDecorator>( codec );
 
         // Decode the CompareRequest PDU
@@ -237,7 +244,7 @@ public class CompareRequestTest extends 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<CompareRequestDecorator> container
+        LdapMessageContainer<CompareRequestDecorator> container 
             = new LdapMessageContainer<CompareRequestDecorator>( codec );
 
         // Decode the CompareRequest PDU
@@ -281,7 +288,7 @@ public class CompareRequestTest extends 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<CompareRequestDecorator> container
+        LdapMessageContainer<CompareRequestDecorator> container 
             = new LdapMessageContainer<CompareRequestDecorator>( codec );
 
         // Decode the CompareRequest PDU
@@ -330,7 +337,7 @@ public class CompareRequestTest extends 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<CompareRequestDecorator> container
+        LdapMessageContainer<CompareRequestDecorator> container 
             = new LdapMessageContainer<CompareRequestDecorator>( codec );
 
         // Decode the CompareRequest PDU
@@ -383,7 +390,7 @@ public class CompareRequestTest extends 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<CompareRequestDecorator> container
+        LdapMessageContainer<CompareRequestDecorator> container 
             = new LdapMessageContainer<CompareRequestDecorator>( codec );
 
         // Decode the CompareRequest PDU
@@ -463,7 +470,7 @@ public class CompareRequestTest extends 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<CompareRequestDecorator> container
+        LdapMessageContainer<CompareRequestDecorator> container 
             = new LdapMessageContainer<CompareRequestDecorator>( codec );
 
         // Decode the CompareRequest PDU
@@ -493,7 +500,7 @@ public class CompareRequestTest extends 
         @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( control.getValue() ) );
+        assertEquals( "", Strings.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the encoding
         try

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=1069215&r1=1069214&r2=1069215&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 Thu Feb 10 03:35:32 2011
@@ -6,33 +6,37 @@
  *  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.compare;
 
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertEquals; 
 import static org.junit.Assert.assertTrue;
 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.AbstractCodecServiceTest;
+import org.apache.directory.shared.ldap.codec.LdapEncoder;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
+import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
+import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.CompareResponseDecorator;
 import org.apache.directory.shared.ldap.model.message.CompareResponse;
 import org.apache.directory.shared.ldap.model.message.Control;
@@ -41,19 +45,21 @@ 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 CompareResponse codec
- *
+ * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class CompareResponseTest extends AbstractCodecServiceTest
+public class CompareResponseTest
 {
+    /** The encoder instance */
+    LdapEncoder encoder = new LdapEncoder();
+
+    LdapCodecService codec = new StandaloneLdapCodecService();
+
     /**
      * Test the decoding of a CompareResponse
      */
@@ -84,7 +90,7 @@ public class CompareResponseTest extends
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<CompareResponseDecorator> container =
+        LdapMessageContainer<CompareResponseDecorator> container = 
             new LdapMessageContainer<CompareResponseDecorator>( codec );
 
         // Decode the CompareResponse PDU
@@ -167,7 +173,7 @@ public class CompareResponseTest extends
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<CompareResponseDecorator> container =
+        LdapMessageContainer<CompareResponseDecorator> container = 
             new LdapMessageContainer<CompareResponseDecorator>( codec );
 
         // Decode the CompareResponse PDU
@@ -197,7 +203,7 @@ public class CompareResponseTest extends
         @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( control.getValue() ) );
+        assertEquals( "", Strings.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the encoding
         try
@@ -239,7 +245,7 @@ public class CompareResponseTest extends
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<CompareResponseDecorator> container =
+        LdapMessageContainer<CompareResponseDecorator> container = 
             new LdapMessageContainer<CompareResponseDecorator>( codec );
 
         // Decode a CompareResponse message

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=1069215&r1=1069214&r2=1069215&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 Thu Feb 10 03:35:32 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.del;
 
@@ -27,37 +27,39 @@ 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.AbstractCodecServiceTest;
+import org.apache.directory.shared.ldap.codec.LdapEncoder;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
+import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
+import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.api.ResponseCarryingException;
 import org.apache.directory.shared.ldap.codec.decorators.DeleteRequestDecorator;
-import org.apache.directory.shared.ldap.model.message.Control;
-import org.apache.directory.shared.ldap.model.message.DeleteRequest;
-import org.apache.directory.shared.ldap.model.message.DeleteRequestImpl;
-import org.apache.directory.shared.ldap.model.message.DeleteResponseImpl;
-import org.apache.directory.shared.ldap.model.message.Message;
-import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.model.message.*;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import com.mycila.junit.concurrent.Concurrency;
-import com.mycila.junit.concurrent.ConcurrentJunitRunner;
-
 
 /**
  * Test the DelRequest codec
- *
+ * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class DelRequestTest extends AbstractCodecServiceTest
+public class DelRequestTest
 {
+    /** The encoder instance */
+    LdapEncoder encoder = new LdapEncoder();
+
+    LdapCodecService codec = new StandaloneLdapCodecService();
+    
+
     /**
      * Test the decoding of a full DelRequest
      */
@@ -263,7 +265,7 @@ public class DelRequestTest extends Abst
         @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( control.getValue() ) );
+        assertEquals( "", Strings.dumpBytes( ( byte[] ) control.getValue() ) );
 
         DeleteRequest internalDeleteRequest = new DeleteRequestImpl( delRequest.getMessageId() );
         internalDeleteRequest.setName( delRequest.getName() );

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=1069215&r1=1069214&r2=1069215&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 Thu Feb 10 03:35:32 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.del;
 
@@ -27,12 +27,16 @@ 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.AbstractCodecServiceTest;
+import org.apache.directory.shared.ldap.codec.LdapEncoder;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
+import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
+import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.DeleteResponseDecorator;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.DeleteResponse;
@@ -41,19 +45,21 @@ 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 DelResponse codec
- *
+ * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class DelResponseTest extends AbstractCodecServiceTest
+public class DelResponseTest
 {
+    /** The encoder instance */
+    LdapEncoder encoder = new LdapEncoder();
+
+    LdapCodecService codec = new StandaloneLdapCodecService();
+
     /**
      * Test the decoding of a DelResponse
      */
@@ -91,7 +97,7 @@ public class DelResponseTest extends Abs
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<DeleteResponseDecorator> container =
+        LdapMessageContainer<DeleteResponseDecorator> container = 
             new LdapMessageContainer<DeleteResponseDecorator>( codec );
 
         // Decode the DelResponse PDU
@@ -152,7 +158,7 @@ public class DelResponseTest extends Abs
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<DeleteResponseDecorator> container =
+        LdapMessageContainer<DeleteResponseDecorator> container = 
             new LdapMessageContainer<DeleteResponseDecorator>( codec );
 
 
@@ -199,10 +205,10 @@ public class DelResponseTest extends Abs
                                           // referral [3] Referral OPTIONAL }
                                           // }
                     ( byte ) 0xA0, 0x1B,  // A control
-                      0x30, 0x19,
-                        0x04, 0x17,
-                          0x32, 0x2E, 0x31, 0x36, 0x2E, 0x38, 0x34, 0x30,
-                          0x2E, 0x31, 0x2E, 0x31, 0x31, 0x33, 0x37, 0x33,
+                      0x30, 0x19, 
+                        0x04, 0x17, 
+                          0x32, 0x2E, 0x31, 0x36, 0x2E, 0x38, 0x34, 0x30, 
+                          0x2E, 0x31, 0x2E, 0x31, 0x31, 0x33, 0x37, 0x33, 
                           0x30, 0x2E, 0x33, 0x2E, 0x34, 0x2E, 0x32
 
             } );
@@ -211,7 +217,7 @@ public class DelResponseTest extends Abs
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<DeleteResponseDecorator> container =
+        LdapMessageContainer<DeleteResponseDecorator> container = 
             new LdapMessageContainer<DeleteResponseDecorator>( codec );
 
         // Decode the DelResponse PDU
@@ -241,7 +247,7 @@ public class DelResponseTest extends Abs
         @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( control.getValue() ) );
+        assertEquals( "", Strings.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the encoding
         try

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=1069215&r1=1069214&r2=1069215&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 Thu Feb 10 03:35:32 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,12 +27,16 @@ 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.AbstractCodecServiceTest;
+import org.apache.directory.shared.ldap.codec.LdapEncoder;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
+import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
+import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.ExtendedRequestDecorator;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.ExtendedRequest;
@@ -40,19 +44,22 @@ 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 extends AbstractCodecServiceTest
+public class ExtendedRequestTest
 {
+    /** The encoder instance */
+    LdapEncoder encoder = new LdapEncoder();
+
+    LdapCodecService codec = new StandaloneLdapCodecService();
+    
+
     /**
      * Test the decoding of a full ExtendedRequest
      */
@@ -77,7 +84,7 @@ public class ExtendedRequestTest extends
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedRequestDecorator> container =
+        LdapMessageContainer<ExtendedRequestDecorator> container = 
             new LdapMessageContainer<ExtendedRequestDecorator>(  codec );
 
         // Decode the ExtendedRequest PDU
@@ -149,7 +156,7 @@ public class ExtendedRequestTest extends
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedRequestDecorator> container =
+        LdapMessageContainer<ExtendedRequestDecorator> container = 
             new LdapMessageContainer<ExtendedRequestDecorator>(  codec );
 
         // Decode the ExtendedRequest PDU
@@ -178,7 +185,7 @@ public class ExtendedRequestTest extends
 
         @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( control.getValue() ) );
+        assertEquals( "", Strings.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the encoding
         try
@@ -231,7 +238,7 @@ public class ExtendedRequestTest extends
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedRequestDecorator> container =
+        LdapMessageContainer<ExtendedRequestDecorator> container = 
             new LdapMessageContainer<ExtendedRequestDecorator>(  codec );
 
         // Decode the ExtendedRequest PDU
@@ -261,7 +268,7 @@ public class ExtendedRequestTest extends
 
         @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( control.getValue() ) );
+        assertEquals( "", Strings.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the encoding
         try
@@ -303,7 +310,7 @@ public class ExtendedRequestTest extends
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedRequestDecorator> container =
+        LdapMessageContainer<ExtendedRequestDecorator> container = 
             new LdapMessageContainer<ExtendedRequestDecorator>(  codec );
 
         // Decode a ExtendedRequest PDU
@@ -339,7 +346,7 @@ public class ExtendedRequestTest extends
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedRequestDecorator> container =
+        LdapMessageContainer<ExtendedRequestDecorator> container = 
             new LdapMessageContainer<ExtendedRequestDecorator>(  codec );
 
         // Decode a ExtendedRequest PDU
@@ -356,7 +363,7 @@ public class ExtendedRequestTest extends
 
 
     /**
-     * Test the decoding of a bad name
+     * Test the decoding of a bad name 
      */
     @Test
     public void testDecodeExtendedBadRequestName()
@@ -376,7 +383,7 @@ public class ExtendedRequestTest extends
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedRequestDecorator> container =
+        LdapMessageContainer<ExtendedRequestDecorator> container = 
             new LdapMessageContainer<ExtendedRequestDecorator>(  codec );
 
         // Decode a ExtendedRequest PDU
@@ -414,7 +421,7 @@ public class ExtendedRequestTest extends
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedRequestDecorator> container =
+        LdapMessageContainer<ExtendedRequestDecorator> container = 
             new LdapMessageContainer<ExtendedRequestDecorator>(  codec );
 
         // Decode the ExtendedRequest PDU
@@ -480,7 +487,7 @@ public class ExtendedRequestTest extends
         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=1069215&r1=1069214&r2=1069215&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 Thu Feb 10 03:35:32 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,12 +27,16 @@ 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.AbstractCodecServiceTest;
+import org.apache.directory.shared.ldap.codec.LdapEncoder;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
+import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
+import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.ExtendedResponseDecorator;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.ExtendedResponse;
@@ -41,19 +45,22 @@ 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 extends AbstractCodecServiceTest
+public class ExtendedResponseTest
 {
+    /** The encoder instance */
+    LdapEncoder encoder = new LdapEncoder();
+
+    LdapCodecService codec = new StandaloneLdapCodecService();
+    
+
     /**
      * Test the decoding of a full ExtendedResponse
      */
@@ -86,7 +93,7 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container =
+        LdapMessageContainer<ExtendedResponseDecorator> container = 
             new LdapMessageContainer<ExtendedResponseDecorator>( codec );
 
         // Decode the ExtendedResponse PDU
@@ -108,7 +115,7 @@ public class ExtendedResponseTest extend
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
         assertEquals( "1.3.6.1.5.5.2", extendedResponse.getID() );
-        assertEquals( "value", Strings.utf8ToString(extendedResponse.getEncodedValue()) );
+        assertEquals( "value", Strings.utf8ToString((byte[]) extendedResponse.getEncodedValue()) );
 
         // Check the encoding
         try
@@ -147,9 +154,9 @@ public class ExtendedResponseTest extend
                 0x02,
                 0x01,
                 0x01, // messageID MessageID
-                // CHOICE {
-                //    ...,
-                //    extendedResp ExtendedResponse,
+                // CHOICE { 
+                //    ..., 
+                //    extendedResp ExtendedResponse, 
                 //    ...
                 0x78,
                 0x1D, // ExtendedResponse ::= [APPLICATION 23] SEQUENCE {
@@ -168,7 +175,7 @@ public class ExtendedResponseTest extend
                 ( 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',
@@ -178,7 +185,7 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container =
+        LdapMessageContainer<ExtendedResponseDecorator> container = 
             new LdapMessageContainer<ExtendedResponseDecorator>( codec );
 
         // Decode the ExtendedResponse PDU
@@ -200,7 +207,7 @@ public class ExtendedResponseTest extend
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
         assertEquals( "1.3.6.1.5.5.2", extendedResponse.getID() );
-        assertEquals( "value", Strings.utf8ToString(extendedResponse.getEncodedValue()) );
+        assertEquals( "value", Strings.utf8ToString((byte[]) extendedResponse.getEncodedValue()) );
 
         // Check the Control
         Map<String, Control> controls = extendedResponse.getControls();
@@ -210,7 +217,7 @@ public class ExtendedResponseTest extend
         @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(control.getValue()) );
+        assertEquals( "", Strings.dumpBytes((byte[]) control.getValue()) );
 
         // Check the encoding
         try
@@ -262,7 +269,7 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container =
+        LdapMessageContainer<ExtendedResponseDecorator> container = 
             new LdapMessageContainer<ExtendedResponseDecorator>( codec );
 
         // Decode the ExtendedResponse PDU
@@ -345,7 +352,7 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container =
+        LdapMessageContainer<ExtendedResponseDecorator> container = 
             new LdapMessageContainer<ExtendedResponseDecorator>( codec );
 
         // Decode the ExtendedResponse PDU
@@ -374,7 +381,7 @@ public class ExtendedResponseTest extend
         @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(control.getValue()) );
+        assertEquals( "", Strings.dumpBytes((byte[]) control.getValue()) );
 
         // Check the encoding
         try
@@ -416,7 +423,7 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container =
+        LdapMessageContainer<ExtendedResponseDecorator> container = 
             new LdapMessageContainer<ExtendedResponseDecorator>( codec );
 
         // Decode a DelRequest PDU
@@ -461,7 +468,7 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container =
+        LdapMessageContainer<ExtendedResponseDecorator> container = 
             new LdapMessageContainer<ExtendedResponseDecorator>( codec );
 
         // Decode a DelRequest PDU
@@ -506,7 +513,7 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container =
+        LdapMessageContainer<ExtendedResponseDecorator> container = 
             new LdapMessageContainer<ExtendedResponseDecorator>( codec );
 
         // Decode a DelRequest PDU
@@ -552,7 +559,7 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container =
+        LdapMessageContainer<ExtendedResponseDecorator> container = 
             new LdapMessageContainer<ExtendedResponseDecorator>( codec );
 
         // Decode the ExtendedResponse PDU
@@ -574,7 +581,7 @@ public class ExtendedResponseTest extend
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
         assertEquals( "1.3.6.1.5.5.2", extendedResponse.getID() );
-        assertEquals( "", Strings.utf8ToString(extendedResponse.getEncodedValue()) );
+        assertEquals( "", Strings.utf8ToString((byte[]) extendedResponse.getEncodedValue()) );
 
         // Check the encoding
         try
@@ -639,7 +646,7 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container =
+        LdapMessageContainer<ExtendedResponseDecorator> container = 
             new LdapMessageContainer<ExtendedResponseDecorator>( codec );
 
         // Decode the ExtendedResponse PDU
@@ -661,7 +668,7 @@ public class ExtendedResponseTest extend
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
         assertEquals( "1.3.6.1.5.5.2", extendedResponse.getID() );
-        assertEquals( "", Strings.utf8ToString(extendedResponse.getEncodedValue()) );
+        assertEquals( "", Strings.utf8ToString((byte[]) extendedResponse.getEncodedValue()) );
 
         // Check the Control
         Map<String, Control> controls = extendedResponse.getControls();
@@ -671,7 +678,7 @@ public class ExtendedResponseTest extend
         @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( control.getValue() ) );
+        assertEquals( "", Strings.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the encoding
         try
@@ -732,7 +739,7 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container =
+        LdapMessageContainer<ExtendedResponseDecorator> container = 
             new LdapMessageContainer<ExtendedResponseDecorator>( codec );
 
         // Decode the ExtendedResponse PDU
@@ -754,7 +761,7 @@ public class ExtendedResponseTest extend
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
         assertEquals( "1.3.6.1.5.5.2", extendedResponse.getID() );
-        assertEquals( "", Strings.utf8ToString(extendedResponse.getEncodedValue()) );
+        assertEquals( "", Strings.utf8ToString((byte[]) extendedResponse.getEncodedValue()) );
 
         // Check the encoding
         try
@@ -820,7 +827,7 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container =
+        LdapMessageContainer<ExtendedResponseDecorator> container = 
             new LdapMessageContainer<ExtendedResponseDecorator>( codec );
 
         // Decode the ExtendedResponse PDU
@@ -842,7 +849,7 @@ public class ExtendedResponseTest extend
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
         assertEquals( "1.3.6.1.5.5.2", extendedResponse.getID() );
-        assertEquals( "", Strings.utf8ToString(extendedResponse.getEncodedValue()) );
+        assertEquals( "", Strings.utf8ToString((byte[]) extendedResponse.getEncodedValue()) );
 
         // Check the Control
         Map<String, Control> controls = extendedResponse.getControls();
@@ -852,7 +859,7 @@ public class ExtendedResponseTest extend
         @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( control.getValue() ) );
+        assertEquals( "", Strings.dumpBytes( ( byte[] ) 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=1069215&r1=1069214&r2=1069215&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 Thu Feb 10 03:35:32 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,12 +27,16 @@ 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.AbstractCodecServiceTest;
+import org.apache.directory.shared.ldap.codec.LdapEncoder;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
+import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
+import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.IntermediateResponseDecorator;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.IntermediateResponse;
@@ -40,19 +44,23 @@ 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 extends AbstractCodecServiceTest
+public class IntermediateResponseTest
 {
+    /** The encoder instance */
+    LdapEncoder encoder = new LdapEncoder();
+
+    /** The codec service */
+    LdapCodecService codec = new StandaloneLdapCodecService();
+
+
     /**
      * Test the decoding of a full IntermediateResponse
      */
@@ -77,7 +85,7 @@ public class IntermediateResponseTest ex
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode the IntermediateResponse PDU
@@ -148,7 +156,7 @@ public class IntermediateResponseTest ex
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode the IntermediateResponse PDU
@@ -176,7 +184,7 @@ public class IntermediateResponseTest ex
 
         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(control.getValue()) );
+        assertEquals( "", Strings.dumpBytes((byte[]) control.getValue()) );
 
         // Check the encoding
         try
@@ -229,7 +237,7 @@ public class IntermediateResponseTest ex
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode the IntermediateResponse PDU
@@ -257,7 +265,7 @@ public class IntermediateResponseTest ex
 
         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(control.getValue()) );
+        assertEquals( "", Strings.dumpBytes((byte[]) control.getValue()) );
 
         // Check the encoding
         try
@@ -299,7 +307,7 @@ public class IntermediateResponseTest ex
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode a IntermediateResponse PDU
@@ -335,7 +343,7 @@ public class IntermediateResponseTest ex
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode a IntermediateResponse PDU
@@ -352,7 +360,7 @@ public class IntermediateResponseTest ex
 
 
     /**
-     * Test the decoding of a bad name
+     * Test the decoding of a bad name 
      */
     @Test
     public void testDecodeExtendedBadRequestName()
@@ -372,7 +380,7 @@ public class IntermediateResponseTest ex
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode a IntermediateResponse PDU
@@ -410,7 +418,7 @@ public class IntermediateResponseTest ex
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode the IntermediateResponse PDU
@@ -476,7 +484,7 @@ public class IntermediateResponseTest ex
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode the IntermediateResponse PDU
@@ -539,7 +547,7 @@ public class IntermediateResponseTest ex
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer =
+        LdapMessageContainer<IntermediateResponseDecorator> ldapMessageContainer = 
             new LdapMessageContainer<IntermediateResponseDecorator>( codec );
 
         // Decode the IntermediateResponse PDU
@@ -602,7 +610,7 @@ public class IntermediateResponseTest ex
         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=1069215&r1=1069214&r2=1069215&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 Thu Feb 10 03:35:32 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,12 +28,16 @@ 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.AbstractCodecServiceTest;
+import org.apache.directory.shared.ldap.codec.LdapEncoder;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
+import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
+import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.api.ResponseCarryingException;
 import org.apache.directory.shared.ldap.codec.decorators.ModifyRequestDecorator;
 import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
@@ -48,19 +52,23 @@ 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 extends AbstractCodecServiceTest
+public class ModifyRequestTest
 {
+    /** The encoder instance */
+    LdapEncoder encoder = new LdapEncoder();
+
+    /** The codec service */
+    LdapCodecService codec = new StandaloneLdapCodecService();
+
+
     /**
      * Test the decoding of a ModifyRequest
      */
@@ -108,7 +116,7 @@ public class ModifyRequestTest extends A
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -214,7 +222,7 @@ public class ModifyRequestTest extends A
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -279,7 +287,7 @@ public class ModifyRequestTest extends A
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -413,7 +421,7 @@ public class ModifyRequestTest extends A
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -541,7 +549,7 @@ public class ModifyRequestTest extends A
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -625,7 +633,7 @@ public class ModifyRequestTest extends A
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -660,7 +668,7 @@ public class ModifyRequestTest extends A
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -699,7 +707,7 @@ public class ModifyRequestTest extends A
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -738,7 +746,7 @@ public class ModifyRequestTest extends A
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -777,7 +785,7 @@ public class ModifyRequestTest extends A
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -819,7 +827,7 @@ public class ModifyRequestTest extends A
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -861,7 +869,7 @@ public class ModifyRequestTest extends A
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -904,7 +912,7 @@ public class ModifyRequestTest extends A
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -947,7 +955,7 @@ public class ModifyRequestTest extends A
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -990,7 +998,7 @@ public class ModifyRequestTest extends A
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -1038,7 +1046,7 @@ public class ModifyRequestTest extends A
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -1082,7 +1090,7 @@ public class ModifyRequestTest extends A
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -1163,7 +1171,7 @@ public class ModifyRequestTest extends A
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyRequestDecorator>( codec );
 
         // Decode a ModifyRequest PDU
@@ -1200,7 +1208,7 @@ public class ModifyRequestTest extends A
 
         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(control.getValue()) );
+        assertEquals( "", Strings.dumpBytes((byte[]) control.getValue()) );
 
         // Check the encoding
         try
@@ -1250,7 +1258,7 @@ public class ModifyRequestTest extends A
         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=1069215&r1=1069214&r2=1069215&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 Thu Feb 10 03:35:32 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,12 +27,16 @@ 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.AbstractCodecServiceTest;
+import org.apache.directory.shared.ldap.codec.LdapEncoder;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
+import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
+import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.ModifyResponseDecorator;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.ModifyResponse;
@@ -41,19 +45,23 @@ 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 extends AbstractCodecServiceTest
+public class ModifyResponseTest
 {
+    /** The encoder instance */
+    LdapEncoder encoder = new LdapEncoder();
+
+    /** The codec service */
+    LdapCodecService codec = new StandaloneLdapCodecService();
+
+
     /**
      * Test the decoding of a ModifyResponse
      */
@@ -83,7 +91,7 @@ public class ModifyResponseTest extends 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyResponseDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyResponseDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyResponseDecorator>( codec );
 
         // Decode a ModifyResponse PDU
@@ -164,7 +172,7 @@ public class ModifyResponseTest extends 
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyResponseDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyResponseDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyResponseDecorator>( codec );
 
         // Decode a ModifyResponse PDU
@@ -193,7 +201,7 @@ public class ModifyResponseTest extends 
 
         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(control.getValue()) );
+        assertEquals( "", Strings.dumpBytes((byte[]) control.getValue()) );
 
         // Check the encoding
         try
@@ -234,7 +242,7 @@ public class ModifyResponseTest extends 
         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=1069215&r1=1069214&r2=1069215&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 Thu Feb 10 03:35:32 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,12 +27,16 @@ 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.AbstractCodecServiceTest;
+import org.apache.directory.shared.ldap.codec.LdapEncoder;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
+import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
+import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.api.ResponseCarryingException;
 import org.apache.directory.shared.ldap.codec.decorators.ModifyDnRequestDecorator;
 import org.apache.directory.shared.ldap.model.message.Control;
@@ -44,19 +48,23 @@ 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 extends AbstractCodecServiceTest
+public class ModifyDNRequestTest
 {
+    /** The encoder instance */
+    LdapEncoder encoder = new LdapEncoder();
+
+    /** The codec service */
+    LdapCodecService codec = new StandaloneLdapCodecService();
+
+
     /**
      * Test the decoding of a full ModifyDNRequest
      */
@@ -91,7 +99,7 @@ public class ModifyDNRequestTest extends
         stream.flip();
 
         // Allocate a ModifyRequest Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         try
@@ -165,7 +173,7 @@ public class ModifyDNRequestTest extends
         stream.flip();
 
         // Allocate a ModifyRequest Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         try
@@ -219,7 +227,7 @@ public class ModifyDNRequestTest extends
         stream.flip();
 
         // Allocate a ModifyRequest Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         try
@@ -273,7 +281,7 @@ public class ModifyDNRequestTest extends
         stream.flip();
 
         // Allocate a ModifyRequest Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         try
@@ -333,7 +341,7 @@ public class ModifyDNRequestTest extends
         stream.flip();
 
         // Allocate a ModifyRequest Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         try
@@ -361,7 +369,7 @@ public class ModifyDNRequestTest extends
 
         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(control.getValue()) );
+        assertEquals( "", Strings.dumpBytes((byte[]) control.getValue()) );
 
         // Check the encoding
         try
@@ -415,7 +423,7 @@ public class ModifyDNRequestTest extends
         stream.flip();
 
         // Allocate a ModifyRequest Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         try
@@ -494,7 +502,7 @@ public class ModifyDNRequestTest extends
         stream.flip();
 
         // Allocate a ModifyRequest Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         try
@@ -523,7 +531,7 @@ public class ModifyDNRequestTest extends
 
         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(control.getValue()) );
+        assertEquals( "", Strings.dumpBytes((byte[]) control.getValue()) );
 
         // Check the encoding
         try
@@ -567,7 +575,7 @@ public class ModifyDNRequestTest extends
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         // Decode a ModifyDNRequest PDU
@@ -603,7 +611,7 @@ public class ModifyDNRequestTest extends
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         // Decode a ModifyDNRequest PDU
@@ -643,7 +651,7 @@ public class ModifyDNRequestTest extends
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyDnRequestDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyDnRequestDecorator>( codec );
 
         // Decode a ModifyDNRequest PDU
@@ -687,7 +695,7 @@ public class ModifyDNRequestTest extends
         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=1069215&r1=1069214&r2=1069215&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 Thu Feb 10 03:35:32 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,12 +27,16 @@ 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.AbstractCodecServiceTest;
+import org.apache.directory.shared.ldap.codec.LdapEncoder;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
+import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapCodecService;
+import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.ModifyDnResponseDecorator;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.ModifyDnResponse;
@@ -41,19 +45,23 @@ 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 extends AbstractCodecServiceTest
+public class ModifyDNResponseTest
 {
+    /** The encoder instance */
+    LdapEncoder encoder = new LdapEncoder();
+
+    /** The codec service */
+    LdapCodecService codec = new StandaloneLdapCodecService();
+
+
     /**
      * Test the decoding of a ModifyDNResponse
      */
@@ -84,7 +92,7 @@ public class ModifyDNResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyDnResponseDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyDnResponseDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyDnResponseDecorator>( codec );
 
         // Decode the ModifyDNResponse PDU
@@ -167,7 +175,7 @@ public class ModifyDNResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyDnResponseDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyDnResponseDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyDnResponseDecorator>( codec );
 
         // Decode the ModifyDNResponse PDU
@@ -196,7 +204,7 @@ public class ModifyDNResponseTest extend
 
         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(control.getValue()) );
+        assertEquals( "", Strings.dumpBytes((byte[]) control.getValue()) );
 
         // Check the encoding
         try
@@ -238,7 +246,7 @@ public class ModifyDNResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ModifyDnResponseDecorator> ldapMessageContainer =
+        LdapMessageContainer<ModifyDnResponseDecorator> ldapMessageContainer = 
             new LdapMessageContainer<ModifyDnResponseDecorator>( codec );
 
         // Decode a ModifyDNResponse message



Mime
View raw message