directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1067686 [2/3] - in /directory: shared/branches/m1/dsml-engine/src/main/java/org/apache/directory/shared/dsmlv2/engine/ shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/ shared/branches/m1/dsml-parser/src/main...
Date Sun, 06 Feb 2011 15:45:57 GMT
Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ModifyRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ModifyRequestDsml.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ModifyRequestDsml.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ModifyRequestDsml.java Sun Feb  6 15:45:55 2011
@@ -25,6 +25,8 @@ import java.util.Iterator;
 
 import org.apache.directory.shared.dsmlv2.ParserUtils;
 import org.apache.directory.shared.ldap.codec.LdapCodecService;
+import org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute;
+import org.apache.directory.shared.ldap.model.entry.DefaultModification;
 import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.model.entry.Modification;
 import org.apache.directory.shared.ldap.model.entry.ModificationOperation;
@@ -47,6 +49,14 @@ public class ModifyRequestDsml 
     extends AbstractResultResponseRequestDsml<ModifyRequest>
     implements ModifyRequest
 {
+
+    /** The current attribute being decoded */
+    private EntryAttribute currentAttribute;
+
+    /** A local storage for the operation */
+    private ModificationOperation currentOperation;
+    
+    
     /**
      * Creates a new getDecoratedMessage() of ModifyRequestDsml.
      */
@@ -69,11 +79,58 @@ public class ModifyRequestDsml 
 
 
     /**
-     * {@inheritDoc}
+     * Return the current attribute's type
+     */
+    public String getCurrentAttributeType()
+    {
+        return currentAttribute.getId();
+    }
+
+    
+    /**
+     * Store the current operation
+     * 
+     * @param currentOperation The currentOperation to set.
+     */
+    public void setCurrentOperation( int currentOperation )
+    {
+        this.currentOperation = ModificationOperation.getOperation( currentOperation );
+    }
+
+
+    /**
+     * Add a new attributeTypeAndValue
+     * 
+     * @param type The attribute's name
+     */
+    public void addAttributeTypeAndValues( String type )
+    {
+        currentAttribute = new DefaultEntryAttribute( type );
+
+        Modification modification = new DefaultModification( currentOperation, currentAttribute );
+        getDecorated().addModification( modification );
+    }
+
+
+    /**
+     * Add a new value to the current attribute
+     * 
+     * @param value The value to add
+     */
+    public void addAttributeValue( byte[] value )
+    {
+        currentAttribute.add( value );
+    }
+
+
+    /**
+     * Add a new value to the current attribute
+     * 
+     * @param value The value to add
      */
-    public MessageTypeEnum getType()
+    public void addAttributeValue( String value )
     {
-        return getDecorated().getType();
+        currentAttribute.add( value );
     }
 
 
@@ -151,6 +208,11 @@ public class ModifyRequestDsml 
     }
 
 
+    //-------------------------------------------------------------------------
+    // The ModifyRequest methods
+    //-------------------------------------------------------------------------
+    
+    
     /**
      * {@inheritDoc}
      */

Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/SearchRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/SearchRequestDsml.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/SearchRequestDsml.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/SearchRequestDsml.java Sun Feb  6 15:45:55 2011
@@ -20,21 +20,37 @@
 package org.apache.directory.shared.dsmlv2.request;
 
 
+import java.util.ArrayList;
 import java.util.List; 
 
+import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.dsmlv2.ParserUtils;
 import org.apache.directory.shared.ldap.codec.AttributeValueAssertion;
 import org.apache.directory.shared.ldap.codec.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
+import org.apache.directory.shared.ldap.codec.search.AndFilter;
 import org.apache.directory.shared.ldap.codec.search.AttributeValueAssertionFilter;
+import org.apache.directory.shared.ldap.codec.search.ConnectorFilter;
 import org.apache.directory.shared.ldap.codec.search.ExtensibleMatchFilter;
+import org.apache.directory.shared.ldap.codec.search.Filter;
+import org.apache.directory.shared.ldap.codec.search.NotFilter;
+import org.apache.directory.shared.ldap.codec.search.OrFilter;
 import org.apache.directory.shared.ldap.codec.search.PresentFilter;
+import org.apache.directory.shared.ldap.codec.search.SubstringFilter;
 import org.apache.directory.shared.ldap.model.entry.Value;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.filter.AndNode;
+import org.apache.directory.shared.ldap.model.filter.ApproximateNode;
+import org.apache.directory.shared.ldap.model.filter.BranchNode;
+import org.apache.directory.shared.ldap.model.filter.EqualityNode;
 import org.apache.directory.shared.ldap.model.filter.ExprNode;
+import org.apache.directory.shared.ldap.model.filter.ExtensibleNode;
+import org.apache.directory.shared.ldap.model.filter.GreaterEqNode;
+import org.apache.directory.shared.ldap.model.filter.LeafNode;
+import org.apache.directory.shared.ldap.model.filter.LessEqNode;
 import org.apache.directory.shared.ldap.model.filter.NotNode;
 import org.apache.directory.shared.ldap.model.filter.OrNode;
+import org.apache.directory.shared.ldap.model.filter.PresenceNode;
 import org.apache.directory.shared.ldap.model.filter.SearchScope;
 import org.apache.directory.shared.ldap.model.filter.SubstringNode;
 import org.apache.directory.shared.ldap.model.message.AliasDerefMode;
@@ -56,6 +72,19 @@ public class SearchRequestDsml 
     extends AbstractResultResponseRequestDsml<SearchRequest>
     implements SearchRequest
 {
+    /** A temporary storage for a terminal Filter */
+    private Filter terminalFilter;
+
+    /** The current filter. This is used while decoding a PDU */
+    private Filter currentFilter;
+
+    /** The global filter. This is used while decoding a PDU */
+    private Filter topFilter;
+
+    /** The SearchRequest TLV id */
+    private int tlvId;
+    
+    
     /**
      * Creates a new getDecoratedMessage() of SearchRequestDsml.
      */
@@ -75,8 +104,246 @@ public class SearchRequestDsml 
     {
         super( codec, ldapMessage );
     }
+    
+    
+
+
+    public Filter getCurrentFilter()
+    {
+        return currentFilter;
+    }
+
+
+    /**
+     * Gets the search filter associated with this search request.
+     *
+     * @return the expression node for the root of the filter expression tree.
+     */
+    public Filter getCodecFilter()
+    {
+        return topFilter;
+    }
+
+
+    /**
+     * Gets the search filter associated with this search request.
+     *
+     * @return the expression node for the root of the filter expression tree.
+     */
+    public ExprNode getFilterNode()
+    {
+        return transform( topFilter );
+    }
+
+
+    /**
+     * Get the terminal filter
+     *
+     * @return Returns the terminal filter.
+     */
+    public Filter getTerminalFilter()
+    {
+        return terminalFilter;
+    }
+
+
+    /**
+     * Set the terminal filter
+     *
+     * @param terminalFilter the teminalFilter.
+     */
+    public void setTerminalFilter( Filter terminalFilter )
+    {
+        this.terminalFilter = terminalFilter;
+    }
+
+
+    /**
+     * Set the current filter
+     *
+     * @param filter The filter to set.
+     */
+    public void setCurrentFilter( Filter filter )
+    {
+        currentFilter = filter;
+    }
+
 
+    /**
+     * Add a current filter. We have two cases :
+     * - there is no previous current filter : the filter
+     * is the top level filter
+     * - there is a previous current filter : the filter is added
+     * to the currentFilter set, and the current filter is changed
+     *
+     * In any case, the previous current filter will always be a
+     * ConnectorFilter when this method is called.
+     *
+     * @param localFilter The filter to set.
+     */
+    public void addCurrentFilter( Filter localFilter ) throws DecoderException
+    {
+        if ( currentFilter != null )
+        {
+            // Ok, we have a parent. The new Filter will be added to
+            // this parent, and will become the currentFilter if it's a connector.
+            ( ( ConnectorFilter ) currentFilter ).addFilter( localFilter );
+            localFilter.setParent( currentFilter, currentFilter.getTlvId() );
+
+            if ( localFilter instanceof ConnectorFilter )
+            {
+                currentFilter = localFilter;
+            }
+        }
+        else
+        {
+            // No parent. This Filter will become the root.
+            currentFilter = localFilter;
+            currentFilter.setParent( null, tlvId );
+            topFilter = localFilter;
+        }
+    }
+    
+
+
+
+    /**
+     * Transform the Filter part of a SearchRequest to an ExprNode
+     *
+     * @param filter The filter to be transformed
+     * @return An ExprNode
+     */
+    @SuppressWarnings({ "unchecked", "rawtypes" })
+    private ExprNode transform( Filter filter )
+    {
+        if ( filter != null )
+        {
+            // Transform OR, AND or NOT leaves
+            if ( filter instanceof ConnectorFilter)
+            {
+                BranchNode branch = null;
+
+                if ( filter instanceof AndFilter)
+                {
+                    branch = new AndNode();
+                }
+                else if ( filter instanceof OrFilter)
+                {
+                    branch = new OrNode();
+                }
+                else if ( filter instanceof NotFilter)
+                {
+                    branch = new NotNode();
+                }
+
+                List<Filter> filtersSet = ( ( ConnectorFilter ) filter ).getFilterSet();
+
+                // Loop on all AND/OR children
+                if ( filtersSet != null )
+                {
+                    for ( Filter node : filtersSet )
+                    {
+                        branch.addNode( transform( node ) );
+                    }
+                }
+
+                return branch;
+            }
+            else
+            {
+                // Transform PRESENT or ATTRIBUTE_VALUE_ASSERTION
+                LeafNode branch = null;
+
+                if ( filter instanceof PresentFilter )
+                {
+                    branch = new PresenceNode( ( ( PresentFilter ) filter ).getAttributeDescription() );
+                }
+                else if ( filter instanceof AttributeValueAssertionFilter )
+                {
+                    AttributeValueAssertion ava = ( ( AttributeValueAssertionFilter ) filter ).getAssertion();
+
+                    // Transform =, >=, <=, ~= filters
+                    switch ( ( ( AttributeValueAssertionFilter ) filter ).getFilterType() )
+                    {
+                        case LdapConstants.EQUALITY_MATCH_FILTER:
+                            branch = new EqualityNode( ava.getAttributeDesc(), ava.getAssertionValue() );
+
+                            break;
+
+                        case LdapConstants.GREATER_OR_EQUAL_FILTER:
+                            branch = new GreaterEqNode( ava.getAttributeDesc(), ava.getAssertionValue() );
+
+                            break;
+
+                        case LdapConstants.LESS_OR_EQUAL_FILTER:
+                            branch = new LessEqNode( ava.getAttributeDesc(), ava.getAssertionValue() );
+
+                            break;
+
+                        case LdapConstants.APPROX_MATCH_FILTER:
+                            branch = new ApproximateNode( ava.getAttributeDesc(), ava.getAssertionValue() );
+
+                            break;
+                    }
+
+                }
+                else if ( filter instanceof SubstringFilter )
+                {
+                    // Transform Substring filters
+                    SubstringFilter substrFilter = ( SubstringFilter ) filter;
+                    String initialString = null;
+                    String finalString = null;
+                    List<String> anyString = null;
+
+                    if ( substrFilter.getInitialSubstrings() != null )
+                    {
+                        initialString = substrFilter.getInitialSubstrings();
+                    }
+
+                    if ( substrFilter.getFinalSubstrings() != null )
+                    {
+                        finalString = substrFilter.getFinalSubstrings();
+                    }
+
+                    if ( substrFilter.getAnySubstrings() != null )
+                    {
+                        anyString = new ArrayList<String>();
+
+                        for ( String any : substrFilter.getAnySubstrings() )
+                        {
+                            anyString.add( any );
+                        }
+                    }
+
+                    branch = new SubstringNode( anyString, substrFilter.getType(), initialString, finalString );
+                }
+                else if ( filter instanceof ExtensibleMatchFilter )
+                {
+                    // Transform Extensible Match Filter
+                    ExtensibleMatchFilter extFilter = ( ExtensibleMatchFilter ) filter;
+                    String matchingRule = null;
+
+                    Value<?> value = extFilter.getMatchValue();
+
+                    if ( extFilter.getMatchingRule() != null )
+                    {
+                        matchingRule = extFilter.getMatchingRule();
+                    }
+
+                    branch = new ExtensibleNode( extFilter.getType(), value, matchingRule, extFilter.isDnAttributes() );
+                }
+
+                return branch;
+            }
+        }
+        else
+        {
+            // We have found nothing to transform. Return null then.
+            return null;
+        }
+    }
 
+    
     /**
      * {@inheritDoc}
      */

Modified: directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/abandonRequest/AbandonRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/abandonRequest/AbandonRequestTest.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/abandonRequest/AbandonRequestTest.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/abandonRequest/AbandonRequestTest.java Sun Feb  6 15:45:55 2011
@@ -32,8 +32,8 @@ import java.util.Map;
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractTest;
+import org.apache.directory.shared.dsmlv2.DsmlControl;
 import org.apache.directory.shared.dsmlv2.Dsmlv2Parser;
-import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.model.message.AbandonRequest;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.util.Strings;
@@ -156,7 +156,7 @@ public class AbandonRequestTest extends 
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "Some text", Strings.utf8ToString(((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some text", Strings.utf8ToString(( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -192,7 +192,7 @@ public class AbandonRequestTest extends 
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString(((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString( ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -228,7 +228,7 @@ public class AbandonRequestTest extends 
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse(  ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 
@@ -264,7 +264,7 @@ public class AbandonRequestTest extends 
         assertNotNull( control );
         assertFalse( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.789", control.getOid() );
-        assertEquals( "Some other text", Strings.utf8ToString(((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some other text", Strings.utf8ToString( ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -300,7 +300,7 @@ public class AbandonRequestTest extends 
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.456", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse(  ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 

Modified: directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/addRequest/AddRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/addRequest/AddRequestTest.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/addRequest/AddRequestTest.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/addRequest/AddRequestTest.java Sun Feb  6 15:45:55 2011
@@ -33,8 +33,8 @@ import java.util.Map;
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractTest;
+import org.apache.directory.shared.dsmlv2.DsmlControl;
 import org.apache.directory.shared.dsmlv2.Dsmlv2Parser;
-import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.model.entry.Value;
@@ -158,7 +158,7 @@ public class AddRequestTest extends Abst
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "Some text", Strings.utf8ToString( ((ControlDecorator<Control>)control).getValue() ) );
+        assertEquals( "Some text", Strings.utf8ToString( ( ( DsmlControl<?> ) control ).getValue() ) );
     }
 
 
@@ -193,7 +193,7 @@ public class AddRequestTest extends Abst
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString( ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString( ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -228,7 +228,7 @@ public class AddRequestTest extends Abst
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 
@@ -262,7 +262,7 @@ public class AddRequestTest extends Abst
         assertNotNull( control );
         assertFalse( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.789", control.getOid() );
-        assertEquals( "Some other text", Strings.utf8ToString( ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some other text", Strings.utf8ToString( ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -297,7 +297,7 @@ public class AddRequestTest extends Abst
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.456", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 

Modified: directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/addResponse/AddResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/addResponse/AddResponseTest.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/addResponse/AddResponseTest.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/addResponse/AddResponseTest.java Sun Feb  6 15:45:55 2011
@@ -34,8 +34,8 @@ import java.util.Map;
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
+import org.apache.directory.shared.dsmlv2.DsmlControl;
 import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
-import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.model.exception.LdapURLEncodingException;
 import org.apache.directory.shared.ldap.model.filter.LdapURL;
 import org.apache.directory.shared.ldap.model.message.AddResponse;
@@ -124,7 +124,7 @@ public class AddResponseTest extends Abs
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "Some text", Strings.utf8ToString(((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some text", Strings.utf8ToString( ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -159,7 +159,7 @@ public class AddResponseTest extends Abs
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse(  ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 
@@ -193,7 +193,7 @@ public class AddResponseTest extends Abs
         assertNotNull( control );
         assertFalse( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.789", control.getOid() );
-        assertEquals( "Some other text", Strings.utf8ToString( ((ControlDecorator<Control>)control).getValue() ) );
+        assertEquals( "Some other text", Strings.utf8ToString(  ( ( DsmlControl<?> ) control ).getValue() ) );
     }
 
 
@@ -228,7 +228,7 @@ public class AddResponseTest extends Abs
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.456", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse(  ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 

Modified: directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/authRequest/AuthRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/authRequest/AuthRequestTest.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/authRequest/AuthRequestTest.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/authRequest/AuthRequestTest.java Sun Feb  6 15:45:55 2011
@@ -32,8 +32,8 @@ import java.util.Map;
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractTest;
+import org.apache.directory.shared.dsmlv2.DsmlControl;
 import org.apache.directory.shared.dsmlv2.Dsmlv2Parser;
-import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.model.message.BindRequest;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.util.Strings;
@@ -154,7 +154,7 @@ public class AuthRequestTest extends Abs
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "Some text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -189,7 +189,7 @@ public class AuthRequestTest extends Abs
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -224,7 +224,7 @@ public class AuthRequestTest extends Abs
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 
@@ -258,7 +258,7 @@ public class AuthRequestTest extends Abs
         assertNotNull( control );
         assertFalse( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.789", control.getOid() );
-        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -293,7 +293,7 @@ public class AuthRequestTest extends Abs
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.456", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 

Modified: directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/authResponse/AuthResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/authResponse/AuthResponseTest.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/authResponse/AuthResponseTest.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/authResponse/AuthResponseTest.java Sun Feb  6 15:45:55 2011
@@ -34,8 +34,8 @@ import java.util.Map;
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
+import org.apache.directory.shared.dsmlv2.DsmlControl;
 import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
-import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.model.exception.LdapURLEncodingException;
 import org.apache.directory.shared.ldap.model.filter.LdapURL;
 import org.apache.directory.shared.ldap.model.message.BindResponse;
@@ -124,7 +124,7 @@ public class AuthResponseTest extends Ab
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "Some text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -159,7 +159,7 @@ public class AuthResponseTest extends Ab
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 
@@ -194,7 +194,7 @@ public class AuthResponseTest extends Ab
         assertNotNull( control );
         assertFalse( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.789", control.getOid() );
-        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -229,7 +229,7 @@ public class AuthResponseTest extends Ab
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.456", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 

Modified: directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/batchRequest/BatchRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/batchRequest/BatchRequestTest.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/batchRequest/BatchRequestTest.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/batchRequest/BatchRequestTest.java Sun Feb  6 15:45:55 2011
@@ -30,17 +30,18 @@ import java.util.List;
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractTest;
+import org.apache.directory.shared.dsmlv2.DsmlDecorator;
 import org.apache.directory.shared.dsmlv2.Dsmlv2Parser;
-import org.apache.directory.shared.dsmlv2.request.BatchRequest;
+import org.apache.directory.shared.dsmlv2.request.BatchRequestDsml;
 import org.apache.directory.shared.ldap.model.message.AbandonRequest;
 import org.apache.directory.shared.ldap.model.message.AddRequest;
 import org.apache.directory.shared.ldap.model.message.BindRequest;
 import org.apache.directory.shared.ldap.model.message.CompareRequest;
 import org.apache.directory.shared.ldap.model.message.DeleteRequest;
 import org.apache.directory.shared.ldap.model.message.ExtendedRequest;
-import org.apache.directory.shared.ldap.model.message.Message;
 import org.apache.directory.shared.ldap.model.message.ModifyDnRequest;
 import org.apache.directory.shared.ldap.model.message.ModifyRequest;
+import org.apache.directory.shared.ldap.model.message.Request;
 import org.apache.directory.shared.ldap.model.message.SearchRequest;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -76,7 +77,7 @@ public class BatchRequestTest extends Ab
             fail( e.getMessage() );
         }
 
-        BatchRequest batchRequest = parser.getBatchRequest();
+        BatchRequestDsml batchRequest = parser.getBatchRequest();
 
         assertEquals( 1234567890, batchRequest.getRequestID() );
     }
@@ -113,7 +114,7 @@ public class BatchRequestTest extends Ab
             fail( e.getMessage() );
         }
 
-        BatchRequest batchRequest = parser.getBatchRequest();
+        BatchRequestDsml batchRequest = parser.getBatchRequest();
 
         assertEquals( 0, batchRequest.getRequests().size() );
     }
@@ -140,13 +141,11 @@ public class BatchRequestTest extends Ab
             fail( e.getMessage() );
         }
 
-        BatchRequest batchRequest = parser.getBatchRequest();
+        BatchRequestDsml batchRequest = parser.getBatchRequest();
 
         assertEquals( 1, batchRequest.getRequests().size() );
 
-        Message request = batchRequest.getCurrentRequest();
-
-        if ( request instanceof BindRequest)
+        if ( batchRequest.getCurrentRequest() instanceof BindRequest)
         {
             assertTrue( true );
         }
@@ -178,13 +177,11 @@ public class BatchRequestTest extends Ab
             fail( e.getMessage() );
         }
 
-        BatchRequest batchRequest = parser.getBatchRequest();
+        BatchRequestDsml batchRequest = parser.getBatchRequest();
 
         assertEquals( 1, batchRequest.getRequests().size() );
 
-        Message request = batchRequest.getCurrentRequest();
-
-        if ( request instanceof AddRequest )
+        if ( batchRequest.getCurrentRequest() instanceof AddRequest )
         {
             assertTrue( true );
         }
@@ -216,13 +213,11 @@ public class BatchRequestTest extends Ab
             fail( e.getMessage() );
         }
 
-        BatchRequest batchRequest = parser.getBatchRequest();
+        BatchRequestDsml batchRequest = parser.getBatchRequest();
 
         assertEquals( 1, batchRequest.getRequests().size() );
 
-        Message request = batchRequest.getCurrentRequest();
-
-        if ( request instanceof CompareRequest )
+        if ( batchRequest.getCurrentRequest() instanceof CompareRequest )
         {
             assertTrue( true );
         }
@@ -254,13 +249,11 @@ public class BatchRequestTest extends Ab
             fail( e.getMessage() );
         }
 
-        BatchRequest batchRequest = parser.getBatchRequest();
+        BatchRequestDsml batchRequest = parser.getBatchRequest();
 
         assertEquals( 1, batchRequest.getRequests().size() );
 
-        Message request = batchRequest.getCurrentRequest();
-
-        if ( request instanceof AbandonRequest )
+        if ( batchRequest.getCurrentRequest() instanceof AbandonRequest )
         {
             assertTrue( true );
         }
@@ -292,13 +285,11 @@ public class BatchRequestTest extends Ab
             fail( e.getMessage() );
         }
 
-        BatchRequest batchRequest = parser.getBatchRequest();
+        BatchRequestDsml batchRequest = parser.getBatchRequest();
 
         assertEquals( 1, batchRequest.getRequests().size() );
 
-        Message request = batchRequest.getCurrentRequest();
-
-        if ( request instanceof DeleteRequest )
+        if ( batchRequest.getCurrentRequest() instanceof DeleteRequest )
         {
             assertTrue( true );
         }
@@ -330,13 +321,11 @@ public class BatchRequestTest extends Ab
             fail( e.getMessage() );
         }
 
-        BatchRequest batchRequest = parser.getBatchRequest();
+        BatchRequestDsml batchRequest = parser.getBatchRequest();
 
         assertEquals( 1, batchRequest.getRequests().size() );
 
-        Message request = batchRequest.getCurrentRequest();
-
-        if ( request instanceof ExtendedRequest)
+        if ( batchRequest.getCurrentRequest() instanceof ExtendedRequest)
         {
             assertTrue( true );
         }
@@ -368,13 +357,11 @@ public class BatchRequestTest extends Ab
             fail( e.getMessage() );
         }
 
-        BatchRequest batchRequest = parser.getBatchRequest();
+        BatchRequestDsml batchRequest = parser.getBatchRequest();
 
         assertEquals( 1, batchRequest.getRequests().size() );
 
-        Message request = batchRequest.getCurrentRequest();
-
-        if ( request instanceof ModifyDnRequest )
+        if ( batchRequest.getCurrentRequest() instanceof ModifyDnRequest )
         {
             assertTrue( true );
         }
@@ -406,13 +393,11 @@ public class BatchRequestTest extends Ab
             fail( e.getMessage() );
         }
 
-        BatchRequest batchRequest = parser.getBatchRequest();
+        BatchRequestDsml batchRequest = parser.getBatchRequest();
 
         assertEquals( 1, batchRequest.getRequests().size() );
 
-        Message request = batchRequest.getCurrentRequest();
-
-        if ( request instanceof ModifyRequest)
+        if ( batchRequest.getCurrentRequest() instanceof ModifyRequest)
         {
             assertTrue( true );
         }
@@ -444,13 +429,11 @@ public class BatchRequestTest extends Ab
             fail( e.getMessage() );
         }
 
-        BatchRequest batchRequest = parser.getBatchRequest();
+        BatchRequestDsml batchRequest = parser.getBatchRequest();
 
         assertEquals( 1, batchRequest.getRequests().size() );
 
-        Message request = batchRequest.getCurrentRequest();
-
-        if ( request instanceof SearchRequest )
+        if ( batchRequest.getCurrentRequest() instanceof SearchRequest )
         {
             assertTrue( true );
         }
@@ -482,13 +465,11 @@ public class BatchRequestTest extends Ab
             fail( e.getMessage() );
         }
 
-        BatchRequest batchRequest = parser.getBatchRequest();
+        BatchRequestDsml batchRequest = parser.getBatchRequest();
 
         assertEquals( 2, batchRequest.getRequests().size() );
 
-        Message request = batchRequest.getCurrentRequest();
-
-        if ( request instanceof AddRequest )
+        if ( batchRequest.getCurrentRequest() instanceof AddRequest )
         {
             assertTrue( true );
         }
@@ -520,13 +501,11 @@ public class BatchRequestTest extends Ab
             fail( e.getMessage() );
         }
 
-        BatchRequest batchRequest = parser.getBatchRequest();
+        BatchRequestDsml batchRequest = parser.getBatchRequest();
 
         assertEquals( 2, batchRequest.getRequests().size() );
 
-        Message request = batchRequest.getCurrentRequest();
-
-        if ( request instanceof CompareRequest )
+        if ( batchRequest.getCurrentRequest() instanceof CompareRequest )
         {
             assertTrue( true );
         }
@@ -558,13 +537,11 @@ public class BatchRequestTest extends Ab
             fail( e.getMessage() );
         }
 
-        BatchRequest batchRequest = parser.getBatchRequest();
+        BatchRequestDsml batchRequest = parser.getBatchRequest();
 
         assertEquals( 2, batchRequest.getRequests().size() );
 
-        Message request = batchRequest.getCurrentRequest();
-
-        if ( request instanceof AbandonRequest )
+        if ( batchRequest.getCurrentRequest() instanceof AbandonRequest )
         {
             assertTrue( true );
         }
@@ -596,13 +573,11 @@ public class BatchRequestTest extends Ab
             fail( e.getMessage() );
         }
 
-        BatchRequest batchRequest = parser.getBatchRequest();
+        BatchRequestDsml batchRequest = parser.getBatchRequest();
 
         assertEquals( 2, batchRequest.getRequests().size() );
 
-        Message request = batchRequest.getCurrentRequest();
-
-        if ( request instanceof DeleteRequest )
+        if ( batchRequest.getCurrentRequest() instanceof DeleteRequest )
         {
             assertTrue( true );
         }
@@ -634,13 +609,11 @@ public class BatchRequestTest extends Ab
             fail( e.getMessage() );
         }
 
-        BatchRequest batchRequest = parser.getBatchRequest();
+        BatchRequestDsml batchRequest = parser.getBatchRequest();
 
         assertEquals( 2, batchRequest.getRequests().size() );
 
-        Message request = batchRequest.getCurrentRequest();
-
-        if ( request instanceof ExtendedRequest )
+        if ( batchRequest.getCurrentRequest() instanceof ExtendedRequest )
         {
             assertTrue( true );
         }
@@ -672,13 +645,11 @@ public class BatchRequestTest extends Ab
             fail( e.getMessage() );
         }
 
-        BatchRequest batchRequest = parser.getBatchRequest();
+        BatchRequestDsml batchRequest = parser.getBatchRequest();
 
         assertEquals( 2, batchRequest.getRequests().size() );
 
-        Message request = batchRequest.getCurrentRequest();
-
-        if ( request instanceof ModifyDnRequest )
+        if ( batchRequest.getCurrentRequest() instanceof ModifyDnRequest )
         {
             assertTrue( true );
         }
@@ -710,13 +681,11 @@ public class BatchRequestTest extends Ab
             fail( e.getMessage() );
         }
 
-        BatchRequest batchRequest = parser.getBatchRequest();
+        BatchRequestDsml batchRequest = parser.getBatchRequest();
 
         assertEquals( 2, batchRequest.getRequests().size() );
 
-        Message request = batchRequest.getCurrentRequest();
-
-        if ( request instanceof ModifyRequest )
+        if ( batchRequest.getCurrentRequest() instanceof ModifyRequest )
         {
             assertTrue( true );
         }
@@ -748,13 +717,11 @@ public class BatchRequestTest extends Ab
             fail( e.getMessage() );
         }
 
-        BatchRequest batchRequest = parser.getBatchRequest();
+        BatchRequestDsml batchRequest = parser.getBatchRequest();
 
         assertEquals( 2, batchRequest.getRequests().size() );
 
-        Message request = batchRequest.getCurrentRequest();
-
-        if ( request instanceof SearchRequest )
+        if ( batchRequest.getCurrentRequest() instanceof SearchRequest )
         {
             assertTrue( true );
         }
@@ -786,15 +753,14 @@ public class BatchRequestTest extends Ab
             fail( e.getMessage() );
         }
 
-        BatchRequest batchRequest = parser.getBatchRequest();
+        BatchRequestDsml batchRequest = parser.getBatchRequest();
 
-        List requests = batchRequest.getRequests();
+        List<DsmlDecorator<? extends Request>> requests = 
+            batchRequest.getRequests();
 
         assertEquals( 2, requests.size() );
 
-        Message request = ( Message ) requests.get( 0 );
-
-        if ( request instanceof BindRequest )
+        if ( requests.get( 0 ) instanceof BindRequest )
         {
             assertTrue( true );
         }
@@ -803,9 +769,7 @@ public class BatchRequestTest extends Ab
             fail();
         }
 
-        request = ( Message ) requests.get( 1 );
-
-        if ( request instanceof AddRequest )
+        if ( requests.get( 1 ) instanceof AddRequest )
         {
             assertTrue( true );
         }

Modified: directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareRequest/CompareRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareRequest/CompareRequestTest.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareRequest/CompareRequestTest.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareRequest/CompareRequestTest.java Sun Feb  6 15:45:55 2011
@@ -33,8 +33,8 @@ import java.util.Map;
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractTest;
+import org.apache.directory.shared.dsmlv2.DsmlControl;
 import org.apache.directory.shared.dsmlv2.Dsmlv2Parser;
-import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.model.message.CompareRequest;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.util.Strings;
@@ -156,7 +156,7 @@ public class CompareRequestTest extends 
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "Some text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -191,7 +191,7 @@ public class CompareRequestTest extends 
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "Some text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -226,7 +226,7 @@ public class CompareRequestTest extends 
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 
@@ -261,7 +261,7 @@ public class CompareRequestTest extends 
         assertNotNull( control );
         assertFalse( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.789", control.getOid() );
-        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -296,7 +296,7 @@ public class CompareRequestTest extends 
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.456", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 

Modified: directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareResponse/CompareResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareResponse/CompareResponseTest.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareResponse/CompareResponseTest.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareResponse/CompareResponseTest.java Sun Feb  6 15:45:55 2011
@@ -34,8 +34,8 @@ import java.util.Map;
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
+import org.apache.directory.shared.dsmlv2.DsmlControl;
 import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
-import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.model.exception.LdapURLEncodingException;
 import org.apache.directory.shared.ldap.model.filter.LdapURL;
 import org.apache.directory.shared.ldap.model.message.CompareResponse;
@@ -125,7 +125,7 @@ public class CompareResponseTest extends
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "Some text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -160,7 +160,7 @@ public class CompareResponseTest extends
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 
@@ -195,7 +195,7 @@ public class CompareResponseTest extends
         assertNotNull( control );
         assertFalse( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.789", control.getOid() );
-        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -230,7 +230,7 @@ public class CompareResponseTest extends
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.456", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 

Modified: directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delRequest/DelRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delRequest/DelRequestTest.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delRequest/DelRequestTest.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delRequest/DelRequestTest.java Sun Feb  6 15:45:55 2011
@@ -21,7 +21,7 @@
 package org.apache.directory.shared.dsmlv2.delRequest;
 
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertEquals; 
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
@@ -32,8 +32,8 @@ import java.util.Map;
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractTest;
+import org.apache.directory.shared.dsmlv2.DsmlControl;
 import org.apache.directory.shared.dsmlv2.Dsmlv2Parser;
-import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.DeleteRequest;
 import org.apache.directory.shared.util.Strings;
@@ -153,7 +153,7 @@ public class DelRequestTest extends Abst
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "Some text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -188,7 +188,7 @@ public class DelRequestTest extends Abst
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -223,7 +223,7 @@ public class DelRequestTest extends Abst
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 
@@ -257,7 +257,7 @@ public class DelRequestTest extends Abst
         assertNotNull( control );
         assertFalse( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.789", control.getOid() );
-        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -292,7 +292,7 @@ public class DelRequestTest extends Abst
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.456", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 

Modified: directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delResponse/DelResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delResponse/DelResponseTest.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delResponse/DelResponseTest.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delResponse/DelResponseTest.java Sun Feb  6 15:45:55 2011
@@ -34,8 +34,8 @@ import java.util.Map;
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
+import org.apache.directory.shared.dsmlv2.DsmlControl;
 import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
-import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.model.exception.LdapURLEncodingException;
 import org.apache.directory.shared.ldap.model.filter.LdapURL;
 import org.apache.directory.shared.ldap.model.message.Control;
@@ -124,7 +124,7 @@ public class DelResponseTest extends Abs
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "Some text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -159,7 +159,7 @@ public class DelResponseTest extends Abs
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 
@@ -193,7 +193,7 @@ public class DelResponseTest extends Abs
         assertNotNull( control );
         assertFalse( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.789", control.getOid() );
-        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -228,7 +228,7 @@ public class DelResponseTest extends Abs
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.456", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 

Modified: directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedRequest/ExtendedRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedRequest/ExtendedRequestTest.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedRequest/ExtendedRequestTest.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedRequest/ExtendedRequestTest.java Sun Feb  6 15:45:55 2011
@@ -33,8 +33,8 @@ import java.util.Map;
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractTest;
+import org.apache.directory.shared.dsmlv2.DsmlControl;
 import org.apache.directory.shared.dsmlv2.Dsmlv2Parser;
-import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.ExtendedRequest;
 import org.apache.directory.shared.util.Strings;
@@ -119,7 +119,7 @@ public class ExtendedRequestTest extends
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "Some text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -154,7 +154,7 @@ public class ExtendedRequestTest extends
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -189,7 +189,7 @@ public class ExtendedRequestTest extends
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 
@@ -224,7 +224,7 @@ public class ExtendedRequestTest extends
         assertNotNull( control );
         assertFalse( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.789", control.getOid() );
-        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -259,7 +259,7 @@ public class ExtendedRequestTest extends
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.456", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 

Modified: directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedResponse/ExtendedResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedResponse/ExtendedResponseTest.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedResponse/ExtendedResponseTest.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedResponse/ExtendedResponseTest.java Sun Feb  6 15:45:55 2011
@@ -36,8 +36,8 @@ import org.apache.directory.junit.tools.
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.util.OID;
 import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
+import org.apache.directory.shared.dsmlv2.DsmlControl;
 import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
-import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.model.exception.LdapURLEncodingException;
 import org.apache.directory.shared.ldap.model.filter.LdapURL;
 import org.apache.directory.shared.ldap.model.message.Control;
@@ -127,7 +127,7 @@ public class ExtendedResponseTest extend
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "Some text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -162,7 +162,7 @@ public class ExtendedResponseTest extend
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 
@@ -197,7 +197,7 @@ public class ExtendedResponseTest extend
         assertNotNull( control );
         assertFalse( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.789", control.getOid() );
-        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -232,7 +232,7 @@ public class ExtendedResponseTest extend
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.456", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 

Modified: directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNRequest/ModifyDNRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNRequest/ModifyDNRequestTest.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNRequest/ModifyDNRequestTest.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNRequest/ModifyDNRequestTest.java Sun Feb  6 15:45:55 2011
@@ -32,8 +32,8 @@ import java.util.Map;
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractTest;
+import org.apache.directory.shared.dsmlv2.DsmlControl;
 import org.apache.directory.shared.dsmlv2.Dsmlv2Parser;
-import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.ModifyDnRequest;
 import org.apache.directory.shared.util.Strings;
@@ -118,7 +118,7 @@ public class ModifyDNRequestTest extends
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "Some text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -153,7 +153,7 @@ public class ModifyDNRequestTest extends
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -188,7 +188,7 @@ public class ModifyDNRequestTest extends
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 
@@ -223,7 +223,7 @@ public class ModifyDNRequestTest extends
         assertNotNull( control );
         assertFalse( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.789", control.getOid() );
-        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -258,7 +258,7 @@ public class ModifyDNRequestTest extends
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.456", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 

Modified: directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNResponse/ModifyDNResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNResponse/ModifyDNResponseTest.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNResponse/ModifyDNResponseTest.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNResponse/ModifyDNResponseTest.java Sun Feb  6 15:45:55 2011
@@ -34,8 +34,8 @@ import java.util.Map;
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
+import org.apache.directory.shared.dsmlv2.DsmlControl;
 import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
-import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.model.exception.LdapURLEncodingException;
 import org.apache.directory.shared.ldap.model.filter.LdapURL;
 import org.apache.directory.shared.ldap.model.message.Control;
@@ -125,7 +125,7 @@ public class ModifyDNResponseTest extend
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "Some text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -160,7 +160,7 @@ public class ModifyDNResponseTest extend
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 
@@ -195,7 +195,7 @@ public class ModifyDNResponseTest extend
         assertNotNull( control );
         assertFalse( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.789", control.getOid() );
-        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -230,7 +230,7 @@ public class ModifyDNResponseTest extend
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.456", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 

Modified: directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyRequest/ModifyRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyRequest/ModifyRequestTest.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyRequest/ModifyRequestTest.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyRequest/ModifyRequestTest.java Sun Feb  6 15:45:55 2011
@@ -37,8 +37,8 @@ import javax.naming.NamingException;
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractTest;
+import org.apache.directory.shared.dsmlv2.DsmlControl;
 import org.apache.directory.shared.dsmlv2.Dsmlv2Parser;
-import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.model.entry.Modification;
 import org.apache.directory.shared.ldap.model.entry.ModificationOperation;
@@ -125,7 +125,7 @@ public class ModifyRequestTest extends A
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "Some text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -160,7 +160,7 @@ public class ModifyRequestTest extends A
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -195,7 +195,7 @@ public class ModifyRequestTest extends A
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 
@@ -230,7 +230,7 @@ public class ModifyRequestTest extends A
         assertNotNull( control );
         assertFalse( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.789", control.getOid() );
-        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -265,7 +265,7 @@ public class ModifyRequestTest extends A
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.456", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 

Modified: directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyResponse/ModifyResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyResponse/ModifyResponseTest.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyResponse/ModifyResponseTest.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyResponse/ModifyResponseTest.java Sun Feb  6 15:45:55 2011
@@ -34,8 +34,8 @@ import java.util.Map;
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
+import org.apache.directory.shared.dsmlv2.DsmlControl;
 import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
-import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.model.exception.LdapURLEncodingException;
 import org.apache.directory.shared.ldap.model.filter.LdapURL;
 import org.apache.directory.shared.ldap.model.message.Control;
@@ -125,7 +125,7 @@ public class ModifyResponseTest extends 
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "Some text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -160,7 +160,7 @@ public class ModifyResponseTest extends 
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 
@@ -195,7 +195,7 @@ public class ModifyResponseTest extends 
         assertNotNull( control );
         assertFalse( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.789", control.getOid() );
-        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -230,7 +230,7 @@ public class ModifyResponseTest extends 
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.456", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 

Modified: directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchRequest/SearchRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchRequest/SearchRequestTest.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchRequest/SearchRequestTest.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchRequest/SearchRequestTest.java Sun Feb  6 15:45:55 2011
@@ -36,8 +36,8 @@ import javax.naming.NamingException;
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractTest;
+import org.apache.directory.shared.dsmlv2.DsmlControl;
 import org.apache.directory.shared.dsmlv2.Dsmlv2Parser;
-import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.model.filter.AndNode;
 import org.apache.directory.shared.ldap.model.filter.ApproximateNode;
 import org.apache.directory.shared.ldap.model.filter.EqualityNode;
@@ -171,7 +171,7 @@ public class SearchRequestTest extends A
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "Some text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -206,7 +206,7 @@ public class SearchRequestTest extends A
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -241,7 +241,7 @@ public class SearchRequestTest extends A
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 
@@ -276,7 +276,7 @@ public class SearchRequestTest extends A
         assertNotNull( control );
         assertFalse( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.789", control.getOid() );
-        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -311,7 +311,7 @@ public class SearchRequestTest extends A
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.456", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 

Modified: directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.java Sun Feb  6 15:45:55 2011
@@ -34,9 +34,9 @@ import java.util.Map;
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
+import org.apache.directory.shared.dsmlv2.DsmlControl;
 import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
 import org.apache.directory.shared.dsmlv2.reponse.SearchResponse;
-import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.model.exception.LdapURLEncodingException;
 import org.apache.directory.shared.ldap.model.filter.LdapURL;
 import org.apache.directory.shared.ldap.model.message.Control;
@@ -89,7 +89,7 @@ public class SearchResultDoneTest extend
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "Some text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -125,7 +125,7 @@ public class SearchResultDoneTest extend
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 
@@ -161,7 +161,7 @@ public class SearchResultDoneTest extend
         assertNotNull( control );
         assertFalse( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.789", control.getOid() );
-        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -198,7 +198,7 @@ public class SearchResultDoneTest extend
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.456", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 

Modified: directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultEntry/SearchResultEntryTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultEntry/SearchResultEntryTest.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultEntry/SearchResultEntryTest.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultEntry/SearchResultEntryTest.java Sun Feb  6 15:45:55 2011
@@ -17,7 +17,6 @@
  *  under the License. 
  *  
  */
-
 package org.apache.directory.shared.dsmlv2.searchResponse.searchResultEntry;
 
 
@@ -34,9 +33,10 @@ import java.util.Map;
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
+import org.apache.directory.shared.dsmlv2.DsmlControl;
 import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
 import org.apache.directory.shared.dsmlv2.reponse.SearchResponse;
-import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
+import org.apache.directory.shared.dsmlv2.reponse.SearchResponseDsml;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.model.entry.Value;
@@ -77,9 +77,12 @@ public class SearchResultEntryTest exten
             fail( e.getMessage() );
         }
 
-        SearchResultEntry searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse().getDecorated() )
-            .getCurrentSearchResultEntry();
-        Map<String, Control> controls = searchResultEntry.getControls();
+        SearchResponse searchResponse = ( SearchResponse ) 
+            parser.getBatchResponse().getCurrentResponse().getDecorated(); 
+        SearchResultEntry searchResultEntry = 
+            searchResponse.getCurrentSearchResultEntry();
+        Map<String, Control> controls = 
+            searchResponse.getCurrentSearchResultEntry().getControls();
 
         assertEquals( 1, searchResultEntry.getControls().size() );
 
@@ -88,7 +91,7 @@ public class SearchResultEntryTest exten
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "Some text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -113,8 +116,10 @@ public class SearchResultEntryTest exten
             fail( e.getMessage() );
         }
 
-        SearchResultEntry searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse().getDecorated() )
-            .getCurrentSearchResultEntry();
+        SearchResponse searchResponse = ( SearchResponse ) 
+            parser.getBatchResponse().getCurrentResponse().getDecorated(); 
+        SearchResultEntry searchResultEntry = 
+            searchResponse.getCurrentSearchResultEntry();
         Map<String, Control> controls = searchResultEntry.getControls();
 
         assertEquals( 1, searchResultEntry.getControls().size() );
@@ -124,7 +129,7 @@ public class SearchResultEntryTest exten
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 
@@ -149,8 +154,10 @@ public class SearchResultEntryTest exten
             fail( e.getMessage() );
         }
 
-        SearchResultEntry searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse().getDecorated() )
-            .getCurrentSearchResultEntry();
+        SearchResponse searchResponse = ( SearchResponse ) 
+            parser.getBatchResponse().getCurrentResponse().getDecorated(); 
+        SearchResultEntry searchResultEntry = 
+            searchResponse.getCurrentSearchResultEntry();
         Map<String, Control> controls = searchResultEntry.getControls();
 
         assertEquals( 2, searchResultEntry.getControls().size() );
@@ -160,7 +167,7 @@ public class SearchResultEntryTest exten
         assertNotNull( control );
         assertFalse( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.789", control.getOid() );
-        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ((ControlDecorator<Control>)control).getValue()) );
+        assertEquals( "Some other text", Strings.utf8ToString((byte[]) ( ( DsmlControl<?> ) control ).getValue()) );
     }
 
 
@@ -185,8 +192,10 @@ public class SearchResultEntryTest exten
             fail( e.getMessage() );
         }
 
-        SearchResultEntry searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse().getDecorated() )
-            .getCurrentSearchResultEntry();
+        SearchResponse searchResponse = ( SearchResponse ) 
+            parser.getBatchResponse().getCurrentResponse().getDecorated(); 
+        SearchResultEntry searchResultEntry = 
+            searchResponse.getCurrentSearchResultEntry();
         Map<String, Control> controls = searchResultEntry.getControls();
 
         assertEquals( 3, searchResultEntry.getControls().size() );
@@ -196,7 +205,7 @@ public class SearchResultEntryTest exten
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.456", control.getOid() );
-        assertFalse( ((ControlDecorator<Control>)control).hasValue() );
+        assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
     }
 
 
@@ -241,9 +250,11 @@ public class SearchResultEntryTest exten
             fail( e.getMessage() );
         }
 
-        SearchResultEntry searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse().getDecorated() )
-            .getCurrentSearchResultEntry();
-
+        SearchResponseDsml searchResponseDsml = ( SearchResponseDsml ) 
+            parser.getBatchResponse().getCurrentResponse();
+        SearchResponse response = ( SearchResponse ) searchResponseDsml.getDecorated();
+        SearchResultEntry searchResultEntry = response.getSearchResultEntryList().get( 0 );
+        
         assertEquals( "dc=example,dc=com", searchResultEntry.getObjectName().toString() );
     }
 



Mime
View raw message