directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r910150 [8/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/LdapResultTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java Mon Feb 15 01:37:34 2010
@@ -279,20 +279,19 @@
         }
 
         // Check the decoded AddResponse
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        AddResponseCodec addResponse = message.getAddResponse();
+        AddResponseCodec addResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getAddResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, addResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, addResponse.getLdapResult().getResultCode() );
         assertEquals( "", addResponse.getLdapResult().getMatchedDN() );
         assertEquals( "", addResponse.getLdapResult().getErrorMessage() );
 
         // Check the length
-        assertEquals( 0x0E, message.computeLength() );
+        assertEquals( 0x0E, addResponse.computeLength() );
 
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = addResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -343,10 +342,9 @@
         }
 
         // Check the decoded AddResponse
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        AddResponseCodec addResponse = message.getAddResponse();
+        AddResponseCodec addResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getAddResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, addResponse.getMessageId() );
         assertEquals( ResultCodeEnum.REFERRAL, addResponse.getLdapResult().getResultCode() );
         assertEquals( "", addResponse.getLdapResult().getMatchedDN() );
         assertEquals( "", addResponse.getLdapResult().getErrorMessage() );
@@ -358,11 +356,11 @@
         assertEquals( "ldap:///", referral.toString() );
 
         // Check the length
-        assertEquals( 0x1A, message.computeLength() );
+        assertEquals( 0x1A, addResponse.computeLength() );
 
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = addResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -414,10 +412,9 @@
         }
 
         // Check the decoded AddResponse
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        AddResponseCodec addResponse = message.getAddResponse();
+        AddResponseCodec addResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getAddResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, addResponse.getMessageId() );
         assertEquals( ResultCodeEnum.REFERRAL, addResponse.getLdapResult().getResultCode() );
         assertEquals( "", addResponse.getLdapResult().getMatchedDN() );
         assertEquals( "", addResponse.getLdapResult().getErrorMessage() );
@@ -433,11 +430,11 @@
         assertEquals( "ldap:///", referral.toString() );
 
         // Check the length
-        assertEquals( 0x24, message.computeLength() );
+        assertEquals( 0x24, addResponse.computeLength() );
 
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = addResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -489,10 +486,9 @@
         }
 
         // Check the decoded AddResponse
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        AddResponseCodec addResponse = message.getAddResponse();
+        AddResponseCodec addResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getAddResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, addResponse.getMessageId() );
         assertEquals( ResultCodeEnum.REFERRAL, addResponse.getLdapResult().getResultCode() );
         assertEquals( "", addResponse.getLdapResult().getMatchedDN() );
         assertEquals( "", addResponse.getLdapResult().getErrorMessage() );
@@ -508,11 +504,11 @@
         assertEquals( "ldap:///", referral.toString() );
 
         // Check the length
-        assertEquals( 0x1C, message.computeLength() );
+        assertEquals( 0x1C, addResponse.computeLength() );
 
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = addResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java Mon Feb 15 01:37:34 2010
@@ -32,7 +32,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;
@@ -107,44 +106,43 @@
         }
 
         // Check that everything is OK
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        AbandonRequestCodec abandonRequest = message.getAbandonRequest();
+        AbandonRequestCodec abandonRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getAbandonRequest();
 
-        assertEquals( 3, message.getMessageId() );
+        assertEquals( 3, abandonRequest.getMessageId() );
         assertEquals( 2, abandonRequest.getAbandonedMessageId() );
 
         // Check the Controls
-        List<Control> controls = message.getControls();
+        List<Control> controls = abandonRequest.getControls();
 
         assertEquals( 4, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = abandonRequest.getControls( 0 );
         assertEquals( "1.3.6.1.5.5.1", control.getOid() );
         assertEquals( "0x61 0x62 0x63 0x64 0x65 0x66 ", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
         assertTrue( control.isCritical() );
 
-        control = message.getControls( 1 );
+        control = abandonRequest.getControls( 1 );
         assertEquals( "1.3.6.1.5.5.2", control.getOid() );
         assertEquals( "0x67 0x68 0x69 0x6A 0x6B 0x6C ", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
         assertFalse( control.isCritical() );
 
-        control = message.getControls( 2 );
+        control = abandonRequest.getControls( 2 );
         assertEquals( "1.3.6.1.5.5.3", control.getOid() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
         assertTrue( control.isCritical() );
 
-        control = message.getControls( 3 );
+        control = abandonRequest.getControls( 3 );
         assertEquals( "1.3.6.1.5.5.4", control.getOid() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
         assertFalse( control.isCritical() );
 
         // Check the length
-        assertEquals( 0x64, message.computeLength() );
+        assertEquals( 0x64, abandonRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = abandonRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -195,19 +193,18 @@
         }
 
         // Check that everything is OK
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        AbandonRequestCodec abandonRequest = message.getAbandonRequest();
+        AbandonRequestCodec abandonRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getAbandonRequest();
 
-        assertEquals( 32787, message.getMessageId() );
+        assertEquals( 32787, abandonRequest.getMessageId() );
         assertEquals( 2, abandonRequest.getAbandonedMessageId() );
 
         // Check the length
-        assertEquals( 10, message.computeLength() );
+        assertEquals( 10, abandonRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = abandonRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java Mon Feb 15 01:37:34 2010
@@ -37,7 +37,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.entry.Entry;
@@ -113,11 +112,10 @@
             fail( de.getMessage() );
         }
 
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        AddRequestCodec addRequest = message.getAddRequest();
+        AddRequestCodec addRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getAddRequest();
 
         // Check the decoded message
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, addRequest.getMessageId() );
         assertEquals( "cn=testModify,ou=users,ou=system", addRequest.getEntryDn().toString() );
 
         Entry entry = addRequest.getEntry();
@@ -168,7 +166,7 @@
         }
 
         // Check the length
-        assertEquals( 0x59, message.computeLength() );
+        assertEquals( 0x59, addRequest.computeLength() );
     }
 
 
@@ -605,11 +603,10 @@
             fail( de.getMessage() );
         }
 
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        AddRequestCodec addRequest = message.getAddRequest();
+        AddRequestCodec addRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getAddRequest();
 
         // Check the decoded message
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, addRequest.getMessageId() );
         assertEquals( "cn=testModify,ou=users,ou=system", addRequest.getEntryDn().toString() );
 
         Entry entry = addRequest.getEntry();
@@ -626,12 +623,12 @@
         }
 
         // Check the length
-        assertEquals( 0x34, message.computeLength() );
+        assertEquals( 0x34, addRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = addRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -694,11 +691,10 @@
             fail( de.getMessage() );
         }
 
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        AddRequestCodec addRequest = message.getAddRequest();
+        AddRequestCodec addRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getAddRequest();
 
         // Check the decoded message
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, addRequest.getMessageId() );
         assertEquals( "cn=testModify,ou=users,ou=system", addRequest.getEntryDn().toString() );
 
         Entry entry = addRequest.getEntry();
@@ -715,21 +711,21 @@
         }
 
         // Check the length
-        assertEquals( 0x51, message.computeLength() );
+        assertEquals( 0x51, addRequest.computeLength() );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = addRequest.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = addRequest.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = addRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java 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;
@@ -87,20 +86,19 @@
         }
 
         // Check the decoded AddResponse
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        AddResponseCodec addResponse = message.getAddResponse();
+        AddResponseCodec addResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getAddResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, addResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, addResponse.getLdapResult().getResultCode() );
         assertEquals( "", addResponse.getLdapResult().getMatchedDN() );
         assertEquals( "", addResponse.getLdapResult().getErrorMessage() );
 
         // Check the length
-        assertEquals( 0x0E, message.computeLength() );
+        assertEquals( 0x0E, addResponse.computeLength() );
 
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = addResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -195,29 +193,28 @@
         }
 
         // Check the decoded AddResponse
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        AddResponseCodec addResponse = message.getAddResponse();
+        AddResponseCodec addResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getAddResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, addResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, addResponse.getLdapResult().getResultCode() );
         assertEquals( "", addResponse.getLdapResult().getMatchedDN() );
         assertEquals( "", addResponse.getLdapResult().getErrorMessage() );
 
         // Check the length
-        assertEquals( 0x2B, message.computeLength() );
+        assertEquals( 0x2B, addResponse.computeLength() );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = addResponse.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = addResponse.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
 
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = addResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java Mon Feb 15 01:37:34 2010
@@ -30,7 +30,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.controls.ControlImpl;
 import org.apache.directory.shared.ldap.message.control.Control;
@@ -85,7 +84,7 @@
         try
         {
             int nbLoops = 1;
-            long t0 = System.currentTimeMillis();
+            //long t0 = System.currentTimeMillis();
             
             for ( int i = 0; i < nbLoops; i++ )
             {
@@ -94,7 +93,7 @@
                 stream.flip();
             }
             
-            long t1 = System.currentTimeMillis();
+            //long t1 = System.currentTimeMillis();
             //System.out.println( "testDecodeBindRequestSimpleNoControlsPerf, " + nbLoops + " loops, Delta = " + ( t1 - t0 ) );
             
             ldapDecoder.decode( stream, ldapMessageContainer );
@@ -106,32 +105,31 @@
         }
 
         // Check the decoded BindRequest
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequestCodec br = message.getBindRequest();
+        BindRequestCodec bindRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getBindRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( 3, br.getVersion() );
-        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName().toString() );
-        assertEquals( true, ( br.getAuthentication() instanceof SimpleAuthentication ) );
-        assertEquals( "password", StringTools.utf8ToString( ( ( SimpleAuthentication ) br.getAuthentication() )
+        assertEquals( 1, bindRequest.getMessageId() );
+        assertEquals( 3, bindRequest.getVersion() );
+        assertEquals( "uid=akarasulu,dc=example,dc=com", bindRequest.getName().toString() );
+        assertEquals( true, ( bindRequest.getAuthentication() instanceof SimpleAuthentication ) );
+        assertEquals( "password", StringTools.utf8ToString( ( ( SimpleAuthentication ) bindRequest.getAuthentication() )
             .getSimple() ) );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = bindRequest.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = bindRequest.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the length
-        assertEquals( 0x52, message.computeLength() );
+        assertEquals( 0x52, bindRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = bindRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -158,25 +156,23 @@
         for ( int i = 0; i< nbLoops; i++)
         {
             // Check the decoded BindRequest
-            LdapMessageCodec message = new LdapMessageCodec();
-            message.setMessageId( 1 );
+            BindRequestCodec bindRequest = new BindRequestCodec();
+            bindRequest.setMessageId( 1 );
             
-            BindRequestCodec br = new BindRequestCodec();
-            br.setName( name );
+            bindRequest.setName( name );
             
             Control control = new ControlImpl( "2.16.840.1.113730.3.4.2" );
 
             LdapAuthentication authentication = new SimpleAuthentication();
             ((SimpleAuthentication)authentication).setSimple( StringTools.getBytesUtf8( "password" ) );
 
-            message.addControl( control );
-            br.setAuthentication( authentication );
-            message.setProtocolOP( br );
+            bindRequest.addControl( control );
+            bindRequest.setAuthentication( authentication );
     
             // Check the encoding
             try
             {
-                message.encode( null );
+                bindRequest.encode();
             }
             catch ( EncoderException ee )
             {

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java 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.BindResponseImpl;
@@ -132,7 +131,7 @@
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = message.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -190,23 +189,22 @@
         }
 
         // Check the decoded BindRequest
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequestCodec br = message.getBindRequest();
+        BindRequestCodec bindRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getBindRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( 3, br.getVersion() );
-        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName().toString() );
-        assertEquals( true, ( br.getAuthentication() instanceof SimpleAuthentication ) );
-        assertEquals( "password", StringTools.utf8ToString( ( ( SimpleAuthentication ) br.getAuthentication() )
+        assertEquals( 1, bindRequest.getMessageId() );
+        assertEquals( 3, bindRequest.getVersion() );
+        assertEquals( "uid=akarasulu,dc=example,dc=com", bindRequest.getName().toString() );
+        assertEquals( true, ( bindRequest.getAuthentication() instanceof SimpleAuthentication ) );
+        assertEquals( "password", StringTools.utf8ToString( ( ( SimpleAuthentication ) bindRequest.getAuthentication() )
             .getSimple() ) );
 
         // Check the length
-        assertEquals( 0x35, message.computeLength() );
+        assertEquals( 0x35, bindRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = bindRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -354,23 +352,22 @@
         }
 
         // Check the decoded BindRequest
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequestCodec br = message.getBindRequest();
+        BindRequestCodec bindRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getBindRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( 3, br.getVersion() );
-        assertEquals( "", br.getName().toString() );
-        assertEquals( true, ( br.getAuthentication() instanceof SimpleAuthentication ) );
-        assertEquals( "password", StringTools.utf8ToString( ( ( SimpleAuthentication ) br.getAuthentication() )
+        assertEquals( 1, bindRequest.getMessageId() );
+        assertEquals( 3, bindRequest.getVersion() );
+        assertEquals( "", bindRequest.getName().toString() );
+        assertEquals( true, ( bindRequest.getAuthentication() instanceof SimpleAuthentication ) );
+        assertEquals( "password", StringTools.utf8ToString( ( ( SimpleAuthentication ) bindRequest.getAuthentication() )
             .getSimple() ) );
 
         // Check the length
-        assertEquals( 0x16, message.computeLength() );
+        assertEquals( 0x16, bindRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = bindRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -432,22 +429,21 @@
         }
 
         // Check the decoded BindRequest
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequestCodec br = message.getBindRequest();
+        BindRequestCodec bindRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getBindRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( 3, br.getVersion() );
-        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName().toString() );
-        assertEquals( true, ( br.getAuthentication() instanceof SaslCredentials ) );
-        assertEquals( "KERBEROS_V4", ( ( SaslCredentials ) br.getAuthentication() ).getMechanism() );
+        assertEquals( 1, bindRequest.getMessageId() );
+        assertEquals( 3, bindRequest.getVersion() );
+        assertEquals( "uid=akarasulu,dc=example,dc=com", bindRequest.getName().toString() );
+        assertEquals( true, ( bindRequest.getAuthentication() instanceof SaslCredentials ) );
+        assertEquals( "KERBEROS_V4", ( ( SaslCredentials ) bindRequest.getAuthentication() ).getMechanism() );
 
         // Check the length
-        assertEquals( 0x3A, message.computeLength() );
+        assertEquals( 0x3A, bindRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = bindRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -516,24 +512,23 @@
         }
 
         // Check the decoded BindRequest
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequestCodec br = message.getBindRequest();
+        BindRequestCodec bindRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getBindRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( 3, br.getVersion() );
-        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName().toString() );
-        assertEquals( true, ( br.getAuthentication() instanceof SaslCredentials ) );
-        assertEquals( "KERBEROS_V4", ( ( SaslCredentials ) br.getAuthentication() ).getMechanism() );
-        assertEquals( "abcdef", StringTools.utf8ToString( ( ( SaslCredentials ) br.getAuthentication() )
+        assertEquals( 1, bindRequest.getMessageId() );
+        assertEquals( 3, bindRequest.getVersion() );
+        assertEquals( "uid=akarasulu,dc=example,dc=com", bindRequest.getName().toString() );
+        assertEquals( true, ( bindRequest.getAuthentication() instanceof SaslCredentials ) );
+        assertEquals( "KERBEROS_V4", ( ( SaslCredentials ) bindRequest.getAuthentication() ).getMechanism() );
+        assertEquals( "abcdef", StringTools.utf8ToString( ( ( SaslCredentials ) bindRequest.getAuthentication() )
             .getCredentials() ) );
 
         // Check the length
-        assertEquals( 0x42, message.computeLength() );
+        assertEquals( 0x42, bindRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = bindRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -600,24 +595,23 @@
         }
 
         // Check the decoded BindRequest
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequestCodec br = message.getBindRequest();
+        BindRequestCodec bindRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getBindRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( 3, br.getVersion() );
-        assertEquals( "", br.getName().toString() );
-        assertEquals( true, ( br.getAuthentication() instanceof SaslCredentials ) );
-        assertEquals( "KERBEROS_V4", ( ( SaslCredentials ) br.getAuthentication() ).getMechanism() );
-        assertEquals( "abcdef", StringTools.utf8ToString( ( ( SaslCredentials ) br.getAuthentication() )
+        assertEquals( 1, bindRequest.getMessageId() );
+        assertEquals( 3, bindRequest.getVersion() );
+        assertEquals( "", bindRequest.getName().toString() );
+        assertEquals( true, ( bindRequest.getAuthentication() instanceof SaslCredentials ) );
+        assertEquals( "KERBEROS_V4", ( ( SaslCredentials ) bindRequest.getAuthentication() ).getMechanism() );
+        assertEquals( "abcdef", StringTools.utf8ToString( ( ( SaslCredentials ) bindRequest.getAuthentication() )
             .getCredentials() ) );
 
         // Check the length
-        assertEquals( 0x23, message.computeLength() );
+        assertEquals( 0x23, bindRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = bindRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -925,22 +919,21 @@
         }
 
         // Check the decoded BindRequest
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequestCodec br = message.getBindRequest();
+        BindRequestCodec bindRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getBindRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( 3, br.getVersion() );
-        assertEquals( "", br.getName().toString() );
-        assertEquals( true, ( br.getAuthentication() instanceof SimpleAuthentication ) );
-        assertEquals( "", StringTools.utf8ToString( ( ( SimpleAuthentication ) br.getAuthentication() ).getSimple() ) );
+        assertEquals( 1, bindRequest.getMessageId() );
+        assertEquals( 3, bindRequest.getVersion() );
+        assertEquals( "", bindRequest.getName().toString() );
+        assertEquals( true, ( bindRequest.getAuthentication() instanceof SimpleAuthentication ) );
+        assertEquals( "", StringTools.utf8ToString( ( ( SimpleAuthentication ) bindRequest.getAuthentication() ).getSimple() ) );
 
         // Check the length
-        assertEquals( 0x0E, message.computeLength() );
+        assertEquals( 0x0E, bindRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = bindRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -1034,22 +1027,21 @@
         }
 
         // Check the decoded BindRequest
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequestCodec br = message.getBindRequest();
+        BindRequestCodec bindRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getBindRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( 3, br.getVersion() );
-        assertEquals( "", br.getName().toString() );
-        assertEquals( true, ( br.getAuthentication() instanceof SaslCredentials ) );
-        assertEquals( "", ( ( SaslCredentials ) br.getAuthentication() ).getMechanism() );
+        assertEquals( 1, bindRequest.getMessageId() );
+        assertEquals( 3, bindRequest.getVersion() );
+        assertEquals( "", bindRequest.getName().toString() );
+        assertEquals( true, ( bindRequest.getAuthentication() instanceof SaslCredentials ) );
+        assertEquals( "", ( ( SaslCredentials ) bindRequest.getAuthentication() ).getMechanism() );
 
         // Check the length
-        assertEquals( 0x10, message.computeLength() );
+        assertEquals( 0x10, bindRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = bindRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -1145,23 +1137,22 @@
         }
 
         // Check the decoded BindRequest
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequestCodec br = message.getBindRequest();
+        BindRequestCodec bindRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getBindRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( 3, br.getVersion() );
-        assertEquals( "", br.getName().toString() );
-        assertEquals( true, ( br.getAuthentication() instanceof SaslCredentials ) );
-        assertEquals( "", ( ( SaslCredentials ) br.getAuthentication() ).getMechanism() );
-        assertEquals( "", StringTools.utf8ToString( ( ( SaslCredentials ) br.getAuthentication() ).getCredentials() ) );
+        assertEquals( 1, bindRequest.getMessageId() );
+        assertEquals( 3, bindRequest.getVersion() );
+        assertEquals( "", bindRequest.getName().toString() );
+        assertEquals( true, ( bindRequest.getAuthentication() instanceof SaslCredentials ) );
+        assertEquals( "", ( ( SaslCredentials ) bindRequest.getAuthentication() ).getMechanism() );
+        assertEquals( "", StringTools.utf8ToString( ( ( SaslCredentials ) bindRequest.getAuthentication() ).getCredentials() ) );
 
         // Check the length
-        assertEquals( 0x12, message.computeLength() );
+        assertEquals( 0x12, bindRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = bindRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -1218,32 +1209,31 @@
         }
 
         // Check the decoded BindRequest
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequestCodec br = message.getBindRequest();
+        BindRequestCodec bindRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getBindRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( 3, br.getVersion() );
-        assertEquals( "", br.getName().toString() );
-        assertEquals( true, ( br.getAuthentication() instanceof SaslCredentials ) );
-        assertEquals( "", ( ( SaslCredentials ) br.getAuthentication() ).getMechanism() );
-        assertEquals( "", StringTools.utf8ToString( ( ( SaslCredentials ) br.getAuthentication() ).getCredentials() ) );
+        assertEquals( 1, bindRequest.getMessageId() );
+        assertEquals( 3, bindRequest.getVersion() );
+        assertEquals( "", bindRequest.getName().toString() );
+        assertEquals( true, ( bindRequest.getAuthentication() instanceof SaslCredentials ) );
+        assertEquals( "", ( ( SaslCredentials ) bindRequest.getAuthentication() ).getMechanism() );
+        assertEquals( "", StringTools.utf8ToString( ( ( SaslCredentials ) bindRequest.getAuthentication() ).getCredentials() ) );
 
         // Check the length
-        assertEquals( 0x2F, message.computeLength() );
+        assertEquals( 0x2F, bindRequest.computeLength() );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = bindRequest.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = bindRequest.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = bindRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -1298,32 +1288,31 @@
         }
 
         // Check the decoded BindRequest
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequestCodec br = message.getBindRequest();
+        BindRequestCodec bindRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getBindRequest();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( 3, br.getVersion() );
-        assertEquals( "", br.getName().toString() );
-        assertEquals( true, ( br.getAuthentication() instanceof SaslCredentials ) );
-        assertEquals( "", ( ( SaslCredentials ) br.getAuthentication() ).getMechanism() );
-        assertEquals( "", StringTools.utf8ToString( ( ( SaslCredentials ) br.getAuthentication() ).getCredentials() ) );
+        assertEquals( 1, bindRequest.getMessageId() );
+        assertEquals( 3, bindRequest.getVersion() );
+        assertEquals( "", bindRequest.getName().toString() );
+        assertEquals( true, ( bindRequest.getAuthentication() instanceof SaslCredentials ) );
+        assertEquals( "", ( ( SaslCredentials ) bindRequest.getAuthentication() ).getMechanism() );
+        assertEquals( "", StringTools.utf8ToString( ( ( SaslCredentials ) bindRequest.getAuthentication() ).getCredentials() ) );
 
         // Check the length
-        assertEquals( 0x2D, message.computeLength() );
+        assertEquals( 0x2D, bindRequest.computeLength() );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = bindRequest.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = bindRequest.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = bindRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -1370,7 +1359,7 @@
             // Check the encoding
             try
             {
-                message.encode( null );
+                message.encode();
             }
             catch ( EncoderException ee )
             {

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java Mon Feb 15 01:37:34 2010
@@ -32,7 +32,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.search.controls.pagedSearch.PagedResultsControl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
@@ -90,21 +89,20 @@
         }
 
         // Check the decoded BindResponse
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindResponseCodec br = message.getBindResponse();
+        BindResponseCodec bindResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getBindResponse();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( ResultCodeEnum.SUCCESS, br.getLdapResult().getResultCode() );
-        assertEquals( "", br.getLdapResult().getMatchedDN() );
-        assertEquals( "", br.getLdapResult().getErrorMessage() );
+        assertEquals( 1, bindResponse.getMessageId() );
+        assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode() );
+        assertEquals( "", bindResponse.getLdapResult().getMatchedDN() );
+        assertEquals( "", bindResponse.getLdapResult().getErrorMessage() );
 
         // Check the length
-        assertEquals( 0x0E, message.computeLength() );
+        assertEquals( 0x0E, bindResponse.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = bindResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -174,23 +172,22 @@
         }
 
         // Check the decoded BindResponse
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindResponseCodec br = message.getBindResponse();
+        BindResponseCodec bindResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getBindResponse();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( ResultCodeEnum.SUCCESS, br.getLdapResult().getResultCode() );
-        assertEquals( "", br.getLdapResult().getMatchedDN() );
-        assertEquals( "", br.getLdapResult().getErrorMessage() );
+        assertEquals( 1, bindResponse.getMessageId() );
+        assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode() );
+        assertEquals( "", bindResponse.getLdapResult().getMatchedDN() );
+        assertEquals( "", bindResponse.getLdapResult().getErrorMessage() );
 
         // Check the length
-        assertEquals( 0x3C, message.computeLength() );
+        assertEquals( 0x3C, bindResponse.computeLength() );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = bindResponse.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = bindResponse.getControls( 0 );
         assertEquals( "1.2.840.113556.1.4.319", control.getOid() );
         assertTrue( control instanceof PagedResultsControl );
         
@@ -202,7 +199,7 @@
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = bindResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -261,22 +258,21 @@
         }
 
         // Check the decoded BindResponse
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindResponseCodec br = message.getBindResponse();
+        BindResponseCodec bindResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getBindResponse();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( ResultCodeEnum.SUCCESS, br.getLdapResult().getResultCode() );
-        assertEquals( "", br.getLdapResult().getMatchedDN() );
-        assertEquals( "", br.getLdapResult().getErrorMessage() );
-        assertEquals( "", StringTools.utf8ToString( br.getServerSaslCreds() ) );
+        assertEquals( 1, bindResponse.getMessageId() );
+        assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode() );
+        assertEquals( "", bindResponse.getLdapResult().getMatchedDN() );
+        assertEquals( "", bindResponse.getLdapResult().getErrorMessage() );
+        assertEquals( "", StringTools.utf8ToString( bindResponse.getServerSaslCreds() ) );
 
         // Check the length
-        assertEquals( 0x10, message.computeLength() );
+        assertEquals( 0x10, bindResponse.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = bindResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -338,31 +334,30 @@
         }
 
         // Check the decoded BindResponse
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindResponseCodec br = message.getBindResponse();
+        BindResponseCodec bindResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getBindResponse();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( ResultCodeEnum.SUCCESS, br.getLdapResult().getResultCode() );
-        assertEquals( "", br.getLdapResult().getMatchedDN() );
-        assertEquals( "", br.getLdapResult().getErrorMessage() );
-        assertEquals( "", StringTools.utf8ToString( br.getServerSaslCreds() ) );
+        assertEquals( 1, bindResponse.getMessageId() );
+        assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode() );
+        assertEquals( "", bindResponse.getLdapResult().getMatchedDN() );
+        assertEquals( "", bindResponse.getLdapResult().getErrorMessage() );
+        assertEquals( "", StringTools.utf8ToString( bindResponse.getServerSaslCreds() ) );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = bindResponse.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = bindResponse.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the length
-        assertEquals( 0x2D, message.computeLength() );
+        assertEquals( 0x2D, bindResponse.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = bindResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -421,22 +416,21 @@
         }
 
         // Check the decoded BindResponse
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindResponseCodec br = message.getBindResponse();
+        BindResponseCodec bindResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getBindResponse();
 
-        assertEquals( 1, message.getMessageId() );
-        assertEquals( ResultCodeEnum.SUCCESS, br.getLdapResult().getResultCode() );
-        assertEquals( "", br.getLdapResult().getMatchedDN() );
-        assertEquals( "", br.getLdapResult().getErrorMessage() );
-        assertEquals( "AB", StringTools.utf8ToString( br.getServerSaslCreds() ) );
+        assertEquals( 1, bindResponse.getMessageId() );
+        assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode() );
+        assertEquals( "", bindResponse.getLdapResult().getMatchedDN() );
+        assertEquals( "", bindResponse.getLdapResult().getErrorMessage() );
+        assertEquals( "AB", StringTools.utf8ToString( bindResponse.getServerSaslCreds() ) );
 
         // Check the length
-        assertEquals( 0x12, message.computeLength() );
+        assertEquals( 0x12, bindResponse.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = bindResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java 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.CompareResponseImpl;
@@ -96,21 +95,20 @@
         }
 
         // Ceck the decoded CompareRequest PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        CompareRequestCodec compareRequest = message.getCompareRequest();
+        CompareRequestCodec compareRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getCompareRequest();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, compareRequest.getMessageId() );
         assertEquals( "cn=testModify,ou=users,ou=system", compareRequest.getEntry().toString() );
         assertEquals( "test", compareRequest.getAttributeDesc() );
         assertEquals( "value", compareRequest.getAssertionValue().toString() );
 
         // Check the length
-        assertEquals( 0x38, message.computeLength() );
+        assertEquals( 0x38, compareRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = compareRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -382,22 +380,21 @@
             fail( de.getMessage() );
         }
 
-        // Ceck the decoded CompareRequest PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        CompareRequestCodec compareRequest = message.getCompareRequest();
+        // Check the decoded CompareRequest PDU
+        CompareRequestCodec compareRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getCompareRequest();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, compareRequest.getMessageId() );
         assertEquals( "cn=testModify,ou=users,ou=system", compareRequest.getEntry().toString() );
         assertEquals( "test", compareRequest.getAttributeDesc() );
         assertEquals( "", compareRequest.getAssertionValue().toString() );
 
         // Check the length
-        assertEquals( 0x33, message.computeLength() );
+        assertEquals( 0x33, compareRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = compareRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -460,30 +457,29 @@
         }
 
         // Ceck the decoded CompareRequest PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        CompareRequestCodec compareRequest = message.getCompareRequest();
+        CompareRequestCodec compareRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getCompareRequest();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, compareRequest.getMessageId() );
         assertEquals( "cn=testModify,ou=users,ou=system", compareRequest.getEntry().toString() );
         assertEquals( "test", compareRequest.getAttributeDesc() );
         assertEquals( "value", compareRequest.getAssertionValue().toString() );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = compareRequest.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = compareRequest.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the length
-        assertEquals( 0x55, message.computeLength() );
+        assertEquals( 0x55, compareRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = compareRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 

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

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java 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.DeleteResponseImpl;
@@ -88,19 +87,18 @@
         }
 
         // Check the decoded DelRequest PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        DelRequestCodec delRequest = message.getDelRequest();
+        DelRequestCodec delRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getDelRequest();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, delRequest.getMessageId() );
         assertEquals( "cn=testModify,ou=users,ou=system", delRequest.getEntry().toString() );
 
         // Check the length
-        assertEquals( 0x27, message.computeLength() );
+        assertEquals( 0x27, delRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = delRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -235,28 +233,27 @@
         }
 
         // Check the decoded DelRequest PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        DelRequestCodec delRequest = message.getDelRequest();
+        DelRequestCodec delRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getDelRequest();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, delRequest.getMessageId() );
         assertEquals( "cn=testModify,ou=users,ou=system", delRequest.getEntry().toString() );
 
         // Check the length
-        assertEquals( 0x44, message.computeLength() );
+        assertEquals( 0x44, delRequest.computeLength() );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = delRequest.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = delRequest.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = delRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.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;
@@ -91,21 +90,20 @@
         }
 
         // Check the decoded DelResponse PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        DelResponseCodec delResponse = message.getDelResponse();
+        DelResponseCodec delResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getDelResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, delResponse.getMessageId() );
         assertEquals( ResultCodeEnum.ALIAS_PROBLEM, delResponse.getLdapResult().getResultCode() );
         assertEquals( "uid=akarasulu,dc=example,dc=com", delResponse.getLdapResult().getMatchedDN() );
         assertEquals( "", delResponse.getLdapResult().getErrorMessage() );
 
         // Check the length
-        assertEquals( 0x2D, message.computeLength() );
+        assertEquals( 0x2D, delResponse.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = delResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -204,30 +202,29 @@
         }
 
         // Check the decoded DelResponse PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        DelResponseCodec delResponse = message.getDelResponse();
+        DelResponseCodec delResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getDelResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, delResponse.getMessageId() );
         assertEquals( ResultCodeEnum.ALIAS_PROBLEM, delResponse.getLdapResult().getResultCode() );
         assertEquals( "uid=akarasulu,dc=example,dc=com", delResponse.getLdapResult().getMatchedDN() );
         assertEquals( "", delResponse.getLdapResult().getErrorMessage() );
 
         // Check the length
-        assertEquals( 0x4A, message.computeLength() );
+        assertEquals( 0x4A, delResponse.computeLength() );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = delResponse.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = delResponse.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = delResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestTest.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 ExtendedRequest PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ExtendedRequestCodec extendedRequest = message.getExtendedRequest();
+        ExtendedRequestCodec extendedRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getExtendedRequest();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, extendedRequest.getMessageId() );
         assertEquals( "1.3.6.1.5.5.2", extendedRequest.getRequestName() );
         assertEquals( "value", StringTools.utf8ToString( extendedRequest.getRequestValue() ) );
 
         // Check the length
-        assertEquals( 0x1D, message.computeLength() );
+        assertEquals( 0x1D, extendedRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = extendedRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -157,29 +155,28 @@
         }
 
         // Check the decoded ExtendedRequest PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ExtendedRequestCodec extendedRequest = message.getExtendedRequest();
+        ExtendedRequestCodec extendedRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getExtendedRequest();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, extendedRequest.getMessageId() );
         assertEquals( "1.3.6.1.5.5.2", extendedRequest.getRequestName() );
         assertEquals( "value", StringTools.utf8ToString( extendedRequest.getRequestValue() ) );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = extendedRequest.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = extendedRequest.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, extendedRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = extendedRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -239,29 +236,28 @@
         }
 
         // Check the decoded ExtendedRequest PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ExtendedRequestCodec extendedRequest = message.getExtendedRequest();
+        ExtendedRequestCodec extendedRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getExtendedRequest();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, extendedRequest.getMessageId() );
         assertEquals( "1.3.6.1.5.5.2", extendedRequest.getRequestName() );
         assertEquals( "", StringTools.utf8ToString( extendedRequest.getRequestValue() ) );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = extendedRequest.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = extendedRequest.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, extendedRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = extendedRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -424,19 +420,18 @@
         }
 
         // Check the decoded ExtendedRequest PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ExtendedRequestCodec extendedRequest = message.getExtendedRequest();
+        ExtendedRequestCodec extendedRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getExtendedRequest();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, extendedRequest.getMessageId() );
         assertEquals( "1.3.6.1.5.5.2", extendedRequest.getRequestName() );
 
         // Check the length
-        assertEquals( 0x16, message.computeLength() );
+        assertEquals( 0x16, extendedRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = extendedRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -490,20 +485,19 @@
         }
 
         // Check the decoded ExtendedRequest PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ExtendedRequestCodec extendedRequest = message.getExtendedRequest();
+        ExtendedRequestCodec extendedRequest = ( ( LdapMessageContainer ) ldapMessageContainer ).getExtendedRequest();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, extendedRequest.getMessageId() );
         assertEquals( "1.3.6.1.5.5.2", extendedRequest.getRequestName() );
         assertEquals( "", StringTools.utf8ToString( extendedRequest.getRequestValue() ) );
 
         // Check the length
-        assertEquals( 0x18, message.computeLength() );
+        assertEquals( 0x18, extendedRequest.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = extendedRequest.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.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;
@@ -92,10 +91,9 @@
         }
 
         // Check the decoded ExtendedResponse PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ExtendedResponseCodec extendedResponse = message.getExtendedResponse();
+        ExtendedResponseCodec extendedResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getExtendedResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, extendedResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, extendedResponse.getLdapResult().getResultCode() );
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDN() );
         assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
@@ -103,12 +101,12 @@
         assertEquals( "value", StringTools.utf8ToString( ( byte[] ) extendedResponse.getResponse() ) );
 
         // Check the length
-        assertEquals( 0x24, message.computeLength() );
+        assertEquals( 0x24, extendedResponse.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = extendedResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -178,10 +176,9 @@
         }
 
         // Check the decoded ExtendedResponse PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ExtendedResponseCodec extendedResponse = message.getExtendedResponse();
+        ExtendedResponseCodec extendedResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getExtendedResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, extendedResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, extendedResponse.getLdapResult().getResultCode() );
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDN() );
         assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
@@ -189,21 +186,21 @@
         assertEquals( "value", StringTools.utf8ToString( ( byte[] ) extendedResponse.getResponse() ) );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = extendedResponse.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = extendedResponse.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the length
-        assertEquals( 0x41, message.computeLength() );
+        assertEquals( 0x41, extendedResponse.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = extendedResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -261,21 +258,20 @@
         }
 
         // Check the decoded ExtendedResponse PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ExtendedResponseCodec extendedResponse = message.getExtendedResponse();
+        ExtendedResponseCodec extendedResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getExtendedResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, extendedResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, extendedResponse.getLdapResult().getResultCode() );
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDN() );
         assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
 
         // Check the length
-        assertEquals( 0x0E, message.computeLength() );
+        assertEquals( 0x0E, extendedResponse.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = extendedResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -335,30 +331,29 @@
         }
 
         // Check the decoded ExtendedResponse PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ExtendedResponseCodec extendedResponse = message.getExtendedResponse();
+        ExtendedResponseCodec extendedResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getExtendedResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, extendedResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, extendedResponse.getLdapResult().getResultCode() );
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDN() );
         assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = extendedResponse.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = extendedResponse.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, extendedResponse.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = extendedResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -539,10 +534,9 @@
         }
 
         // Check the decoded ExtendedResponse PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ExtendedResponseCodec extendedResponse = message.getExtendedResponse();
+        ExtendedResponseCodec extendedResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getExtendedResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, extendedResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, extendedResponse.getLdapResult().getResultCode() );
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDN() );
         assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
@@ -550,12 +544,12 @@
         assertEquals( "", StringTools.utf8ToString( ( byte[] ) extendedResponse.getResponse() ) );
 
         // Check the length
-        assertEquals( 0x1D, message.computeLength() );
+        assertEquals( 0x1D, extendedResponse.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = extendedResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -616,10 +610,9 @@
         }
 
         // Check the decoded ExtendedResponse PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ExtendedResponseCodec extendedResponse = message.getExtendedResponse();
+        ExtendedResponseCodec extendedResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getExtendedResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, extendedResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, extendedResponse.getLdapResult().getResultCode() );
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDN() );
         assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
@@ -627,21 +620,21 @@
         assertEquals( "", StringTools.utf8ToString( ( byte[] ) extendedResponse.getResponse() ) );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = extendedResponse.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = extendedResponse.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, extendedResponse.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = extendedResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -700,10 +693,9 @@
         }
 
         // Check the decoded ExtendedResponse PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ExtendedResponseCodec extendedResponse = message.getExtendedResponse();
+        ExtendedResponseCodec extendedResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getExtendedResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, extendedResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, extendedResponse.getLdapResult().getResultCode() );
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDN() );
         assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
@@ -711,12 +703,12 @@
         assertEquals( "", StringTools.utf8ToString( ( byte[] ) extendedResponse.getResponse() ) );
 
         // Check the length
-        assertEquals( 0x1F, message.computeLength() );
+        assertEquals( 0x1F, extendedResponse.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = extendedResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 
@@ -778,10 +770,9 @@
         }
 
         // Check the decoded ExtendedResponse PDU
-        LdapMessageCodec message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ExtendedResponseCodec extendedResponse = message.getExtendedResponse();
+        ExtendedResponseCodec extendedResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getExtendedResponse();
 
-        assertEquals( 1, message.getMessageId() );
+        assertEquals( 1, extendedResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, extendedResponse.getLdapResult().getResultCode() );
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDN() );
         assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
@@ -789,21 +780,21 @@
         assertEquals( "", StringTools.utf8ToString( ( byte[] ) extendedResponse.getResponse() ) );
 
         // Check the Control
-        List<Control> controls = message.getControls();
+        List<Control> controls = extendedResponse.getControls();
 
         assertEquals( 1, controls.size() );
 
-        Control control = message.getControls( 0 );
+        Control control = extendedResponse.getControls( 0 );
         assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
 
         // Check the length
-        assertEquals( 0x3C, message.computeLength() );
+        assertEquals( 0x3C, extendedResponse.computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = message.encode( null );
+            ByteBuffer bb = extendedResponse.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/CancelRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/CancelRequestTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/CancelRequestTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/CancelRequestTest.java Mon Feb 15 01:37:34 2010
@@ -21,6 +21,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,11 +35,7 @@
 import org.apache.directory.shared.ldap.codec.extended.operations.cancel.CancelContainer;
 import org.apache.directory.shared.ldap.codec.extended.operations.cancel.CancelDecoder;
 import org.apache.directory.shared.ldap.util.StringTools;
-
 import org.junit.Test;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
 
 
 /*
@@ -84,7 +84,7 @@
         // Check the encoding
         try
         {
-            ByteBuffer bb = cancel.encode( null );
+            ByteBuffer bb = cancel.encode();
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/CertGenerationRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/CertGenerationRequestTest.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/CertGenerationRequestTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/CertGenerationRequestTest.java Mon Feb 15 01:37:34 2010
@@ -110,7 +110,7 @@
 
         try
         {
-            ByteBuffer encodedBuf = certGenObj.encode( null );
+            ByteBuffer encodedBuf = certGenObj.encode();
             String encodedPdu = StringTools.dumpBytes( encodedBuf.array() );
 
             assertEquals( decodedPdu, encodedPdu );



Mime
View raw message