directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r910150 [10/11] - in /directory: apacheds/trunk/ apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/c...
Date Mon, 15 Feb 2010 01:37:47 GMT
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=910150&r1=910149&r2=910150&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 Mon Feb 15 01:37:34 2010
@@ -39,7 +39,6 @@
 import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.ldap.codec.AttributeValueAssertion;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
-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.controls.subentries.SubentriesControl;
@@ -176,19 +175,18 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.ONELEVEL, sr.getScope() );
-        assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
-        assertEquals( 1000, sr.getSizeLimit() );
-        assertEquals( 1000, sr.getTimeLimit() );
-        assertEquals( true, sr.isTypesOnly() );
+        assertEquals( 1, searchRequest.getMessageId() );
+        assertEquals( "uid=akarasulu,dc=example,dc=com", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.ONELEVEL, searchRequest.getScope() );
+        assertEquals( LdapConstants.DEREF_ALWAYS, searchRequest.getDerefAliases() );
+        assertEquals( 1000, searchRequest.getSizeLimit() );
+        assertEquals( 1000, searchRequest.getTimeLimit() );
+        assertEquals( true, searchRequest.isTypesOnly() );
 
         // (& (...
-        AndFilter andFilter = ( AndFilter ) sr.getFilter();
+        AndFilter andFilter = ( AndFilter ) searchRequest.getFilter();
         assertNotNull( andFilter );
 
         List<Filter> andFilters = andFilter.getAndFilter();
@@ -234,7 +232,7 @@
         assertEquals( "objectclass", assertion.getAttributeDesc() );
         assertEquals( "ttt", assertion.getAssertionValue().getString() );
 
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
 
         for ( EntryAttribute attribute:attributes )
         {
@@ -246,7 +244,7 @@
         // attributes may have been reordered
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -341,19 +339,18 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.ONELEVEL, sr.getScope() );
-        assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
-        assertEquals( 1000, sr.getSizeLimit() );
-        assertEquals( 1000, sr.getTimeLimit() );
-        assertEquals( true, sr.isTypesOnly() );
+        assertEquals( 1, searchRequest.getMessageId() );
+        assertEquals( "uid=akarasulu,dc=example,dc=com", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.ONELEVEL, searchRequest.getScope() );
+        assertEquals( LdapConstants.DEREF_ALWAYS, searchRequest.getDerefAliases() );
+        assertEquals( 1000, searchRequest.getSizeLimit() );
+        assertEquals( 1000, searchRequest.getTimeLimit() );
+        assertEquals( true, searchRequest.isTypesOnly() );
 
         // (& (...
-        AndFilter andFilter = ( AndFilter ) sr.getFilter();
+        AndFilter andFilter = ( AndFilter ) searchRequest.getFilter();
         assertNotNull( andFilter );
 
         List<Filter> andFilters = andFilter.getAndFilter();
@@ -400,7 +397,7 @@
         assertEquals( "ttt", assertion.getAssertionValue().getString() );
 
         // The attributes
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
 
         for ( EntryAttribute attribute:attributes )
         {
@@ -408,14 +405,14 @@
         }
 
         // Check the length
-        assertEquals( 0x90, message.computeLength() );
+        assertEquals( 0x90, searchRequest.computeLength() );
 
         // Check the encoding
         // We won't check the whole PDU, as it may differs because
         // attributes may have been reordered
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -516,19 +513,18 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.ONELEVEL, sr.getScope() );
-        assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
-        assertEquals( 1000, sr.getSizeLimit() );
-        assertEquals( 1000, sr.getTimeLimit() );
-        assertEquals( true, sr.isTypesOnly() );
+        assertEquals( 1, searchRequest.getMessageId() );
+        assertEquals( "uid=akarasulu,dc=example,dc=com", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.ONELEVEL, searchRequest.getScope() );
+        assertEquals( LdapConstants.DEREF_ALWAYS, searchRequest.getDerefAliases() );
+        assertEquals( 1000, searchRequest.getSizeLimit() );
+        assertEquals( 1000, searchRequest.getTimeLimit() );
+        assertEquals( true, searchRequest.isTypesOnly() );
 
         // (& (...
-        AndFilter andFilter = ( AndFilter ) sr.getFilter();
+        AndFilter andFilter = ( AndFilter ) searchRequest.getFilter();
         assertNotNull( andFilter );
 
         List<Filter> andFilters = andFilter.getAndFilter();
@@ -568,7 +564,7 @@
         assertEquals( "ttt", assertion.getAssertionValue().getString() );
 
         // The attributes
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
 
         for ( EntryAttribute attribute:attributes )
         {
@@ -576,14 +572,14 @@
         }
 
         // Check the length
-        assertEquals( 0x7B, message.computeLength() );
+        assertEquals( 0x7B, searchRequest.computeLength() );
 
         // Check the encoding
         // We won't check the whole PDU, as it may differs because
         // attributes may have been reordered
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -657,34 +653,33 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 3, message.getMessageId() );
-        assertEquals( "ou=users,ou=system", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.OBJECT, sr.getScope() );
-        assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
-        assertEquals( 0, sr.getSizeLimit() );
-        assertEquals( 0, sr.getTimeLimit() );
-        assertEquals( false, sr.isTypesOnly() );
+        assertEquals( 3, searchRequest.getMessageId() );
+        assertEquals( "ou=users,ou=system", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.OBJECT, searchRequest.getScope() );
+        assertEquals( LdapConstants.DEREF_ALWAYS, searchRequest.getDerefAliases() );
+        assertEquals( 0, searchRequest.getSizeLimit() );
+        assertEquals( 0, searchRequest.getTimeLimit() );
+        assertEquals( false, searchRequest.isTypesOnly() );
 
         // (objectClass = *)
-        PresentFilter presentFilter = ( PresentFilter ) sr.getFilter();
+        PresentFilter presentFilter = ( PresentFilter ) searchRequest.getFilter();
         assertNotNull( presentFilter );
         assertEquals( "objectClass", presentFilter.getAttributeDescription() );
 
         // The attributes
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
 
         assertEquals( 0, attributes.size() );
 
         // Check the length
-        assertEquals( 0x39, message.computeLength() );
+        assertEquals( 0x39, searchRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -758,24 +753,23 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 3, message.getMessageId() );
-        assertEquals( "ou=users,ou=system", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.OBJECT, sr.getScope() );
-        assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
-        assertEquals( 0, sr.getSizeLimit() );
-        assertEquals( 0, sr.getTimeLimit() );
-        assertEquals( false, sr.isTypesOnly() );
+        assertEquals( 3, searchRequest.getMessageId() );
+        assertEquals( "ou=users,ou=system", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.OBJECT, searchRequest.getScope() );
+        assertEquals( LdapConstants.DEREF_ALWAYS, searchRequest.getDerefAliases() );
+        assertEquals( 0, searchRequest.getSizeLimit() );
+        assertEquals( 0, searchRequest.getTimeLimit() );
+        assertEquals( false, searchRequest.isTypesOnly() );
 
         // (objectClass = *)
-        PresentFilter presentFilter = ( PresentFilter ) sr.getFilter();
+        PresentFilter presentFilter = ( PresentFilter ) searchRequest.getFilter();
         assertNotNull( presentFilter );
         assertEquals( "objectClass", presentFilter.getAttributeDescription() );
 
         // The attributes
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
 
         assertEquals( 1, attributes.size() );
     }
@@ -841,24 +835,23 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 3, message.getMessageId() );
-        assertEquals( "ou=users,ou=system", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.OBJECT, sr.getScope() );
-        assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
-        assertEquals( 0, sr.getSizeLimit() );
-        assertEquals( 0, sr.getTimeLimit() );
-        assertEquals( false, sr.isTypesOnly() );
+        assertEquals( 3, searchRequest.getMessageId() );
+        assertEquals( "ou=users,ou=system", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.OBJECT, searchRequest.getScope() );
+        assertEquals( LdapConstants.DEREF_ALWAYS, searchRequest.getDerefAliases() );
+        assertEquals( 0, searchRequest.getSizeLimit() );
+        assertEquals( 0, searchRequest.getTimeLimit() );
+        assertEquals( false, searchRequest.isTypesOnly() );
 
         // (objectClass = *)
-        PresentFilter presentFilter = ( PresentFilter ) sr.getFilter();
+        PresentFilter presentFilter = ( PresentFilter ) searchRequest.getFilter();
         assertNotNull( presentFilter );
         assertEquals( "objectClass", presentFilter.getAttributeDescription() );
 
         // The attributes
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
 
         assertEquals( 2, attributes.size() );
         Set<String> expectedAttrs = new HashSet<String>();
@@ -951,19 +944,18 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 33, message.getMessageId() );
-        assertEquals( "dc=example,dc=com", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.OBJECT, sr.getScope() );
-        assertEquals( LdapConstants.DEREF_FINDING_BASE_OBJ, sr.getDerefAliases() );
-        assertEquals( 2, sr.getSizeLimit() );
-        assertEquals( 3, sr.getTimeLimit() );
-        assertEquals( true, sr.isTypesOnly() );
+        assertEquals( 33, searchRequest.getMessageId() );
+        assertEquals( "dc=example,dc=com", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.OBJECT, searchRequest.getScope() );
+        assertEquals( LdapConstants.DEREF_FINDING_BASE_OBJ, searchRequest.getDerefAliases() );
+        assertEquals( 2, searchRequest.getSizeLimit() );
+        assertEquals( 3, searchRequest.getTimeLimit() );
+        assertEquals( true, searchRequest.isTypesOnly() );
 
         // (objectclass=t*)
-        OrFilter orFilter = ( OrFilter ) sr.getFilter();
+        OrFilter orFilter = ( OrFilter ) searchRequest.getFilter();
         assertNotNull( orFilter );
         assertEquals( 5, orFilter.getFilterSet().size() );
 
@@ -999,7 +991,7 @@
         assertEquals( "abok", assertion.getAssertionValue().getString() );
 
         // The attributes
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
 
         for ( EntryAttribute attribute:attributes )
         {
@@ -1007,14 +999,14 @@
         }
 
         // Check the length
-        assertEquals( 0x96, message.computeLength() );
+        assertEquals( 0x96, searchRequest.computeLength() );
 
         // Check the encoding
         // We won't check the whole PDU, as it may differs because
         // attributes may have been reordered
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -1087,37 +1079,36 @@
         }
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        assertEquals( 4, message.getMessageId() );
-        assertEquals( 2, message.getControls().size() );
+        assertEquals( 4, searchRequest.getMessageId() );
+        assertEquals( 2, searchRequest.getControls().size() );
 
         // this is a constant in Java 5 API
         String pagedResultsControlOID = "1.2.840.113556.1.4.319";
-        Control pagedResultsControl = message.getControls( 0 );
+        Control pagedResultsControl = searchRequest.getControls( 0 );
         assertEquals( pagedResultsControlOID, pagedResultsControl.getOid() );
         assertTrue( pagedResultsControl.isCritical() );
 
         // this is a constant in Java 5 API
         String manageReferralControlOID = "2.16.840.1.113730.3.4.2";
-        Control manageReferralControl = message.getControls( 1 );
+        Control manageReferralControl = searchRequest.getControls( 1 );
         assertEquals( manageReferralControlOID, manageReferralControl.getOid() );
 
-        SearchRequestCodec sr = message.getSearchRequest();
-        assertEquals( "dc=my-domain,dc=com", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.SUBTREE, sr.getScope() );
-        assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
-        assertEquals( 0, sr.getSizeLimit() );
-        assertEquals( 0, sr.getTimeLimit() );
-        assertEquals( false, sr.isTypesOnly() );
+        assertEquals( "dc=my-domain,dc=com", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.SUBTREE, searchRequest.getScope() );
+        assertEquals( LdapConstants.DEREF_ALWAYS, searchRequest.getDerefAliases() );
+        assertEquals( 0, searchRequest.getSizeLimit() );
+        assertEquals( 0, searchRequest.getTimeLimit() );
+        assertEquals( false, searchRequest.isTypesOnly() );
 
-        assertTrue( sr.getFilter() instanceof PresentFilter );
-        assertEquals( "objectClass", ( ( PresentFilter ) sr.getFilter() ).getAttributeDescription() );
+        assertTrue( searchRequest.getFilter() instanceof PresentFilter );
+        assertEquals( "objectClass", ( ( PresentFilter ) searchRequest.getFilter() ).getAttributeDescription() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchRequest.encode();
             String encodedPdu = StringTools.dumpBytes( bb.array() );
             assertEquals( decodedPdu, encodedPdu );
         }
@@ -1224,19 +1215,18 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.ONELEVEL, sr.getScope() );
-        assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
-        assertEquals( 1000, sr.getSizeLimit() );
-        assertEquals( 1000, sr.getTimeLimit() );
-        assertEquals( true, sr.isTypesOnly() );
+        assertEquals( 1, searchRequest.getMessageId() );
+        assertEquals( "uid=akarasulu,dc=example,dc=com", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.ONELEVEL, searchRequest.getScope() );
+        assertEquals( LdapConstants.DEREF_ALWAYS, searchRequest.getDerefAliases() );
+        assertEquals( 1000, searchRequest.getSizeLimit() );
+        assertEquals( 1000, searchRequest.getTimeLimit() );
+        assertEquals( true, searchRequest.isTypesOnly() );
 
         // (& (...
-        AndFilter andFilter = ( AndFilter ) sr.getFilter();
+        AndFilter andFilter = ( AndFilter ) searchRequest.getFilter();
         assertNotNull( andFilter );
 
         List<Filter> andFilters = andFilter.getAndFilter();
@@ -1282,7 +1272,7 @@
         assertEquals( "organizationalUnitName", assertion.getAttributeDesc() );
         assertEquals( "ttt", assertion.getAssertionValue().getString() );
 
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
 
         for ( EntryAttribute attribute:attributes )
         {
@@ -1346,34 +1336,33 @@
         }
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        assertEquals( 4, message.getMessageId() );
-        assertEquals( 1, message.getControls().size() );
+        assertEquals( 4, searchRequest.getMessageId() );
+        assertEquals( 1, searchRequest.getControls().size() );
 
         // SubEntry Control
         String subEntryControlOID = "1.3.6.1.4.1.4203.1.10.1";
-        Control subEntryControl = message.getControls( 0 );
+        Control subEntryControl = searchRequest.getControls( 0 );
         assertEquals( subEntryControlOID, subEntryControl.getOid() );
         assertTrue( subEntryControl.isCritical() );
         assertTrue( subEntryControl instanceof SubentriesControl );
         assertTrue( ((SubentriesControl)subEntryControl).isVisible() );
 
-        SearchRequestCodec sr = message.getSearchRequest();
-        assertEquals( "dc=my-domain,dc=com", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.SUBTREE, sr.getScope() );
-        assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
-        assertEquals( 0, sr.getSizeLimit() );
-        assertEquals( 0, sr.getTimeLimit() );
-        assertEquals( false, sr.isTypesOnly() );
+        assertEquals( "dc=my-domain,dc=com", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.SUBTREE, searchRequest.getScope() );
+        assertEquals( LdapConstants.DEREF_ALWAYS, searchRequest.getDerefAliases() );
+        assertEquals( 0, searchRequest.getSizeLimit() );
+        assertEquals( 0, searchRequest.getTimeLimit() );
+        assertEquals( false, searchRequest.isTypesOnly() );
 
-        assertTrue( sr.getFilter() instanceof PresentFilter );
-        assertEquals( "objectClass", ( ( PresentFilter ) sr.getFilter() ).getAttributeDescription() );
+        assertTrue( searchRequest.getFilter() instanceof PresentFilter );
+        assertEquals( "objectClass", ( ( PresentFilter ) searchRequest.getFilter() ).getAttributeDescription() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchRequest.encode();
             String encodedPdu = StringTools.dumpBytes( bb.array() );
             assertEquals( decodedPdu, encodedPdu );
         }
@@ -1536,19 +1525,18 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( "", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.ONELEVEL, sr.getScope() );
-        assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
-        assertEquals( 1000, sr.getSizeLimit() );
-        assertEquals( 1000, sr.getTimeLimit() );
-        assertEquals( true, sr.isTypesOnly() );
+        assertEquals( 1, searchRequest.getMessageId() );
+        assertEquals( "", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.ONELEVEL, searchRequest.getScope() );
+        assertEquals( LdapConstants.DEREF_ALWAYS, searchRequest.getDerefAliases() );
+        assertEquals( 1000, searchRequest.getSizeLimit() );
+        assertEquals( 1000, searchRequest.getTimeLimit() );
+        assertEquals( true, searchRequest.isTypesOnly() );
 
         // (& (...
-        AndFilter andFilter = ( AndFilter ) sr.getFilter();
+        AndFilter andFilter = ( AndFilter ) searchRequest.getFilter();
         assertNotNull( andFilter );
 
         List<Filter> andFilters = andFilter.getAndFilter();
@@ -1594,7 +1582,7 @@
         assertEquals( "objectclass", assertion.getAttributeDesc() );
         assertEquals( "ttt", assertion.getAssertionValue().getString() );
 
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
 
         for ( EntryAttribute attribute:attributes )
         {
@@ -1606,7 +1594,7 @@
         // attributes may have been reordered
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -2544,19 +2532,18 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 4, message.getMessageId() );
-        assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.ONELEVEL, sr.getScope() );
-        assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
-        assertEquals( 0, sr.getSizeLimit() );
-        assertEquals( 0, sr.getTimeLimit() );
-        assertEquals( true, sr.isTypesOnly() );
+        assertEquals( 4, searchRequest.getMessageId() );
+        assertEquals( "uid=akarasulu,dc=example,dc=com", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.ONELEVEL, searchRequest.getScope() );
+        assertEquals( LdapConstants.DEREF_ALWAYS, searchRequest.getDerefAliases() );
+        assertEquals( 0, searchRequest.getSizeLimit() );
+        assertEquals( 0, searchRequest.getTimeLimit() );
+        assertEquals( true, searchRequest.isTypesOnly() );
 
         // >=
-        AttributeValueAssertionFilter greaterThanFilter = ( AttributeValueAssertionFilter ) sr.getFilter();
+        AttributeValueAssertionFilter greaterThanFilter = ( AttributeValueAssertionFilter ) searchRequest.getFilter();
         assertNotNull( greaterThanFilter );
 
         AttributeValueAssertion assertion = greaterThanFilter.getAssertion();
@@ -2564,7 +2551,7 @@
         assertEquals( "test", assertion.getAttributeDesc() );
         assertEquals( "", assertion.getAssertionValue().getString() );
 
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
 
         assertEquals( 0, attributes.size() );
 
@@ -2573,7 +2560,7 @@
         // attributes may have been reordered
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -2627,19 +2614,18 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 4, message.getMessageId() );
-        assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.ONELEVEL, sr.getScope() );
-        assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
-        assertEquals( 0, sr.getSizeLimit() );
-        assertEquals( 0, sr.getTimeLimit() );
-        assertEquals( true, sr.isTypesOnly() );
+        assertEquals( 4, searchRequest.getMessageId() );
+        assertEquals( "uid=akarasulu,dc=example,dc=com", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.ONELEVEL, searchRequest.getScope() );
+        assertEquals( LdapConstants.DEREF_ALWAYS, searchRequest.getDerefAliases() );
+        assertEquals( 0, searchRequest.getSizeLimit() );
+        assertEquals( 0, searchRequest.getTimeLimit() );
+        assertEquals( true, searchRequest.isTypesOnly() );
 
         // >=
-        AttributeValueAssertionFilter greaterThanFilter = ( AttributeValueAssertionFilter ) sr.getFilter();
+        AttributeValueAssertionFilter greaterThanFilter = ( AttributeValueAssertionFilter ) searchRequest.getFilter();
         assertNotNull( greaterThanFilter );
 
         AttributeValueAssertion assertion = greaterThanFilter.getAssertion();
@@ -2647,7 +2633,7 @@
         assertEquals( "test", assertion.getAttributeDesc() );
         assertEquals( "", assertion.getAssertionValue().getString() );
 
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
 
         assertEquals( 1, attributes.size() );
         assertEquals( "*", attributes.get( 0 ).getId() );
@@ -2657,7 +2643,7 @@
         // attributes may have been reordered
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -2722,19 +2708,18 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 4, message.getMessageId() );
-        assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.ONELEVEL, sr.getScope() );
-        assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
-        assertEquals( 0, sr.getSizeLimit() );
-        assertEquals( 0, sr.getTimeLimit() );
-        assertEquals( true, sr.isTypesOnly() );
+        assertEquals( 4, searchRequest.getMessageId() );
+        assertEquals( "uid=akarasulu,dc=example,dc=com", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.ONELEVEL, searchRequest.getScope() );
+        assertEquals( LdapConstants.DEREF_ALWAYS, searchRequest.getDerefAliases() );
+        assertEquals( 0, searchRequest.getSizeLimit() );
+        assertEquals( 0, searchRequest.getTimeLimit() );
+        assertEquals( true, searchRequest.isTypesOnly() );
 
         // >=
-        AttributeValueAssertionFilter greaterThanFilter = ( AttributeValueAssertionFilter ) sr.getFilter();
+        AttributeValueAssertionFilter greaterThanFilter = ( AttributeValueAssertionFilter ) searchRequest.getFilter();
         assertNotNull( greaterThanFilter );
 
         AttributeValueAssertion assertion = greaterThanFilter.getAssertion();
@@ -2742,7 +2727,7 @@
         assertEquals( "test", assertion.getAttributeDesc() );
         assertEquals( "", assertion.getAssertionValue().getString() );
 
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
 
         assertEquals( 0, attributes.size() );
     }
@@ -2972,19 +2957,18 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 2, message.getMessageId() );
-        assertEquals( "dc=pgpkeys", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.SUBTREE, sr.getScope() );
-        assertEquals( LdapConstants.NEVER_DEREF_ALIASES, sr.getDerefAliases() );
-        assertEquals( 0, sr.getSizeLimit() );
-        assertEquals( 0, sr.getTimeLimit() );
-        assertEquals( false, sr.isTypesOnly() );
+        assertEquals( 2, searchRequest.getMessageId() );
+        assertEquals( "dc=pgpkeys", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.SUBTREE, searchRequest.getScope() );
+        assertEquals( LdapConstants.NEVER_DEREF_ALIASES, searchRequest.getDerefAliases() );
+        assertEquals( 0, searchRequest.getSizeLimit() );
+        assertEquals( 0, searchRequest.getTimeLimit() );
+        assertEquals( false, searchRequest.isTypesOnly() );
 
         // And 
-        AndFilter andFilter = ( AndFilter ) sr.getFilter();
+        AndFilter andFilter = ( AndFilter ) searchRequest.getFilter();
         assertNotNull( andFilter );
 
         List<Filter> andFilters = andFilter.getAndFilter();
@@ -3012,7 +2996,7 @@
         // attributes may have been reordered
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -3084,19 +3068,18 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( "a=b", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.ONELEVEL, sr.getScope() );
-        assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
-        assertEquals( 0, sr.getSizeLimit() );
-        assertEquals( 0, sr.getTimeLimit() );
-        assertEquals( true, sr.isTypesOnly() );
+        assertEquals( 1, searchRequest.getMessageId() );
+        assertEquals( "a=b", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.ONELEVEL, searchRequest.getScope() );
+        assertEquals( LdapConstants.DEREF_ALWAYS, searchRequest.getDerefAliases() );
+        assertEquals( 0, searchRequest.getSizeLimit() );
+        assertEquals( 0, searchRequest.getTimeLimit() );
+        assertEquals( true, searchRequest.isTypesOnly() );
 
         // (a=b)
-        AttributeValueAssertionFilter equalityMatch = ( AttributeValueAssertionFilter ) sr.getFilter();
+        AttributeValueAssertionFilter equalityMatch = ( AttributeValueAssertionFilter ) searchRequest.getFilter();
         assertNotNull( equalityMatch );
 
         AttributeValueAssertion assertion = equalityMatch.getAssertion();
@@ -3105,7 +3088,7 @@
         assertEquals( "a", assertion.getAttributeDesc() );
         assertEquals( "b", assertion.getAssertionValue().getString() );
 
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
         assertEquals( 0, attributes.size() );
 
         // Check the encoding
@@ -3113,7 +3096,7 @@
         // attributes may have been reordered
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -3186,19 +3169,18 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( "a=b", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.ONELEVEL, sr.getScope() );
-        assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
-        assertEquals( 0, sr.getSizeLimit() );
-        assertEquals( 0, sr.getTimeLimit() );
-        assertEquals( true, sr.isTypesOnly() );
+        assertEquals( 1, searchRequest.getMessageId() );
+        assertEquals( "a=b", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.ONELEVEL, searchRequest.getScope() );
+        assertEquals( LdapConstants.DEREF_ALWAYS, searchRequest.getDerefAliases() );
+        assertEquals( 0, searchRequest.getSizeLimit() );
+        assertEquals( 0, searchRequest.getTimeLimit() );
+        assertEquals( true, searchRequest.isTypesOnly() );
 
         // (&(...
-        AndFilter andFilter = ( AndFilter ) sr.getFilter();
+        AndFilter andFilter = ( AndFilter ) searchRequest.getFilter();
         assertNotNull( andFilter );
 
         List<Filter> andFilters = andFilter.getAndFilter();
@@ -3214,7 +3196,7 @@
         assertEquals( "a", assertion.getAttributeDesc() );
         assertEquals( "b", assertion.getAssertionValue().getString() );
 
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
         assertEquals( 0, attributes.size() );
 
         // Check the encoding
@@ -3222,7 +3204,7 @@
         // attributes may have been reordered
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -3300,19 +3282,18 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( "a=b", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.ONELEVEL, sr.getScope() );
-        assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
-        assertEquals( 0, sr.getSizeLimit() );
-        assertEquals( 0, sr.getTimeLimit() );
-        assertEquals( true, sr.isTypesOnly() );
+        assertEquals( 1, searchRequest.getMessageId() );
+        assertEquals( "a=b", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.ONELEVEL, searchRequest.getScope() );
+        assertEquals( LdapConstants.DEREF_ALWAYS, searchRequest.getDerefAliases() );
+        assertEquals( 0, searchRequest.getSizeLimit() );
+        assertEquals( 0, searchRequest.getTimeLimit() );
+        assertEquals( true, searchRequest.isTypesOnly() );
 
         // (&(...
-        AndFilter andFilter = ( AndFilter ) sr.getFilter();
+        AndFilter andFilter = ( AndFilter ) searchRequest.getFilter();
         assertNotNull( andFilter );
 
         List<Filter> andFilters = andFilter.getAndFilter();
@@ -3338,7 +3319,7 @@
         assertEquals( "c", assertion.getAttributeDesc() );
         assertEquals( "d", assertion.getAssertionValue().getString() );
 
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
         assertEquals( 0, attributes.size() );
 
         // Check the encoding
@@ -3346,7 +3327,7 @@
         // attributes may have been reordered
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -3418,19 +3399,18 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( "a=b", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.ONELEVEL, sr.getScope() );
-        assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
-        assertEquals( 0, sr.getSizeLimit() );
-        assertEquals( 0, sr.getTimeLimit() );
-        assertEquals( true, sr.isTypesOnly() );
+        assertEquals( 1, searchRequest.getMessageId() );
+        assertEquals( "a=b", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.ONELEVEL, searchRequest.getScope() );
+        assertEquals( LdapConstants.DEREF_ALWAYS, searchRequest.getDerefAliases() );
+        assertEquals( 0, searchRequest.getSizeLimit() );
+        assertEquals( 0, searchRequest.getTimeLimit() );
+        assertEquals( true, searchRequest.isTypesOnly() );
 
         // (&(...
-        AndFilter andFilter = ( AndFilter ) sr.getFilter();
+        AndFilter andFilter = ( AndFilter ) searchRequest.getFilter();
         assertNotNull( andFilter );
 
         List<Filter> andFilters = andFilter.getAndFilter();
@@ -3453,7 +3433,7 @@
         assertEquals( "a", assertion.getAttributeDesc() );
         assertEquals( "b", assertion.getAssertionValue().getString() );
 
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
         assertEquals( 0, attributes.size() );
 
         // Check the encoding
@@ -3461,7 +3441,7 @@
         // attributes may have been reordered
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -3539,19 +3519,18 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( "a=b", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.ONELEVEL, sr.getScope() );
-        assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
-        assertEquals( 0, sr.getSizeLimit() );
-        assertEquals( 0, sr.getTimeLimit() );
-        assertEquals( true, sr.isTypesOnly() );
+        assertEquals( 1, searchRequest.getMessageId() );
+        assertEquals( "a=b", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.ONELEVEL, searchRequest.getScope() );
+        assertEquals( LdapConstants.DEREF_ALWAYS, searchRequest.getDerefAliases() );
+        assertEquals( 0, searchRequest.getSizeLimit() );
+        assertEquals( 0, searchRequest.getTimeLimit() );
+        assertEquals( true, searchRequest.isTypesOnly() );
 
         // (&(...
-        AndFilter andFilter = ( AndFilter ) sr.getFilter();
+        AndFilter andFilter = ( AndFilter ) searchRequest.getFilter();
         assertNotNull( andFilter );
 
         List<Filter> andFilters = andFilter.getAndFilter();
@@ -3584,7 +3563,7 @@
         assertEquals( "c", assertion.getAttributeDesc() );
         assertEquals( "d", assertion.getAssertionValue().getString() );
 
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
         assertEquals( 0, attributes.size() );
 
         // Check the encoding
@@ -3592,7 +3571,7 @@
         // attributes may have been reordered
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -3669,19 +3648,18 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( "a=b", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.ONELEVEL, sr.getScope() );
-        assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
-        assertEquals( 0, sr.getSizeLimit() );
-        assertEquals( 0, sr.getTimeLimit() );
-        assertEquals( true, sr.isTypesOnly() );
+        assertEquals( 1, searchRequest.getMessageId() );
+        assertEquals( "a=b", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.ONELEVEL, searchRequest.getScope() );
+        assertEquals( LdapConstants.DEREF_ALWAYS, searchRequest.getDerefAliases() );
+        assertEquals( 0, searchRequest.getSizeLimit() );
+        assertEquals( 0, searchRequest.getTimeLimit() );
+        assertEquals( true, searchRequest.isTypesOnly() );
 
         // (&(...
-        AndFilter andFilter = ( AndFilter ) sr.getFilter();
+        AndFilter andFilter = ( AndFilter ) searchRequest.getFilter();
         assertNotNull( andFilter );
 
         List<Filter> andFilters = andFilter.getAndFilter();
@@ -3714,7 +3692,7 @@
         assertEquals( "c", assertion.getAttributeDesc() );
         assertEquals( "d", assertion.getAssertionValue().getString() );
 
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
         assertEquals( 0, attributes.size() );
 
         // Check the encoding
@@ -3722,7 +3700,7 @@
         // attributes may have been reordered
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -3804,19 +3782,18 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( "a=b", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.ONELEVEL, sr.getScope() );
-        assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
-        assertEquals( 0, sr.getSizeLimit() );
-        assertEquals( 0, sr.getTimeLimit() );
-        assertEquals( true, sr.isTypesOnly() );
+        assertEquals( 1, searchRequest.getMessageId() );
+        assertEquals( "a=b", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.ONELEVEL, searchRequest.getScope() );
+        assertEquals( LdapConstants.DEREF_ALWAYS, searchRequest.getDerefAliases() );
+        assertEquals( 0, searchRequest.getSizeLimit() );
+        assertEquals( 0, searchRequest.getTimeLimit() );
+        assertEquals( true, searchRequest.isTypesOnly() );
 
         // (&(...
-        AndFilter andFilter = ( AndFilter ) sr.getFilter();
+        AndFilter andFilter = ( AndFilter ) searchRequest.getFilter();
         assertNotNull( andFilter );
 
         List<Filter> andFilters = andFilter.getAndFilter();
@@ -3859,7 +3836,7 @@
         assertEquals( "e", assertion.getAttributeDesc() );
         assertEquals( "f", assertion.getAssertionValue().getString() );
 
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
         assertEquals( 0, attributes.size() );
 
         // Check the encoding
@@ -3867,7 +3844,7 @@
         // attributes may have been reordered
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -3951,19 +3928,18 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( "a=b", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.ONELEVEL, sr.getScope() );
-        assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
-        assertEquals( 0, sr.getSizeLimit() );
-        assertEquals( 0, sr.getTimeLimit() );
-        assertEquals( true, sr.isTypesOnly() );
+        assertEquals( 1, searchRequest.getMessageId() );
+        assertEquals( "a=b", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.ONELEVEL, searchRequest.getScope() );
+        assertEquals( LdapConstants.DEREF_ALWAYS, searchRequest.getDerefAliases() );
+        assertEquals( 0, searchRequest.getSizeLimit() );
+        assertEquals( 0, searchRequest.getTimeLimit() );
+        assertEquals( true, searchRequest.isTypesOnly() );
 
         // (&(...
-        AndFilter andFilter = ( AndFilter ) sr.getFilter();
+        AndFilter andFilter = ( AndFilter ) searchRequest.getFilter();
         assertNotNull( andFilter );
 
         List<Filter> andFilters = andFilter.getAndFilter();
@@ -4006,7 +3982,7 @@
         assertEquals( "e", assertion.getAttributeDesc() );
         assertEquals( "f", assertion.getAssertionValue().getString() );
         
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
         assertEquals( 0, attributes.size() );
 
         // Check the encoding
@@ -4014,7 +3990,7 @@
         // attributes may have been reordered
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -4093,19 +4069,18 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( "a=b", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.ONELEVEL, sr.getScope() );
-        assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
-        assertEquals( 0, sr.getSizeLimit() );
-        assertEquals( 0, sr.getTimeLimit() );
-        assertEquals( true, sr.isTypesOnly() );
+        assertEquals( 1, searchRequest.getMessageId() );
+        assertEquals( "a=b", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.ONELEVEL, searchRequest.getScope() );
+        assertEquals( LdapConstants.DEREF_ALWAYS, searchRequest.getDerefAliases() );
+        assertEquals( 0, searchRequest.getSizeLimit() );
+        assertEquals( 0, searchRequest.getTimeLimit() );
+        assertEquals( true, searchRequest.isTypesOnly() );
 
         // (&(...
-        AndFilter andFilter = ( AndFilter ) sr.getFilter();
+        AndFilter andFilter = ( AndFilter ) searchRequest.getFilter();
         assertNotNull( andFilter );
 
         List<Filter> andFilters = andFilter.getAndFilter();
@@ -4145,7 +4120,7 @@
         assertEquals( "c", assertion.getAttributeDesc() );
         assertEquals( "d", assertion.getAssertionValue().getString() );
 
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
         assertEquals( 0, attributes.size() );
 
         // Check the encoding
@@ -4153,7 +4128,7 @@
         // attributes may have been reordered
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -4235,19 +4210,18 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( "a=b", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.ONELEVEL, sr.getScope() );
-        assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
-        assertEquals( 0, sr.getSizeLimit() );
-        assertEquals( 0, sr.getTimeLimit() );
-        assertEquals( true, sr.isTypesOnly() );
+        assertEquals( 1, searchRequest.getMessageId() );
+        assertEquals( "a=b", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.ONELEVEL, searchRequest.getScope() );
+        assertEquals( LdapConstants.DEREF_ALWAYS, searchRequest.getDerefAliases() );
+        assertEquals( 0, searchRequest.getSizeLimit() );
+        assertEquals( 0, searchRequest.getTimeLimit() );
+        assertEquals( true, searchRequest.isTypesOnly() );
 
         // (&(...
-        AndFilter andFilter = ( AndFilter ) sr.getFilter();
+        AndFilter andFilter = ( AndFilter ) searchRequest.getFilter();
         assertNotNull( andFilter );
 
         List<Filter> andFilters = andFilter.getAndFilter();
@@ -4297,7 +4271,7 @@
         assertEquals( "e", assertion.getAttributeDesc() );
         assertEquals( "f", assertion.getAssertionValue().getString() );
 
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
         assertEquals( 0, attributes.size() );
 
         // Check the encoding
@@ -4305,7 +4279,7 @@
         // attributes may have been reordered
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -4384,19 +4358,18 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( "a=b", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.ONELEVEL, sr.getScope() );
-        assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
-        assertEquals( 0, sr.getSizeLimit() );
-        assertEquals( 0, sr.getTimeLimit() );
-        assertEquals( true, sr.isTypesOnly() );
+        assertEquals( 1, searchRequest.getMessageId() );
+        assertEquals( "a=b", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.ONELEVEL, searchRequest.getScope() );
+        assertEquals( LdapConstants.DEREF_ALWAYS, searchRequest.getDerefAliases() );
+        assertEquals( 0, searchRequest.getSizeLimit() );
+        assertEquals( 0, searchRequest.getTimeLimit() );
+        assertEquals( true, searchRequest.isTypesOnly() );
 
         // (&(...
-        AndFilter andFilter = ( AndFilter ) sr.getFilter();
+        AndFilter andFilter = ( AndFilter ) searchRequest.getFilter();
         assertNotNull( andFilter );
 
         List<Filter> andFilters = andFilter.getAndFilter();
@@ -4435,7 +4408,7 @@
         assertEquals( "e", assertion.getAttributeDesc() );
         assertEquals( "f", assertion.getAssertionValue().getString() );
 
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
         assertEquals( 0, attributes.size() );
 
         // Check the encoding
@@ -4443,7 +4416,7 @@
         // attributes may have been reordered
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -4499,22 +4472,21 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( "", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.OBJECT, sr.getScope() );
-        assertEquals( LdapConstants.SCOPE_BASE_OBJECT, sr.getDerefAliases() );
-        assertEquals( 0, sr.getSizeLimit() );
-        assertEquals( 0, sr.getTimeLimit() );
-        assertEquals( false, sr.isTypesOnly() );
+        assertEquals( 1, searchRequest.getMessageId() );
+        assertEquals( "", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.OBJECT, searchRequest.getScope() );
+        assertEquals( LdapConstants.SCOPE_BASE_OBJECT, searchRequest.getDerefAliases() );
+        assertEquals( 0, searchRequest.getSizeLimit() );
+        assertEquals( 0, searchRequest.getTimeLimit() );
+        assertEquals( false, searchRequest.isTypesOnly() );
         
-        PresentFilter presentFilter = ( PresentFilter ) sr.getFilter();
+        PresentFilter presentFilter = ( PresentFilter ) searchRequest.getFilter();
         assertNotNull( presentFilter );
         assertEquals( "objectClass", presentFilter.getAttributeDescription() );
         
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
         assertEquals( 0, attributes.size() );
     }
     
@@ -4572,18 +4544,17 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 3, message.getMessageId() );
-        assertEquals( "ou=users,ou=system", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.ONELEVEL, sr.getScope() );
-        assertEquals( LdapConstants.SCOPE_BASE_OBJECT, sr.getDerefAliases() );
-        assertEquals( 0, sr.getSizeLimit() );
-        assertEquals( 30, sr.getTimeLimit() );
-        assertEquals( true, sr.isTypesOnly() );
+        assertEquals( 3, searchRequest.getMessageId() );
+        assertEquals( "ou=users,ou=system", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.ONELEVEL, searchRequest.getScope() );
+        assertEquals( LdapConstants.SCOPE_BASE_OBJECT, searchRequest.getDerefAliases() );
+        assertEquals( 0, searchRequest.getSizeLimit() );
+        assertEquals( 30, searchRequest.getTimeLimit() );
+        assertEquals( true, searchRequest.isTypesOnly() );
         
-        AndFilter andFilter = ( AndFilter ) sr.getFilter();
+        AndFilter andFilter = ( AndFilter ) searchRequest.getFilter();
         assertNotNull( andFilter );
         
         List<Filter> andFilters = andFilter.getAndFilter();
@@ -4609,7 +4580,7 @@
         assertEquals( "sbAttribute", assertion.getAttributeDesc() );
         assertEquals( "Buy ", assertion.getAssertionValue().getString() );
 
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
         assertEquals( 0, attributes.size() );
     }
     
@@ -4681,19 +4652,18 @@
 
         assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 6, message.getMessageId() );
-        assertEquals( "ou=system", sr.getBaseObject().toString() );
-        assertEquals( SearchScope.SUBTREE, sr.getScope() );
-        assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
-        assertEquals( 0, sr.getSizeLimit() );
-        assertEquals( 0, sr.getTimeLimit() );
-        assertEquals( false, sr.isTypesOnly() );
+        assertEquals( 6, searchRequest.getMessageId() );
+        assertEquals( "ou=system", searchRequest.getBaseObject().toString() );
+        assertEquals( SearchScope.SUBTREE, searchRequest.getScope() );
+        assertEquals( LdapConstants.DEREF_ALWAYS, searchRequest.getDerefAliases() );
+        assertEquals( 0, searchRequest.getSizeLimit() );
+        assertEquals( 0, searchRequest.getTimeLimit() );
+        assertEquals( false, searchRequest.isTypesOnly() );
 
         // (&(...
-        AndFilter andFilter = ( AndFilter ) sr.getFilter();
+        AndFilter andFilter = ( AndFilter ) searchRequest.getFilter();
         assertNotNull( andFilter );
 
         List<Filter> andFilters = andFilter.getAndFilter();

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=910150&r1=910149&r2=910150&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 Mon Feb 15 01:37:34 2010
@@ -31,7 +31,6 @@
 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.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.control.Control;
@@ -88,21 +87,20 @@
             fail( de.getMessage() );
         }
 
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultDoneCodec searchResultDone = message.getSearchResultDone();
+        SearchResultDoneCodec searchResultDone = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchResultDone();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, searchResultDone.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, searchResultDone.getLdapResult().getResultCode() );
         assertEquals( "", searchResultDone.getLdapResult().getMatchedDN() );
         assertEquals( "", searchResultDone.getLdapResult().getErrorMessage() );
 
         // Check the length
-        assertEquals( 0x0E, message.computeLength() );
+        assertEquals( 0x0E, searchResultDone.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchResultDone.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -161,30 +159,29 @@
             fail( de.getMessage() );
         }
 
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultDoneCodec searchResultDone = message.getSearchResultDone();
+        SearchResultDoneCodec searchResultDone = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchResultDone();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, searchResultDone.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, searchResultDone.getLdapResult().getResultCode() );
         assertEquals( "", searchResultDone.getLdapResult().getMatchedDN() );
         assertEquals( "", searchResultDone.getLdapResult().getErrorMessage() );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = searchResultDone.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = searchResultDone.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the length
-        assertEquals( 0x2B, message.computeLength() );
+        assertEquals( 0x2B, searchResultDone.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchResultDone.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 

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=910150&r1=910149&r2=910150&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 Mon Feb 15 01:37:34 2010
@@ -33,7 +33,6 @@
 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.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
@@ -98,10 +97,9 @@
             fail( de.getMessage() );
         }
 
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultEntryCodec searchResultEntry = message.getSearchResultEntry();
+        SearchResultEntryCodec searchResultEntry = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchResultEntry();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, searchResultEntry.getMessageId() );
         assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName().toString() );
 
         Entry entry = searchResultEntry.getEntry();
@@ -119,12 +117,12 @@
         }
 
         // Check the length
-        assertEquals( 0x50, message.computeLength() );
+        assertEquals( 0x50, searchResultEntry.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchResultEntry.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -193,10 +191,9 @@
             fail( de.getMessage() );
         }
 
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultEntryCodec searchResultEntry = message.getSearchResultEntry();
+        SearchResultEntryCodec searchResultEntry = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchResultEntry();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, searchResultEntry.getMessageId() );
         assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName().toString() );
 
         Entry entry = searchResultEntry.getEntry();
@@ -217,12 +214,12 @@
         }
 
         // Check the length
-        assertEquals( 0x7b, message.computeLength() );
+        assertEquals( 0x7b, searchResultEntry.computeLength() );
 
         // Check the encoding
         try
         {
-            message.encode( null );
+            searchResultEntry.encode();
 
             // We can't compare the encodings, the order of the attributes has
             // changed
@@ -293,10 +290,9 @@
             fail( de.getMessage() );
         }
 
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultEntryCodec searchResultEntry = message.getSearchResultEntry();
+        SearchResultEntryCodec searchResultEntry = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchResultEntry();
 
-        assertEquals( 2, message.getMessageId() );
+        assertEquals( 2, searchResultEntry.getMessageId() );
         assertEquals( "uid=admin,ou=system", searchResultEntry.getObjectName().toString() );
 
         Entry entry = searchResultEntry.getEntry();
@@ -316,7 +312,7 @@
         }
 
         // Check the length
-        assertEquals( 0x61, message.computeLength() );
+        assertEquals( 0x61, searchResultEntry.computeLength() );
 
         // Check that the next bytes is the first of the next PDU
         assertEquals( 0x30, stream.get( stream.position() ) );
@@ -328,7 +324,7 @@
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchResultEntry.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -504,10 +500,9 @@
             fail( de.getMessage() );
         }
 
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultEntryCodec searchResultEntry = message.getSearchResultEntry();
+        SearchResultEntryCodec searchResultEntry = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchResultEntry();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, searchResultEntry.getMessageId() );
         assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName().toString() );
 
         Entry entry = searchResultEntry.getEntry();
@@ -515,12 +510,12 @@
         assertEquals( 0, entry.size() );
 
         // Check the length
-        assertEquals( 0x26, message.computeLength() );
+        assertEquals( 0x26, searchResultEntry.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchResultEntry.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -762,10 +757,9 @@
             fail( de.getMessage() );
         }
 
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultEntryCodec searchResultEntry = message.getSearchResultEntry();
+        SearchResultEntryCodec searchResultEntry = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchResultEntry();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, searchResultEntry.getMessageId() );
         assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName().toString() );
 
         Entry entry = searchResultEntry.getEntry();
@@ -781,12 +775,12 @@
         }
 
         // Check the length
-        assertEquals( 0x37, message.computeLength() );
+        assertEquals( 0x37, searchResultEntry.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchResultEntry.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -845,10 +839,9 @@
             fail( de.getMessage() );
         }
 
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultEntryCodec searchResultEntry = message.getSearchResultEntry();
+        SearchResultEntryCodec searchResultEntry = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchResultEntry();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, searchResultEntry.getMessageId() );
         assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName().toString() );
 
         Entry entry = searchResultEntry.getEntry();
@@ -864,12 +857,12 @@
         assertEquals( 0, attribute.size() );
 
         // Check the length
-        assertEquals( 0x48, message.computeLength() );
+        assertEquals( 0x48, searchResultEntry.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchResultEntry.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -929,10 +922,9 @@
             fail( de.getMessage() );
         }
 
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultEntryCodec searchResultEntry = message.getSearchResultEntry();
+        SearchResultEntryCodec searchResultEntry = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchResultEntry();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, searchResultEntry.getMessageId() );
         assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName().toString() );
 
         Entry entry = searchResultEntry.getEntry();
@@ -949,21 +941,21 @@
         }
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = searchResultEntry.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = searchResultEntry.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the length
-        assertEquals( 0x54, message.computeLength() );
+        assertEquals( 0x54, searchResultEntry.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchResultEntry.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -1022,10 +1014,9 @@
             fail( de.getMessage() );
         }
 
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultEntryCodec searchResultEntry = message.getSearchResultEntry();
+        SearchResultEntryCodec searchResultEntry = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchResultEntry();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, searchResultEntry.getMessageId() );
         assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName().toString() );
 
         Entry entry = searchResultEntry.getEntry();
@@ -1042,12 +1033,12 @@
         }
 
         // Check the length
-        assertEquals( 0x39, message.computeLength() );
+        assertEquals( 0x39, searchResultEntry.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchResultEntry.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -1109,10 +1100,9 @@
             fail( de.getMessage() );
         }
 
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultEntryCodec searchResultEntry = message.getSearchResultEntry();
+        SearchResultEntryCodec searchResultEntry = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchResultEntry();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, searchResultEntry.getMessageId() );
         assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName().toString() );
 
         Entry entry = searchResultEntry.getEntry();
@@ -1129,21 +1119,21 @@
         }
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = searchResultEntry.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = searchResultEntry.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the length
-        assertEquals( 0x56, message.computeLength() );
+        assertEquals( 0x56, searchResultEntry.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchResultEntry.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 

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=910150&r1=910149&r2=910150&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 Mon Feb 15 01:37:34 2010
@@ -33,7 +33,6 @@
 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.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
 import org.apache.directory.shared.ldap.message.control.Control;
@@ -116,10 +115,9 @@
             fail( de.getMessage() );
         }
 
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultReferenceCodec searchResultReference = message.getSearchResultReference();
+        SearchResultReferenceCodec searchResultReference = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchResultReference();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, searchResultReference.getMessageId() );
 
         Set<String> ldapUrlsSet = new HashSet<String>();
 
@@ -150,12 +148,12 @@
         assertTrue( ldapUrlsSet.size() == 0 );
 
         // Check the length
-        assertEquals( 0x3D8, message.computeLength() );
+        assertEquals( 0x3D8, searchResultReference.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchResultReference.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -249,10 +247,9 @@
         
         stream.flip();
         
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultReferenceCodec searchResultReference = message.getSearchResultReference();
+        SearchResultReferenceCodec searchResultReference = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchResultReference();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, searchResultReference.getMessageId() );
 
         Set<String> ldapUrlsSet = new HashSet<String>();
 
@@ -283,21 +280,21 @@
         assertTrue( ldapUrlsSet.size() == 0 );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = searchResultReference.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = searchResultReference.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the length
-        assertEquals( 0x3F5, message.computeLength() );
+        assertEquals( 0x3F5, searchResultReference.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchResultReference.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -393,22 +390,21 @@
             fail( de.getMessage() );
         }
 
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultReferenceCodec searchResultReference = message.getSearchResultReference();
+        SearchResultReferenceCodec searchResultReference = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchResultReference();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, searchResultReference.getMessageId() );
 
         LdapURL ldapUrl = searchResultReference.getSearchResultReferences().get( 0 );
 
         assertEquals( "ldap:///", ldapUrl.toString() );
 
         // Check the length
-        assertEquals( 0x11, message.computeLength() );
+        assertEquals( 0x11, searchResultReference.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = searchResultReference.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 

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=910150&r1=910149&r2=910150&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 Mon Feb 15 01:37:34 2010
@@ -85,7 +85,7 @@
 
         try
         {
-            ByteBuffer bb = ldapMessage.encode( null );
+            ByteBuffer bb = ldapMessage.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -155,7 +155,7 @@
 
         try
         {
-            ByteBuffer bb = ldapMessage.encode( null );
+            ByteBuffer bb = ldapMessage.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/AbstractMessageTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/AbstractMessageTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/AbstractMessageTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/AbstractMessageTest.java Mon Feb 15 01:37:34 2010
@@ -23,6 +23,7 @@
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
+import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
 import org.apache.directory.shared.ldap.codec.controls.ControlImpl;
 import org.apache.directory.shared.ldap.message.internal.InternalAbstractMessage;
 import org.junit.Test;

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/AbstractResultResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/AbstractResultResponseTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/AbstractResultResponseTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/AbstractResultResponseTest.java Mon Feb 15 01:37:34 2010
@@ -25,6 +25,7 @@
 
 import javax.naming.InvalidNameException;
 
+import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
 import org.apache.directory.shared.ldap.codec.controls.ControlImpl;
 import org.apache.directory.shared.ldap.message.internal.InternalAbstractResultResponse;
 import org.apache.directory.shared.ldap.message.internal.InternalLdapResult;

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/AddRequestImplTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/AddRequestImplTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/AddRequestImplTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/AddRequestImplTest.java Mon Feb 15 01:37:34 2010
@@ -29,6 +29,7 @@
 import javax.naming.InvalidNameException;
 import javax.naming.NamingException;
 
+import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute;

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindRequestImplTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindRequestImplTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindRequestImplTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindRequestImplTest.java Mon Feb 15 01:37:34 2010
@@ -28,6 +28,7 @@
 
 import javax.naming.InvalidNameException;
 
+import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.message.internal.InternalBindRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalResultResponse;



Mime
View raw message