directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r910150 [9/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/co...
Date Mon, 15 Feb 2010 01:37:47 GMT
Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnectTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnectTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnectTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnectTest.java Mon Feb 15 01:37:34 2010
@@ -20,6 +20,10 @@
 package org.apache.directory.shared.ldap.codec.extended.operations;
 
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.nio.ByteBuffer;
 
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
@@ -31,10 +35,6 @@
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.junit.Test;
 
-import static org.junit.Assert.fail;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
 
 /**
  * Test the GracefulDisconnectTest codec
@@ -94,7 +94,7 @@
         // Check the encoding
         try
         {
-            ByteBuffer bb = gracefulDisconnect.encode( null );
+            ByteBuffer bb = gracefulDisconnect.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -147,7 +147,7 @@
         // Check the encoding
         try
         {
-            ByteBuffer bb1 = gracefulDisconnect.encode( null );
+            ByteBuffer bb1 = gracefulDisconnect.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb1.array() );
 
@@ -201,7 +201,7 @@
         // Check the encoding
         try
         {
-            ByteBuffer bb1 = gracefulDisconnect.encode( null );
+            ByteBuffer bb1 = gracefulDisconnect.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb1.array() );
 
@@ -256,7 +256,7 @@
         // Check the encoding
         try
         {
-            ByteBuffer bb2 = gracefulDisconnect.encode( null );
+            ByteBuffer bb2 = gracefulDisconnect.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb2.array() );
 
@@ -321,7 +321,7 @@
         // Check the encoding
         try
         {
-            ByteBuffer bb = gracefulDisconnect.encode( null );
+            ByteBuffer bb = gracefulDisconnect.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -373,7 +373,7 @@
         // Check the encoding
         try
         {
-            ByteBuffer bb1 = gracefulDisconnect.encode( null );
+            ByteBuffer bb1 = gracefulDisconnect.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb1.array() );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulShutdownTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulShutdownTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulShutdownTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulShutdownTest.java Mon Feb 15 01:37:34 2010
@@ -83,7 +83,7 @@
         // Check the encoding
         try
         {
-            ByteBuffer bb1 = gracefulShutdown.encode( null );
+            ByteBuffer bb1 = gracefulShutdown.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb1.array() );
 
@@ -135,7 +135,7 @@
         // Check the encoding
         try
         {
-            ByteBuffer bb1 = gracefulShutdown.encode( null );
+            ByteBuffer bb1 = gracefulShutdown.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb1.array() );
 
@@ -188,7 +188,7 @@
         // Check the encoding
         try
         {
-            ByteBuffer bb1 = gracefulShutdown.encode( null );
+            ByteBuffer bb1 = gracefulShutdown.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb1.array() );
 
@@ -239,7 +239,7 @@
         // Check the encoding
         try
         {
-            ByteBuffer bb1 = gracefulShutdown.encode( null );
+            ByteBuffer bb1 = gracefulShutdown.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb1.array() );
 
@@ -293,7 +293,7 @@
         // Check the encoding
         try
         {
-            ByteBuffer bb1 = gracefulShutdown.encode( null );
+            ByteBuffer bb1 = gracefulShutdown.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb1.array() );
 
@@ -347,7 +347,7 @@
         // Check the encoding
         try
         {
-            ByteBuffer bb1 = gracefulShutdown.encode( null );
+            ByteBuffer bb1 = gracefulShutdown.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb1.array() );
 
@@ -403,7 +403,7 @@
         // Check the encoding
         try
         {
-            ByteBuffer bb1 = gracefulShutdown.encode( null );
+            ByteBuffer bb1 = gracefulShutdown.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb1.array() );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureTest.java Mon Feb 15 01:37:34 2010
@@ -21,6 +21,9 @@
 package org.apache.directory.shared.ldap.codec.extended.operations;
 
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
 import java.nio.ByteBuffer;
 
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
@@ -33,8 +36,6 @@
 import org.apache.directory.shared.ldap.codec.extended.operations.storedProcedure.StoredProcedure.StoredProcedureParameter;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.junit.Test;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
 
 
 /*
@@ -111,7 +112,7 @@
         // Check the encoding
         try
         {
-            ByteBuffer bb = storedProcedure.encode( null );
+            ByteBuffer bb = storedProcedure.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -167,7 +168,7 @@
         // Check the encoding
         try
         {
-            ByteBuffer bb = storedProcedure.encode( null );
+            ByteBuffer bb = storedProcedure.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -232,7 +233,7 @@
         // Check the encoding
         try
         {
-            ByteBuffer bb = storedProcedure.encode( null );
+            ByteBuffer bb = storedProcedure.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/intermediate/IntermediateResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/intermediate/IntermediateResponseTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/intermediate/IntermediateResponseTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/intermediate/IntermediateResponseTest.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.control.Control;
 import org.apache.directory.shared.ldap.util.StringTools;
@@ -85,20 +84,19 @@
         }
 
         // Check the decoded IntermediateResponse PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        IntermediateResponseCodec intermediateResponse = message.getIntermediateResponse();
+        IntermediateResponseCodec intermediateResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getIntermediateResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, intermediateResponse.getMessageId() );
         assertEquals( "1.3.6.1.5.5.2", intermediateResponse.getResponseName() );
         assertEquals( "value", StringTools.utf8ToString( intermediateResponse.getResponseValue() ) );
 
         // Check the length
-        assertEquals( 0x1D, message.computeLength() );
+        assertEquals( 0x1D, intermediateResponse.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = intermediateResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -157,29 +155,28 @@
         }
 
         // Check the decoded IntermediateResponse PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        IntermediateResponseCodec intermediateResponse = message.getIntermediateResponse();
+        IntermediateResponseCodec intermediateResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getIntermediateResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, intermediateResponse.getMessageId() );
         assertEquals( "1.3.6.1.5.5.2", intermediateResponse.getResponseName() );
         assertEquals( "value", StringTools.utf8ToString( intermediateResponse.getResponseValue() ) );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = intermediateResponse.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = intermediateResponse.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the length
-        assertEquals( 0x3A, message.computeLength() );
+        assertEquals( 0x3A, intermediateResponse.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = intermediateResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -239,29 +236,28 @@
         }
 
         // Check the decoded IntermediateResponse PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        IntermediateResponseCodec intermediateResponse = message.getIntermediateResponse();
+        IntermediateResponseCodec intermediateResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getIntermediateResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, intermediateResponse.getMessageId() );
         assertEquals( "1.3.6.1.5.5.2", intermediateResponse.getResponseName() );
         assertEquals( "", StringTools.utf8ToString( intermediateResponse.getResponseValue() ) );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = intermediateResponse.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = intermediateResponse.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the length
-        assertEquals( 0x33, message.computeLength() );
+        assertEquals( 0x33, intermediateResponse.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = intermediateResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -424,19 +420,18 @@
         }
 
         // Check the decoded IntermediateResponse PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        IntermediateResponseCodec intermediateResponse = message.getIntermediateResponse();
+        IntermediateResponseCodec intermediateResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getIntermediateResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, intermediateResponse.getMessageId() );
         assertEquals( "1.3.6.1.5.5.2", intermediateResponse.getResponseName() );
 
         // Check the length
-        assertEquals( 0x16, message.computeLength() );
+        assertEquals( 0x16, intermediateResponse.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = intermediateResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -490,20 +485,19 @@
         }
 
         // Check the decoded IntermediateResponse PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        IntermediateResponseCodec intermediateResponse = message.getIntermediateResponse();
+        IntermediateResponseCodec intermediateResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getIntermediateResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, intermediateResponse.getMessageId() );
         assertEquals( "1.3.6.1.5.5.2", intermediateResponse.getResponseName() );
         assertEquals( "", StringTools.utf8ToString( intermediateResponse.getResponseValue() ) );
 
         // Check the length
-        assertEquals( 0x18, message.computeLength() );
+        assertEquals( 0x18, intermediateResponse.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = intermediateResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -555,20 +549,19 @@
         }
 
         // Check the decoded IntermediateResponse PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        IntermediateResponseCodec intermediateResponse = message.getIntermediateResponse();
+        IntermediateResponseCodec intermediateResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getIntermediateResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, intermediateResponse.getMessageId() );
         assertEquals( "", intermediateResponse.getResponseName() );
         assertEquals( "value", StringTools.utf8ToString( intermediateResponse.getResponseValue() ) );
 
         // Check the length
-        assertEquals( 0x0E, message.computeLength() );
+        assertEquals( 0x0E, intermediateResponse.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = intermediateResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -620,20 +613,19 @@
         }
 
         // Check the decoded IntermediateResponse PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        IntermediateResponseCodec intermediateResponse = message.getIntermediateResponse();
+        IntermediateResponseCodec intermediateResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getIntermediateResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, intermediateResponse.getMessageId() );
         assertEquals( "1.3.6.1.5.5.2", intermediateResponse.getResponseName() );
         assertEquals( "", StringTools.utf8ToString( intermediateResponse.getResponseValue() ) );
 
         // Check the length
-        assertEquals( 0x16, message.computeLength() );
+        assertEquals( 0x16, intermediateResponse.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = intermediateResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java Mon Feb 15 01:37:34 2010
@@ -116,10 +116,9 @@
         }
 
         // Check the decoded PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ModifyRequestCodec modifyRequest = message.getModifyRequest();
+        ModifyRequestCodec modifyRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getModifyRequest();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, modifyRequest.getMessageId() );
         assertEquals( "cn=testModify,ou=users,ou=system", modifyRequest.getObject().toString() );
 
         List<Modification> modifications = modifyRequest.getModifications();
@@ -143,12 +142,12 @@
         }
 
         // Check the length
-        assertEquals( 0x54, message.computeLength() );
+        assertEquals( 0x54, modifyRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = modifyRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -286,10 +285,9 @@
         }
 
         // Check the decoded PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ModifyRequestCodec modifyRequest = message.getModifyRequest();
+        ModifyRequestCodec modifyRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getModifyRequest();
 
-        assertEquals( 21, message.getMessageId() );
+        assertEquals( 21, modifyRequest.getMessageId() );
         assertEquals( "cn=Tori Amos,ou=playground,dc=apache,dc=org", modifyRequest.getObject().toString() );
 
         List<Modification> modifications = modifyRequest.getModifications();
@@ -313,12 +311,12 @@
         assertEquals( "XXX", attrValue );
 
         // Check the length
-        assertEquals( 0x8C, message.computeLength() );
+        assertEquals( 0x8C, modifyRequest.computeLength() );
 
         // Check the encoding, by decoding and re-encoding the result
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = modifyRequest.encode();
             String decodedPdu1 = StringTools.dumpBytes( bb.array() );
 
             try
@@ -333,7 +331,7 @@
 
             LdapMessageCodec message2 = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
 
-            ByteBuffer bb2 = message2.encode( null );
+            ByteBuffer bb2 = message2.encode();
             String decodedPdu2 = StringTools.dumpBytes( bb2.array() );
 
             assertEquals( decodedPdu1, decodedPdu2 );
@@ -410,10 +408,9 @@
         }
 
         // Check the decoded PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ModifyRequestCodec modifyRequest = message.getModifyRequest();
+        ModifyRequestCodec modifyRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getModifyRequest();
 
-        assertEquals( 49, message.getMessageId() );
+        assertEquals( 49, modifyRequest.getMessageId() );
         assertEquals( "cn=Tori Amos,ou=playground,dc=apache,dc=org", modifyRequest.getObject().toString() );
 
         List<Modification> modifications = modifyRequest.getModifications();
@@ -446,12 +443,12 @@
         assertEquals( "01234567890", attrValue );
 
         // Check the length
-        assertEquals( 0xB9, message.computeLength() );
+        assertEquals( 0xB9, modifyRequest.computeLength() );
 
         // Check the encoding, by decoding and re-encoding the result
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = modifyRequest.encode();
             String decodedPdu1 = StringTools.dumpBytes( bb.array() );
 
             try
@@ -466,7 +463,7 @@
 
             LdapMessageCodec message2 = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
 
-            ByteBuffer bb2 = message2.encode( null );
+            ByteBuffer bb2 = message2.encode();
             String decodedPdu2 = StringTools.dumpBytes( bb2.array() );
 
             assertEquals( decodedPdu1, decodedPdu2 );
@@ -542,10 +539,9 @@
         }
 
         // Check the decoded PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ModifyRequestCodec modifyRequest = message.getModifyRequest();
+        ModifyRequestCodec modifyRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getModifyRequest();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, modifyRequest.getMessageId() );
         assertEquals( "cn=testModify,ou=users,ou=system", modifyRequest.getObject().toString() );
 
         List<Modification> modifications = modifyRequest.getModifications();
@@ -572,12 +568,12 @@
         assertEquals( "test", attrValue );
 
         // Check the length
-        assertEquals( 0x5C, message.computeLength() );
+        assertEquals( 0x5C, modifyRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = modifyRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -1085,10 +1081,9 @@
         }
 
         // Check the decoded PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ModifyRequestCodec modifyRequest = message.getModifyRequest();
+        ModifyRequestCodec modifyRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getModifyRequest();
 
-        assertEquals( 49, message.getMessageId() );
+        assertEquals( 49, modifyRequest.getMessageId() );
         assertEquals( "cn=testModify,ou=users,ou=system", modifyRequest.getObject().toString() );
 
         List<Modification> modifications = modifyRequest.getModifications();
@@ -1102,12 +1097,12 @@
         assertEquals( 0, attributeValue.size() );
 
         // Check the length
-        assertEquals( 0x37, message.computeLength() );
+        assertEquals( 0x37, modifyRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = modifyRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -1169,10 +1164,9 @@
         }
 
         // Check the decoded PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ModifyRequestCodec modifyRequest = message.getModifyRequest();
+        ModifyRequestCodec modifyRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getModifyRequest();
 
-        assertEquals( 49, message.getMessageId() );
+        assertEquals( 49, modifyRequest.getMessageId() );
         assertEquals( "cn=testModify,ou=users,ou=system", modifyRequest.getObject().toString() );
 
         List<Modification> modifications = modifyRequest.getModifications();
@@ -1186,21 +1180,21 @@
         assertEquals( 0, attributeValue.size() );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = modifyRequest.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = modifyRequest.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, modifyRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = modifyRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -1261,10 +1255,9 @@
         }
 
         // Check the decoded PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ModifyRequestCodec modifyRequest = message.getModifyRequest();
+        ModifyRequestCodec modifyRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getModifyRequest();
 
-        assertEquals( 49, message.getMessageId() );
+        assertEquals( 49, modifyRequest.getMessageId() );
         assertEquals( "cn=testModify,ou=users,ou=system", modifyRequest.getObject().toString() );
 
         List<Modification> modifications = modifyRequest.getModifications();
@@ -1284,12 +1277,12 @@
         assertEquals( "b", attrValue );
 
         // Check the length
-        assertEquals( 0x3D, message.computeLength() );
+        assertEquals( 0x3D, modifyRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = modifyRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.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;
@@ -89,21 +88,20 @@
         }
 
         // Check the decoded ModifyResponse PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ModifyResponseCodec modifyResponse = message.getModifyResponse();
+        ModifyResponseCodec modifyResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getModifyResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, modifyResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, modifyResponse.getLdapResult().getResultCode() );
         assertEquals( "", modifyResponse.getLdapResult().getMatchedDN() );
         assertEquals( "", modifyResponse.getLdapResult().getErrorMessage() );
 
         // Check the length
-        assertEquals( 0x0E, message.computeLength() );
+        assertEquals( 0x0E, modifyResponse.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = modifyResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -162,30 +160,29 @@
         }
 
         // Check the decoded ModifyResponse PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ModifyResponseCodec modifyResponse = message.getModifyResponse();
+        ModifyResponseCodec modifyResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getModifyResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, modifyResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, modifyResponse.getLdapResult().getResultCode() );
         assertEquals( "", modifyResponse.getLdapResult().getMatchedDN() );
         assertEquals( "", modifyResponse.getLdapResult().getErrorMessage() );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = modifyResponse.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = modifyResponse.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, modifyResponse.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = modifyResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.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.codec.ResponseCarryingException;
 import org.apache.directory.shared.ldap.message.ModifyDnResponseImpl;
@@ -95,22 +94,21 @@
             fail( de.getMessage() );
         }
 
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ModifyDNRequestCodec modifyDNRequest = message.getModifyDNRequest();
+        ModifyDNRequestCodec modifyDNRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getModifyDnRequest();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, modifyDNRequest.getMessageId() );
         assertEquals( "cn=testModify,ou=users,ou=system", modifyDNRequest.getEntry().toString() );
         assertEquals( false, modifyDNRequest.isDeleteOldRDN() );
         assertEquals( "cn=testDNModify", modifyDNRequest.getNewRDN().toString() );
         assertEquals( "ou=system", modifyDNRequest.getNewSuperior().toString() );
 
         // Check the length
-        assertEquals( 0x48, message.computeLength() );
+        assertEquals( 0x48, modifyDNRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = modifyDNRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -325,31 +323,30 @@
             fail( de.getMessage() );
         }
 
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ModifyDNRequestCodec modifyDNRequest = message.getModifyDNRequest();
+        ModifyDNRequestCodec modifyDNRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getModifyDnRequest();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, modifyDNRequest.getMessageId() );
         assertEquals( "cn=testModify,ou=users,ou=system", modifyDNRequest.getEntry().toString() );
         assertEquals( false, modifyDNRequest.isDeleteOldRDN() );
         assertEquals( "cn=testDNModify", modifyDNRequest.getNewRDN().toString() );
         assertEquals( "ou=system", modifyDNRequest.getNewSuperior().toString() );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = modifyDNRequest.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = modifyDNRequest.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the length
-        assertEquals( 0x65, message.computeLength() );
+        assertEquals( 0x65, modifyDNRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = modifyDNRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -407,21 +404,20 @@
             fail( de.getMessage() );
         }
 
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ModifyDNRequestCodec modifyDNRequest = message.getModifyDNRequest();
+        ModifyDNRequestCodec modifyDNRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getModifyDnRequest();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, modifyDNRequest.getMessageId() );
         assertEquals( "cn=testModify,ou=users,ou=system", modifyDNRequest.getEntry().toString() );
         assertEquals( false, modifyDNRequest.isDeleteOldRDN() );
         assertEquals( "cn=testDNModify", modifyDNRequest.getNewRDN().toString() );
 
         // Check the length
-        assertEquals( 0x3D, message.computeLength() );
+        assertEquals( 0x3D, modifyDNRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = modifyDNRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -482,30 +478,29 @@
             fail( de.getMessage() );
         }
 
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ModifyDNRequestCodec modifyDNRequest = message.getModifyDNRequest();
+        ModifyDNRequestCodec modifyDNRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getModifyDnRequest();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, modifyDNRequest.getMessageId() );
         assertEquals( "cn=testModify,ou=users,ou=system", modifyDNRequest.getEntry().toString() );
         assertEquals( false, modifyDNRequest.isDeleteOldRDN() );
         assertEquals( "cn=testDNModify", modifyDNRequest.getNewRDN().toString() );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = modifyDNRequest.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = modifyDNRequest.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the length
-        assertEquals( 0x5A, message.computeLength() );
+        assertEquals( 0x5A, modifyDNRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = modifyDNRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNResponseTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNResponseTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNResponseTest.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;
@@ -90,21 +89,20 @@
         }
 
         // Check the decoded ModifyDNResponse PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ModifyDNResponseCodec modifyDNResponse = message.getModifyDNResponse();
+        ModifyDNResponseCodec modifyDNResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getModifyDnResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, modifyDNResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, modifyDNResponse.getLdapResult().getResultCode() );
         assertEquals( "", modifyDNResponse.getLdapResult().getMatchedDN() );
         assertEquals( "", modifyDNResponse.getLdapResult().getErrorMessage() );
 
         // Check the length
-        assertEquals( 0x0E, message.computeLength() );
+        assertEquals( 0x0E, modifyDNResponse.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = modifyDNResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -164,30 +162,29 @@
         }
 
         // Check the decoded ModifyDNResponse PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ModifyDNResponseCodec modifyDNResponse = message.getModifyDNResponse();
+        ModifyDNResponseCodec modifyDNResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getModifyDnResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, modifyDNResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, modifyDNResponse.getLdapResult().getResultCode() );
         assertEquals( "", modifyDNResponse.getLdapResult().getMatchedDN() );
         assertEquals( "", modifyDNResponse.getLdapResult().getErrorMessage() );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = modifyDNResponse.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = modifyDNResponse.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, modifyDNResponse.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = modifyDNResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java Mon Feb 15 01:37:34 2010
@@ -37,7 +37,6 @@
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.EncoderException;
 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.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
@@ -148,19 +147,18 @@
             fail( de.getMessage() );
         }
 
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequestCodec sr = message.getSearchRequest();
+        SearchRequestCodec searchRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getSearchRequest();
 
-        assertEquals( 1, 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( 1, 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() );
 
         // The attributes
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
 
         for ( EntryAttribute attribute:attributes  )
         {
@@ -168,14 +166,14 @@
         }
 
         // Check the length
-        assertEquals( 0x63, message.computeLength() );
+        assertEquals( 0x63, 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() );
 
@@ -384,19 +382,18 @@
             fail( de.getMessage() );
         }
 
-        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() );
 
         // Extended
-        ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter ) sr.getFilter();
+        ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter ) searchRequest.getFilter();
         assertNotNull( extensibleMatchFilter );
 
         assertEquals( "test", extensibleMatchFilter.getMatchingRule() );
@@ -404,7 +401,7 @@
         assertNull( extensibleMatchFilter.getMatchValue().get() );
         assertFalse( extensibleMatchFilter.isDnAttributes() );
 
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
 
         assertEquals( 0, attributes.size() );
     }
@@ -671,19 +668,18 @@
             fail( de.getMessage() );
         }
 
-        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() );
 
         // Extended
-        ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter ) sr.getFilter();
+        ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter ) searchRequest.getFilter();
         assertNotNull( extensibleMatchFilter );
 
         assertNull( extensibleMatchFilter.getMatchingRule() );
@@ -691,7 +687,7 @@
         assertEquals( "test", extensibleMatchFilter.getMatchValue().getString() );
         assertFalse( extensibleMatchFilter.isDnAttributes() );
 
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
 
         assertEquals( 0, attributes.size() );
     }

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=910150&r1=910149&r2=910150&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 Mon Feb 15 01:37:34 2010
@@ -35,7 +35,6 @@
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.EncoderException;
 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.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
@@ -155,26 +154,25 @@
             fail( de.getMessage() );
         }
 
-        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() );
 
         // (objectclass=t*)
-        SubstringFilter substringFilter = ( SubstringFilter ) sr.getFilter();
+        SubstringFilter substringFilter = ( SubstringFilter ) searchRequest.getFilter();
         assertNotNull( substringFilter );
 
         assertEquals( "objectclass", substringFilter.getType() );
         assertEquals( "t", substringFilter.getInitialSubstrings() );
 
         // The attributes
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
 
         for ( EntryAttribute attribute:attributes )
         {
@@ -182,14 +180,14 @@
         }
 
         // Check the length
-        assertEquals( 0x64, message.computeLength() );
+        assertEquals( 0x64, 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() );
 
@@ -275,26 +273,25 @@
             fail( de.getMessage() );
         }
 
-        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() );
 
         // (objectclass=t*)
-        SubstringFilter substringFilter = ( SubstringFilter ) sr.getFilter();
+        SubstringFilter substringFilter = ( SubstringFilter ) searchRequest.getFilter();
         assertNotNull( substringFilter );
 
         assertEquals( "objectclass", substringFilter.getType() );
         assertEquals( "t", substringFilter.getInitialSubstrings() );
 
         // The attributes
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
 
         for ( EntryAttribute attribute:attributes )
         {
@@ -302,23 +299,23 @@
         }
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = searchRequest.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = searchRequest.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the length
-        assertEquals( 0x0081, message.computeLength() );
+        assertEquals( 0x0081, 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() );
 
@@ -406,19 +403,18 @@
             fail( de.getMessage() );
         }
 
-        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() );
 
         // (objectclass=t*)
-        SubstringFilter substringFilter = ( SubstringFilter ) sr.getFilter();
+        SubstringFilter substringFilter = ( SubstringFilter ) searchRequest.getFilter();
         assertNotNull( substringFilter );
 
         assertEquals( "objectclass", substringFilter.getType() );
@@ -427,7 +423,7 @@
         assertEquals( null, substringFilter.getFinalSubstrings() );
 
         // The attributes
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
 
         for ( EntryAttribute attribute:attributes )
         {
@@ -435,14 +431,14 @@
         }
 
         // Check the length
-        assertEquals( 0x64, message.computeLength() );
+        assertEquals( 0x64, 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() );
 
@@ -524,19 +520,18 @@
             fail( de.getMessage() );
         }
 
-        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() );
 
         // (objectclass=t*)
-        SubstringFilter substringFilter = ( SubstringFilter ) sr.getFilter();
+        SubstringFilter substringFilter = ( SubstringFilter ) searchRequest.getFilter();
         assertNotNull( substringFilter );
 
         assertEquals( "objectclass", substringFilter.getType() );
@@ -545,7 +540,7 @@
         assertEquals( "t", substringFilter.getFinalSubstrings() );
 
         // The attributes
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
 
         for ( EntryAttribute attribute:attributes )
         {
@@ -553,14 +548,14 @@
         }
 
         // Check the length
-        assertEquals( 0x67, message.computeLength() );
+        assertEquals( 0x67, 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() );
 
@@ -643,19 +638,18 @@
             fail( de.getMessage() );
         }
 
-        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() );
 
         // (objectclass=t*)
-        SubstringFilter substringFilter = ( SubstringFilter ) sr.getFilter();
+        SubstringFilter substringFilter = ( SubstringFilter ) searchRequest.getFilter();
         assertNotNull( substringFilter );
 
         assertEquals( "objectclass", substringFilter.getType() );
@@ -664,7 +658,7 @@
         assertEquals( "t", substringFilter.getFinalSubstrings() );
 
         // The attributes
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
 
         for ( EntryAttribute attribute:attributes )
         {
@@ -672,14 +666,14 @@
         }
 
         // Check the length
-        assertEquals( 0x6A, message.computeLength() );
+        assertEquals( 0x6A, 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() );
 
@@ -761,19 +755,18 @@
             fail( de.getMessage() );
         }
 
-        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() );
 
         // (objectclass=t*)
-        SubstringFilter substringFilter = ( SubstringFilter ) sr.getFilter();
+        SubstringFilter substringFilter = ( SubstringFilter ) searchRequest.getFilter();
         assertNotNull( substringFilter );
 
         assertEquals( "objectclass", substringFilter.getType() );
@@ -781,7 +774,7 @@
         assertEquals( "t", substringFilter.getAnySubstrings().get( 0 ) );
 
         // The attributes
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
 
         for ( EntryAttribute attribute:attributes )
         {
@@ -789,14 +782,14 @@
         }
 
         // Check the length
-        assertEquals( 0x67, message.computeLength() );
+        assertEquals( 0x67, 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() );
 
@@ -873,19 +866,18 @@
             fail( de.getMessage() );
         }
 
-        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() );
 
         // (objectclass=t*)
-        SubstringFilter substringFilter = ( SubstringFilter ) sr.getFilter();
+        SubstringFilter substringFilter = ( SubstringFilter ) searchRequest.getFilter();
         assertNotNull( substringFilter );
 
         assertEquals( "objectclass", substringFilter.getType() );
@@ -895,7 +887,7 @@
         assertEquals( "t", substringFilter.getFinalSubstrings() );
 
         // The attributes
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
 
         for ( EntryAttribute attribute:attributes )
         {
@@ -903,14 +895,14 @@
         }
 
         // Check the length
-        assertEquals( 0x6A, message.computeLength() );
+        assertEquals( 0x6A, 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() );
 
@@ -992,19 +984,18 @@
             fail( de.getMessage() );
         }
 
-        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() );
 
         // (objectclass=t*)
-        SubstringFilter substringFilter = ( SubstringFilter ) sr.getFilter();
+        SubstringFilter substringFilter = ( SubstringFilter ) searchRequest.getFilter();
         assertNotNull( substringFilter );
 
         assertEquals( "objectclass", substringFilter.getType() );
@@ -1012,7 +1003,7 @@
         assertEquals( "*", substringFilter.getAnySubstrings().get( 0 ) );
 
         // The attributes
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
 
         for ( EntryAttribute attribute:attributes )
         {
@@ -1020,14 +1011,14 @@
         }
 
         // Check the length
-        assertEquals( 0x67, message.computeLength() );
+        assertEquals( 0x67, 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() );
 
@@ -1110,19 +1101,18 @@
             fail( de.getMessage() );
         }
 
-        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() );
 
         // (objectclass=t*)
-        SubstringFilter substringFilter = ( SubstringFilter ) sr.getFilter();
+        SubstringFilter substringFilter = ( SubstringFilter ) searchRequest.getFilter();
         assertNotNull( substringFilter );
 
         assertEquals( "objectclass", substringFilter.getType() );
@@ -1133,7 +1123,7 @@
         assertEquals( null, substringFilter.getFinalSubstrings() );
 
         // The attributes
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
 
         for ( EntryAttribute attribute:attributes )
         {
@@ -1141,14 +1131,14 @@
         }
 
         // Check the length
-        assertEquals( 0x6A, message.computeLength() );
+        assertEquals( 0x6A, 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() );
 
@@ -1230,19 +1220,18 @@
             fail( de.getMessage() );
         }
 
-        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() );
 
         // (objectclass=t*)
-        SubstringFilter substringFilter = ( SubstringFilter ) sr.getFilter();
+        SubstringFilter substringFilter = ( SubstringFilter ) searchRequest.getFilter();
         assertNotNull( substringFilter );
 
         assertEquals( "objectclass", substringFilter.getType() );
@@ -1251,7 +1240,7 @@
         assertEquals( "Amos", substringFilter.getFinalSubstrings() );
 
         // The attributes
-        List<EntryAttribute> attributes = sr.getAttributes();
+        List<EntryAttribute> attributes = searchRequest.getAttributes();
 
         for ( EntryAttribute attribute:attributes )
         {
@@ -1259,14 +1248,14 @@
         }
 
         // Check the length
-        assertEquals( 0x67, message.computeLength() );
+        assertEquals( 0x67, 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() );
 



Mime
View raw message