directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r985540 - in /directory: clients/ldap/branches/ldap-client-codec-merge/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/ shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/ shared/...
Date Sat, 14 Aug 2010 17:36:26 GMT
Author: elecharny
Date: Sat Aug 14 17:36:25 2010
New Revision: 985540

URL: http://svn.apache.org/viewvc?rev=985540&view=rev
Log:
Merged the AbandonRequest messages

Removed:
    directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/abandon/
Modified:
    directory/clients/ldap/branches/ldap-client-codec-merge/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
    directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapDecoder.java
    directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java
    directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/message/AbandonRequestImpl.java
    directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapProtocolEncoder.java
    directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/message/internal/InternalAbstractMessage.java
    directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/message/internal/InternalAbstractRequest.java
    directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapControlTest.java
    directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java
    directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java
    directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java
    directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java
    directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java
    directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java

Modified: directory/clients/ldap/branches/ldap-client-codec-merge/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/branches/ldap-client-codec-merge/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java?rev=985540&r1=985539&r2=985540&view=diff
==============================================================================
--- directory/clients/ldap/branches/ldap-client-codec-merge/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
(original)
+++ directory/clients/ldap/branches/ldap-client-codec-merge/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
Sat Aug 14 17:36:25 2010
@@ -68,7 +68,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.LdapTransformer;
 import org.apache.directory.shared.ldap.codec.MessageEncoderException;
-import org.apache.directory.shared.ldap.codec.abandon.AbandonRequestCodec;
 import org.apache.directory.shared.ldap.codec.add.AddRequestCodec;
 import org.apache.directory.shared.ldap.codec.bind.BindRequestCodec;
 import org.apache.directory.shared.ldap.codec.bind.LdapAuthentication;
@@ -96,6 +95,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.FilterParser;
 import org.apache.directory.shared.ldap.filter.SearchScope;
+import org.apache.directory.shared.ldap.message.AbandonRequestImpl;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
 import org.apache.directory.shared.ldap.message.IntermediateResponseImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
@@ -105,6 +105,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.internal.CompareResponse;
 import org.apache.directory.shared.ldap.message.internal.DeleteResponse;
 import org.apache.directory.shared.ldap.message.internal.ExtendedResponse;
+import org.apache.directory.shared.ldap.message.internal.InternalAbandonRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalIntermediateResponse;
 import org.apache.directory.shared.ldap.message.internal.InternalMessage;
 import org.apache.directory.shared.ldap.message.internal.ModifyDnResponse;
@@ -320,6 +321,26 @@ public class LdapNetworkConnection exten
 
 
     /**
+     * Inject the client Controls into the message
+     */
+    private void setControls( Map<String, Control> controls, InternalMessage message
)
+    {
+        // Add the controls
+        if ( controls != null )
+        {
+            for ( Control control : controls.values() )
+            {
+                ControlImpl ctrl = new ControlImpl( control.getOid() );
+
+                ctrl.setValue( control.getValue() );
+
+                message.add( ctrl );
+            }
+        }
+    }
+
+
+    /**
      * Get the smallest timeout from the client timeout and the connection
      * timeout.
      */
@@ -733,16 +754,16 @@ public class LdapNetworkConnection exten
      */
     private void abandonInternal( AbandonRequest abandonRequest )
     {
-        // Create the inner abandonRequest
-        AbandonRequestCodec request = new AbandonRequestCodec();
-
         // Todo : The Abandon messageID is always 0
         int newId = messageId.incrementAndGet();
+
+        // Create the inner abandonRequest
+        InternalAbandonRequest request = new AbandonRequestImpl( newId );
+
         abandonRequest.setMessageId( newId );
-        request.setMessageId( newId );
 
         // Inject the data into the request
-        request.setAbandonedMessageId( abandonRequest.getAbandonedMessageId() );
+        request.setAbandoned( abandonRequest.getAbandonedMessageId() );
 
         // Inject the controls
         setControls( abandonRequest.getControls(), request );
@@ -2047,8 +2068,7 @@ public class LdapNetworkConnection exten
      * @param newDn The new Entry DN
      * @param deleteOldRdn Tells if the old RDN must be removed
      */
-    public ModifyDnResponse moveAndRename( String entryDn, String newDn, boolean deleteOldRdn
)
-        throws LdapException
+    public ModifyDnResponse moveAndRename( String entryDn, String newDn, boolean deleteOldRdn
) throws LdapException
     {
         return moveAndRename( new DN( entryDn ), new DN( newDn ), true );
     }
@@ -2274,8 +2294,8 @@ public class LdapNetworkConnection exten
      * @param listener  the delete operation response listener
      * @throws LdapException If the DN is not valid or if the deletion failed
      */
-    private DeleteResponse deleteRecursive( DN dn, Map<DN, Cursor<Response>>
cursorMap,
-        DeleteListener listener ) throws LdapException
+    private DeleteResponse deleteRecursive( DN dn, Map<DN, Cursor<Response>>
cursorMap, DeleteListener listener )
+        throws LdapException
     {
         LOG.debug( "searching for {}", dn.getName() );
         DeleteResponse delResponse = null;
@@ -2674,8 +2694,8 @@ public class LdapNetworkConnection exten
             long timeout = getTimeout( extendedRequest.getTimeout() );
 
             // Get the response, blocking
-            ExtendedResponse extendedResponse = ( ExtendedResponse ) extendedFuture.get(
timeout,
-                TimeUnit.MILLISECONDS );
+            ExtendedResponse extendedResponse = ( ExtendedResponse ) extendedFuture
+                .get( timeout, TimeUnit.MILLISECONDS );
 
             if ( extendedResponse == null )
             {

Modified: directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapDecoder.java?rev=985540&r1=985539&r2=985540&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapDecoder.java
(original)
+++ directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapDecoder.java
Sat Aug 14 17:36:25 2010
@@ -225,7 +225,7 @@ public class LdapDecoder implements Prov
 
                 if ( ldapMessageContainer.isInternal() )
                 {
-                    return ldapMessageContainer.getInternalBindResponse();
+                    return ldapMessageContainer.getBindResponse();
                 }
                 else
                 {

Modified: directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java?rev=985540&r1=985539&r2=985540&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java
(original)
+++ directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java
Sat Aug 14 17:36:25 2010
@@ -21,7 +21,6 @@ package org.apache.directory.shared.ldap
 
 
 import org.apache.directory.shared.asn1.ber.AbstractContainer;
-import org.apache.directory.shared.ldap.codec.abandon.AbandonRequestCodec;
 import org.apache.directory.shared.ldap.codec.add.AddRequestCodec;
 import org.apache.directory.shared.ldap.codec.bind.BindRequestCodec;
 import org.apache.directory.shared.ldap.codec.compare.CompareRequestCodec;
@@ -32,24 +31,24 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.modifyDn.ModifyDNRequestCodec;
 import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
 import org.apache.directory.shared.ldap.codec.unbind.UnBindRequestCodec;
-import org.apache.directory.shared.ldap.message.internal.InternalAbandonRequest;
-import org.apache.directory.shared.ldap.message.internal.InternalAddRequest;
 import org.apache.directory.shared.ldap.message.internal.AddResponse;
-import org.apache.directory.shared.ldap.message.internal.InternalBindRequest;
 import org.apache.directory.shared.ldap.message.internal.BindResponse;
-import org.apache.directory.shared.ldap.message.internal.InternalCompareRequest;
 import org.apache.directory.shared.ldap.message.internal.CompareResponse;
-import org.apache.directory.shared.ldap.message.internal.InternalDeleteRequest;
 import org.apache.directory.shared.ldap.message.internal.DeleteResponse;
 import org.apache.directory.shared.ldap.message.internal.ExtendedResponse;
+import org.apache.directory.shared.ldap.message.internal.InternalAbandonRequest;
+import org.apache.directory.shared.ldap.message.internal.InternalAddRequest;
+import org.apache.directory.shared.ldap.message.internal.InternalBindRequest;
+import org.apache.directory.shared.ldap.message.internal.InternalCompareRequest;
+import org.apache.directory.shared.ldap.message.internal.InternalDeleteRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalIntermediateResponse;
 import org.apache.directory.shared.ldap.message.internal.InternalMessage;
+import org.apache.directory.shared.ldap.message.internal.InternalUnbindRequest;
 import org.apache.directory.shared.ldap.message.internal.ModifyDnResponse;
 import org.apache.directory.shared.ldap.message.internal.ModifyResponse;
 import org.apache.directory.shared.ldap.message.internal.SearchResultDone;
 import org.apache.directory.shared.ldap.message.internal.SearchResultEntry;
 import org.apache.directory.shared.ldap.message.internal.SearchResultReference;
-import org.apache.directory.shared.ldap.message.internal.InternalUnbindRequest;
 import org.apache.directory.shared.ldap.message.spi.BinaryAttributeDetector;
 
 
@@ -148,9 +147,9 @@ public class LdapMessageContainer extend
     /**
      * @return Returns the AbandonRequest stored in the container
      */
-    public AbandonRequestCodec getAbandonRequest()
+    public InternalAbandonRequest getAbandonRequest()
     {
-        return ( AbandonRequestCodec ) ldapMessage;
+        return ( InternalAbandonRequest ) internalMessage;
     }
 
 
@@ -184,7 +183,7 @@ public class LdapMessageContainer extend
     /**
      * @return Returns the AddResponse stored in the container
      */
-    public AddResponse getInternalAddResponse()
+    public AddResponse getAddResponse()
     {
         return ( AddResponse ) internalMessage;
     }
@@ -211,7 +210,7 @@ public class LdapMessageContainer extend
     /**
      * @return Returns the BindResponse stored in the container
      */
-    public BindResponse getInternalBindResponse()
+    public BindResponse getBindResponse()
     {
         return ( BindResponse ) internalMessage;
     }
@@ -238,7 +237,7 @@ public class LdapMessageContainer extend
     /**
      * @return Returns the CompareResponse stored in the container
      */
-    public CompareResponse getInternalCompareResponse()
+    public CompareResponse getCompareResponse()
     {
         return ( CompareResponse ) internalMessage;
     }
@@ -265,7 +264,7 @@ public class LdapMessageContainer extend
     /**
      * @return Returns the DelResponse stored in the container
      */
-    public DeleteResponse getInternalDelResponse()
+    public DeleteResponse getDeleteResponse()
     {
         return ( DeleteResponse ) internalMessage;
     }

Modified: directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/message/AbandonRequestImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/message/AbandonRequestImpl.java?rev=985540&r1=985539&r2=985540&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/message/AbandonRequestImpl.java
(original)
+++ directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/message/AbandonRequestImpl.java
Sat Aug 14 17:36:25 2010
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.shared.ldap.message;
 
+
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.message.internal.InternalAbandonRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalAbstractRequest;
@@ -43,7 +44,7 @@ public class AbandonRequestImpl extends 
      * @param id
      *            the sequence identifier of the AbandonRequest message.
      */
-    public AbandonRequestImpl(final int id)
+    public AbandonRequestImpl( final int id )
     {
         super( id, TYPE, false );
     }
@@ -92,14 +93,14 @@ public class AbandonRequestImpl extends 
         {
             return false;
         }
-        
+
         if ( !super.equals( obj ) )
         {
             return false;
         }
 
         InternalAbandonRequest req = ( InternalAbandonRequest ) obj;
-        
+
         if ( req.getAbandoned() != abandonId )
         {
             return false;
@@ -108,7 +109,7 @@ public class AbandonRequestImpl extends 
         return true;
     }
 
-    
+
     /**
      * @see Object#hashCode()
      * @return the instance's hash code 
@@ -116,13 +117,13 @@ public class AbandonRequestImpl extends 
     public int hashCode()
     {
         int hash = 37;
-        hash = hash*17 + abandonId;
-        hash = hash*17 + super.hashCode();
-        
+        hash = hash * 17 + abandonId;
+        hash = hash * 17 + super.hashCode();
+
         return hash;
     }
 
-    
+
     /**
      * RFC 2251 [Section 4.11]: Abandon, Bind, Unbind, and StartTLS operations
      * cannot be abandoned.
@@ -131,4 +132,23 @@ public class AbandonRequestImpl extends 
     {
         throw new UnsupportedOperationException( I18n.err( I18n.ERR_04185 ) );
     }
+
+
+    /**
+     * Return a String representing an AbandonRequest
+     * 
+     * @return A String representing the AbandonRequest
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+
+        sb.append( "    Abandon Request :\n" );
+        sb.append( "        Message Id : " ).append( abandonId );
+
+        // The controls
+        sb.append( super.toString() );
+
+        return sb.toString();
+    }
 }

Modified: directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapProtocolEncoder.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapProtocolEncoder.java?rev=985540&r1=985539&r2=985540&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapProtocolEncoder.java
(original)
+++ directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapProtocolEncoder.java
Sat Aug 14 17:36:25 2010
@@ -46,12 +46,13 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.internal.CompareResponse;
 import org.apache.directory.shared.ldap.message.internal.DeleteResponse;
 import org.apache.directory.shared.ldap.message.internal.ExtendedResponse;
+import org.apache.directory.shared.ldap.message.internal.InternalAbandonRequest;
 import org.apache.directory.shared.ldap.message.internal.InternalIntermediateResponse;
-import org.apache.directory.shared.ldap.message.internal.LdapResult;
 import org.apache.directory.shared.ldap.message.internal.InternalMessage;
+import org.apache.directory.shared.ldap.message.internal.InternalReferral;
+import org.apache.directory.shared.ldap.message.internal.LdapResult;
 import org.apache.directory.shared.ldap.message.internal.ModifyDnResponse;
 import org.apache.directory.shared.ldap.message.internal.ModifyResponse;
-import org.apache.directory.shared.ldap.message.internal.InternalReferral;
 import org.apache.directory.shared.ldap.message.internal.SearchResultDone;
 import org.apache.directory.shared.ldap.message.internal.SearchResultEntry;
 import org.apache.directory.shared.ldap.message.internal.SearchResultReference;
@@ -121,7 +122,7 @@ public class LdapProtocolEncoder extends
             || ( message instanceof ExtendedResponse ) || ( message instanceof ModifyResponse
)
             || ( message instanceof ModifyDnResponse ) || ( message instanceof InternalIntermediateResponse
)
             || ( message instanceof SearchResultDone ) || ( message instanceof SearchResultEntry
)
-            || ( message instanceof SearchResultReference ) )
+            || ( message instanceof SearchResultReference ) || ( message instanceof InternalAbandonRequest
) )
         {
             try
             {
@@ -321,8 +322,7 @@ public class LdapProtocolEncoder extends
      * @param buffer The buffer where to put the PDU
      * @return The PDU.
      */
-    private ByteBuffer encodeLdapResult( ByteBuffer buffer, LdapResult internalLdapResult
)
-        throws EncoderException
+    private ByteBuffer encodeLdapResult( ByteBuffer buffer, LdapResult internalLdapResult
) throws EncoderException
     {
         LdapResultImpl ldapResult = ( LdapResultImpl ) internalLdapResult;
 
@@ -389,6 +389,22 @@ public class LdapProtocolEncoder extends
 
 
     /**
+     * Compute the AbandonRequest length 
+     * 
+     * AbandonRequest : 
+     * 0x50 0x0(1..4) abandoned MessageId 
+     * 
+     * Length(AbandonRequest) = Length(0x50) + 1 + Length(abandoned MessageId)
+     */
+    private int computeAbandonRequestLength( AbandonRequestImpl abandonRequest )
+    {
+        int length = 1 + 1 + Value.getNbBytes( abandonRequest.getAbandoned() );
+
+        return length;
+    }
+
+
+    /**
      * Compute the AddResponse length 
      * 
      * AddResponse : 
@@ -411,6 +427,12 @@ public class LdapProtocolEncoder extends
     }
 
 
+    private int computeBindRequestLength( BindRequestImpl bindRequest )
+    {
+        return 0;
+    }
+
+
     /**
      * Compute the BindResponse length 
      * 
@@ -854,6 +876,31 @@ public class LdapProtocolEncoder extends
 
 
     /**
+     * Encode the Abandon protocolOp part
+     */
+    private void encodeAbandonRequest( ByteBuffer buffer, AbandonRequestImpl abandonRequest
) throws EncoderException
+    {
+        try
+        {
+            // The tag
+            buffer.put( LdapConstants.ABANDON_REQUEST_TAG );
+
+            // The length. It has to be evaluated depending on
+            // the abandoned messageId value.
+            buffer.put( ( byte ) Value.getNbBytes( abandonRequest.getAbandoned() ) );
+
+            // The abandoned messageId
+            buffer.put( Value.getBytes( abandonRequest.getAbandoned() ) );
+        }
+        catch ( BufferOverflowException boe )
+        {
+            String msg = I18n.err( I18n.ERR_04005 );
+            throw new EncoderException( msg );
+        }
+    }
+
+
+    /**
      * Encode the AddResponse message to a PDU.
      * 
      * @param buffer The buffer where to put the PDU
@@ -876,6 +923,12 @@ public class LdapProtocolEncoder extends
     }
 
 
+    private void encodeBindRequest( ByteBuffer bb, BindRequestImpl bindRequest ) throws EncoderException
+    {
+
+    }
+
+
     /**
      * Encode the BindResponse message to a PDU.
      * 
@@ -1286,9 +1339,15 @@ public class LdapProtocolEncoder extends
     {
         switch ( message.getType() )
         {
+            case ABANDON_REQUEST:
+                return computeAbandonRequestLength( ( AbandonRequestImpl ) message );
+
             case ADD_RESPONSE:
                 return computeAddResponseLength( ( AddResponseImpl ) message );
 
+            case BIND_REQUEST:
+                return computeBindRequestLength( ( BindRequestImpl ) message );
+
             case BIND_RESPONSE:
                 return computeBindResponseLength( ( BindResponseImpl ) message );
 
@@ -1329,10 +1388,18 @@ public class LdapProtocolEncoder extends
     {
         switch ( message.getType() )
         {
+            case ABANDON_REQUEST:
+                encodeAbandonRequest( bb, ( AbandonRequestImpl ) message );
+                break;
+
             case ADD_RESPONSE:
                 encodeAddResponse( bb, ( AddResponseImpl ) message );
                 break;
 
+            case BIND_REQUEST:
+                encodeBindRequest( bb, ( BindRequestImpl ) message );
+                break;
+
             case BIND_RESPONSE:
                 encodeBindResponse( bb, ( BindResponseImpl ) message );
                 break;

Modified: directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/message/internal/InternalAbstractMessage.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/message/internal/InternalAbstractMessage.java?rev=985540&r1=985539&r2=985540&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/message/internal/InternalAbstractMessage.java
(original)
+++ directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/message/internal/InternalAbstractMessage.java
Sat Aug 14 17:36:25 2010
@@ -319,4 +319,25 @@ public abstract class InternalAbstractMe
     {
         return messageLength;
     }
+
+
+    /**
+     * Get a String representation of a LdapMessage
+     * 
+     * @return A LdapMessage String
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+
+        if ( controls != null )
+        {
+            for ( Control control : controls.values() )
+            {
+                sb.append( control );
+            }
+        }
+
+        return sb.toString();
+    }
 }

Modified: directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/message/internal/InternalAbstractRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/message/internal/InternalAbstractRequest.java?rev=985540&r1=985539&r2=985540&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/message/internal/InternalAbstractRequest.java
(original)
+++ directory/shared/branches/shared-codec-merge/ldap/src/main/java/org/apache/directory/shared/ldap/message/internal/InternalAbstractRequest.java
Sat Aug 14 17:36:25 2010
@@ -39,12 +39,9 @@ public class InternalAbstractRequest ext
     /**
      * Subclasses must provide these parameters via a super constructor call.
      * 
-     * @param id
-     *            the sequential message identifier
-     * @param type
-     *            the request type enum
-     * @param hasResponse
-     *            flag indicating if this request generates a response
+     * @param id the sequential message identifier
+     * @param type the request type enum
+     * @param hasResponse flag indicating if this request generates a response
      */
     protected InternalAbstractRequest( final int id, final MessageTypeEnum type, boolean
hasResponse )
     {
@@ -81,8 +78,8 @@ public class InternalAbstractRequest ext
         {
             return false;
         }
-        
-        if ( hasResponse != ( ( InternalRequest) obj ).hasResponse() )
+
+        if ( hasResponse != ( ( InternalRequest ) obj ).hasResponse() )
         {
             return false;
         }

Modified: directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapControlTest.java?rev=985540&r1=985539&r2=985540&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapControlTest.java
(original)
+++ directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapControlTest.java
Sat Aug 14 17:36:25 2010
@@ -34,7 +34,8 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.EncoderException;
-import org.apache.directory.shared.ldap.codec.abandon.AbandonRequestCodec;
+import org.apache.directory.shared.ldap.message.AbandonRequestImpl;
+import org.apache.directory.shared.ldap.message.LdapProtocolEncoder;
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.message.internal.InternalAbandonRequest;
 import org.apache.directory.shared.ldap.util.StringTools;
@@ -46,6 +47,10 @@ import org.junit.runner.RunWith;
 @Concurrent()
 public class LdapControlTest
 {
+    /** The encoder instance */
+    LdapProtocolEncoder encoder = new LdapProtocolEncoder();
+
+
     /**
      * Test the decoding of a Request with controls
      */
@@ -101,9 +106,8 @@ public class LdapControlTest
             .getInternalAbandonRequest();
 
         // Copy the message
-        AbandonRequestCodec abandonRequestCodec = new AbandonRequestCodec();
-        abandonRequestCodec.setMessageId( abandonRequest.getMessageId() );
-        abandonRequestCodec.setAbandonedMessageId( abandonRequest.getAbandoned() );
+        InternalAbandonRequest internalAbandonRequest = new AbandonRequestImpl( abandonRequest.getMessageId()
);
+        internalAbandonRequest.setAbandoned( abandonRequest.getAbandoned() );
 
         assertEquals( 3, abandonRequest.getMessageId() );
         assertEquals( 2, abandonRequest.getAbandoned() );
@@ -117,37 +121,50 @@ public class LdapControlTest
         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() );
-        abandonRequestCodec.addControl( control );
+        internalAbandonRequest.add( control );
 
         control = controls.get( "1.3.6.1.5.5.2" );
         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() );
-        abandonRequestCodec.addControl( control );
+        internalAbandonRequest.add( control );
 
         control = controls.get( "1.3.6.1.5.5.3" );
         assertEquals( "1.3.6.1.5.5.3", control.getOid() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
         assertTrue( control.isCritical() );
-        abandonRequestCodec.addControl( control );
+        internalAbandonRequest.add( control );
 
         control = controls.get( "1.3.6.1.5.5.4" );
         assertEquals( "1.3.6.1.5.5.4", control.getOid() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
         assertFalse( control.isCritical() );
-        abandonRequestCodec.addControl( control );
-
-        // Check the length
-        assertEquals( 0x64, abandonRequestCodec.computeLength() );
+        internalAbandonRequest.add( control );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = abandonRequestCodec.encode();
+            ByteBuffer bb = encoder.encodeMessage( internalAbandonRequest );
+
+            // Check the length
+            assertEquals( 0x64, bb.limit() );
+
+            // Don't check the PDU, as control are in a Map, and can be in a different order
+            // So we decode the generated PDU, and we compare it with the initial message
+            try
+            {
+                ldapDecoder.decode( bb, ldapMessageContainer );
+            }
+            catch ( DecoderException de )
+            {
+                de.printStackTrace();
+                fail( de.getMessage() );
+            }
 
-            String encodedPdu = StringTools.dumpBytes( bb.array() );
+            InternalAbandonRequest abandonRequest2 = ( ( LdapMessageContainer ) ldapMessageContainer
)
+                .getInternalAbandonRequest();
 
-            assertEquals( encodedPdu, decodedPdu );
+            assertEquals( abandonRequest, abandonRequest2 );
         }
         catch ( EncoderException ee )
         {

Modified: directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java?rev=985540&r1=985539&r2=985540&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java
(original)
+++ directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java
Sat Aug 14 17:36:25 2010
@@ -291,7 +291,7 @@ public class LdapResultTest
         }
 
         // Check the decoded AddResponse
-        AddResponse addResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getInternalAddResponse();
+        AddResponse addResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getAddResponse();
 
         assertEquals( 1, addResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, addResponse.getLdapResult().getResultCode()
);
@@ -354,7 +354,7 @@ public class LdapResultTest
         }
 
         // Check the decoded AddResponse
-        AddResponse addResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getInternalAddResponse();
+        AddResponse addResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getAddResponse();
 
         assertEquals( 1, addResponse.getMessageId() );
         assertEquals( ResultCodeEnum.REFERRAL, addResponse.getLdapResult().getResultCode()
);
@@ -432,7 +432,7 @@ public class LdapResultTest
         }
 
         // Check the decoded AddResponse
-        AddResponse addResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getInternalAddResponse();
+        AddResponse addResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getAddResponse();
 
         assertEquals( 1, addResponse.getMessageId() );
         assertEquals( ResultCodeEnum.REFERRAL, addResponse.getLdapResult().getResultCode()
);
@@ -509,7 +509,7 @@ public class LdapResultTest
         }
 
         // Check the decoded AddResponse
-        AddResponse addResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getInternalAddResponse();
+        AddResponse addResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getAddResponse();
 
         assertEquals( 1, addResponse.getMessageId() );
         assertEquals( ResultCodeEnum.REFERRAL, addResponse.getLdapResult().getResultCode()
);

Modified: directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java?rev=985540&r1=985539&r2=985540&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java
(original)
+++ directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestTest.java
Sat Aug 14 17:36:25 2010
@@ -35,6 +35,8 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
+import org.apache.directory.shared.ldap.message.AbandonRequestImpl;
+import org.apache.directory.shared.ldap.message.LdapProtocolEncoder;
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.message.internal.InternalAbandonRequest;
 import org.apache.directory.shared.ldap.util.StringTools;
@@ -51,6 +53,10 @@ import org.junit.runner.RunWith;
 @Concurrent()
 public class AbandonRequestTest
 {
+    /** The encoder instance */
+    LdapProtocolEncoder encoder = new LdapProtocolEncoder();
+
+
     /**
      * Test the decoding of a AbandonRequest with controls
      */
@@ -84,7 +90,6 @@ public class AbandonRequestTest
                 // controlType LDAPOID}
                 0x04, 0x0D, '1', '.', '3', '.', '6', '.', '1', '.', '5', '.', '5', '.', '4'
} );
 
-        String decodedPdu = StringTools.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a LdapMessageContainer Container
@@ -106,9 +111,8 @@ public class AbandonRequestTest
             .getInternalAbandonRequest();
 
         // Copy the message
-        AbandonRequestCodec abandonRequestCodec = new AbandonRequestCodec();
-        abandonRequestCodec.setMessageId( abandonRequest.getMessageId() );
-        abandonRequestCodec.setAbandonedMessageId( abandonRequest.getAbandoned() );
+        InternalAbandonRequest internalAbandonRequest = new AbandonRequestImpl( abandonRequest.getMessageId()
);
+        internalAbandonRequest.setAbandoned( abandonRequest.getAbandoned() );
 
         assertEquals( 3, abandonRequest.getMessageId() );
         assertEquals( 2, abandonRequest.getAbandoned() );
@@ -122,37 +126,50 @@ public class AbandonRequestTest
         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() );
-        abandonRequestCodec.addControl( control );
+        internalAbandonRequest.add( control );
 
         control = controls.get( "1.3.6.1.5.5.2" );
         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() );
-        abandonRequestCodec.addControl( control );
+        internalAbandonRequest.add( control );
 
         control = controls.get( "1.3.6.1.5.5.3" );
         assertEquals( "1.3.6.1.5.5.3", control.getOid() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
         assertTrue( control.isCritical() );
-        abandonRequestCodec.addControl( control );
+        internalAbandonRequest.add( control );
 
         control = controls.get( "1.3.6.1.5.5.4" );
         assertEquals( "1.3.6.1.5.5.4", control.getOid() );
         assertEquals( "", StringTools.dumpBytes( ( byte[] ) control.getValue() ) );
         assertFalse( control.isCritical() );
-        abandonRequestCodec.addControl( control );
-
-        // Check the length
-        assertEquals( 0x64, abandonRequestCodec.computeLength() );
+        internalAbandonRequest.add( control );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = abandonRequestCodec.encode();
+            ByteBuffer bb = encoder.encodeMessage( internalAbandonRequest );
 
-            String encodedPdu = StringTools.dumpBytes( bb.array() );
+            // Check the length
+            assertEquals( 0x64, bb.limit() );
+
+            // Don't check the PDU, as control are in a Map, and can be in a different order
+            // So we decode the generated PDU, and we compare it with the initial message
+            try
+            {
+                ldapDecoder.decode( bb, ldapMessageContainer );
+            }
+            catch ( DecoderException de )
+            {
+                de.printStackTrace();
+                fail( de.getMessage() );
+            }
+
+            InternalAbandonRequest abandonRequest2 = ( ( LdapMessageContainer ) ldapMessageContainer
)
+                .getInternalAbandonRequest();
 
-            assertEquals( decodedPdu, encodedPdu );
+            assertEquals( abandonRequest, abandonRequest2 );
         }
         catch ( EncoderException ee )
         {
@@ -204,16 +221,16 @@ public class AbandonRequestTest
         assertEquals( 2, abandonRequest.getAbandoned() );
 
         // Check the length
-        AbandonRequestCodec abandonRequestCodec = new AbandonRequestCodec();
-        abandonRequestCodec.setMessageId( abandonRequest.getMessageId() );
-        abandonRequestCodec.setAbandonedMessageId( abandonRequest.getAbandoned() );
-
-        assertEquals( 10, abandonRequestCodec.computeLength() );
+        InternalAbandonRequest internalAbandonRequest = new AbandonRequestImpl( abandonRequest.getMessageId()
);
+        internalAbandonRequest.setAbandoned( abandonRequest.getAbandoned() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb = abandonRequestCodec.encode();
+            ByteBuffer bb = encoder.encodeMessage( internalAbandonRequest );
+
+            // Check the length
+            assertEquals( 0x0A, bb.limit() );
 
             String encodedPdu = StringTools.dumpBytes( bb.array() );
 

Modified: directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java?rev=985540&r1=985539&r2=985540&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java
(original)
+++ directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java
Sat Aug 14 17:36:25 2010
@@ -97,7 +97,7 @@ public class AddResponseTest
         }
 
         // Check the decoded AddResponse
-        AddResponse addResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getInternalAddResponse();
+        AddResponse addResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getAddResponse();
 
         assertEquals( 1, addResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, addResponse.getLdapResult().getResultCode()
);
@@ -212,7 +212,7 @@ public class AddResponseTest
         }
 
         // Check the decoded AddResponse
-        AddResponse addResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getInternalAddResponse();
+        AddResponse addResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getAddResponse();
 
         assertEquals( 1, addResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, addResponse.getLdapResult().getResultCode()
);

Modified: directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java?rev=985540&r1=985539&r2=985540&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java
(original)
+++ directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java
Sat Aug 14 17:36:25 2010
@@ -100,7 +100,7 @@ public class BindResponseTest
         }
 
         // Check the decoded BindResponse
-        BindResponse bindResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getInternalBindResponse();
+        BindResponse bindResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getBindResponse();
 
         assertEquals( 1, bindResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode()
);
@@ -189,7 +189,7 @@ public class BindResponseTest
         }
 
         // Check the decoded BindResponse
-        BindResponse bindResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getInternalBindResponse();
+        BindResponse bindResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getBindResponse();
 
         assertEquals( 1, bindResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode()
);
@@ -275,7 +275,7 @@ public class BindResponseTest
         }
 
         // Check the decoded BindResponse
-        BindResponse bindResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getInternalBindResponse();
+        BindResponse bindResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getBindResponse();
 
         assertEquals( 1, bindResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode()
);
@@ -361,7 +361,7 @@ public class BindResponseTest
         }
 
         // Check the decoded BindResponse
-        BindResponse bindResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getInternalBindResponse();
+        BindResponse bindResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getBindResponse();
 
         assertEquals( 1, bindResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode()
);
@@ -443,7 +443,7 @@ public class BindResponseTest
         }
 
         // Check the decoded BindResponse
-        BindResponse bindResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getInternalBindResponse();
+        BindResponse bindResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getBindResponse();
 
         assertEquals( 1, bindResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode()
);

Modified: directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java?rev=985540&r1=985539&r2=985540&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java
(original)
+++ directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java
Sat Aug 14 17:36:25 2010
@@ -100,8 +100,7 @@ public class CompareResponseTest
         }
 
         // Check the decoded CompareResponse PDU
-        CompareResponse compareResponse = ( ( LdapMessageContainer ) ldapMessageContainer
)
-            .getInternalCompareResponse();
+        CompareResponse compareResponse = ( ( LdapMessageContainer ) ldapMessageContainer
).getCompareResponse();
 
         assertEquals( 1, compareResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, compareResponse.getLdapResult().getResultCode()
);
@@ -183,8 +182,7 @@ public class CompareResponseTest
         }
 
         // Check the decoded CompareResponse PDU
-        CompareResponse compareResponse = ( ( LdapMessageContainer ) ldapMessageContainer
)
-            .getInternalCompareResponse();
+        CompareResponse compareResponse = ( ( LdapMessageContainer ) ldapMessageContainer
).getCompareResponse();
 
         assertEquals( 1, compareResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, compareResponse.getLdapResult().getResultCode()
);

Modified: directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java?rev=985540&r1=985539&r2=985540&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java
(original)
+++ directory/shared/branches/shared-codec-merge/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java
Sat Aug 14 17:36:25 2010
@@ -107,7 +107,7 @@ public class DelResponseTest
         }
 
         // Check the decoded DelResponse PDU
-        DeleteResponse delResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getInternalDelResponse();
+        DeleteResponse delResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getDeleteResponse();
 
         assertEquals( 1, delResponse.getMessageId() );
         assertEquals( ResultCodeEnum.ALIAS_PROBLEM, delResponse.getLdapResult().getResultCode()
);
@@ -231,7 +231,7 @@ public class DelResponseTest
         }
 
         // Check the decoded DelResponse PDU
-        DeleteResponse delResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getInternalDelResponse();
+        DeleteResponse delResponse = ( ( LdapMessageContainer ) ldapMessageContainer ).getDeleteResponse();
 
         assertEquals( 1, delResponse.getMessageId() );
         assertEquals( ResultCodeEnum.ALIAS_PROBLEM, delResponse.getLdapResult().getResultCode()
);



Mime
View raw message