directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r764131 [11/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/ apache...
Date Sat, 11 Apr 2009 01:03:25 GMT
Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java Sat Apr 11 01:03:00 2009
@@ -29,20 +29,24 @@
 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.LdapConstants;
 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.search.SearchRequest;
+import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
 import org.apache.directory.shared.ldap.codec.search.SubstringFilter;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.schema.normalizers.DeepTrimToLowerNormalizer;
 import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
 import org.apache.directory.shared.ldap.util.StringTools;
-
-import junit.framework.TestCase;
+import org.junit.BeforeClass;
+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.assertNotNull;
 
 
 /**
@@ -50,14 +54,13 @@
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SearchRequestSubstringTest extends TestCase
+public class SearchRequestSubstringTest
 {
     static Map<String, OidNormalizer> oids = new HashMap<String, OidNormalizer>();
 
-    protected void setUp() throws Exception
+    @BeforeClass
+    public static void setUp() throws Exception
     {
-        super.setUp();
-
         oids.put( "dc", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer() ) );
         oids.put( "domaincomponent", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer() ) );
         oids.put( "0.9.2342.19200300.100.1.25", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer() ) );
@@ -73,6 +76,7 @@
      * Test the decoding of a SearchRequest with a substring filter. Test the
      * initial filter : (objectclass=t*)
      */
+    @Test
     public void testDecodeSearchRequestSubstringInitialAny()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -137,8 +141,8 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -189,6 +193,7 @@
      * Test the decoding of a SearchRequest with a substring filter. Test the
      * initial filter : (objectclass=t*) With controls
      */
+    @Test
     public void testDecodeSearchRequestSubstringInitialAnyWithControls()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -253,8 +258,8 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -280,11 +285,11 @@
         }
 
         // 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() ) );
 
@@ -314,6 +319,7 @@
      * Test the decoding of a SearchRequest with a substring filter. Test the
      * any filter : (objectclass=*t*)
      */
+    @Test
     public void testDecodeSearchRequestSubstringAny()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -376,8 +382,8 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -430,6 +436,7 @@
      * Test the decoding of a SearchRequest with a substring filter. Test the
      * initial filter : (objectclass=*t*t)
      */
+    @Test
     public void testDecodeSearchRequestSubstringAnyFinal()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -493,8 +500,8 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -547,6 +554,7 @@
      * Test the decoding of a SearchRequest with a substring filter. Test the
      * initial filter : (objectclass=t*t*t)
      */
+    @Test
     public void testDecodeSearchRequestSubstringInitialAnyFinal()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -611,8 +619,8 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -665,6 +673,7 @@
      * Test the decoding of a SearchRequest with a substring filter. Test the
      * initial filter : (objectclass=t*t*)
      */
+    @Test
     public void testDecodeSearchRequestSubstringInitialAnyAnyFinal()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -728,8 +737,8 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -781,6 +790,7 @@
      * Test the decoding of a SearchRequest with a substring filter. Test the
      * initial filter : (objectclass=t*t*t)
      */
+    @Test
     public void testDecodeSearchRequestSubstringAnyAnyFinal()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -839,8 +849,8 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -894,6 +904,7 @@
      * Test the decoding of a SearchRequest with a substring filter. Test the
      * initial filter : (objectclass=t*)
      */
+    @Test
     public void testDecodeSearchRequestSubstringInitialAnyAny()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -957,8 +968,8 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -1010,6 +1021,7 @@
      * Test the decoding of a SearchRequest with a substring filter. Test the
      * initial filter : (objectclass=*t*t*t*)
      */
+    @Test
     public void testDecodeSearchRequestSubstringAnyAnyAny()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -1074,8 +1086,8 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -1130,6 +1142,7 @@
      * Test the decoding of a SearchRequest with a substring filter. Test the
      * initial filter : (objectclass=*t*t*t*)
      */
+    @Test
     public void testDecodeSearchRequestSubstringFinal()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -1193,8 +1206,8 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -1246,6 +1259,7 @@
     /**
      * Test the decoding of a SearchRequest with an empty Substring filter
      */
+    @Test
     public void testDecodeSearchRequestEmptySubstringFilter()
     {
         byte[] asn1BER = new byte[]
@@ -1294,6 +1308,7 @@
      * Test the decoding of a SearchRequest with a Substring filter and an empty
      * Substring
      */
+    @Test
     public void testDecodeSearchRequestSubstringFilterEmptyType()
     {
         byte[] asn1BER = new byte[]
@@ -1343,6 +1358,7 @@
      * Test the decoding of a SearchRequest with a Substring filter and an empty
      * Substring
      */
+    @Test
     public void testDecodeSearchRequestSubstringFilterNoSubstrings()
     {
         byte[] asn1BER = new byte[]
@@ -1392,6 +1408,7 @@
      * Test the decoding of a SearchRequest with a Substring filter and an empty
      * Substring
      */
+    @Test
     public void testDecodeSearchRequestSubstringFilterEmptySubstrings()
     {
         byte[] asn1BER = new byte[]
@@ -1442,6 +1459,7 @@
      * Test the decoding of a SearchRequest with a Substring filter and an empty
      * Substring Initial
      */
+    @Test
     public void testDecodeSearchRequestSubstringFilterEmptyInitial()
     {
         byte[] asn1BER = new byte[]
@@ -1493,6 +1511,7 @@
      * Test the decoding of a SearchRequest with a Substring filter and an empty
      * Substring Any
      */
+    @Test
     public void testDecodeSearchRequestSubstringFilterEmptyAny()
     {
         byte[] asn1BER = new byte[]
@@ -1544,6 +1563,7 @@
      * Test the decoding of a SearchRequest with a Substring filter and an empty
      * Substring Initial
      */
+    @Test
     public void testDecodeSearchRequestSubstringFilterEmptyFinal()
     {
         byte[] asn1BER = new byte[]
@@ -1595,6 +1615,7 @@
      * Test the decoding of a SearchRequest with a Substring filter Any before
      * initial
      */
+    @Test
     public void testDecodeSearchRequestSubstringFilterAnyInitial()
     {
         byte[] asn1BER = new byte[]
@@ -1638,6 +1659,7 @@
      * Test the decoding of a SearchRequest with a Substring filter Final before
      * initial
      */
+    @Test
     public void testDecodeSearchRequestSubstringFilterFinalInitial()
     {
         byte[] asn1BER = new byte[]
@@ -1681,6 +1703,7 @@
      * Test the decoding of a SearchRequest with a Substring filter Final before
      * any
      */
+    @Test
     public void testDecodeSearchRequestSubstringFilterFinalAny()
     {
         byte[] asn1BER = new byte[]
@@ -1723,6 +1746,7 @@
     /**
      * Test the decoding of a SearchRequest with a Substring filter Two initials
      */
+    @Test
     public void testDecodeSearchRequestSubstringFilterTwoInitials()
     {
         byte[] asn1BER = new byte[]
@@ -1765,6 +1789,7 @@
     /**
      * Test the decoding of a SearchRequest with a Substring filter Two finals
      */
+    @Test
     public void testDecodeSearchRequestSubstringFilterTwoFinals()
     {
         byte[] asn1BER = new byte[]

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java Sat Apr 11 01:03:00 2009
@@ -33,10 +33,10 @@
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.ldap.codec.AttributeValueAssertion;
-import org.apache.directory.shared.ldap.codec.Control;
+import org.apache.directory.shared.ldap.codec.ControlCodec;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
 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.search.AndFilter;
@@ -44,9 +44,9 @@
 import org.apache.directory.shared.ldap.codec.search.NotFilter;
 import org.apache.directory.shared.ldap.codec.search.OrFilter;
 import org.apache.directory.shared.ldap.codec.search.PresentFilter;
-import org.apache.directory.shared.ldap.codec.search.SearchRequest;
+import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
 import org.apache.directory.shared.ldap.codec.search.controls.subEntry.SubEntryControlCodec;
-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.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.filter.SearchScope;
@@ -166,8 +166,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -331,8 +331,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -506,8 +506,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -647,8 +647,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 3, message.getMessageId() );
         assertEquals( "ou=users,ou=system", sr.getBaseObject().toString() );
@@ -748,8 +748,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 3, message.getMessageId() );
         assertEquals( "ou=users,ou=system", sr.getBaseObject().toString() );
@@ -831,8 +831,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 3, message.getMessageId() );
         assertEquals( "ou=users,ou=system", sr.getBaseObject().toString() );
@@ -941,8 +941,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 33, message.getMessageId() );
         assertEquals( "dc=example,dc=com", sr.getBaseObject().toString() );
@@ -1077,22 +1077,22 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         assertEquals( 4, message.getMessageId() );
         assertEquals( 2, message.getControls().size() );
 
         // this is a constant in Java 5 API
         String pagedResultsControlOID = "1.2.840.113556.1.4.319";
-        Control pagedResultsControl = message.getControls( 0 );
+        ControlCodec pagedResultsControl = message.getControls( 0 );
         assertEquals( pagedResultsControlOID, pagedResultsControl.getControlType() );
         assertTrue( pagedResultsControl.getCriticality() );
 
         // this is a constant in Java 5 API
         String manageReferralControlOID = "2.16.840.1.113730.3.4.2";
-        Control manageReferralControl = message.getControls( 1 );
+        ControlCodec manageReferralControl = message.getControls( 1 );
         assertEquals( manageReferralControlOID, manageReferralControl.getControlType() );
 
-        SearchRequest sr = message.getSearchRequest();
+        SearchRequestCodec sr = message.getSearchRequest();
         assertEquals( "dc=my-domain,dc=com", sr.getBaseObject().toString() );
         assertEquals( SearchScope.SUBTREE, sr.getScope() );
         assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
@@ -1213,8 +1213,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -1336,18 +1336,18 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         assertEquals( 4, message.getMessageId() );
         assertEquals( 1, message.getControls().size() );
 
         // SubEntry Control
         String subEntryControlOID = "1.3.6.1.4.1.4203.1.10.1";
-        Control subEntryControl = message.getControls( 0 );
+        ControlCodec subEntryControl = message.getControls( 0 );
         assertEquals( subEntryControlOID, subEntryControl.getControlType() );
         assertTrue( subEntryControl.getCriticality() );
         assertTrue( ( ( SubEntryControlCodec ) subEntryControl.getControlValue() ).isVisible() );
 
-        SearchRequest sr = message.getSearchRequest();
+        SearchRequestCodec sr = message.getSearchRequest();
         assertEquals( "dc=my-domain,dc=com", sr.getBaseObject().toString() );
         assertEquals( SearchScope.SUBTREE, sr.getScope() );
         assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
@@ -1524,8 +1524,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "", sr.getBaseObject().toString() );
@@ -1681,7 +1681,7 @@
         catch ( DecoderException de )
         {
             assertTrue( de instanceof ResponseCarryingException );
-            Message response = ((ResponseCarryingException)de).getResponse();
+            InternalMessage response = ((ResponseCarryingException)de).getResponse();
             assertTrue( response instanceof SearchResponseDoneImpl );
             assertEquals( ResultCodeEnum.INVALID_DN_SYNTAX, ((SearchResponseDoneImpl)response).getLdapResult().getResultCode() );
             return;
@@ -2532,8 +2532,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 4, message.getMessageId() );
         assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -2615,8 +2615,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 4, message.getMessageId() );
         assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -2710,8 +2710,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 4, message.getMessageId() );
         assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -2960,8 +2960,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 2, message.getMessageId() );
         assertEquals( "dc=pgpkeys", sr.getBaseObject().toString() );
@@ -3072,8 +3072,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "a=b", sr.getBaseObject().toString() );
@@ -3174,8 +3174,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "a=b", sr.getBaseObject().toString() );
@@ -3288,8 +3288,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "a=b", sr.getBaseObject().toString() );
@@ -3406,8 +3406,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "a=b", sr.getBaseObject().toString() );
@@ -3527,8 +3527,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "a=b", sr.getBaseObject().toString() );
@@ -3657,8 +3657,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "a=b", sr.getBaseObject().toString() );
@@ -3792,8 +3792,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "a=b", sr.getBaseObject().toString() );
@@ -3939,8 +3939,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "a=b", sr.getBaseObject().toString() );
@@ -4081,8 +4081,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "a=b", sr.getBaseObject().toString() );
@@ -4223,8 +4223,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "a=b", sr.getBaseObject().toString() );
@@ -4372,8 +4372,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "a=b", sr.getBaseObject().toString() );
@@ -4487,8 +4487,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "", sr.getBaseObject().toString() );
@@ -4560,8 +4560,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 3, message.getMessageId() );
         assertEquals( "ou=users,ou=system", sr.getBaseObject().toString() );
@@ -4669,8 +4669,8 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr = message.getSearchRequest();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequestCodec sr = message.getSearchRequest();
 
         assertEquals( 6, message.getMessageId() );
         assertEquals( "ou=system", sr.getBaseObject().toString() );

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultDoneTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultDoneTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultDoneTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultDoneTest.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.search.SearchResultDone;
+import org.apache.directory.shared.ldap.codec.search.SearchResultDoneCodec;
 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,12 +45,13 @@
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SearchResultDoneTest extends TestCase
+public class SearchResultDoneTest
 {
 
     /**
      * Test the decoding of a SearchResultDone
      */
+    @Test
     public void testDecodeSearchResultDoneSuccess()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -86,8 +89,8 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultDone searchResultDone = message.getSearchResultDone();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchResultDoneCodec searchResultDone = message.getSearchResultDone();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, searchResultDone.getLdapResult().getResultCode() );
@@ -117,6 +120,7 @@
     /**
      * Test the decoding of a SearchResultDone with controls
      */
+    @Test
     public void testDecodeSearchResultDoneSuccessWithControls()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -158,8 +162,8 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultDone searchResultDone = message.getSearchResultDone();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchResultDoneCodec searchResultDone = message.getSearchResultDone();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, searchResultDone.getLdapResult().getResultCode() );
@@ -167,11 +171,11 @@
         assertEquals( "", searchResultDone.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() ) );
 
@@ -198,6 +202,7 @@
     /**
      * Test the decoding of a SearchResultDone with no LdapResult
      */
+    @Test
     public void testDecodeSearchResultDoneEmptyResult()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java Sat Apr 11 01:03:00 2009
@@ -29,16 +29,18 @@
 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.search.SearchResultEntry;
+import org.apache.directory.shared.ldap.codec.search.SearchResultEntryCodec;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 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 SearchResultEntryTest extends TestCase
+public class SearchResultEntryTest
 {
     /**
      * Test the decoding of a SearchResultEntry
      */
+    @Test
     public void testDecodeSearchResultEntrySuccess() throws NamingException
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -96,8 +99,8 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultEntry searchResultEntry = message.getSearchResultEntry();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchResultEntryCodec searchResultEntry = message.getSearchResultEntry();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName().toString() );
@@ -139,6 +142,7 @@
     /**
      * Test the decoding of a SearchResultEntry
      */
+    @Test
     public void testDecodeSearchResultEntry2AttrsSuccess() throws NamingException
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -190,8 +194,8 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultEntry searchResultEntry = message.getSearchResultEntry();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchResultEntryCodec searchResultEntry = message.getSearchResultEntry();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName().toString() );
@@ -236,6 +240,7 @@
      * Test the decoding of a SearchResultEntry with more bytes to be decoded at
      * the end
      */
+    @Test
     public void testDecodeSearchResultEntrySuccessWithFollowingMessage() throws NamingException
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -289,8 +294,8 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultEntry searchResultEntry = message.getSearchResultEntry();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchResultEntryCodec searchResultEntry = message.getSearchResultEntry();
 
         assertEquals( 2, message.getMessageId() );
         assertEquals( "uid=admin,ou=system", searchResultEntry.getObjectName().toString() );
@@ -345,6 +350,7 @@
     /**
      * Test the decoding of an empty SearchResultEntry
      */
+    @Test
     public void testDecodeSearchResultEntryEmpty()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -382,6 +388,7 @@
     /**
      * Test the decoding of an SearchResultEntry with an empty object name
      */
+    @Test
     public void testDecodeSearchResultEntryEmptyObjectName()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -421,6 +428,7 @@
     /**
      * Test the decoding of an SearchResultEntry with an object name alone
      */
+    @Test
     public void testDecodeSearchResultEntryObjectNameAlone()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -461,6 +469,7 @@
     /**
      * Test the decoding of an SearchResultEntry with an empty attributes
      */
+    @Test
     public void testDecodeSearchResultEntryEmptyAttributes()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -496,8 +505,8 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultEntry searchResultEntry = message.getSearchResultEntry();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchResultEntryCodec searchResultEntry = message.getSearchResultEntry();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName().toString() );
@@ -529,6 +538,7 @@
     /**
      * Test the decoding of an SearchResultEntry with an empty attributes list
      */
+    @Test
     public void testDecodeSearchResultEntryEmptyAttributeList()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -571,6 +581,7 @@
      * Test the decoding of an SearchResultEntry with an empty attributes list
      * with controls
      */
+    @Test
     public void testDecodeSearchResultEntryEmptyAttributeListWithControls()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -620,6 +631,7 @@
     /**
      * Test the decoding of a SearchResultEntry with an empty type
      */
+    @Test
     public void testDecodeSearchResultEntryEmptyType()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -665,6 +677,7 @@
     /**
      * Test the decoding of a SearchResultEntry with a type alone
      */
+    @Test
     public void testDecodeSearchResultEntryTypeAlone()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -710,6 +723,7 @@
     /**
      * Test the decoding of a SearchResultEntry with an empty vals
      */
+    @Test
     public void testDecodeSearchResultEntryEmptyVals() throws NamingException
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -749,8 +763,8 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultEntry searchResultEntry = message.getSearchResultEntry();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchResultEntryCodec searchResultEntry = message.getSearchResultEntry();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName().toString() );
@@ -790,6 +804,7 @@
     /**
      * Test the decoding of a SearchResultEntry with two empty vals
      */
+    @Test
     public void testDecodeSearchResultEntryEmptyVals2() throws NamingException
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -831,8 +846,8 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultEntry searchResultEntry = message.getSearchResultEntry();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchResultEntryCodec searchResultEntry = message.getSearchResultEntry();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName().toString() );
@@ -872,6 +887,7 @@
     /**
      * Test the decoding of a SearchResultEntry with an empty vals with controls
      */
+    @Test
     public void testDecodeSearchResultEntryEmptyValsWithControls() throws NamingException
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -914,8 +930,8 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultEntry searchResultEntry = message.getSearchResultEntry();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchResultEntryCodec searchResultEntry = message.getSearchResultEntry();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName().toString() );
@@ -934,11 +950,11 @@
         }
 
         // 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() ) );
 
@@ -965,6 +981,7 @@
     /**
      * Test the decoding of a SearchResultEntry with an empty attribute value
      */
+    @Test
     public void testDecodeSearchResultEntryEmptyAttributeValue() throws NamingException
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -1006,8 +1023,8 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultEntry searchResultEntry = message.getSearchResultEntry();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchResultEntryCodec searchResultEntry = message.getSearchResultEntry();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName().toString() );
@@ -1049,6 +1066,7 @@
      * Test the decoding of a SearchResultEntry with an empty attribute value
      * with controls
      */
+    @Test
     public void testDecodeSearchResultEntryEmptyAttributeValueWithControls() throws NamingException
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -1092,8 +1110,8 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultEntry searchResultEntry = message.getSearchResultEntry();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchResultEntryCodec searchResultEntry = message.getSearchResultEntry();
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName().toString() );
@@ -1112,11 +1130,11 @@
         }
 
         // 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/search/SearchResultReferenceTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultReferenceTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultReferenceTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultReferenceTest.java Sat Apr 11 01:03:00 2009
@@ -29,16 +29,18 @@
 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.search.SearchResultReference;
+import org.apache.directory.shared.ldap.codec.search.SearchResultReferenceCodec;
 import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
 import org.apache.directory.shared.ldap.util.LdapURL;
 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 SearchResultReferenceTest extends TestCase
+public class SearchResultReferenceTest
 {
     /**
      * Test the decoding of a SearchResultReference
      */
+    @Test
     public void testDecodeSearchResultReferenceSuccess()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -114,8 +117,8 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultReference searchResultReference = message.getSearchResultReference();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchResultReferenceCodec searchResultReference = message.getSearchResultReference();
 
         assertEquals( 1, message.getMessageId() );
 
@@ -170,6 +173,7 @@
     /**
      * Test the decoding of a SearchResultReference with controls
      */
+    @Test
     public void testDecodeSearchResultReferenceSuccessWithControls()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -246,8 +250,8 @@
         
         stream.flip();
         
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultReference searchResultReference = message.getSearchResultReference();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchResultReferenceCodec searchResultReference = message.getSearchResultReference();
 
         assertEquals( 1, message.getMessageId() );
 
@@ -280,11 +284,11 @@
         assertTrue( ldapUrlsSet.size() == 0 );
 
         // 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() ) );
 
@@ -311,6 +315,7 @@
     /**
      * Test the decoding of a SearchResultReference with no reference
      */
+    @Test
     public void testDecodeSearchResultReferenceNoReference()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -350,6 +355,7 @@
     /**
      * Test the decoding of a SearchResultReference with one reference
      */
+    @Test
     public void testDecodeSearchResultReferenceOneReference()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -388,8 +394,8 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultReference searchResultReference = message.getSearchResultReference();
+        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchResultReferenceCodec searchResultReference = message.getSearchResultReference();
 
         assertEquals( 1, message.getMessageId() );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java Sat Apr 11 01:03:00 2009
@@ -31,9 +31,10 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.junit.Test;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.junit.Assert.assertNull;
 
 
 /**
@@ -41,7 +42,7 @@
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class EntryChangeControlTest extends TestCase
+public class EntryChangeControlTest
 {
     /**
      * Test the decoding of a EntryChangeControl
@@ -70,7 +71,7 @@
         catch ( DecoderException de )
         {
             de.printStackTrace();
-            Assert.fail( de.getMessage() );
+            fail( de.getMessage() );
         }
 
         EntryChangeControlCodec entryChange = container.getEntryChangeControl();
@@ -108,7 +109,7 @@
         catch ( DecoderException de )
         {
             de.printStackTrace();
-            Assert.fail( de.getMessage() );
+            fail( de.getMessage() );
         }
 
         EntryChangeControlCodec entryChange = container.getEntryChangeControl();
@@ -145,7 +146,7 @@
         catch ( DecoderException de )
         {
             de.printStackTrace();
-            Assert.fail( de.getMessage() );
+            fail( de.getMessage() );
         }
 
         EntryChangeControlCodec entryChange = container.getEntryChangeControl();
@@ -190,7 +191,7 @@
             return;
         }
 
-        Assert.fail( "A ADD operation should not have a PreviousDN" );
+        fail( "A ADD operation should not have a PreviousDN" );
     }
 
 
@@ -221,7 +222,7 @@
         catch ( DecoderException de )
         {
             de.printStackTrace();
-            Assert.fail( de.getMessage() );
+            fail( de.getMessage() );
         }
 
         EntryChangeControlCodec entryChange = container.getEntryChangeControl();
@@ -263,7 +264,7 @@
             return;
         }
 
-        Assert.fail( "The changeType is unknown" );
+        fail( "The changeType is unknown" );
     }
 
 
@@ -301,7 +302,7 @@
             return;
         }
 
-        Assert.fail( "The changeNumber is incorrect" );
+        fail( "The changeNumber is incorrect" );
     }
 
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlTest.java Sat Apr 11 01:03:00 2009
@@ -28,9 +28,11 @@
 import org.apache.directory.shared.ldap.codec.search.controls.pSearch.PSearchControlContainer;
 import org.apache.directory.shared.ldap.codec.search.controls.pSearch.PSearchControlDecoder;
 import org.apache.directory.shared.ldap.util.StringTools;
+import org.junit.Test;
 
-import junit.framework.Assert;
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 
 /**
@@ -38,11 +40,12 @@
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class PSearchControlTest extends TestCase
+public class PSearchControlTest
 {
     /**
      * Test encoding of a PSearchControl.
      */
+    @Test
     public void testEncodePSearchControl() throws Exception
     {
         ByteBuffer bb = ByteBuffer.allocate( 0x0b );
@@ -69,6 +72,7 @@
     /**
      * Test the decoding of a PSearchControl with combined changes types
      */
+    @Test
     public void testDecodeModifyDNRequestSuccessChangeTypesAddModDN()
     {
         Asn1Decoder decoder = new PSearchControlDecoder();
@@ -89,7 +93,7 @@
         }
         catch ( DecoderException de )
         {
-            Assert.fail( de.getMessage() );
+            fail( de.getMessage() );
         }
 
         PSearchControlCodec control = container.getPSearchControl();
@@ -104,6 +108,7 @@
      * Test the decoding of a PSearchControl with a changes types which
      * value is 0
      */
+    @Test
     public void testDecodeModifyDNRequestSuccessChangeTypes0()
     {
         Asn1Decoder decoder = new PSearchControlDecoder();
@@ -133,6 +138,7 @@
      * Test the decoding of a PSearchControl with a changes types which
      * value is above 15
      */
+    @Test
     public void testDecodeModifyDNRequestSuccessChangeTypes22()
     {
         Asn1Decoder decoder = new PSearchControlDecoder();
@@ -161,6 +167,7 @@
     /**
      * Test the decoding of a PSearchControl with a null sequence
      */
+    @Test
     public void testDecodeModifyDNRequestSuccessNullSequence()
     {
         Asn1Decoder decoder = new PSearchControlDecoder();
@@ -186,6 +193,7 @@
     /**
      * Test the decoding of a PSearchControl without changeTypes
      */
+    @Test
     public void testDecodeModifyDNRequestSuccessWithoutChangeTypes()
     {
         Asn1Decoder decoder = new PSearchControlDecoder();
@@ -213,6 +221,7 @@
     /**
      * Test the decoding of a PSearchControl without changeOnly
      */
+    @Test
     public void testDecodeModifyDNRequestSuccessWithoutChangesOnly()
     {
         Asn1Decoder decoder = new PSearchControlDecoder();
@@ -240,6 +249,7 @@
     /**
      * Test the decoding of a PSearchControl without returnECs
      */
+    @Test
     public void testDecodeModifyDNRequestSuccessWithoutReturnECs()
     {
         Asn1Decoder decoder = new PSearchControlDecoder();

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java Sat Apr 11 01:03:00 2009
@@ -30,9 +30,10 @@
 import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedSearchControlDecoder;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.junit.Test;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.junit.Assert.assertNotNull;
 
 
 /**
@@ -40,7 +41,7 @@
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class PagedSearchControlTest extends TestCase
+public class PagedSearchControlTest
 {
     /**
      * Test encoding of a PagedSearchControl.
@@ -67,7 +68,7 @@
         catch ( DecoderException de )
         {
             de.printStackTrace();
-            Assert.fail( de.getMessage() );
+            fail( de.getMessage() );
         }
 
         PagedSearchControlCodec pagedSearch = container.getPagedSearchControl();
@@ -198,7 +199,7 @@
         catch ( DecoderException de )
         {
             de.printStackTrace();
-            Assert.fail( de.getMessage() );
+            fail( de.getMessage() );
         }
 
         PagedSearchControlCodec pagedSearch = container.getPagedSearchControl();
@@ -274,7 +275,7 @@
         catch ( DecoderException de )
         {
             de.printStackTrace();
-            Assert.fail( de.getMessage() );
+            fail( de.getMessage() );
         }
 
         PagedSearchControlCodec pagedSearch = container.getPagedSearchControl();

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlTest.java Sat Apr 11 01:03:00 2009
@@ -28,9 +28,10 @@
 import org.apache.directory.shared.ldap.codec.search.controls.subEntry.SubEntryControlCodec;
 import org.apache.directory.shared.ldap.codec.search.controls.subEntry.SubEntryControlContainer;
 import org.apache.directory.shared.ldap.codec.search.controls.subEntry.SubEntryControlDecoder;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.junit.Assert.assertFalse;
 
 
 /**
@@ -38,11 +39,12 @@
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SubEntryControlTest extends TestCase
+public class SubEntryControlTest
 {
     /**
      * Test the decoding of a SubEntryControl with a true visibility
      */
+    @Test
     public void testDecodeSubEntryVisibilityTrue()
     {
         Asn1Decoder decoder = new SubEntryControlDecoder();
@@ -60,7 +62,7 @@
         catch ( DecoderException de )
         {
             de.printStackTrace();
-            Assert.fail( de.getMessage() );
+            fail( de.getMessage() );
         }
 
         SubEntryControlCodec control = container.getSubEntryControl();
@@ -71,6 +73,7 @@
     /**
      * Test the decoding of a SubEntryControl with a false visibility
      */
+    @Test
     public void testDecodeSubEntryVisibilityFalse()
     {
         Asn1Decoder decoder = new SubEntryControlDecoder();
@@ -88,7 +91,7 @@
         catch ( DecoderException de )
         {
             de.printStackTrace();
-            Assert.fail( de.getMessage() );
+            fail( de.getMessage() );
         }
 
         SubEntryControlCodec control = container.getSubEntryControl();
@@ -99,6 +102,7 @@
     /**
      * Test the decoding of a SubEntryControl with an empty visibility
      */
+    @Test
     public void testDecodeSubEntryEmptyVisibility()
     {
         Asn1Decoder decoder = new SubEntryControlDecoder();
@@ -129,6 +133,7 @@
     /**
      * Test the decoding of a bad SubEntryControl
      */
+    @Test
     public void testDecodeSubEntryBad()
     {
         Asn1Decoder decoder = new SubEntryControlDecoder();

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/unbind/UnBindRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/unbind/UnBindRequestTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/unbind/UnBindRequestTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/unbind/UnBindRequestTest.java Sat Apr 11 01:03:00 2009
@@ -27,23 +27,26 @@
 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.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 UnBindRequestTest extends TestCase
+public class UnBindRequestTest
 {
     /**
      * Test the decoding of a UnBindRequest with no controls
      */
+    @Test
     public void testDecodeUnBindRequestNoControls()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -73,7 +76,7 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage ldapMessage = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        LdapMessageCodec ldapMessage = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
 
         assertEquals( 1, ldapMessage.getMessageId() );
 
@@ -99,6 +102,7 @@
     /**
      * Test the decoding of a UnBindRequest with controls
      */
+    @Test
     public void testDecodeUnBindRequestWithControls()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
@@ -133,16 +137,16 @@
             fail( de.getMessage() );
         }
 
-        LdapMessage ldapMessage = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        LdapMessageCodec ldapMessage = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
 
         assertEquals( 1, ldapMessage.getMessageId() );
 
         // Check the Control
-        List<Control> controls = ldapMessage.getControls();
+        List<ControlCodec> controls = ldapMessage.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = ldapMessage.getControls( 0 );
+        ControlCodec control = ldapMessage.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getControlType() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getControlValue() ) );
 
@@ -168,6 +172,7 @@
     /**
      * Test the decoding of a UnBindRequest with a not null body
      */
+    @Test
     public void testDecodeUnBindRequestNotNull()
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/filter/BranchNormalizedVisitorTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/filter/BranchNormalizedVisitorTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/filter/BranchNormalizedVisitorTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/filter/BranchNormalizedVisitorTest.java Sat Apr 11 01:03:00 2009
@@ -22,8 +22,10 @@
 
 import org.apache.directory.shared.ldap.filter.BranchNormalizedVisitor;
 import org.apache.directory.shared.ldap.filter.ExprNode;
-
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 
 /**
@@ -32,8 +34,9 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class BranchNormalizedVisitorTest extends TestCase
+public class BranchNormalizedVisitorTest
 {
+    @Test
     public void testBranchNormalizedVisitor0() throws Exception
     {
         String filter = "(ou=Human Resources)";
@@ -50,6 +53,7 @@
     }
 
 
+    @Test
     public void testBranchNormalizedVisitor1() throws Exception
     {
         String filter = "(&(ou=Human Resources)(uid=akarasulu))";
@@ -66,6 +70,7 @@
     }
 
 
+    @Test
     public void testBranchNormalizedVisitor2() throws Exception
     {
         String filter = "(&(uid=akarasulu)(ou=Human Resources)";
@@ -84,6 +89,7 @@
     }
 
 
+    @Test
     public void testBranchNormalizedVisitor3() throws Exception
     {
         String filter = "(&(ou=Human Resources)(uid=akarasulu)";
@@ -102,6 +108,7 @@
     }
 
 
+    @Test
     public void testBranchNormalizedComplex() throws Exception
     {
         String filter1 = "(&(a=A)(|(b=B)(c=C)))";

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterNodeEqualityTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterNodeEqualityTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterNodeEqualityTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterNodeEqualityTest.java Sat Apr 11 01:03:00 2009
@@ -21,8 +21,9 @@
 
 
 import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
-
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 
 
 /**
@@ -31,8 +32,9 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 575783 $
  */
-public class FilterNodeEqualityTest extends TestCase
+public class FilterNodeEqualityTest
 {
+    @Test
     public void testEqualityEquals()
     {
         EqualityNode<String> eqNode1 = new EqualityNode<String>( "attr1", new ClientStringValue( "test" ) );
@@ -56,6 +58,7 @@
     }
 
 
+    @Test
     public void testGreaterEqEquals()
     {
         GreaterEqNode<String> greaterEqNode1 = new GreaterEqNode<String>( "attr1", new ClientStringValue( "test" ) );
@@ -72,6 +75,7 @@
     }
 
 
+    @Test
     public void testLessEqEquals()
     {
         LessEqNode<String> lessEqNode1 = new LessEqNode<String>( "attr1", new ClientStringValue( "test" ) );
@@ -87,6 +91,7 @@
     }
 
 
+    @Test
     public void testApproximateEqEquals()
     {
         ApproximateNode<String> approximateNode1 = new ApproximateNode<String>( "attr1", new ClientStringValue( "test" ) );
@@ -104,6 +109,7 @@
     }
 
 
+    @Test
     public void testPresenceEquals()
     {
         PresenceNode presenceNode1 = new PresenceNode( "attr1" );
@@ -116,6 +122,7 @@
     }
 
 
+    @Test
     public void testSubstringEquals()
     {
     }

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java Sat Apr 11 01:03:00 2009
@@ -27,8 +27,6 @@
 import java.io.UnsupportedEncodingException;
 import java.util.List;
 
-import junit.framework.TestCase;
-
 import javax.naming.ldap.Control;
 import javax.naming.NamingException;
 
@@ -37,19 +35,27 @@
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.util.StringTools;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.fail;
 
 /**
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 379008 $
  */
-public class LdifReaderTest extends TestCase
+public class LdifReaderTest
 {
-    private byte[] data;
+    private static byte[] data;
     
-    private File HJENSEN_JPEG_FILE = null;
-    private File FIONA_JPEG_FILE = null;
+    private static File HJENSEN_JPEG_FILE = null;
+    private static File FIONA_JPEG_FILE = null;
     
-    private File createFile( String name, byte[] data ) throws IOException
+    private static File createFile( String name, byte[] data ) throws IOException
     {
         File jpeg = File.createTempFile( name, "jpg" );
         
@@ -70,10 +76,9 @@
     /**
      * Create a file to be used by ":<" values
      */
-    public void setUp() throws Exception
+   @BeforeClass
+    public static void setUp() throws Exception
     {
-        super.setUp();
-
         data = new byte[256];
 
         for ( int i = 0; i < 256; i++ )
@@ -85,6 +90,7 @@
         FIONA_JPEG_FILE = createFile( "fiona", data );
     }
 
+    @Test
     public void testLdifNull() throws NamingException
     {
         String ldif = null;
@@ -95,6 +101,7 @@
         assertEquals( 0, entries.size() );
     }
 
+    @Test
     public void testLdifEmpty() throws NamingException
     {
         String ldif = "";
@@ -105,6 +112,7 @@
         assertEquals( 0, entries.size() );
     }
 
+    @Test
     public void testLdifEmptyLines() throws NamingException
     {
         String ldif = "\n\n\r\r\n";
@@ -115,6 +123,7 @@
         assertEquals( 0, entries.size() );
     }
 
+    @Test
     public void testLdifComments() throws NamingException
     {
         String ldif = 
@@ -130,6 +139,7 @@
         assertEquals( 0, entries.size() );
     }
 
+    @Test
     public void testLdifVersion() throws NamingException
     {
         String ldif = 
@@ -149,6 +159,7 @@
         assertEquals( 1, reader.getVersion() );
     }
 
+    @Test
     public void testLdifVersionStart() throws NamingException
     {
         String ldif = 
@@ -184,6 +195,7 @@
      * Test the ldif parser with a file without a version. It should default to 1
      * @throws NamingException
      */
+    @Test
     public void testLdifWithoutVersion() throws NamingException
     {
         String ldif = 
@@ -206,6 +218,7 @@
      * 
      * @throws NamingException
      */
+    @Test
     public void testLdifParserEndSpaces() throws NamingException
     {
         String ldif = 
@@ -234,6 +247,7 @@
 
     }
 
+    @Test
     public void testLdifParserAddAttrCaseInsensitiveAttrId() throws NamingException
     {
         // test that mixed case attr ids work at all
@@ -259,7 +273,7 @@
         testReaderAttrIdCaseInsensitive( ldif );
     }
 
-    public void testReaderAttrIdCaseInsensitive( String ldif )
+    private void testReaderAttrIdCaseInsensitive( String ldif )
             throws NamingException
     {
         LdifReader reader = new LdifReader();
@@ -285,6 +299,7 @@
      * 
      * @throws NamingException
      */
+    @Test
     public void testLdifParserCombinedEntriesChanges()
     {
         String ldif = 
@@ -323,6 +338,7 @@
      * 
      * @throws NamingException
      */
+    @Test
     public void testLdifParserCombinedEntriesChanges2()
     {
         String ldif = 
@@ -360,6 +376,7 @@
      * 
      * @throws NamingException
      */
+    @Test
     public void testLdifParserCombinedChangesEntries()
     {
         String ldif = 
@@ -398,6 +415,7 @@
      * 
      * @throws NamingException
      */
+    @Test
     public void testLdifParserCombinedChangesEntries2()
     {
         String ldif = 
@@ -430,6 +448,7 @@
         }
     }
 
+    @Test
     public void testLdifParser() throws NamingException
     {
         String ldif = 
@@ -469,6 +488,7 @@
         assertNull( attr.get().get() );
     }
 
+    @Test
     public void testLdifParserMuiltiLineComments() throws NamingException
     {
         String ldif = 
@@ -512,6 +532,7 @@
         assertNull( attr.get().get() );
     }
 
+    @Test
     public void testLdifParserMultiLineEntries() throws NamingException
     {
         String ldif = 
@@ -555,6 +576,7 @@
         assertNull( attr.get().get() );
     }
 
+    @Test
     public void testLdifParserBase64() throws NamingException, UnsupportedEncodingException
     {
         String ldif = 
@@ -597,6 +619,7 @@
         assertNull( attr.get().get() );
     }
 
+    @Test
     public void testLdifParserBase64MultiLine() throws NamingException, UnsupportedEncodingException
     {
         String ldif = 
@@ -640,6 +663,7 @@
         assertNull( attr.get().get() );
     }
 
+    @Test
     public void testLdifParserRFC2849Sample1() throws NamingException
     {
         String ldif = 
@@ -719,6 +743,7 @@
         assertTrue( attr.contains( "+1 408 555 1212" ) );
     }
 
+    @Test
     public void testLdifParserRFC2849Sample2() throws NamingException
     {
         String ldif = 
@@ -776,6 +801,7 @@
 
     }
 
+    @Test
     public void testLdifParserRFC2849Sample3() throws NamingException, Exception
     {
         String ldif = 
@@ -829,6 +855,7 @@
                         .getBytes( "UTF-8" ) ) );
     }
 
+    @Test
     public void testLdifParserRFC2849Sample3VariousSpacing() throws NamingException, Exception
     {
         String ldif = 
@@ -882,6 +909,7 @@
                         .getBytes( "UTF-8" ) ) );
     }
 
+    @Test
     public void testLdifParserRFC2849Sample4() throws NamingException, Exception
     {
         String ldif = 
@@ -1014,6 +1042,7 @@
         }
     }
 
+    @Test
     public void testLdifParserRFC2849Sample5() throws NamingException, Exception
     {
         String ldif = 
@@ -1079,6 +1108,7 @@
         }
     }
 
+    @Test
     public void testLdifParserRFC2849Sample5WithSizeLimit() throws Exception
     {
         String ldif = 
@@ -1108,6 +1138,7 @@
         }
     }
 
+    @Test
     public void testLdifParserRFC2849Sample6() throws NamingException, Exception
     {
         String ldif = 
@@ -1337,6 +1368,7 @@
         assertEquals( values[5][2][0], item.getAttribute().getId() );
     }
 
+    @Test
     public void testLdifParserRFC2849Sample7() throws NamingException, Exception
     {
         String ldif = 
@@ -1364,6 +1396,7 @@
         assertTrue( control.isCritical() );
     }
 
+    @Test
     public void testLdifParserRFC2849Sample7NoValueNoCritical() throws NamingException, Exception
     {
         String ldif = 
@@ -1391,6 +1424,7 @@
         assertFalse( control.isCritical() );
     }
 
+    @Test
     public void testLdifParserRFC2849Sample7NoCritical() throws NamingException, Exception
     {
         String ldif = 
@@ -1419,6 +1453,7 @@
         assertEquals( "control-value", StringTools.utf8ToString( control.getEncodedValue() ) );
     }
 
+    @Test
     public void testLdifParserRFC2849Sample7NoOid() throws Exception
     {
         String ldif = 
@@ -1444,6 +1479,7 @@
         }
     }
 
+    @Test
     public void testLdifParserRFC2849Sample7BadOid() throws Exception
     {
         String ldif = 
@@ -1470,6 +1506,7 @@
     }
 
     
+    @Test
     public void testLdifReaderDirServer() throws NamingException, Exception
     {
         String ldif = 
@@ -1520,6 +1557,7 @@
     }
 
     
+    @Test
     public void testLdifParserCommentsEmptyLines() throws NamingException, Exception
     {
         String ldif = 



Mime
View raw message