directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r796383 [13/23] - in /directory/shared/trunk: ./ dsml-parser/ dsml-parser/src/ dsml-parser/src/main/ dsml-parser/src/main/java/ dsml-parser/src/main/java/org/ dsml-parser/src/main/java/org/apache/ dsml-parser/src/main/java/org/apache/direct...
Date Tue, 21 Jul 2009 17:04:29 GMT
Added: directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.java?rev=796383&view=auto
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.java (added)
+++ directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.java Tue Jul 21 17:04:13 2009
@@ -0,0 +1,539 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+
+package org.apache.directory.studio.dsmlv2.searchResponse.searchResultDone;
+
+
+import java.util.List;
+
+import javax.naming.NamingException;
+
+import org.apache.directory.shared.ldap.codec.ControlCodec;
+import org.apache.directory.shared.ldap.codec.LdapResultCodec;
+import org.apache.directory.shared.ldap.codec.search.SearchResultDoneCodec;
+import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.studio.dsmlv2.AbstractResponseTest;
+import org.apache.directory.studio.dsmlv2.Dsmlv2ResponseParser;
+import org.apache.directory.studio.dsmlv2.reponse.SearchResponse;
+
+import com.sun.jndi.ldap.LdapURL;
+
+
+/**
+ * Tests for the Search Result Done Response parsing
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class SearchResultDoneTest extends AbstractResponseTest
+{
+    /**
+     * Test parsing of a response with a (optional) Control element
+     */
+    public void testResponseWith1Control()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultDoneTest.class.getResource( "response_with_1_control.xml" ).openStream(),
+                "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultDoneCodec searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
+            .getSearchResultDone();
+
+        assertEquals( 1, searchResultDone.getControls().size() );
+
+        ControlCodec control = searchResultDone.getCurrentControl();
+
+        assertTrue( control.getCriticality() );
+
+        assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
+
+        assertEquals( "Some text", StringTools.utf8ToString( ( byte[] ) control.getControlValue() ) );
+    }
+
+
+    /**
+     * Test parsing of a response with a (optional) Control element with empty value
+     */
+    public void testResponseWith1ControlEmptyValue()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultDoneTest.class.getResource( "response_with_1_control_empty_value.xml" )
+                .openStream(), "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultDoneCodec searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
+            .getSearchResultDone();
+        ControlCodec control = searchResultDone.getCurrentControl();
+
+        assertEquals( 1, searchResultDone.getControls().size() );
+        assertTrue( control.getCriticality() );
+        assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
+        assertEquals( StringTools.EMPTY_BYTES, ( byte[] ) control.getControlValue() );
+    }
+
+
+    /**
+     * Test parsing of a response with 2 (optional) Control elements
+     */
+    public void testResponseWith2Controls()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultDoneTest.class.getResource( "response_with_2_controls.xml" ).openStream(),
+                "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultDoneCodec searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
+            .getSearchResultDone();
+
+        assertEquals( 2, searchResultDone.getControls().size() );
+
+        ControlCodec control = searchResultDone.getCurrentControl();
+
+        assertFalse( control.getCriticality() );
+
+        assertEquals( "1.2.840.113556.1.4.789", control.getControlType() );
+
+        assertEquals( "Some other text", StringTools.utf8ToString( ( byte[] ) control.getControlValue() ) );
+    }
+
+
+    /**
+     * Test parsing of a response with 3 (optional) Control elements without value
+     */
+    public void testResponseWith3ControlsWithoutValue()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultDoneTest.class.getResource( "response_with_3_controls_without_value.xml" )
+                .openStream(), "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultDoneCodec searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
+            .getSearchResultDone();
+
+        assertEquals( 3, searchResultDone.getControls().size() );
+
+        ControlCodec control = searchResultDone.getCurrentControl();
+
+        assertTrue( control.getCriticality() );
+
+        assertEquals( "1.2.840.113556.1.4.456", control.getControlType() );
+
+        assertEquals( StringTools.EMPTY_BYTES, control.getControlValue() );
+    }
+
+
+    /**
+     * Test parsing of a Response with the (optional) requestID attribute
+     */
+    public void testResponseWithRequestId()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultDoneTest.class.getResource( "response_with_requestID_attribute.xml" )
+                .openStream(), "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultDoneCodec searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
+            .getSearchResultDone();
+
+        assertEquals( 456, searchResultDone.getMessageId() );
+    }
+
+
+    /**
+     * Test parsing of a Response with the (optional) requestID attribute equals 0
+     */
+    public void testResponseWithRequestIdEquals0()
+    {
+        testParsingFail( SearchResultDoneTest.class, "response_with_requestID_equals_0.xml" );
+    }
+
+
+    /**
+     * Test parsing of a response without Result Code element
+     */
+    public void testResponseWithoutResultCode()
+    {
+        testParsingFail( SearchResultDoneTest.class, "response_without_result_code.xml" );
+    }
+
+
+    /**
+     * Test parsing of a response with Result Code element but a not integer value
+     */
+    public void testResponseWithResultCodeNotInteger()
+    {
+        testParsingFail( SearchResultDoneTest.class, "response_with_result_code_not_integer.xml" );
+    }
+
+
+    /**
+     * Test parsing of a response with Result Code 
+     */
+    public void testResponseWithResultCode()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultDoneTest.class.getResource( "response_with_result_code.xml" ).openStream(),
+                "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultDoneCodec searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
+            .getSearchResultDone();
+
+        LdapResultCodec ldapResult = searchResultDone.getLdapResult();
+
+        assertEquals( ResultCodeEnum.PROTOCOL_ERROR, ldapResult.getResultCode() );
+    }
+
+
+    /**
+     * Test parsing of a response with Error Message
+     */
+    public void testResponseWithErrorMessage()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultDoneTest.class.getResource( "response_with_error_message.xml" ).openStream(),
+                "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultDoneCodec searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
+            .getSearchResultDone();
+
+        LdapResultCodec ldapResult = searchResultDone.getLdapResult();
+
+        assertEquals( "Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2", ldapResult
+            .getErrorMessage() );
+    }
+
+
+    /**
+     * Test parsing of a response with empty Error Message
+     */
+    public void testResponseWithEmptyErrorMessage()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultDoneTest.class.getResource( "response_with_empty_error_message.xml" )
+                .openStream(), "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultDoneCodec searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
+            .getSearchResultDone();
+
+        LdapResultCodec ldapResult = searchResultDone.getLdapResult();
+
+        assertNull( ldapResult.getErrorMessage() );
+    }
+
+
+    /**
+     * Test parsing of a response with a Referral
+     */
+    public void testResponseWith1Referral()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultDoneTest.class.getResource( "response_with_1_referral.xml" ).openStream(),
+                "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultDoneCodec searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
+            .getSearchResultDone();
+
+        LdapResultCodec ldapResult = searchResultDone.getLdapResult();
+
+        List referrals = ldapResult.getReferrals();
+
+        assertEquals( 1, referrals.size() );
+
+        Object referral = referrals.get( 0 );
+
+        try
+        {
+            assertEquals( new LdapURL( "ldap://www.apache.org/" ).toString(), referral.toString() );
+        }
+        catch ( NamingException e )
+        {
+            fail();
+        }
+    }
+
+
+    /**
+     * Test parsing of a response with an empty Referral
+     */
+    public void testResponseWith1EmptyReferral()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultDoneTest.class.getResource( "response_with_1_empty_referral.xml" )
+                .openStream(), "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultDoneCodec searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
+            .getSearchResultDone();
+
+        LdapResultCodec ldapResult = searchResultDone.getLdapResult();
+
+        List referrals = ldapResult.getReferrals();
+
+        assertEquals( 0, referrals.size() );
+    }
+
+
+    /**
+     * Test parsing of a response with 2 Referral elements
+     */
+    public void testResponseWith2Referrals()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultDoneTest.class.getResource( "response_with_2_referrals.xml" ).openStream(),
+                "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultDoneCodec searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
+            .getSearchResultDone();
+
+        LdapResultCodec ldapResult = searchResultDone.getLdapResult();
+
+        List referrals = ldapResult.getReferrals();
+
+        assertEquals( 2, referrals.size() );
+
+        Object referral = referrals.get( 0 );
+
+        try
+        {
+            assertEquals( new LdapURL( "ldap://www.apache.org/" ).toString(), referral.toString() );
+        }
+        catch ( NamingException e )
+        {
+            fail();
+        }
+
+        Object referral2 = referrals.get( 1 );
+
+        try
+        {
+            assertEquals( new LdapURL( "ldap://www.apple.com/" ).toString(), referral2.toString() );
+        }
+        catch ( NamingException e )
+        {
+            fail();
+        }
+    }
+
+
+    /**
+     * Test parsing of a response with a Referral and an Error Message
+     */
+    public void testResponseWith1ReferralAndAnErrorMessage()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultDoneTest.class.getResource( "response_with_1_referral_and_error_message.xml" )
+                .openStream(), "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultDoneCodec searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
+            .getSearchResultDone();
+
+        LdapResultCodec ldapResult = searchResultDone.getLdapResult();
+
+        List referrals = ldapResult.getReferrals();
+
+        assertEquals( 1, referrals.size() );
+
+        Object referral = referrals.get( 0 );
+
+        try
+        {
+            assertEquals( new LdapURL( "ldap://www.apache.org/" ).toString(), referral.toString() );
+        }
+        catch ( NamingException e )
+        {
+            fail();
+        }
+    }
+
+
+    /**
+     * Test parsing of a response with MatchedDN attribute
+     */
+    public void testResponseWithMatchedDNAttribute()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultDoneTest.class.getResource( "response_with_matchedDN_attribute.xml" )
+                .openStream(), "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultDoneCodec searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
+            .getSearchResultDone();
+
+        LdapResultCodec ldapResult = searchResultDone.getLdapResult();
+
+        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", ldapResult.getMatchedDN() );
+    }
+
+
+    /**
+     * Test parsing of a response with wrong matched DN
+     */
+    public void testResponseWithWrongMatchedDN()
+    {
+        testParsingFail( SearchResultDoneTest.class, "response_with_wrong_matchedDN_attribute.xml" );
+    }
+
+
+    /**
+     * Test parsing of a response with wrong Descr attribute
+     */
+    public void testResponseWithWrongDescr()
+    {
+        testParsingFail( SearchResultDoneTest.class, "response_with_wrong_descr.xml" );
+    }
+}

Added: directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/searchResultEntry/SearchResultEntryTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/searchResultEntry/SearchResultEntryTest.java?rev=796383&view=auto
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/searchResultEntry/SearchResultEntryTest.java (added)
+++ directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/searchResultEntry/SearchResultEntryTest.java Tue Jul 21 17:04:13 2009
@@ -0,0 +1,532 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+
+package org.apache.directory.studio.dsmlv2.searchResponse.searchResultEntry;
+
+
+import java.io.UnsupportedEncodingException;
+import java.util.Iterator;
+
+import org.apache.directory.shared.ldap.codec.ControlCodec;
+import org.apache.directory.shared.ldap.codec.search.SearchResultEntryCodec;
+import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.studio.dsmlv2.AbstractResponseTest;
+import org.apache.directory.studio.dsmlv2.Dsmlv2ResponseParser;
+import org.apache.directory.studio.dsmlv2.reponse.SearchResponse;
+
+
+/**
+ * Tests for the Search Result Entry Response parsing
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class SearchResultEntryTest extends AbstractResponseTest
+{
+    /**
+     * Test parsing of a response with a (optional) Control element
+     */
+    public void testResponseWith1Control()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultEntryTest.class.getResource( "response_with_1_control.xml" ).openStream(),
+                "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultEntryCodec searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
+            .getCurrentSearchResultEntry();
+
+        assertEquals( 1, searchResultEntry.getControls().size() );
+
+        ControlCodec control = searchResultEntry.getCurrentControl();
+
+        assertTrue( control.getCriticality() );
+
+        assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
+
+        assertEquals( "Some text", StringTools.utf8ToString( ( byte[] ) control.getControlValue() ) );
+    }
+
+
+    /**
+     * Test parsing of a response with a (optional) Control element with empty value
+     */
+    public void testResponseWith1ControlEmptyValue()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultEntryTest.class.getResource( "response_with_1_control_empty_value.xml" )
+                .openStream(), "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultEntryCodec searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
+            .getCurrentSearchResultEntry();
+        ControlCodec control = searchResultEntry.getCurrentControl();
+
+        assertEquals( 1, searchResultEntry.getControls().size() );
+        assertTrue( control.getCriticality() );
+        assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
+        assertEquals( StringTools.EMPTY_BYTES, ( byte[] ) control.getControlValue() );
+    }
+
+
+    /**
+     * Test parsing of a response with 2 (optional) Control elements
+     */
+    public void testResponseWith2Controls()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultEntryTest.class.getResource( "response_with_2_controls.xml" ).openStream(),
+                "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultEntryCodec searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
+            .getCurrentSearchResultEntry();
+
+        assertEquals( 2, searchResultEntry.getControls().size() );
+
+        ControlCodec control = searchResultEntry.getCurrentControl();
+
+        assertFalse( control.getCriticality() );
+
+        assertEquals( "1.2.840.113556.1.4.789", control.getControlType() );
+
+        assertEquals( "Some other text", StringTools.utf8ToString( ( byte[] ) control.getControlValue() ) );
+    }
+
+
+    /**
+     * Test parsing of a response with 3 (optional) Control elements without value
+     */
+    public void testResponseWith3ControlsWithoutValue()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultEntryTest.class.getResource( "response_with_3_controls_without_value.xml" )
+                .openStream(), "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultEntryCodec searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
+            .getCurrentSearchResultEntry();
+
+        assertEquals( 3, searchResultEntry.getControls().size() );
+
+        ControlCodec control = searchResultEntry.getCurrentControl();
+
+        assertTrue( control.getCriticality() );
+
+        assertEquals( "1.2.840.113556.1.4.456", control.getControlType() );
+
+        assertEquals( StringTools.EMPTY_BYTES, control.getControlValue() );
+    }
+
+
+    /**
+     * Test parsing of a response without dn Attribute
+     */
+    public void testResponseWithoutDnAttribute()
+    {
+        testParsingFail( SearchResultEntryTest.class, "response_without_dn_attribute.xml" );
+    }
+
+
+    /**
+     * Test parsing of a response with wrong dn Attribute
+     */
+    public void testResponseWithWrongDnAttribute()
+    {
+        testParsingFail( SearchResultEntryTest.class, "response_with_wrong_dn_attribute.xml" );
+    }
+
+
+    /**
+     * Test parsing of a response with dn Attribute
+     */
+    public void testResponseWithDnAttribute()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultEntryTest.class.getResource( "response_with_dn_attribute.xml" ).openStream(),
+                "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultEntryCodec searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
+            .getCurrentSearchResultEntry();
+
+        assertEquals( "dc=example,dc=com", searchResultEntry.getObjectName().toString() );
+    }
+
+
+    /**
+     * Test parsing of a Response with the (optional) requestID attribute
+     */
+    public void testResponseWithRequestId()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultEntryTest.class.getResource( "response_with_requestID_attribute.xml" )
+                .openStream(), "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultEntryCodec searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
+            .getCurrentSearchResultEntry();
+
+        assertEquals( 456, searchResultEntry.getMessageId() );
+    }
+
+
+    /**
+     * Test parsing of a Response with the (optional) requestID attribute equals 0
+     */
+    public void testResponseWithRequestIdEquals0()
+    {
+        testParsingFail( SearchResultEntryTest.class, "response_with_requestID_equals_0.xml" );
+    }
+
+
+    /**
+     * Test parsing of a response with 0 Attr
+     */
+    public void testResponseWith0Attr()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultEntryTest.class.getResource( "response_with_0_attr.xml" ).openStream(),
+                "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        assertTrue( true );
+    }
+
+
+    /**
+     * Test parsing of a response with 1 Attr 0 Value
+     */
+    public void testResponseWith1Attr0Value()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput(
+                SearchResultEntryTest.class.getResource( "response_with_1_attr_0_value.xml" ).openStream(), "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultEntryCodec searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
+            .getCurrentSearchResultEntry();
+
+        Entry entry = searchResultEntry.getEntry();
+        assertEquals( 1, entry.size() );
+
+        Iterator<EntryAttribute> attributeIterator = entry.iterator();
+        EntryAttribute attribute = attributeIterator.next();
+        assertEquals( "dc", attribute.getUpId() );
+    }
+
+
+    /**
+     * Test parsing of a response with 1 Attr 1 Value
+     */
+    public void testResponseWith1Attr1Value()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput(
+                SearchResultEntryTest.class.getResource( "response_with_1_attr_1_value.xml" ).openStream(), "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultEntryCodec searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
+            .getCurrentSearchResultEntry();
+
+        Entry entry = searchResultEntry.getEntry();
+        assertEquals( 1, entry.size() );
+
+        Iterator<EntryAttribute> attributeIterator = entry.iterator();
+        EntryAttribute attribute = attributeIterator.next();
+        assertEquals( "dc", attribute.getUpId() );
+
+        Iterator<Value<?>> valueIterator = attribute.iterator();
+        assertTrue( valueIterator.hasNext() );
+        Value<?> value = valueIterator.next();
+        assertEquals( "example", value.get() );
+    }
+
+
+    /**
+     * Test parsing of a response with 1 Attr 1 Base64 Value
+     * @throws UnsupportedEncodingException 
+     */
+    public void testResponseWith1Attr1Base64Value() throws UnsupportedEncodingException
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultEntryTest.class.getResource( "response_with_1_attr_1_base64_value.xml" )
+                .openStream(), "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultEntryCodec searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
+            .getCurrentSearchResultEntry();
+
+        Entry entry = searchResultEntry.getEntry();
+        assertEquals( 1, entry.size() );
+
+        Iterator<EntryAttribute> attributeIterator = entry.iterator();
+        EntryAttribute attribute = attributeIterator.next();
+        assertEquals( "cn", attribute.getUpId() );
+        assertEquals( 1, attribute.size() );
+
+        Iterator<Value<?>> valueIterator = attribute.iterator();
+        assertTrue( valueIterator.hasNext() );
+        Value<?> value = valueIterator.next();
+
+        String expected = new String( new byte[]
+            { 'E', 'm', 'm', 'a', 'n', 'u', 'e', 'l', ' ', 'L', ( byte ) 0xc3, ( byte ) 0xa9, 'c', 'h', 'a', 'r', 'n',
+                'y' }, "UTF-8" );
+        assertEquals( expected, new String( ( byte[] ) value.get(), "UTF-8" ) );
+    }
+
+
+    /**
+     * Test parsing of a response with 1 Attr 1 empty Value
+     */
+    public void testResponseWith1Attr1EmptyValue()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultEntryTest.class.getResource( "response_with_1_attr_1_empty_value.xml" )
+                .openStream(), "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultEntryCodec searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
+            .getCurrentSearchResultEntry();
+
+        Entry entry = searchResultEntry.getEntry();
+        assertEquals( 1, entry.size() );
+
+        Iterator<EntryAttribute> attributeIterator = entry.iterator();
+        EntryAttribute attribute = attributeIterator.next();
+        assertEquals( "dc", attribute.getUpId() );
+        assertEquals( 1, attribute.size() );
+
+        Iterator<Value<?>> valueIterator = attribute.iterator();
+        assertTrue( valueIterator.hasNext() );
+        Value<?> value = valueIterator.next();
+        assertEquals( "", value.get() );
+    }
+
+
+    /**
+     * Test parsing of a response with 1 Attr 2 Value
+     */
+    public void testResponseWith1Attr2Value()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput(
+                SearchResultEntryTest.class.getResource( "response_with_1_attr_2_value.xml" ).openStream(), "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultEntryCodec searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
+            .getCurrentSearchResultEntry();
+
+        Entry entry = searchResultEntry.getEntry();
+        assertEquals( 1, entry.size() );
+
+        Iterator<EntryAttribute> attributeIterator = entry.iterator();
+        EntryAttribute attribute = attributeIterator.next();
+        assertEquals( "objectclass", attribute.getUpId() );
+        assertEquals( 2, attribute.size() );
+
+        Iterator<Value<?>> valueIterator = attribute.iterator();
+        assertTrue( valueIterator.hasNext() );
+        Value<?> value = valueIterator.next();
+        assertEquals( "top", value.get() );
+        assertTrue( valueIterator.hasNext() );
+        value = valueIterator.next();
+        assertEquals( "domain", value.get() );
+        assertFalse( valueIterator.hasNext() );
+    }
+
+
+    /**
+     * Test parsing of a response with 2 Attr 1 Value
+     */
+    public void testResponseWith2Attr1Value()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput(
+                SearchResultEntryTest.class.getResource( "response_with_2_attr_1_value.xml" ).openStream(), "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultEntryCodec searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
+            .getCurrentSearchResultEntry();
+
+        Entry entry = searchResultEntry.getEntry();
+        assertEquals( 2, entry.size() );
+
+        EntryAttribute objectClassAttribute = entry.get( "objectclass" );
+        assertEquals( 1, objectClassAttribute.size() );
+
+        Iterator<Value<?>> valueIterator = objectClassAttribute.iterator();
+        assertTrue( valueIterator.hasNext() );
+        Value<?> value = valueIterator.next();
+        assertEquals( "top", value.get() );
+        assertFalse( valueIterator.hasNext() );
+
+        EntryAttribute dcAttribute = entry.get( "dc" );
+        assertEquals( 1, objectClassAttribute.size() );
+
+        valueIterator = dcAttribute.iterator();
+        assertTrue( valueIterator.hasNext() );
+        value = valueIterator.next();
+        assertEquals( "example", value.get() );
+        assertFalse( valueIterator.hasNext() );
+    }
+
+
+    /**
+     * Test parsing of a response with 1 Attr without name Attribute
+     */
+    public void testResponseWith1AttrWithoutNameAttribute()
+    {
+        testParsingFail( SearchResultEntryTest.class, "response_with_1_attr_without_name_attribute.xml" );
+    }
+}

Added: directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/searchResultReference/SearchResultReferenceTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/searchResultReference/SearchResultReferenceTest.java?rev=796383&view=auto
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/searchResultReference/SearchResultReferenceTest.java (added)
+++ directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/searchResultReference/SearchResultReferenceTest.java Tue Jul 21 17:04:13 2009
@@ -0,0 +1,350 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+
+package org.apache.directory.studio.dsmlv2.searchResponse.searchResultReference;
+
+
+import java.util.List;
+
+import org.apache.directory.shared.ldap.codec.ControlCodec;
+import org.apache.directory.shared.ldap.codec.search.SearchResultReferenceCodec;
+import org.apache.directory.shared.ldap.util.LdapURL;
+import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.studio.dsmlv2.AbstractResponseTest;
+import org.apache.directory.studio.dsmlv2.Dsmlv2ResponseParser;
+import org.apache.directory.studio.dsmlv2.reponse.SearchResponse;
+
+
+/**
+ * Tests for the Search Result Reference Response parsing
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class SearchResultReferenceTest extends AbstractResponseTest
+{
+    /**
+     * Test parsing of a response with a (optional) Control element
+     */
+    public void testResponseWith1Control()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultReferenceTest.class.getResource( "response_with_1_control.xml" ).openStream(),
+                "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultReferenceCodec searchResultReference = ( ( SearchResponse ) parser.getBatchResponse()
+            .getCurrentResponse() ).getCurrentSearchResultReference();
+
+        assertEquals( 1, searchResultReference.getControls().size() );
+
+        ControlCodec control = searchResultReference.getCurrentControl();
+
+        assertTrue( control.getCriticality() );
+
+        assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
+
+        assertEquals( "Some text", StringTools.utf8ToString( ( byte[] ) control.getControlValue() ) );
+    }
+
+
+    /**
+     * Test parsing of a response with a (optional) Control element with empty value
+     */
+    public void testResponseWith1ControlEmptyValue()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultReferenceTest.class.getResource( "response_with_1_control_empty_value.xml" )
+                .openStream(), "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultReferenceCodec searchResultReference = ( ( SearchResponse ) parser.getBatchResponse()
+            .getCurrentResponse() ).getCurrentSearchResultReference();
+
+        assertEquals( 1, searchResultReference.getControls().size() );
+
+        ControlCodec control = searchResultReference.getCurrentControl();
+
+        assertTrue( control.getCriticality() );
+
+        assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
+
+        assertEquals( StringTools.EMPTY_BYTES, ( byte[] ) control.getControlValue() );
+    }
+
+
+    /**
+     * Test parsing of a response with 2 (optional) Control elements
+     */
+    public void testResponseWith2Controls()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput(
+                SearchResultReferenceTest.class.getResource( "response_with_2_controls.xml" ).openStream(), "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultReferenceCodec searchResultReference = ( ( SearchResponse ) parser.getBatchResponse()
+            .getCurrentResponse() ).getCurrentSearchResultReference();
+
+        assertEquals( 2, searchResultReference.getControls().size() );
+
+        ControlCodec control = searchResultReference.getCurrentControl();
+
+        assertFalse( control.getCriticality() );
+
+        assertEquals( "1.2.840.113556.1.4.789", control.getControlType() );
+
+        assertEquals( "Some other text", StringTools.utf8ToString( ( byte[] ) control.getControlValue() ) );
+    }
+
+
+    /**
+     * Test parsing of a response with 3 (optional) Control elements without value
+     */
+    public void testResponseWith3ControlsWithoutValue()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultReferenceTest.class.getResource( "response_with_3_controls_without_value.xml" )
+                .openStream(), "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultReferenceCodec searchResultReference = ( ( SearchResponse ) parser.getBatchResponse()
+            .getCurrentResponse() ).getCurrentSearchResultReference();
+
+        assertEquals( 3, searchResultReference.getControls().size() );
+
+        ControlCodec control = searchResultReference.getCurrentControl();
+
+        assertTrue( control.getCriticality() );
+
+        assertEquals( "1.2.840.113556.1.4.456", control.getControlType() );
+
+        assertEquals( StringTools.EMPTY_BYTES, control.getControlValue() );
+    }
+
+
+    /**
+     * Test parsing of a Response with the (optional) requestID attribute
+     */
+    public void testResponseWithRequestId()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultReferenceTest.class.getResource( "response_with_requestID_attribute.xml" )
+                .openStream(), "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultReferenceCodec searchResultReference = ( ( SearchResponse ) parser.getBatchResponse()
+            .getCurrentResponse() ).getCurrentSearchResultReference();
+
+        assertEquals( 456, searchResultReference.getMessageId() );
+    }
+
+
+    /**
+     * Test parsing of a Response with the (optional) requestID attribute equals 0
+     */
+    public void testResponseWithRequestIdEquals0()
+    {
+        testParsingFail( SearchResultReferenceTest.class, "response_with_requestID_equals_0.xml" );
+    }
+
+
+    /**
+     * Test parsing of a response with 0 Ref
+     */
+    public void testResponseWith0Ref()
+    {
+        testParsingFail( SearchResultReferenceTest.class, "response_with_0_ref.xml" );
+    }
+
+
+    /**
+     * Test parsing of a Response with 1 Ref
+     */
+    public void testResponseWith1Ref()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultReferenceTest.class.getResource( "response_with_1_ref.xml" ).openStream(),
+                "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultReferenceCodec searchResultReference = ( ( SearchResponse ) parser.getBatchResponse()
+            .getCurrentResponse() ).getCurrentSearchResultReference();
+
+        List references = searchResultReference.getSearchResultReferences();
+
+        assertEquals( 1, references.size() );
+
+        try
+        {
+            assertEquals( new LdapURL( "ldap://localhost" ).toString(), references.get( 0 ).toString() );
+        }
+        catch ( LdapURLEncodingException e )
+        {
+            fail();
+        }
+    }
+
+
+    /**
+     * Test parsing of a Response with 1 Ref
+     */
+    public void testResponseWith1EmptyRef()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultReferenceTest.class.getResource( "response_with_1_empty_ref.xml" )
+                .openStream(), "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultReferenceCodec searchResultReference = ( ( SearchResponse ) parser.getBatchResponse()
+            .getCurrentResponse() ).getCurrentSearchResultReference();
+
+        List references = searchResultReference.getSearchResultReferences();
+
+        assertEquals( 0, references.size() );
+    }
+
+
+    /**
+     * Test parsing of a Response with 2 Ref
+     */
+    public void testResponseWith2Ref()
+    {
+        Dsmlv2ResponseParser parser = null;
+        try
+        {
+            parser = new Dsmlv2ResponseParser();
+
+            parser.setInput( SearchResultReferenceTest.class.getResource( "response_with_2_ref.xml" ).openStream(),
+                "UTF-8" );
+
+            parser.parse();
+        }
+        catch ( Exception e )
+        {
+            fail( e.getMessage() );
+        }
+
+        SearchResultReferenceCodec searchResultReference = ( ( SearchResponse ) parser.getBatchResponse()
+            .getCurrentResponse() ).getCurrentSearchResultReference();
+
+        List references = searchResultReference.getSearchResultReferences();
+
+        assertEquals( 2, references.size() );
+
+        try
+        {
+            assertEquals( new LdapURL( "ldap://localhost" ).toString(), references.get( 0 ).toString() );
+        }
+        catch ( LdapURLEncodingException e )
+        {
+            fail();
+        }
+
+        try
+        {
+            assertEquals( new LdapURL( "ldap://www.apache.org" ).toString(), references.get( 1 ).toString() );
+        }
+        catch ( LdapURLEncodingException e )
+        {
+            fail();
+        }
+    }
+
+
+    /**
+     * Test parsing of a response with 1 wrong Ref
+     */
+    public void testResponseWith1WrongRef()
+    {
+        testParsingFail( SearchResultReferenceTest.class, "response_with_1_wrong_ref.xml" );
+    }
+}

Added: directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_1_control.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_1_control.xml?rev=796383&view=auto
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_1_control.xml (added)
+++ directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_1_control.xml Tue Jul 21 17:04:13 2009
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<batchRequest xmlns="urn:oasis:names:tc:DSML:2.0:core">
+	<abandonRequest abandonID="123">
+		<control type="1.2.840.113556.1.4.643" criticality="true">
+			<controlValue><!-- comment -->Some text<!-- another --></controlValue>
+		</control>
+	</abandonRequest>
+</batchRequest>
\ No newline at end of file

Added: directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_1_control_base64_value.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_1_control_base64_value.xml?rev=796383&view=auto
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_1_control_base64_value.xml (added)
+++ directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_1_control_base64_value.xml Tue Jul 21 17:04:13 2009
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<batchRequest xmlns="urn:oasis:names:tc:DSML:2.0:core"
+              xmlns:xsi="http://www.w3c.org/2001/XMLSchema-instance"
+              xmlns:xsd="http://www.w3c.org/2001/XMLSchema">
+	<abandonRequest abandonID="123">
+		<control type="1.2.840.113556.1.4.643" criticality="true">
+			<controlValue xsi:type="xsd:base64Binary">RFNNTHYyLjAgcm9ja3MhIQ==</controlValue>
+		</control>
+	</abandonRequest>
+</batchRequest>
\ No newline at end of file

Added: directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_1_control_empty_value.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_1_control_empty_value.xml?rev=796383&view=auto
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_1_control_empty_value.xml (added)
+++ directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_1_control_empty_value.xml Tue Jul 21 17:04:13 2009
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<batchRequest xmlns="urn:oasis:names:tc:DSML:2.0:core">
+	<abandonRequest abandonID="123">
+		<control type="1.2.840.113556.1.4.643" criticality="true">
+			<controlValue></controlValue>
+		</control>
+	</abandonRequest>
+</batchRequest>
\ No newline at end of file

Added: directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_2_controls.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_2_controls.xml?rev=796383&view=auto
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_2_controls.xml (added)
+++ directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_2_controls.xml Tue Jul 21 17:04:13 2009
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<batchRequest xmlns="urn:oasis:names:tc:DSML:2.0:core">
+	<abandonRequest abandonID="123">
+		<control type="1.2.840.113556.1.4.643" criticality="true">
+			<controlValue><!-- comment -->Some text<!-- another --></controlValue>
+		</control>
+		<control type="1.2.840.113556.1.4.789" criticality="false">
+			<controlValue><!-- comment -->Some other text<!-- another --></controlValue>
+		</control>
+	</abandonRequest>
+</batchRequest>
\ No newline at end of file

Added: directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_3_controls_without_value.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_3_controls_without_value.xml?rev=796383&view=auto
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_3_controls_without_value.xml (added)
+++ directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_3_controls_without_value.xml Tue Jul 21 17:04:13 2009
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<batchRequest xmlns="urn:oasis:names:tc:DSML:2.0:core">
+	<abandonRequest abandonID="123">
+		<control type="1.2.840.113556.1.4.643" criticality="true">
+		</control>
+		
+		<control type="1.2.840.113556.1.4.789" criticality="false">
+		</control>
+		<control type="1.2.840.113556.1.4.456" criticality="true">
+		</control>
+	</abandonRequest>
+</batchRequest>
\ No newline at end of file

Added: directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_abandonID_attribute.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_abandonID_attribute.xml?rev=796383&view=auto
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_abandonID_attribute.xml (added)
+++ directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_abandonID_attribute.xml Tue Jul 21 17:04:13 2009
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<batchRequest xmlns="urn:oasis:names:tc:DSML:2.0:core">
+	<abandonRequest abandonID="123">
+	</abandonRequest>
+</batchRequest>

Added: directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_needed_requestID.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_needed_requestID.xml?rev=796383&view=auto
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_needed_requestID.xml (added)
+++ directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_needed_requestID.xml Tue Jul 21 17:04:13 2009
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<batchRequest processing="parallel" responseOrder="unordered" xmlns="urn:oasis:names:tc:DSML:2.0:core">
+	<abandonRequest abandonID="123">
+	</abandonRequest>
+</batchRequest>
\ No newline at end of file

Added: directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_requestID_attribute.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_requestID_attribute.xml?rev=796383&view=auto
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_requestID_attribute.xml (added)
+++ directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_requestID_attribute.xml Tue Jul 21 17:04:13 2009
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<batchRequest xmlns="urn:oasis:names:tc:DSML:2.0:core">
+	<abandonRequest abandonID="123" requestID="456">
+	</abandonRequest>
+</batchRequest>

Added: directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_requestID_equals_0.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_requestID_equals_0.xml?rev=796383&view=auto
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_requestID_equals_0.xml (added)
+++ directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_with_requestID_equals_0.xml Tue Jul 21 17:04:13 2009
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<batchRequest xmlns="urn:oasis:names:tc:DSML:2.0:core">
+	<abandonRequest abandonID="123" requestID="0">
+	</abandonRequest>
+</batchRequest>

Added: directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_without_abandonID_attribute.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_without_abandonID_attribute.xml?rev=796383&view=auto
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_without_abandonID_attribute.xml (added)
+++ directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/abandonRequest/request_without_abandonID_attribute.xml Tue Jul 21 17:04:13 2009
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<batchRequest xmlns="urn:oasis:names:tc:DSML:2.0:core">
+	<abandonRequest>
+	</abandonRequest>
+</batchRequest>

Added: directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_attr_empty_value.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_attr_empty_value.xml?rev=796383&view=auto
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_attr_empty_value.xml (added)
+++ directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_attr_empty_value.xml Tue Jul 21 17:04:13 2009
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<batchRequest xmlns="urn:oasis:names:tc:DSML:2.0:core">
+	<addRequest dn="CN=Bob Rush,OU=Dev,DC=Example,DC=COM">
+		<attr name="objectclass"><value></value></attr>
+	</addRequest>
+</batchRequest>
\ No newline at end of file

Added: directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_attr_with_2_values.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_attr_with_2_values.xml?rev=796383&view=auto
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_attr_with_2_values.xml (added)
+++ directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_attr_with_2_values.xml Tue Jul 21 17:04:13 2009
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<batchRequest xmlns="urn:oasis:names:tc:DSML:2.0:core">
+	<addRequest dn="CN=Bob Rush,OU=Dev,DC=Example,DC=COM">
+		<attr name="objectclass"><value>top</value><value>person</value></attr>
+	</addRequest>
+</batchRequest>
\ No newline at end of file

Added: directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_attr_with_base64_value.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_attr_with_base64_value.xml?rev=796383&view=auto
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_attr_with_base64_value.xml (added)
+++ directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_attr_with_base64_value.xml Tue Jul 21 17:04:13 2009
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<batchRequest xmlns="urn:oasis:names:tc:DSML:2.0:core"
+              xmlns:xsi="http://www.w3c.org/2001/XMLSchema-instance"
+              xmlns:xsd="http://www.w3c.org/2001/XMLSchema">
+	<addRequest dn="CN=Bob Rush,OU=Dev,DC=Example,DC=COM">
+		<attr name="objectclass">
+			<value xsi:type="xsd:base64Binary">RFNNTHYyLjAgcm9ja3MhIQ==</value>
+		</attr>
+	</addRequest>
+</batchRequest>
\ No newline at end of file

Added: directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_attr_with_value.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_attr_with_value.xml?rev=796383&view=auto
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_attr_with_value.xml (added)
+++ directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_attr_with_value.xml Tue Jul 21 17:04:13 2009
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<batchRequest xmlns="urn:oasis:names:tc:DSML:2.0:core">
+	<addRequest dn="CN=Bob Rush,OU=Dev,DC=Example,DC=COM">
+		<attr name="objectclass"><value>top</value></attr>
+	</addRequest>
+</batchRequest>
\ No newline at end of file

Added: directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_attr_without_name_attribute.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_attr_without_name_attribute.xml?rev=796383&view=auto
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_attr_without_name_attribute.xml (added)
+++ directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_attr_without_name_attribute.xml Tue Jul 21 17:04:13 2009
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<batchRequest xmlns="urn:oasis:names:tc:DSML:2.0:core">
+	<addRequest dn="CN=Bob Rush,OU=Dev,DC=Example,DC=COM">
+		<attr><value>top</value></attr>
+	</addRequest>
+</batchRequest>
\ No newline at end of file

Added: directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_attr_without_value.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_attr_without_value.xml?rev=796383&view=auto
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_attr_without_value.xml (added)
+++ directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_attr_without_value.xml Tue Jul 21 17:04:13 2009
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<batchRequest xmlns="urn:oasis:names:tc:DSML:2.0:core">
+	<addRequest dn="CN=Bob Rush,OU=Dev,DC=Example,DC=COM">
+		<attr name="objectclass"></attr>
+	</addRequest>
+</batchRequest>
\ No newline at end of file

Added: directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_control.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_control.xml?rev=796383&view=auto
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_control.xml (added)
+++ directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_control.xml Tue Jul 21 17:04:13 2009
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<batchRequest xmlns="urn:oasis:names:tc:DSML:2.0:core">
+	<addRequest dn="CN=Bob Rush,OU=Dev,DC=Example,DC=COM">
+		<control type="1.2.840.113556.1.4.643" criticality="true">
+			<controlValue><!-- comment -->Some text<!-- another --></controlValue>
+		</control>
+	</addRequest>
+</batchRequest>
\ No newline at end of file

Added: directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_control_base64_value.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_control_base64_value.xml?rev=796383&view=auto
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_control_base64_value.xml (added)
+++ directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_control_base64_value.xml Tue Jul 21 17:04:13 2009
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<batchRequest xmlns="urn:oasis:names:tc:DSML:2.0:core"
+              xmlns:xsi="http://www.w3c.org/2001/XMLSchema-instance"
+              xmlns:xsd="http://www.w3c.org/2001/XMLSchema">
+	<addRequest dn="CN=Bob Rush,OU=Dev,DC=Example,DC=COM">
+		<control type="1.2.840.113556.1.4.643" criticality="true">
+			<controlValue xsi:type="xsd:base64Binary">RFNNTHYyLjAgcm9ja3MhIQ==</controlValue>
+		</control>
+	</addRequest>
+</batchRequest>
\ No newline at end of file

Added: directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_control_empty_value.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_control_empty_value.xml?rev=796383&view=auto
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_control_empty_value.xml (added)
+++ directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_1_control_empty_value.xml Tue Jul 21 17:04:13 2009
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<batchRequest xmlns="urn:oasis:names:tc:DSML:2.0:core">
+	<addRequest dn="CN=Bob Rush,OU=Dev,DC=Example,DC=COM">
+		<control type="1.2.840.113556.1.4.643" criticality="true">
+			<controlValue></controlValue>
+		</control>
+	</addRequest>
+</batchRequest>
\ No newline at end of file

Added: directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_2_attr_with_value.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_2_attr_with_value.xml?rev=796383&view=auto
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_2_attr_with_value.xml (added)
+++ directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_2_attr_with_value.xml Tue Jul 21 17:04:13 2009
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<batchRequest xmlns="urn:oasis:names:tc:DSML:2.0:core">
+	<addRequest dn="CN=Bob Rush,OU=Dev,DC=Example,DC=COM">
+		<attr name="objectclass"><value>top</value></attr>
+		<attr name="objectclass"><value>person</value></attr>
+	</addRequest>
+</batchRequest>
\ No newline at end of file

Added: directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_2_controls.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_2_controls.xml?rev=796383&view=auto
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_2_controls.xml (added)
+++ directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_2_controls.xml Tue Jul 21 17:04:13 2009
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<batchRequest xmlns="urn:oasis:names:tc:DSML:2.0:core">
+	<addRequest dn="CN=Bob Rush,OU=Dev,DC=Example,DC=COM">
+		<control type="1.2.840.113556.1.4.643" criticality="true">
+			<controlValue><!-- comment -->Some text<!-- another --></controlValue>
+		</control>
+		<control type="1.2.840.113556.1.4.789" criticality="false">
+			<controlValue><!-- comment -->Some other text<!-- another --></controlValue>
+		</control>
+	</addRequest>
+</batchRequest>
\ No newline at end of file

Added: directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_3_controls_without_value.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_3_controls_without_value.xml?rev=796383&view=auto
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_3_controls_without_value.xml (added)
+++ directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/addRequest/request_with_3_controls_without_value.xml Tue Jul 21 17:04:13 2009
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<batchRequest xmlns="urn:oasis:names:tc:DSML:2.0:core">
+	<addRequest dn="CN=Bob Rush,OU=Dev,DC=Example,DC=COM">
+		<control type="1.2.840.113556.1.4.643" criticality="true">
+		</control>
+		<control type="1.2.840.113556.1.4.789" criticality="false">
+		</control>
+		<control type="1.2.840.113556.1.4.456" criticality="true">
+		</control>
+	</addRequest>
+</batchRequest>
\ No newline at end of file



Mime
View raw message