directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r764131 [9/16] - in /directory: apacheds/trunk/ apacheds/trunk/core-avl/ apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/ apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/ apached...
Date Sat, 11 Apr 2009 01:03:25 GMT
Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/aci/ACIItemParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/aci/ACIItemParserTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/aci/ACIItemParserTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/aci/ACIItemParserTest.java Sat Apr 11 01:03:00 2009
@@ -23,8 +23,10 @@
 
 import java.text.ParseException;
 
-import junit.framework.TestCase;
-
+import org.junit.Test;
+import static org.junit.Assert.fail;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertEquals;
 
 /**
  * Unit tests class for ACIItem parser (wrapper).
@@ -32,16 +34,13 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class ACIItemParserTest extends TestCase
+public class ACIItemParserTest
 {
 
     /** the ACIItem parser wrapper */
     ACIItemParser parser;
 
 
-    // /** holds multithreaded success value */
-    // boolean isSuccessMultithreaded = true;
-
     /**
      * Creates a ACIItemParserTest instance.
      */
@@ -57,7 +56,6 @@
      */
     public ACIItemParserTest( String s )
     {
-        super( s );
         parser = new ACIItemParser( null );
     }
 
@@ -72,6 +70,7 @@
     /**
      * Tests the parser with a rangeOfValues with a nested filter.
      */
+    @Test
     public void testRangeOfValues() throws Exception
     {
         String spec = " {  identificationTag  \"id1\" , precedence 114  , authenticationLevel simple  , "
@@ -96,6 +95,7 @@
     /**
      * Tests the parser with an ACIItem of ItemFirst main component.
      */
+    @Test 
     public void testItemFirst() throws Exception
     {
         String spec = " {  identificationTag  \"id1\" , precedence 114  , authenticationLevel simple  , "
@@ -115,6 +115,7 @@
     /**
      * Tests the parser with an ACIItem of UserFirst main component.
      */
+    @Test 
     public void testUserFirst() throws Exception
     {
         String spec = "{ identificationTag \"id2\"   , precedence 14, authenticationLevel none  , "
@@ -129,6 +130,7 @@
     }
 
 
+    @Test 
     public void testAllowAddAllUsers() throws Exception
     {
         String spec = "{ identificationTag \"addAci\", " + "precedence 14, " + "authenticationLevel none, "
@@ -140,6 +142,7 @@
     }
 
 
+    @Test 
     public void testCombo() throws Exception
     {
         String spec = "{ identificationTag \"addAci\", " + "precedence 14, " + "authenticationLevel none, "
@@ -151,6 +154,7 @@
     }
 
 
+    @Test 
     public void testOrderOfProtectedItemsDoesNotMatter() throws Exception
     {
         String spec = " {  identificationTag  \"id1\" , precedence 114  , authenticationLevel simple  , "
@@ -167,6 +171,7 @@
     }
 
 
+    @Test 
     public void testOrderOfUserClassesDoesNotMatter() throws Exception
     {
         String spec = "{ identificationTag \"id2\"   , precedence 14, authenticationLevel none  , "
@@ -181,6 +186,7 @@
     }
 
 
+    @Test 
     public void testOrderOfProtectedItemsDoesNotMatterButDuplicatesMatter() throws Exception
     {
         String spec = " {  identificationTag  \"id1\" , precedence 114  , authenticationLevel simple  , "
@@ -204,6 +210,7 @@
     }
 
 
+    @Test 
     public void testOrderOfUserClassesDoesNotMatterButDuplicatesMatter() throws Exception
     {
         String spec = "{ identificationTag \"id2\"   , precedence 14, authenticationLevel none  , "
@@ -225,6 +232,7 @@
     }
 
 
+    @Test 
     public void testItemPermissionComponentsOrderDoesNotMatter() throws Exception
     {
         String spec = " {  identificationTag  \"id1\" , precedence 114  , authenticationLevel simple  , "
@@ -241,6 +249,7 @@
     }
 
 
+    @Test 
     public void testItemPermissionComponentsOrderDoesNotMatterButDuplicatesMatter() throws Exception
     {
         String spec = " {  identificationTag  \"id1\" , precedence 114  , authenticationLevel simple  , "
@@ -265,6 +274,7 @@
     }
 
 
+    @Test 
     public void testUserPermissionComponentsOrderDoesNotMatter() throws Exception
     {
         String spec = "{ identificationTag \"id2\"   , precedence 14, authenticationLevel none  , "
@@ -279,6 +289,7 @@
     }
 
 
+    @Test 
     public void testUserPermissionComponentsOrderDoesNotMatterButDuplicatesMatter() throws Exception
     {
         String spec = "{ identificationTag \"id2\"   , precedence 14, authenticationLevel none  , "
@@ -300,6 +311,7 @@
     }
 
 
+    @Test 
     public void testOrderOfMainACIComponentsDoesNotMatter() throws Exception
     {
         String spec = "{   itemOrUserFirst userFirst:  { userClasses {  allUsers  , name { \"ou=people,cn=ersin\" }, "
@@ -314,6 +326,7 @@
     }
 
 
+    @Test 
     public void testOrderOfMainACIComponentsDoesNotMatterButDuplicatesMatter() throws Exception
     {
         String spec = "{   itemOrUserFirst userFirst:  { userClasses {  allUsers  , name { \"ou=people,cn=ersin\" }, "
@@ -335,6 +348,7 @@
     }
 
 
+    @Test 
     public void testOrderOfMainACIComponentsDoesNotMatterButMissingsMatter() throws Exception
     {
         String spec = "{   itemOrUserFirst userFirst:  { userClasses {  allUsers  , name { \"ou=people,cn=ersin\" }, "
@@ -356,6 +370,7 @@
     }
 
 
+    @Test 
     public void testUserFirstComponentsOrderDoesNotMatter() throws Exception
     {
         String spec = "{ identificationTag \"id2\"   , precedence 14, authenticationLevel none  , "
@@ -369,6 +384,7 @@
     }
 
 
+    @Test 
     public void testItemFirstComponentsOrderDoesNotMatter() throws Exception
     {
         String spec = " {  identificationTag  \"id1\" , precedence 114  , authenticationLevel simple  , "
@@ -384,6 +400,7 @@
     }
 
 
+    @Test 
     public void testGrantAndDenialBitsOrderDoesNotMatterButDuplicatesMatter() throws Exception
     {
         String spec = "{ identificationTag \"id2\"   , precedence 14, authenticationLevel none  , "
@@ -402,6 +419,7 @@
     }
 
 
+    @Test 
     public void testMaxValueCountComponentsOrderDoesNotMatter() throws Exception
     {
         String spec = "{ identificationTag \"id2\"   , precedence 14, authenticationLevel none  , "
@@ -416,6 +434,7 @@
     }
 
 
+    @Test 
     public void testRestrictedValueComponentsOrderDoesNotMatter() throws Exception
     {
         String spec = "{ identificationTag \"id2\"   , precedence 14, authenticationLevel none  , "
@@ -430,6 +449,7 @@
     }
 
 
+    @Test 
     public void testMaxImmSubComponentsOrderDoesNotMatter() throws Exception
     {
         String spec = "{ identificationTag \"id2\"   , precedence 14, authenticationLevel none  , "
@@ -443,6 +463,7 @@
     }
     
     
+    @Test 
     public void testSubtreeSpecificationComponentsOrderDoesNotMatter() throws Exception
     {
         String spec = "{ identificationTag \"id2\"   , precedence 14, authenticationLevel none  , "
@@ -459,6 +480,7 @@
     /**
      * Test case for DIRSERVER-891
      */
+    @Test 
     public void testInvalidAttributeValue()
     {
         String spec;
@@ -496,6 +518,7 @@
         }
     }
     
+    @Test 
     public void testUserClassParentOfEntry() throws Exception
     {
         String spec = "{ identificationTag \"id\"   , precedence 10, authenticationLevel none  , "
@@ -513,6 +536,7 @@
     /**
      * Test case for DIRSTUDIO-440
      */
+    @Test 
     public void testPrecedenceOfUserFirst() throws Exception
     {
         String spec = "{ identificationTag \"test\", precedence 14, authenticationLevel simple, "
@@ -550,6 +574,7 @@
     /**
      * Test case for DIRSERVER-891
      */
+    @Test 
     public void testIncomplete()
     {
         String spec;

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapControlTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapControlTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapControlTest.java Sat Apr 11 01:03:00 2009
@@ -26,16 +26,21 @@
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.EncoderException;
-import org.apache.directory.shared.ldap.codec.abandon.AbandonRequest;
+import org.apache.directory.shared.ldap.codec.abandon.AbandonRequestCodec;
 import org.apache.directory.shared.ldap.util.StringTools;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.junit.Assert.assertFalse;
 
-import junit.framework.TestCase;
 
-public class LdapControlTest extends TestCase
+public class LdapControlTest
 {
     /**
      * Test the decoding of a Request with controls
      */
+	@Test
     public void testDecodeRequestWithControls()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -92,18 +97,18 @@
         }
 
         // Check that everything is OK
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        AbandonRequest abandonRequest = message.getAbandonRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        AbandonRequestCodec abandonRequest = message.getAbandonRequest();
 
         assertEquals( 3, message.getMessageId() );
         assertEquals( 2, abandonRequest.getAbandonedMessageId() );
 
         // Check the Controls
-        List<Control> controls = message.getControls();
+        List<ControlCodec> controls = message.getControls();
 
         assertEquals( 4, controls.size() );
 
-        Control control = message.getControls( 0 );
+        ControlCodec control = message.getControls( 0 );
         assertEquals( "1.3.6.1.5.5.1", control.getControlType() );
         assertEquals( "0x61 0x62 0x63 0x64 0x65 0x66 ", StringTools.dumpBytes( ( byte[] ) control.getControlValue() ) );
         assertTrue( control.getCriticality() );
@@ -145,6 +150,7 @@
     /**
      * Test the decoding of a Request with null OID controls
      */
+	@Test
     public void testDecodeRequestWithControlsNullOID()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -188,6 +194,7 @@
     /**
      * Test the decoding of a Request with bad OID controls
      */
+	@Test
     public void testDecodeRequestWithControlsBadOID()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -231,6 +238,7 @@
     /**
      * Test the decoding of a Request with bad criticality
      */
+	@Test
     public void testDecodeRequestWithControlsBadCriticality()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java Sat Apr 11 01:03:00 2009
@@ -20,29 +20,30 @@
 package org.apache.directory.shared.ldap.codec;
 
 
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.ber.tlv.TLVStateEnum;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.ldap.codec.LdapDecoder;
-import org.apache.directory.shared.ldap.codec.LdapMessage;
+import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
-import org.apache.directory.shared.ldap.codec.bind.BindRequest;
+import org.apache.directory.shared.ldap.codec.bind.BindRequestCodec;
 import org.apache.directory.shared.ldap.codec.bind.SimpleAuthentication;
 import org.apache.directory.shared.ldap.util.StringTools;
+import org.junit.Test;
 
 import java.nio.ByteBuffer;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
 
 /**
  * A global Ldap Decoder test
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class LdapDecoderTest extends TestCase
+public class LdapDecoderTest
 {
     // ~ Methods
     // ------------------------------------------------------------------------------------
@@ -50,6 +51,7 @@
     /**
      * Test the decoding of a full PDU
      */
+    @Test
     public void testDecodeFull()
     {
 
@@ -87,8 +89,8 @@
         }
 
         // Check the decoded PDU
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequest br = message.getBindRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        BindRequestCodec br = message.getBindRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
@@ -102,6 +104,7 @@
     /**
      * Test the decoding of a partial PDU
      */
+    @Test
     public void testDecodePartial()
     {
 
@@ -133,11 +136,11 @@
             fail( de.getMessage() );
         }
 
-        Assert.assertEquals( TLVStateEnum.VALUE_STATE_PENDING, ldapMessageContainer.getState() );
+        assertEquals( TLVStateEnum.VALUE_STATE_PENDING, ldapMessageContainer.getState() );
 
         // Check the decoded PDU
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequest br = message.getBindRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        BindRequestCodec br = message.getBindRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
@@ -149,6 +152,7 @@
     /**
      * Test the decoding of a splitted PDU
      */
+    @Test
     public void testDecodeSplittedPDU()
     {
 
@@ -208,8 +212,8 @@
         assertEquals( ldapMessageContainer.getState(), TLVStateEnum.PDU_DECODED );
 
         // Check the decoded PDU
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequest br = message.getBindRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        BindRequestCodec br = message.getBindRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
@@ -224,6 +228,7 @@
      * Test the decoding of a PDU with a bad Length. The first TLV has a length
      * of 0x32 when the PDU is 0x33 bytes long.
      */
+    @Test
     public void testDecodeBadLengthTooSmall()
     {
 
@@ -270,6 +275,7 @@
      * Test the decoding of a PDU with a bad primitive Length. The second TLV
      * has a length of 0x02 when the PDU is 0x01 bytes long.
      */
+    @Test
     public void testDecodeBadPrimitiveLengthTooBig()
     {
 
@@ -316,6 +322,7 @@
      * Test the decoding of a PDU with a bad primitive Length. The second TLV
      * has a length of 0x02 when the PDU is 0x01 bytes long.
      */
+    @Test
     public void testDecodeBadTagTransition()
     {
 
@@ -362,6 +369,7 @@
      * The length is 3 bytes long, but the PDU has been splitted 
      * just after the first byte 
      */
+    @Test
     public void testDecodeSplittedLength()
     {
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java Sat Apr 11 01:03:00 2009
@@ -20,25 +20,28 @@
 package org.apache.directory.shared.ldap.codec;
 
 
-import junit.framework.TestCase;
-
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.ldap.codec.LdapDecoder;
-import org.apache.directory.shared.ldap.codec.LdapMessage;
+import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.util.StringTools;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.nio.ByteBuffer;
 
+
 /**
  * A global Ldap Decoder test
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class LdapMessageTest extends TestCase
+public class LdapMessageTest
 {
     // ~ Methods
     // ------------------------------------------------------------------------------------
@@ -46,6 +49,7 @@
     /**
      * Test the decoding of null length messageId
      */
+    @Test
     public void testDecodeMessageLengthNull()
     {
 
@@ -80,6 +84,7 @@
     /**
      * Test the decoding of null length messageId
      */
+    @Test
     public void testDecodeMessageIdLengthNull()
     {
 
@@ -115,6 +120,7 @@
     /**
      * Test the decoding of null length messageId
      */
+    @Test
     public void testDecodeMessageIdMinusOne()
     {
 
@@ -150,6 +156,7 @@
     /**
      * Test the decoding of messageId which value is -1
      */
+    @Test
     public void testDecodeMessageIdMaxInt()
     {
 
@@ -186,6 +193,7 @@
     /**
      * Test the decoding of a message with a wrong protocol operation
      */
+    @Test
     public void testDecodeWrongProtocolOpMaxInt()
     {
 
@@ -269,6 +277,7 @@
     /**
      * Test the decoding of a LdapMessage with a large MessageId
      */
+    @Test
     public void testDecodeUnBindRequestNoControls()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -298,7 +307,7 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
 
         assertEquals( 500, message.getMessageId() );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java Sat Apr 11 01:03:00 2009
@@ -20,19 +20,21 @@
 package org.apache.directory.shared.ldap.codec;
 
 
-import junit.framework.TestCase;
-
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.ldap.codec.LdapDecoder;
-import org.apache.directory.shared.ldap.codec.LdapMessage;
+import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
-import org.apache.directory.shared.ldap.codec.add.AddResponse;
+import org.apache.directory.shared.ldap.codec.add.AddResponseCodec;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.LdapURL;
 import org.apache.directory.shared.ldap.util.StringTools;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.nio.ByteBuffer;
 
@@ -43,7 +45,7 @@
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class LdapResultTest extends TestCase
+public class LdapResultTest
 {
     // ~ Methods
     // ------------------------------------------------------------------------------------
@@ -51,6 +53,7 @@
     /**
      * Test the decoding of a AddResponse with no LdapResult
      */
+	@Test
     public void testDecodeAddResponseEmptyResultCode()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -87,7 +90,8 @@
     /**
      * Test the decoding of a AddResponse with no LdapResult
      */
-    public void testDecodeAddResponseEmptyResultCodeAbove90()
+	@Test
+	public void testDecodeAddResponseEmptyResultCodeAbove90()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
 
@@ -123,6 +127,7 @@
     /**
      * Test the decoding of a AddResponse with all the different result codes
      */
+	@Test
     public void testDecodeAddResponseEmptyResultCodesOK()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -167,6 +172,7 @@
     /**
      * Test the decoding of a AddResponse with no matched DN
      */
+	@Test
     public void testDecodeAddResponseEmptyResultCodeNoMatchedDN()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -203,6 +209,7 @@
     /**
      * Test the decoding of a AddResponse with no error message
      */
+	@Test
     public void testDecodeAddResponseEmptyResultCodeNoErrorMsg()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -240,6 +247,7 @@
     /**
      * Test the decoding of a AddResponse with a valid LdapResult
      */
+	@Test
     public void testDecodeAddResponseEmptyResultCodeOK()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -273,8 +281,8 @@
         }
 
         // Check the decoded AddResponse
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        AddResponse addResponse = message.getAddResponse();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        AddResponseCodec addResponse = message.getAddResponse();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, addResponse.getLdapResult().getResultCode() );
@@ -303,6 +311,7 @@
     /**
      * Test the decoding of a AddResponse with a valid LdapResult with referral
      */
+	@Test
     public void testDecodeAddResponseEmptyResultCodeOKReferral()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -336,8 +345,8 @@
         }
 
         // Check the decoded AddResponse
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        AddResponse addResponse = message.getAddResponse();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        AddResponseCodec addResponse = message.getAddResponse();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( ResultCodeEnum.REFERRAL, addResponse.getLdapResult().getResultCode() );
@@ -372,6 +381,7 @@
     /**
      * Test the decoding of a AddResponse with a valid LdapResult with referrals
      */
+	@Test
     public void testDecodeAddResponseEmptyResultCodeOKReferrals()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -406,8 +416,8 @@
         }
 
         // Check the decoded AddResponse
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        AddResponse addResponse = message.getAddResponse();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        AddResponseCodec addResponse = message.getAddResponse();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( ResultCodeEnum.REFERRAL, addResponse.getLdapResult().getResultCode() );
@@ -447,6 +457,7 @@
      * Test the decoding of a AddResponse with a valid LdapResult with referrals
      * and an empty referral
      */
+	@Test
     public void testDecodeAddResponseEmptyResultCodeEmptyReferral()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -480,8 +491,8 @@
         }
 
         // Check the decoded AddResponse
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        AddResponse addResponse = message.getAddResponse();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        AddResponseCodec addResponse = message.getAddResponse();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( ResultCodeEnum.REFERRAL, addResponse.getLdapResult().getResultCode() );
@@ -521,6 +532,7 @@
      * Test the decoding of a AddResponse with a valid LdapResult and an invalid
      * transition after the referral sequence
      */
+	@Test
     public void testDecodeAddResponseEmptyResultCodeEmptyReferrals()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java Sat Apr 11 01:03:00 2009
@@ -27,14 +27,17 @@
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.EncoderException;
-import org.apache.directory.shared.ldap.codec.Control;
+import org.apache.directory.shared.ldap.codec.ControlCodec;
 import org.apache.directory.shared.ldap.codec.LdapDecoder;
-import org.apache.directory.shared.ldap.codec.LdapMessage;
+import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
-import org.apache.directory.shared.ldap.codec.abandon.AbandonRequest;
+import org.apache.directory.shared.ldap.codec.abandon.AbandonRequestCodec;
 import org.apache.directory.shared.ldap.util.StringTools;
-
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.junit.Assert.assertFalse;
 
 
 /**
@@ -42,11 +45,12 @@
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AbandonRequestTest extends TestCase
+public class AbandonRequestTest
 {
     /**
      * Test the decoding of a AbandonRequest with controls
      */
+	@Test
     public void testDecodeAbandonRequestWithControls()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -101,18 +105,18 @@
         }
 
         // Check that everything is OK
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        AbandonRequest abandonRequest = message.getAbandonRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        AbandonRequestCodec abandonRequest = message.getAbandonRequest();
 
         assertEquals( 3, message.getMessageId() );
         assertEquals( 2, abandonRequest.getAbandonedMessageId() );
 
         // Check the Controls
-        List<Control> controls = message.getControls();
+        List<ControlCodec> controls = message.getControls();
 
         assertEquals( 4, controls.size() );
 
-        Control control = message.getControls( 0 );
+        ControlCodec control = message.getControls( 0 );
         assertEquals( "1.3.6.1.5.5.1", control.getControlType() );
         assertEquals( "0x61 0x62 0x63 0x64 0x65 0x66 ", StringTools.dumpBytes( ( byte[] ) control.getControlValue() ) );
         assertTrue( control.getCriticality() );
@@ -155,6 +159,7 @@
     /**
      * Test the decoding of a AbandonRequest with no controls
      */
+	@Test
     public void testDecodeAbandonRequestNoControlsHighMessageId()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -188,8 +193,8 @@
         }
 
         // Check that everything is OK
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        AbandonRequest abandonRequest = message.getAbandonRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        AbandonRequestCodec abandonRequest = message.getAbandonRequest();
 
         assertEquals( 32787, message.getMessageId() );
         assertEquals( 2, abandonRequest.getAbandonedMessageId() );
@@ -217,6 +222,7 @@
     /**
      * Test the decoding of a AbandonRequest with a null messageId
      */
+	@Test
     public void testDecodeAbandonRequestNoMessageId()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -252,6 +258,7 @@
     /**
      * Test the decoding of a AbandonRequest with a bad Message Id
      */
+	@Test
     public void testDecodeAbandonRequestBadMessageId()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java Sat Apr 11 01:03:00 2009
@@ -33,21 +33,23 @@
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.EncoderException;
-import org.apache.directory.shared.ldap.codec.Control;
+import org.apache.directory.shared.ldap.codec.ControlCodec;
 import org.apache.directory.shared.ldap.codec.LdapDecoder;
-import org.apache.directory.shared.ldap.codec.LdapMessage;
+import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.ResponseCarryingException;
-import org.apache.directory.shared.ldap.codec.add.AddRequest;
+import org.apache.directory.shared.ldap.codec.add.AddRequestCodec;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.message.AddResponseImpl;
-import org.apache.directory.shared.ldap.message.Message;
+import org.apache.directory.shared.ldap.message.InternalMessage;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
-
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 
 /**
@@ -55,11 +57,12 @@
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AddRequestTest extends TestCase
+public class AddRequestTest
 {
     /**
      * Test the decoding of a AddRequest
      */
+    @Test
     public void testDecodeAddRequestSuccess() throws NamingException
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -111,8 +114,8 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        AddRequest addRequest = message.getAddRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        AddRequestCodec addRequest = message.getAddRequest();
 
         // Check the decoded message
         assertEquals( 1, message.getMessageId() );
@@ -173,6 +176,7 @@
     /**
      * Test the decoding of a AddRequest with a null body
      */
+    @Test
     public void testDecodeAddRequestNullBody()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -209,6 +213,7 @@
     /**
      * Test the decoding of a AddRequest with a null entry
      */
+    @Test
     public void testDecodeAddRequestNullEntry()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -255,7 +260,7 @@
         catch ( DecoderException de )
         {
             assertTrue( de instanceof ResponseCarryingException );
-            Message response = ((ResponseCarryingException)de).getResponse();
+            InternalMessage response = ((ResponseCarryingException)de).getResponse();
             assertTrue( response instanceof AddResponseImpl );
             assertEquals( ResultCodeEnum.NAMING_VIOLATION, ((AddResponseImpl)response).getLdapResult().getResultCode() );
             return;
@@ -267,6 +272,7 @@
     /**
      * Test the decoding of a AddRequest
      */
+    @Test
     public void testDecodeAddRequestbadDN()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -315,7 +321,7 @@
         catch ( DecoderException de )
         {
             assertTrue( de instanceof ResponseCarryingException );
-            Message response = ((ResponseCarryingException)de).getResponse();
+            InternalMessage response = ((ResponseCarryingException)de).getResponse();
             assertTrue( response instanceof AddResponseImpl );
             assertEquals( ResultCodeEnum.INVALID_DN_SYNTAX, ((AddResponseImpl)response).getLdapResult().getResultCode() );
             return;
@@ -327,6 +333,7 @@
     /**
      * Test the decoding of a AddRequest with a null attributeList
      */
+    @Test
     public void testDecodeAddRequestNullAttributes()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -370,6 +377,7 @@
     /**
      * Test the decoding of a AddRequest with a empty attributeList
      */
+    @Test
     public void testDecodeAddRequestNullAttributeList()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -414,6 +422,7 @@
     /**
      * Test the decoding of a AddRequest with a empty attributeList
      */
+    @Test
     public void testDecodeAddRequestNullType()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -449,7 +458,7 @@
         catch ( DecoderException de )
         {
             assertTrue( de instanceof ResponseCarryingException );
-            Message response = ((ResponseCarryingException)de).getResponse();
+            InternalMessage response = ((ResponseCarryingException)de).getResponse();
             assertTrue( response instanceof AddResponseImpl );
             assertEquals( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, ((AddResponseImpl)response).getLdapResult().getResultCode() );
             return;
@@ -462,6 +471,7 @@
     /**
      * Test the decoding of a AddRequest with a empty attributeList
      */
+    @Test
     public void testDecodeAddRequestNoVals()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -507,6 +517,7 @@
     /**
      * Test the decoding of a AddRequest with a empty attributeList
      */
+    @Test
     public void testDecodeAddRequestNullVals()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -553,6 +564,7 @@
     /**
      * Test the decoding of a AddRequest with a empty attributeList
      */
+    @Test
     public void testDecodeAddRequestEmptyAttributeValue() throws NamingException
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -594,8 +606,8 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        AddRequest addRequest = message.getAddRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        AddRequestCodec addRequest = message.getAddRequest();
 
         // Check the decoded message
         assertEquals( 1, message.getMessageId() );
@@ -638,6 +650,7 @@
      * Test the decoding of a AddRequest with a empty attributeList and a
      * control
      */
+    @Test
     public void testDecodeAddRequestEmptyAttributeValueWithControl() throws NamingException
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -682,8 +695,8 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        AddRequest addRequest = message.getAddRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        AddRequestCodec addRequest = message.getAddRequest();
 
         // Check the decoded message
         assertEquals( 1, message.getMessageId() );
@@ -706,11 +719,11 @@
         assertEquals( 0x51, message.computeLength() );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<ControlCodec> controls = message.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        ControlCodec control = message.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getControlType() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getControlValue() ) );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java Sat Apr 11 01:03:00 2009
@@ -27,25 +27,28 @@
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.EncoderException;
-import org.apache.directory.shared.ldap.codec.Control;
+import org.apache.directory.shared.ldap.codec.ControlCodec;
 import org.apache.directory.shared.ldap.codec.LdapDecoder;
-import org.apache.directory.shared.ldap.codec.LdapMessage;
+import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
-import org.apache.directory.shared.ldap.codec.add.AddResponse;
+import org.apache.directory.shared.ldap.codec.add.AddResponseCodec;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
-
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 
 /**
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AddResponseTest extends TestCase
+public class AddResponseTest
 {
     /**
      * Test the decoding of a AddResponse
      */
+    @Test
     public void testDecodeAddResponseSuccess()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -85,8 +88,8 @@
         }
 
         // Check the decoded AddResponse
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        AddResponse addResponse = message.getAddResponse();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        AddResponseCodec addResponse = message.getAddResponse();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, addResponse.getLdapResult().getResultCode() );
@@ -115,6 +118,7 @@
     /**
      * Test the decoding of a AddResponse with no LdapResult
      */
+    @Test
     public void testDecodeAddResponseEmptyResult()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -150,6 +154,7 @@
     /**
      * Test the decoding of a AddResponse with a control
      */
+    @Test
     public void testDecodeAddResponseSuccessWithControl()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -161,17 +166,17 @@
                 0x02, 0x01, 0x01, // messageID MessageID
                 0x69, 0x07, // CHOICE { ..., addResponse AddResponse, ...
                 // AddResponse ::= [APPLICATION 9] LDAPResult
-                0x0A, 0x01, 0x00,// LDAPResult ::= SEQUENCE {
+                  0x0A, 0x01, 0x00,// LDAPResult ::= SEQUENCE {
                 // resultCode ENUMERATED {
                 // success (0), ...
                 // },
-                0x04, 0x00, // matchedDN LDAPDN,
-                0x04, 0x00, // errorMessage LDAPString,
+                  0x04, 0x00, // matchedDN LDAPDN,
+                  0x04, 0x00, // errorMessage LDAPString,
                 // 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, 0x2E, 0x33, 0x2E, 0x34, 0x2E, 0x32 } );
+                  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 } );
 
         String decodedPdu = StringTools.dumpBytes( stream.array() );
         stream.flip();
@@ -191,8 +196,8 @@
         }
 
         // Check the decoded AddResponse
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        AddResponse addResponse = message.getAddResponse();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        AddResponseCodec addResponse = message.getAddResponse();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, addResponse.getLdapResult().getResultCode() );
@@ -203,11 +208,11 @@
         assertEquals( 0x2B, message.computeLength() );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<ControlCodec> controls = message.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        ControlCodec control = message.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getControlType() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getControlValue() ) );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java Sat Apr 11 01:03:00 2009
@@ -27,27 +27,30 @@
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.EncoderException;
-import org.apache.directory.shared.ldap.codec.Control;
+import org.apache.directory.shared.ldap.codec.ControlCodec;
 import org.apache.directory.shared.ldap.codec.LdapDecoder;
-import org.apache.directory.shared.ldap.codec.LdapMessage;
+import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
-import org.apache.directory.shared.ldap.codec.bind.BindRequest;
+import org.apache.directory.shared.ldap.codec.bind.BindRequestCodec;
 import org.apache.directory.shared.ldap.codec.bind.SimpleAuthentication;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.StringTools;
+import org.junit.Test;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
 
 
 /**
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class BindRequestPerfTest extends TestCase
+public class BindRequestPerfTest
 {
     /**
      * Test the decoding of a BindRequest with Simple authentication and no
      * controls
      */
+    @Test
     public void testDecodeBindRequestSimpleNoControlsPerf()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -105,8 +108,8 @@
         }
 
         // Check the decoded BindRequest
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequest br = message.getBindRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        BindRequestCodec br = message.getBindRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
@@ -116,11 +119,11 @@
             .getSimple() ) );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<ControlCodec> controls = message.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        ControlCodec control = message.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getControlType() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getControlValue() ) );
 
@@ -147,6 +150,7 @@
      * Test the decoding of a BindRequest with Simple authentication and no
      * controls
      */
+    @Test
     public void testEncodeBindRequestPerf() throws Exception
     {
         LdapDN name = new LdapDN( "uid=akarasulu,dc=example,dc=com" );
@@ -156,13 +160,13 @@
         for ( int i = 0; i< nbLoops; i++)
         {
             // Check the decoded BindRequest
-            LdapMessage message = new LdapMessage();
+            LdapMessageCodec message = new LdapMessageCodec();
             message.setMessageId( 1 );
             
-            BindRequest br = new BindRequest();
+            BindRequestCodec br = new BindRequestCodec();
             br.setName( name );
             
-            Control control = new Control();
+            ControlCodec control = new ControlCodec();
             control.setControlType( "2.16.840.1.113730.3.4.2" );
 
             LdapAuthentication authentication = new SimpleAuthentication();

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java Sat Apr 11 01:03:00 2009
@@ -27,32 +27,36 @@
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.EncoderException;
-import org.apache.directory.shared.ldap.codec.Control;
+import org.apache.directory.shared.ldap.codec.ControlCodec;
 import org.apache.directory.shared.ldap.codec.LdapDecoder;
-import org.apache.directory.shared.ldap.codec.LdapMessage;
+import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.ResponseCarryingException;
-import org.apache.directory.shared.ldap.codec.bind.BindRequest;
+import org.apache.directory.shared.ldap.codec.bind.BindRequestCodec;
 import org.apache.directory.shared.ldap.codec.bind.SaslCredentials;
 import org.apache.directory.shared.ldap.codec.bind.SimpleAuthentication;
 import org.apache.directory.shared.ldap.message.BindResponseImpl;
-import org.apache.directory.shared.ldap.message.Message;
+import org.apache.directory.shared.ldap.message.InternalMessage;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
+import org.junit.Test;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 
 /**
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class BindRequestTest extends TestCase
+public class BindRequestTest
 {
     /**
      * Test the decoding of a BindRequest with Simple authentication and no
      * controls
      */
     /* Not used in unit tests
+    @Test
     public void testDecodeBindRequestSimpleNoControlsPerf()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -150,6 +154,7 @@
      * Test the decoding of a BindRequest with Simple authentication and
      * controls
      */
+    @Test
     public void testDecodeBindRequestSimpleWithControls()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -189,8 +194,8 @@
         }
 
         // Check the decoded BindRequest
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequest br = message.getBindRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        BindRequestCodec br = message.getBindRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
@@ -222,6 +227,7 @@
      * Test the decoding of a BindRequest with Simple authentication and
      * controls
      */
+    @Test
     public void testDecodeBindRequestBadDN()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -256,7 +262,7 @@
         catch ( DecoderException de )
         {
             assertTrue( de instanceof ResponseCarryingException );
-            Message response = ((ResponseCarryingException)de).getResponse();
+            InternalMessage response = ((ResponseCarryingException)de).getResponse();
             assertTrue( response instanceof BindResponseImpl );
             assertEquals( ResultCodeEnum.INVALID_DN_SYNTAX, ((BindResponseImpl)response).getLdapResult().getResultCode() );
             return;
@@ -270,6 +276,7 @@
      * Test the decoding of a BindRequest with Simple authentication, no name
      * and no controls
      */
+    @Test
     public void testDecodeBindRequestSimpleNoName()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -312,6 +319,7 @@
      * Test the decoding of a BindRequest with Simple authentication, empty name
      * (an anonymous bind) and no controls
      */
+    @Test
     public void testDecodeBindRequestSimpleEmptyName()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -350,8 +358,8 @@
         }
 
         // Check the decoded BindRequest
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequest br = message.getBindRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        BindRequestCodec br = message.getBindRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
@@ -384,6 +392,7 @@
      * Test the decoding of a BindRequest with Sasl authentication, no
      * credentials and no controls
      */
+    @Test
     public void testDecodeBindRequestSaslNoCredsNoControls()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -427,8 +436,8 @@
         }
 
         // Check the decoded BindRequest
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequest br = message.getBindRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        BindRequestCodec br = message.getBindRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
@@ -460,6 +469,7 @@
      * Test the decoding of a BindRequest with Sasl authentication, a
      * credentials and no controls
      */
+    @Test
     public void testDecodeBindRequestSaslCredsNoControls()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -510,8 +520,8 @@
         }
 
         // Check the decoded BindRequest
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequest br = message.getBindRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        BindRequestCodec br = message.getBindRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
@@ -545,6 +555,7 @@
      * Test the decoding of a BindRequest with Sasl authentication, no name, a
      * credentials and no controls
      */
+    @Test
     public void testDecodeBindRequestSaslNoNameCredsNoControls()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -593,8 +604,8 @@
         }
 
         // Check the decoded BindRequest
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequest br = message.getBindRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        BindRequestCodec br = message.getBindRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
@@ -627,6 +638,7 @@
     /**
      * Test the decoding of a BindRequest with an empty body
      */
+    @Test
     public void testDecodeBindRequestEmptyBody()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -662,6 +674,7 @@
     /**
      * Test the decoding of a BindRequest with an empty version
      */
+    @Test
     public void testDecodeBindRequestEmptyVersion()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -698,6 +711,7 @@
     /**
      * Test the decoding of a BindRequest with a bad version (0)
      */
+    @Test
     public void testDecodeBindRequestBadVersion0()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -734,6 +748,7 @@
     /**
      * Test the decoding of a BindRequest with a bad version (4)
      */
+    @Test
     public void testDecodeBindRequestBadVersion4()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -770,6 +785,7 @@
     /**
      * Test the decoding of a BindRequest with a bad version (128)
      */
+    @Test
     public void testDecodeBindRequestBadVersion128()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -807,6 +823,7 @@
     /**
      * Test the decoding of a BindRequest with no name
      */
+    @Test
     public void testDecodeBindRequestNoName()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -843,6 +860,7 @@
     /**
      * Test the decoding of a BindRequest with an empty name
      */
+    @Test
     public void testDecodeBindRequestEmptyName()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -879,6 +897,7 @@
     /**
      * Test the decoding of a BindRequest with an empty simple
      */
+    @Test
     public void testDecodeBindRequestEmptysimple()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -910,8 +929,8 @@
         }
 
         // Check the decoded BindRequest
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequest br = message.getBindRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        BindRequestCodec br = message.getBindRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
@@ -942,6 +961,7 @@
     /**
      * Test the decoding of a BindRequest with an empty sasl
      */
+    @Test
     public void testDecodeBindRequestEmptySasl()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -970,7 +990,7 @@
         catch ( DecoderException de )
         {
             assertTrue( de instanceof ResponseCarryingException );
-            Message response = ((ResponseCarryingException)de).getResponse();
+            InternalMessage response = ((ResponseCarryingException)de).getResponse();
             assertTrue( response instanceof BindResponseImpl );
             assertEquals( ResultCodeEnum.INVALID_CREDENTIALS, ((BindResponseImpl)response).getLdapResult().getResultCode() );
             return;
@@ -983,6 +1003,7 @@
     /**
      * Test the decoding of a BindRequest with an empty mechanism
      */
+    @Test
     public void testDecodeBindRequestEmptyMechanism()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -1017,8 +1038,8 @@
         }
 
         // Check the decoded BindRequest
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequest br = message.getBindRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        BindRequestCodec br = message.getBindRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
@@ -1050,6 +1071,7 @@
      * Test the decoding of a BindRequest with an bad mechanism
      */
     /* This test is not valid. I don't know how to generate a UnsupportedEncodingException ...
+    @Test
     public void testDecodeBindRequestBadMechanism()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -1092,6 +1114,7 @@
     /**
      * Test the decoding of a BindRequest with an empty credentials
      */
+    @Test
     public void testDecodeBindRequestEmptyCredentials()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -1126,8 +1149,8 @@
         }
 
         // Check the decoded BindRequest
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequest br = message.getBindRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        BindRequestCodec br = message.getBindRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
@@ -1160,6 +1183,7 @@
      * Test the decoding of a BindRequest with an empty credentials with
      * controls
      */
+    @Test
     public void testDecodeBindRequestEmptyCredentialsWithControls()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -1198,8 +1222,8 @@
         }
 
         // Check the decoded BindRequest
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequest br = message.getBindRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        BindRequestCodec br = message.getBindRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
@@ -1212,11 +1236,11 @@
         assertEquals( 0x2F, message.computeLength() );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<ControlCodec> controls = message.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        ControlCodec control = message.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getControlType() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getControlValue() ) );
 
@@ -1240,6 +1264,7 @@
     /**
      * Test the decoding of a BindRequest with an empty mechanisms with controls
      */
+    @Test
     public void testDecodeBindRequestEmptyMechanismWithControls()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -1277,8 +1302,8 @@
         }
 
         // Check the decoded BindRequest
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequest br = message.getBindRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        BindRequestCodec br = message.getBindRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
@@ -1291,11 +1316,11 @@
         assertEquals( 0x2D, message.computeLength() );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<ControlCodec> controls = message.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        ControlCodec control = message.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getControlType() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getControlValue() ) );
 
@@ -1320,6 +1345,7 @@
      * controls
      */
     /* No used by unit tests
+    @Test
     public void testPerf() throws Exception
     {
         LdapDN name = new LdapDN( "uid=akarasulu,dc=example,dc=com" );

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java Sat Apr 11 01:03:00 2009
@@ -28,27 +28,30 @@
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.EncoderException;
-import org.apache.directory.shared.ldap.codec.Control;
+import org.apache.directory.shared.ldap.codec.ControlCodec;
 import org.apache.directory.shared.ldap.codec.LdapDecoder;
-import org.apache.directory.shared.ldap.codec.LdapMessage;
+import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
-import org.apache.directory.shared.ldap.codec.bind.BindResponse;
+import org.apache.directory.shared.ldap.codec.bind.BindResponseCodec;
 import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedSearchControlCodec;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
-import org.apache.directory.shared.ldap.message.control.PagedSearchControl;
 import org.apache.directory.shared.ldap.util.StringTools;
+import org.junit.Test;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 
 /**
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class BindResponseTest extends TestCase
+public class BindResponseTest
 {
     /**
      * Test the decoding of a BindResponse
      */
+    @Test
     public void testDecodeBindResponseSuccess()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -89,8 +92,8 @@
         }
 
         // Check the decoded BindResponse
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindResponse br = message.getBindResponse();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        BindResponseCodec br = message.getBindResponse();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, br.getLdapResult().getResultCode() );
@@ -120,6 +123,7 @@
     /**
      * Test the decoding of a BindResponse with a control
      */
+    @Test
     public void testDecodeBindResponseWithControlSuccess()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -172,8 +176,8 @@
         }
 
         // Check the decoded BindResponse
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindResponse br = message.getBindResponse();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        BindResponseCodec br = message.getBindResponse();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, br.getLdapResult().getResultCode() );
@@ -184,11 +188,11 @@
         assertEquals( 0x3C, message.computeLength() );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<ControlCodec> controls = message.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        ControlCodec control = message.getControls( 0 );
         assertEquals( "1.2.840.113556.1.4.319", control.getControlType() );
         assertTrue( control.getControlValue() instanceof PagedSearchControlCodec );
         
@@ -217,6 +221,7 @@
     /**
      * Test the decoding of a BindResponse with an empty credentials
      */
+    @Test
     public void testDecodeBindResponseServerSASLEmptyCredentials()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -258,8 +263,8 @@
         }
 
         // Check the decoded BindResponse
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindResponse br = message.getBindResponse();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        BindResponseCodec br = message.getBindResponse();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, br.getLdapResult().getResultCode() );
@@ -291,6 +296,7 @@
      * Test the decoding of a BindResponse with an empty credentials with
      * controls
      */
+    @Test
     public void testDecodeBindResponseServerSASLEmptyCredentialsWithControls()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -334,8 +340,8 @@
         }
 
         // Check the decoded BindResponse
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindResponse br = message.getBindResponse();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        BindResponseCodec br = message.getBindResponse();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, br.getLdapResult().getResultCode() );
@@ -344,11 +350,11 @@
         assertEquals( "", StringTools.utf8ToString( br.getServerSaslCreds() ) );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<ControlCodec> controls = message.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        ControlCodec control = message.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getControlType() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getControlValue() ) );
 
@@ -375,6 +381,7 @@
     /**
      * Test the decoding of a BindResponse with a credentials
      */
+    @Test
     public void testDecodeBindResponseServerSASL()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -416,8 +423,8 @@
         }
 
         // Check the decoded BindResponse
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindResponse br = message.getBindResponse();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        BindResponseCodec br = message.getBindResponse();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, br.getLdapResult().getResultCode() );
@@ -448,6 +455,7 @@
     /**
      * Test the decoding of a BindResponse with no LdapResult
      */
+    @Test
     public void testDecodeAddResponseEmptyResult()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java Sat Apr 11 01:03:00 2009
@@ -27,18 +27,20 @@
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.EncoderException;
-import org.apache.directory.shared.ldap.codec.Control;
+import org.apache.directory.shared.ldap.codec.ControlCodec;
 import org.apache.directory.shared.ldap.codec.LdapDecoder;
-import org.apache.directory.shared.ldap.codec.LdapMessage;
+import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.ResponseCarryingException;
-import org.apache.directory.shared.ldap.codec.compare.CompareRequest;
+import org.apache.directory.shared.ldap.codec.compare.CompareRequestCodec;
 import org.apache.directory.shared.ldap.message.CompareResponseImpl;
-import org.apache.directory.shared.ldap.message.Message;
+import org.apache.directory.shared.ldap.message.InternalMessage;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
-
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 
 /**
@@ -46,12 +48,13 @@
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class CompareRequestTest extends TestCase
+public class CompareRequestTest
 {
 
     /**
      * Test the decoding of a full CompareRequest
      */
+    @Test
     public void testDecodeCompareRequestSuccess()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -94,8 +97,8 @@
         }
 
         // Ceck the decoded CompareRequest PDU
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        CompareRequest compareRequest = message.getCompareRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        CompareRequestCodec compareRequest = message.getCompareRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "cn=testModify,ou=users,ou=system", compareRequest.getEntry().toString() );
@@ -125,6 +128,7 @@
     /**
      * Test the decoding of an empty CompareRequest
      */
+    @Test
     public void testDecodeCompareRequestEmptyRequest()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -160,6 +164,7 @@
     /**
      * Test the decoding of an empty entry CompareRequest
      */
+    @Test
     public void testDecodeCompareRequestEmptyEntry()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -202,6 +207,7 @@
     /**
      * Test the decoding of an empty ava
      */
+    @Test
     public void testDecodeCompareRequestEmptyAVA()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -242,6 +248,7 @@
     /**
      * Test the decoding of an empty ava
      */
+    @Test
     public void testDecodeCompareRequestInvalidDN()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -276,7 +283,7 @@
         catch ( DecoderException de )
         {
             assertTrue( de instanceof ResponseCarryingException );
-            Message response = ((ResponseCarryingException)de).getResponse();
+            InternalMessage response = ((ResponseCarryingException)de).getResponse();
             assertTrue( response instanceof CompareResponseImpl );
             assertEquals( ResultCodeEnum.INVALID_DN_SYNTAX, ((CompareResponseImpl)response).getLdapResult().getResultCode() );
             return;
@@ -287,6 +294,7 @@
     /**
      * Test the decoding of an empty attributeDesc ava
      */
+    @Test
     public void testDecodeCompareRequestEmptyAttributeDesc()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -322,7 +330,7 @@
         catch ( DecoderException de )
         {
             assertTrue( de instanceof ResponseCarryingException );
-            Message response = ((ResponseCarryingException)de).getResponse();
+            InternalMessage response = ((ResponseCarryingException)de).getResponse();
             assertTrue( response instanceof CompareResponseImpl );
             assertEquals( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, ((CompareResponseImpl)response).getLdapResult().getResultCode() );
             return;
@@ -333,6 +341,7 @@
     /**
      * Test the decoding of an empty attributeValue ava
      */
+    @Test
     public void testDecodeCompareRequestEmptyAttributeValue()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -375,8 +384,8 @@
         }
 
         // Ceck the decoded CompareRequest PDU
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        CompareRequest compareRequest = message.getCompareRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        CompareRequestCodec compareRequest = message.getCompareRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "cn=testModify,ou=users,ou=system", compareRequest.getEntry().toString() );
@@ -406,6 +415,7 @@
     /**
      * Test the decoding of an compare request with controls
      */
+    @Test
     public void testDecodeCompareRequestWithControls()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -451,8 +461,8 @@
         }
 
         // Ceck the decoded CompareRequest PDU
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        CompareRequest compareRequest = message.getCompareRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        CompareRequestCodec compareRequest = message.getCompareRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "cn=testModify,ou=users,ou=system", compareRequest.getEntry().toString() );
@@ -460,11 +470,11 @@
         assertEquals( "value", compareRequest.getAssertionValue().toString() );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<ControlCodec> controls = message.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        ControlCodec control = message.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getControlType() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getControlValue() ) );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java Sat Apr 11 01:03:00 2009
@@ -27,15 +27,17 @@
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.EncoderException;
-import org.apache.directory.shared.ldap.codec.Control;
+import org.apache.directory.shared.ldap.codec.ControlCodec;
 import org.apache.directory.shared.ldap.codec.LdapDecoder;
-import org.apache.directory.shared.ldap.codec.LdapMessage;
+import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
-import org.apache.directory.shared.ldap.codec.compare.CompareResponse;
+import org.apache.directory.shared.ldap.codec.compare.CompareResponseCodec;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
-
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 
 /**
@@ -43,11 +45,12 @@
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class CompareResponseTest extends TestCase
+public class CompareResponseTest
 {
     /**
      * Test the decoding of a CompareResponse
      */
+    @Test
     public void testDecodeCompareResponseSuccess()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -88,8 +91,8 @@
         }
 
         // Check the decoded CompareResponse PDU
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        CompareResponse compareResponse = message.getCompareResponse();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        CompareResponseCodec compareResponse = message.getCompareResponse();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, compareResponse.getLdapResult().getResultCode() );
@@ -119,6 +122,7 @@
     /**
      * Test the decoding of a CompareResponse with controls
      */
+    @Test
     public void testDecodeCompareResponseSuccessWithControls()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -161,8 +165,8 @@
         }
 
         // Check the decoded CompareResponse PDU
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        CompareResponse compareResponse = message.getCompareResponse();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        CompareResponseCodec compareResponse = message.getCompareResponse();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, compareResponse.getLdapResult().getResultCode() );
@@ -170,11 +174,11 @@
         assertEquals( "", compareResponse.getLdapResult().getErrorMessage() );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<ControlCodec> controls = message.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        ControlCodec control = message.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getControlType() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getControlValue() ) );
 
@@ -201,6 +205,7 @@
     /**
      * Test the decoding of a CompareResponse with no LdapResult
      */
+    @Test
     public void testDecodeCompareResponseEmptyResult()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncStateValueControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncStateValueControlTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncStateValueControlTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncStateValueControlTest.java Sat Apr 11 01:03:00 2009
@@ -35,7 +35,6 @@
 import org.apache.directory.shared.ldap.codec.controls.replication.syncStateValue.SyncStateValueControlContainer;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncStateValue.SyncStateValueControlDecoder;
 import org.apache.directory.shared.ldap.message.control.replication.SyncStateTypeEnum;
-import org.apache.directory.shared.ldap.message.control.replication.SynchronizationModeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.junit.Test;
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java Sat Apr 11 01:03:00 2009
@@ -27,18 +27,20 @@
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.EncoderException;
-import org.apache.directory.shared.ldap.codec.Control;
+import org.apache.directory.shared.ldap.codec.ControlCodec;
 import org.apache.directory.shared.ldap.codec.LdapDecoder;
-import org.apache.directory.shared.ldap.codec.LdapMessage;
+import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.ResponseCarryingException;
-import org.apache.directory.shared.ldap.codec.del.DelRequest;
+import org.apache.directory.shared.ldap.codec.del.DelRequestCodec;
 import org.apache.directory.shared.ldap.message.DeleteResponseImpl;
-import org.apache.directory.shared.ldap.message.Message;
+import org.apache.directory.shared.ldap.message.InternalMessage;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
-
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 
 /**
@@ -46,11 +48,12 @@
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class DelRequestTest extends TestCase
+public class DelRequestTest
 {
     /**
      * Test the decoding of a full DelRequest
      */
+    @Test
     public void testDecodeDelRequestSuccess()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -86,8 +89,8 @@
         }
 
         // Check the decoded DelRequest PDU
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        DelRequest delRequest = message.getDelRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        DelRequestCodec delRequest = message.getDelRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "cn=testModify,ou=users,ou=system", delRequest.getEntry().toString() );
@@ -114,6 +117,7 @@
     /**
      * Test the decoding of a full DelRequest
      */
+    @Test
     public void testDecodeDelRequestBadDN()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -144,7 +148,7 @@
         catch ( DecoderException de )
         {
             assertTrue( de instanceof ResponseCarryingException );
-            Message response = ((ResponseCarryingException)de).getResponse();
+            InternalMessage response = ((ResponseCarryingException)de).getResponse();
             assertTrue( response instanceof DeleteResponseImpl );
             assertEquals( ResultCodeEnum.INVALID_DN_SYNTAX, ((DeleteResponseImpl)response).getLdapResult().getResultCode() );
             return;
@@ -156,6 +160,7 @@
     /**
      * Test the decoding of an empty DelRequest
      */
+    @Test
     public void testDecodeDelRequestEmpty()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -192,6 +197,7 @@
     /**
      * Test the decoding of a full DelRequest with controls
      */
+    @Test
     public void testDecodeDelRequestSuccessWithControls()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -230,8 +236,8 @@
         }
 
         // Check the decoded DelRequest PDU
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        DelRequest delRequest = message.getDelRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        DelRequestCodec delRequest = message.getDelRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "cn=testModify,ou=users,ou=system", delRequest.getEntry().toString() );
@@ -240,11 +246,11 @@
         assertEquals( 0x44, message.computeLength() );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<ControlCodec> controls = message.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        ControlCodec control = message.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getControlType() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getControlValue() ) );
 



Mime
View raw message