directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r515141 - in /directory/ldapstudio/trunk/ldapstudio-dsml-parser: ./ src/main/java/org/apache/directory/ldapstudio/dsmlv2/ src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/ src/test/java/org/apache/directory/ldapstudio/dsmlv2/add...
Date Tue, 06 Mar 2007 15:31:53 GMT
Author: pamarcelot
Date: Tue Mar  6 07:31:49 2007
New Revision: 515141

URL: http://svn.apache.org/viewvc?view=rev&rev=515141
Log:
Fixed DIRSTUDIO-1 (DSML Parser does not throw an exception when it doesn't find a requestID attribute when processing=parallel and responseOrder=unordered).
Updated jar version to 0.4

Added:
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/addRequest/request_with_needed_requestID.xml
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/authRequest/request_with_needed_requestID.xml
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/compareRequest/request_with_needed_requestID.xml
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/delRequest/request_with_needed_requestID.xml
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/extendedRequest/request_with_needed_requestID.xml
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/modDNRequest/request_with_needed_requestID.xml
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/modifyRequest/request_with_needed_requestID.xml
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/searchRequest/request_with_needed_requestID.xml
Modified:
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/build.xml
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/ParserUtils.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/Dsmlv2Grammar.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/addRequest/AddRequestTest.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/authRequest/AuthRequestTest.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/compareRequest/CompareRequestTest.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/delRequest/DelRequestTest.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/extendedRequest/ExtendedRequestTest.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/modDNRequest/ModifyDNRequestTest.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/modifyRequest/ModifyRequestTest.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/searchRequest/SearchRequestTest.java

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/build.xml
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/build.xml?view=diff&rev=515141&r1=515140&r2=515141
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/build.xml (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/build.xml Tue Mar  6 07:31:49 2007
@@ -18,7 +18,7 @@
 -->
 <project default="jar" xmlns:ivy="antlib:fr.jayasoft.ivy.ant">
 	<property name="project.name" value="ldapstudio-dsml-parser" />
-	<property name="project.version" value="0.3" />
+	<property name="project.version" value="0.4" />
 
 	<property name="project.output" value="${basedir}/target" />
 	<property name="project.build" value="${project.output}/build" />

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/ParserUtils.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/ParserUtils.java?view=diff&rev=515141&r1=515140&r2=515141
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/ParserUtils.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/ParserUtils.java Tue Mar  6 07:31:49 2007
@@ -23,6 +23,9 @@
 
 import java.util.List;
 
+import org.apache.directory.ldapstudio.dsmlv2.request.BatchRequest;
+import org.apache.directory.ldapstudio.dsmlv2.request.BatchRequest.Processing;
+import org.apache.directory.ldapstudio.dsmlv2.request.BatchRequest.ResponseOrder;
 import org.apache.directory.shared.ldap.codec.Control;
 import org.apache.directory.shared.ldap.ldif.LdifUtils;
 import org.apache.directory.shared.ldap.util.Base64;
@@ -225,5 +228,28 @@
                 }
             }
         }
+    }
+
+
+    /**
+     * Indicates if a request ID is needed.
+     *
+     * @param container
+     *      the associated container
+     * @return
+     *      true if a request ID is needed (ie Processing=Parallel and ResponseOrder=Unordered)
+     * @throws XmlPullParserException
+     *      if the batch request has not been parsed yet
+     */
+    public static boolean isRequestIdNeeded( Dsmlv2Container container ) throws XmlPullParserException
+    {
+        BatchRequest batchRequest = container.getBatchRequest();
+
+        if ( batchRequest == null )
+        {
+            throw new XmlPullParserException( "unable to find the batch request", container.getParser(), null );
+        }
+
+        return ( ( batchRequest.getProcessing() == Processing.PARALLEL ) && ( batchRequest.getResponseOrder() == ResponseOrder.UNORDERED ) );
     }
 }

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/Dsmlv2Grammar.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/Dsmlv2Grammar.java?view=diff&rev=515141&r1=515140&r2=515141
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/Dsmlv2Grammar.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/Dsmlv2Grammar.java Tue Mar  6 07:31:49 2007
@@ -1140,6 +1140,13 @@
             {
                 abandonRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
             }
+            else
+            {
+                if ( ParserUtils.isRequestIdNeeded( container ) )
+                {
+                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
+                }
+            }
             // abandonID
             attributeValue = xpp.getAttributeValue( "", "abandonID" );
             if ( attributeValue != null )
@@ -1181,6 +1188,13 @@
             {
                 addRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
             }
+            else
+            {
+                if ( ParserUtils.isRequestIdNeeded( container ) )
+                {
+                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
+                }
+            }
             // dn
             attributeValue = xpp.getAttributeValue( "", "dn" );
             if ( attributeValue != null )
@@ -1288,6 +1302,13 @@
             {
                 authRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
             }
+            else
+            {
+                if ( ParserUtils.isRequestIdNeeded( container ) )
+                {
+                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
+                }
+            }
             // principal
             attributeValue = xpp.getAttributeValue( "", "principal" );
             if ( attributeValue != null )
@@ -1328,6 +1349,13 @@
             {
                 compareRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
             }
+            else
+            {
+                if ( ParserUtils.isRequestIdNeeded( container ) )
+                {
+                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
+                }
+            }
             // dn
             attributeValue = xpp.getAttributeValue( "", "dn" );
             if ( attributeValue != null )
@@ -1432,6 +1460,13 @@
             {
                 delRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
             }
+            else
+            {
+                if ( ParserUtils.isRequestIdNeeded( container ) )
+                {
+                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
+                }
+            }
             // dn
             attributeValue = xpp.getAttributeValue( "", "dn" );
             if ( attributeValue != null )
@@ -1472,6 +1507,13 @@
             {
                 extendedRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
             }
+            else
+            {
+                if ( ParserUtils.isRequestIdNeeded( container ) )
+                {
+                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
+                }
+            }
         }
     };
 
@@ -1564,6 +1606,13 @@
             {
                 modifyDNRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
             }
+            else
+            {
+                if ( ParserUtils.isRequestIdNeeded( container ) )
+                {
+                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
+                }
+            }
             // dn
             attributeValue = xpp.getAttributeValue( "", "dn" );
             if ( attributeValue != null )
@@ -1657,6 +1706,13 @@
             {
                 modifyRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
             }
+            else
+            {
+                if ( ParserUtils.isRequestIdNeeded( container ) )
+                {
+                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
+                }
+            }
             // dn
             attributeValue = xpp.getAttributeValue( "", "dn" );
             if ( attributeValue != null )
@@ -1785,6 +1841,13 @@
             {
                 searchRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
             }
+            else
+            {
+                if ( ParserUtils.isRequestIdNeeded( container ) )
+                {
+                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
+                }
+            }
             // dn
             attributeValue = xpp.getAttributeValue( "", "dn" );
             if ( attributeValue != null )
@@ -2155,7 +2218,7 @@
             {
                 searchRequest.setCurrentFilter( null );
             }
-                
+
         }
     };
 

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/addRequest/AddRequestTest.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/addRequest/AddRequestTest.java?view=diff&rev=515141&r1=515140&r2=515141
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/addRequest/AddRequestTest.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/addRequest/AddRequestTest.java Tue Mar  6 07:31:49 2007
@@ -98,8 +98,8 @@
 
         assertEquals( 456, addRequest.getMessageId() );
     }
-    
-    
+
+
     /**
      * Test parsing of a request with the (optional) requestID attribute equals to 0
      */
@@ -140,7 +140,8 @@
 
         assertEquals( "Some text", StringTools.utf8ToString( ( byte[] ) control.getControlValue() ) );
     }
-    
+
+
     /**
      * Test parsing of a request with a (optional) Control element with Base64 value
      */
@@ -151,7 +152,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( AddRequestTest.class.getResource( "request_with_1_control_base64_value.xml" ).getFile() );
+            parser.setInputFile( AddRequestTest.class.getResource( "request_with_1_control_base64_value.xml" )
+                .getFile() );
 
             parser.parse();
         }
@@ -162,7 +164,7 @@
 
         AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = addRequest.getCurrentControl();
-        
+
         assertEquals( 1, addRequest.getControls().size() );
         assertTrue( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
@@ -192,7 +194,7 @@
 
         AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = addRequest.getCurrentControl();
-        
+
         assertEquals( 1, addRequest.getControls().size() );
         assertTrue( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
@@ -432,7 +434,8 @@
 
         assertEquals( "top", value );
     }
-    
+
+
     /**
      * Test parsing of a request with an Attr elements with value
      */
@@ -443,7 +446,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( AddRequestTest.class.getResource( "request_with_1_attr_with_base64_value.xml" ).getFile() );
+            parser.setInputFile( AddRequestTest.class.getResource( "request_with_1_attr_with_base64_value.xml" )
+                .getFile() );
 
             parser.parse();
         }
@@ -494,7 +498,7 @@
             fail( e.getMessage() );
         }
 
-        assertEquals( "DSMLv2.0 rocks!!", new String( (byte[]) value ) );
+        assertEquals( "DSMLv2.0 rocks!!", new String( ( byte[] ) value ) );
     }
 
 
@@ -656,5 +660,16 @@
         }
 
         assertEquals( "person", value );
+    }
+
+
+    /**
+     * Test parsing of a request with a needed requestID attribute
+     * 
+     * DIRSTUDIO-1
+     */
+    public void testRequestWithNeededRequestId()
+    {
+        testParsingFail( AddRequestTest.class, "request_with_needed_requestID.xml" );
     }
 }

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/authRequest/AuthRequestTest.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/authRequest/AuthRequestTest.java?view=diff&rev=515141&r1=515140&r2=515141
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/authRequest/AuthRequestTest.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/authRequest/AuthRequestTest.java Tue Mar  6 07:31:49 2007
@@ -93,8 +93,8 @@
 
         assertEquals( 456, abandonRequest.getMessageId() );
     }
-    
-    
+
+
     /**
      * Test parsing of a request with the (optional) requestID attribute equals to 0
      */
@@ -125,13 +125,14 @@
 
         BindRequest abandonRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = abandonRequest.getCurrentControl();
-        
+
         assertEquals( 1, abandonRequest.getControls().size() );
         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 request with a (optional) Control element with Base64 value
      */
@@ -142,7 +143,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( AuthRequestTest.class.getResource( "request_with_1_control_base64_value.xml" ).getFile() );
+            parser.setInputFile( AuthRequestTest.class.getResource( "request_with_1_control_base64_value.xml" )
+                .getFile() );
 
             parser.parse();
         }
@@ -153,7 +155,7 @@
 
         BindRequest abandonRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = abandonRequest.getCurrentControl();
-        
+
         assertEquals( 1, abandonRequest.getControls().size() );
         assertTrue( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
@@ -183,7 +185,7 @@
 
         BindRequest abandonRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = abandonRequest.getCurrentControl();
-        
+
         assertEquals( 1, abandonRequest.getControls().size() );
         assertTrue( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
@@ -212,7 +214,7 @@
 
         BindRequest abandonRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = abandonRequest.getCurrentControl();
-        
+
         assertEquals( 2, abandonRequest.getControls().size() );
         assertFalse( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.789", control.getControlType() );
@@ -242,10 +244,21 @@
 
         BindRequest abandonRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = abandonRequest.getCurrentControl();
-        
+
         assertEquals( 3, abandonRequest.getControls().size() );
         assertTrue( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.456", control.getControlType() );
         assertEquals( StringTools.EMPTY_BYTES, control.getControlValue() );
+    }
+
+
+    /**
+     * Test parsing of a request with a needed requestID attribute
+     * 
+     * DIRSTUDIO-1
+     */
+    public void testRequestWithNeededRequestId()
+    {
+        testParsingFail( AuthRequestTest.class, "request_with_needed_requestID.xml" );
     }
 }

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/compareRequest/CompareRequestTest.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/compareRequest/CompareRequestTest.java?view=diff&rev=515141&r1=515140&r2=515141
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/compareRequest/CompareRequestTest.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/compareRequest/CompareRequestTest.java Tue Mar  6 07:31:49 2007
@@ -95,7 +95,7 @@
         assertEquals( 456, compareRequest.getMessageId() );
     }
 
-    
+
     /**
      * Test parsing of a request with the (optional) requestID attribute equals to 0
      */
@@ -104,6 +104,7 @@
         testParsingFail( CompareRequestTest.class, "request_with_requestID_equals_0.xml" );
     }
 
+
     /**
      * Test parsing of a request with a (optional) Control element
      */
@@ -135,7 +136,8 @@
 
         assertEquals( "Some text", StringTools.utf8ToString( ( byte[] ) control.getControlValue() ) );
     }
-    
+
+
     /**
      * Test parsing of a request with a (optional) Control element with Base64 value
      */
@@ -299,6 +301,7 @@
         assertEquals( "Johnson", ( String ) compareRequest.getAssertionValue() );
     }
 
+
     /**
      * Test parsing of a request with a complete assertion with base64 value
      */
@@ -309,8 +312,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( CompareRequestTest.class.getResource( "request_with_1_complete_assertion_base64_value.xml" )
-                .getFile() );
+            parser.setInputFile( CompareRequestTest.class.getResource(
+                "request_with_1_complete_assertion_base64_value.xml" ).getFile() );
 
             parser.parse();
         }
@@ -325,9 +328,10 @@
 
         assertEquals( "sn", ( String ) compareRequest.getAttributeDesc() );
 
-        assertEquals( "DSMLv2.0 rocks!!", new String( (byte[]) compareRequest.getAssertionValue() ) );
+        assertEquals( "DSMLv2.0 rocks!!", new String( ( byte[] ) compareRequest.getAssertionValue() ) );
     }
 
+
     /**
      * Test parsing of a request with an Attr elements with empty value
      */
@@ -400,5 +404,16 @@
     public void testRequestWith1AssertionWith2Value()
     {
         testParsingFail( CompareRequestTest.class, "request_with_1_assertion_with_2_values.xml" );
+    }
+
+
+    /**
+     * Test parsing of a request with a needed requestID attribute
+     * 
+     * DIRSTUDIO-1
+     */
+    public void testRequestWithNeededRequestId()
+    {
+        testParsingFail( CompareRequestTest.class, "request_with_needed_requestID.xml" );
     }
 }

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/delRequest/DelRequestTest.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/delRequest/DelRequestTest.java?view=diff&rev=515141&r1=515140&r2=515141
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/delRequest/DelRequestTest.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/delRequest/DelRequestTest.java Tue Mar  6 07:31:49 2007
@@ -93,7 +93,8 @@
 
         assertEquals( 456, delRequest.getMessageId() );
     }
-    
+
+
     /**
      * Test parsing of a request with the (optional) requestID attribute equals to 0
      */
@@ -124,13 +125,14 @@
 
         DelRequest delRequest = ( DelRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = delRequest.getCurrentControl();
-        
+
         assertEquals( 1, delRequest.getControls().size() );
         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 request with a (optional) Control element
      */
@@ -141,7 +143,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( DelRequestTest.class.getResource( "request_with_1_control_base64_value.xml" ).getFile() );
+            parser.setInputFile( DelRequestTest.class.getResource( "request_with_1_control_base64_value.xml" )
+                .getFile() );
 
             parser.parse();
         }
@@ -152,7 +155,7 @@
 
         DelRequest delRequest = ( DelRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = delRequest.getCurrentControl();
-        
+
         assertEquals( 1, delRequest.getControls().size() );
         assertTrue( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
@@ -182,7 +185,7 @@
 
         DelRequest delRequest = ( DelRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = delRequest.getCurrentControl();
-        
+
         assertEquals( 1, delRequest.getControls().size() );
         assertTrue( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
@@ -211,7 +214,7 @@
 
         DelRequest delRequest = ( DelRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = delRequest.getCurrentControl();
-        
+
         assertEquals( 2, delRequest.getControls().size() );
         assertFalse( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.789", control.getControlType() );
@@ -241,10 +244,21 @@
 
         DelRequest delRequest = ( DelRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = delRequest.getCurrentControl();
-        
+
         assertEquals( 3, delRequest.getControls().size() );
         assertTrue( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.456", control.getControlType() );
         assertEquals( StringTools.EMPTY_BYTES, control.getControlValue() );
+    }
+
+
+    /**
+     * Test parsing of a request with a needed requestID attribute
+     * 
+     * DIRSTUDIO-1
+     */
+    public void testRequestWithNeededRequestId()
+    {
+        testParsingFail( DelRequestTest.class, "request_with_needed_requestID.xml" );
     }
 }

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/extendedRequest/ExtendedRequestTest.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/extendedRequest/ExtendedRequestTest.java?view=diff&rev=515141&r1=515140&r2=515141
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/extendedRequest/ExtendedRequestTest.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/extendedRequest/ExtendedRequestTest.java Tue Mar  6 07:31:49 2007
@@ -60,7 +60,8 @@
 
         assertEquals( 456, extendedRequest.getMessageId() );
     }
-    
+
+
     /**
      * Test parsing of a request with the (optional) requestID attribute equals to 0
      */
@@ -97,7 +98,8 @@
         assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
         assertEquals( "Some text", StringTools.utf8ToString( ( byte[] ) control.getControlValue() ) );
     }
-    
+
+
     /**
      * Test parsing of a request with a (optional) Control element with Base64 value
      */
@@ -108,7 +110,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ExtendedRequestTest.class.getResource( "request_with_1_control_base64_value.xml" ).getFile() );
+            parser.setInputFile( ExtendedRequestTest.class.getResource( "request_with_1_control_base64_value.xml" )
+                .getFile() );
 
             parser.parse();
         }
@@ -119,7 +122,7 @@
 
         ExtendedRequest extendedRequest = ( ExtendedRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = extendedRequest.getCurrentControl();
-        
+
         assertEquals( 1, extendedRequest.getControls().size() );
         assertTrue( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
@@ -149,7 +152,7 @@
 
         ExtendedRequest extendedRequest = ( ExtendedRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = extendedRequest.getCurrentControl();
-        
+
         assertEquals( 1, extendedRequest.getControls().size() );
         assertTrue( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
@@ -208,7 +211,7 @@
 
         ExtendedRequest extendedRequest = ( ExtendedRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = extendedRequest.getCurrentControl();
-        
+
         assertEquals( 3, extendedRequest.getControls().size() );
         assertTrue( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.456", control.getControlType() );
@@ -237,9 +240,10 @@
 
         ExtendedRequest extendedRequest = ( ExtendedRequest ) parser.getBatchRequest().getCurrentRequest();
 
-        assertEquals( "foobar", new String ( extendedRequest.getRequestValue() ) );
+        assertEquals( "foobar", new String( extendedRequest.getRequestValue() ) );
     }
-    
+
+
     /**
      * Test parsing of a request with a RequestValue element with Base64 value
      */
@@ -250,7 +254,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ExtendedRequestTest.class.getResource( "request_with_base64_requestValue.xml" ).getFile() );
+            parser.setInputFile( ExtendedRequestTest.class.getResource( "request_with_base64_requestValue.xml" )
+                .getFile() );
 
             parser.parse();
         }
@@ -261,7 +266,7 @@
 
         ExtendedRequest extendedRequest = ( ExtendedRequest ) parser.getBatchRequest().getCurrentRequest();
 
-        assertEquals( "DSMLv2.0 rocks!!", new String ( extendedRequest.getRequestValue() ) );
+        assertEquals( "DSMLv2.0 rocks!!", new String( extendedRequest.getRequestValue() ) );
     }
 
 
@@ -314,5 +319,16 @@
 
         ExtendedRequest extendedRequest = ( ExtendedRequest ) parser.getBatchRequest().getCurrentRequest();
         assertNull( extendedRequest.getRequestValue() );
+    }
+
+
+    /**
+     * Test parsing of a request with a needed requestID attribute
+     * 
+     * DIRSTUDIO-1
+     */
+    public void testRequestWithNeededRequestId()
+    {
+        testParsingFail( ExtendedRequestTest.class, "request_with_needed_requestID.xml" );
     }
 }

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/modDNRequest/ModifyDNRequestTest.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/modDNRequest/ModifyDNRequestTest.java?view=diff&rev=515141&r1=515140&r2=515141
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/modDNRequest/ModifyDNRequestTest.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/modDNRequest/ModifyDNRequestTest.java Tue Mar  6 07:31:49 2007
@@ -60,7 +60,8 @@
 
         assertEquals( 456, modifyDNRequest.getMessageId() );
     }
-    
+
+
     /**
      * Test parsing of a request with the (optional) requestID attribute equals to 0
      */
@@ -91,13 +92,14 @@
 
         ModifyDNRequest modifyDNRequest = ( ModifyDNRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = modifyDNRequest.getCurrentControl();
-        
+
         assertEquals( 1, modifyDNRequest.getControls().size() );
         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 request with a (optional) Control element with Base64 Value
      */
@@ -108,7 +110,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyDNRequestTest.class.getResource( "request_with_1_control_base64_value.xml" ).getFile() );
+            parser.setInputFile( ModifyDNRequestTest.class.getResource( "request_with_1_control_base64_value.xml" )
+                .getFile() );
 
             parser.parse();
         }
@@ -119,7 +122,7 @@
 
         ModifyDNRequest modifyDNRequest = ( ModifyDNRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = modifyDNRequest.getCurrentControl();
-        
+
         assertEquals( 1, modifyDNRequest.getControls().size() );
         assertTrue( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
@@ -149,7 +152,7 @@
 
         ModifyDNRequest modifyDNRequest = ( ModifyDNRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = modifyDNRequest.getCurrentControl();
-        
+
         assertEquals( 1, modifyDNRequest.getControls().size() );
         assertTrue( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
@@ -178,7 +181,7 @@
 
         ModifyDNRequest modifyDNRequest = ( ModifyDNRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = modifyDNRequest.getCurrentControl();
-        
+
         assertEquals( 2, modifyDNRequest.getControls().size() );
         assertFalse( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.789", control.getControlType() );
@@ -208,7 +211,7 @@
 
         ModifyDNRequest modifyDNRequest = ( ModifyDNRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = modifyDNRequest.getCurrentControl();
-        
+
         assertEquals( 3, modifyDNRequest.getControls().size() );
         assertTrue( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.456", control.getControlType() );
@@ -398,4 +401,14 @@
         assertEquals( "cn=Steve Jobs,ou=Dev,dc=apple,dc=com", modifyDNRequest.getNewSuperior().toString() );
     }
 
+
+    /**
+     * Test parsing of a request with a needed requestID attribute
+     * 
+     * DIRSTUDIO-1
+     */
+    public void testRequestWithNeededRequestId()
+    {
+        testParsingFail( ModifyDNRequestTest.class, "request_with_needed_requestID.xml" );
+    }
 }

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/modifyRequest/ModifyRequestTest.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/modifyRequest/ModifyRequestTest.java?view=diff&rev=515141&r1=515140&r2=515141
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/modifyRequest/ModifyRequestTest.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/modifyRequest/ModifyRequestTest.java Tue Mar  6 07:31:49 2007
@@ -68,8 +68,8 @@
 
         assertEquals( 456, modifyRequest.getMessageId() );
     }
-    
-    
+
+
     /**
      * Test parsing of a request with the (optional) requestID attribute equals to 0
      */
@@ -100,13 +100,14 @@
 
         ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = modifyRequest.getCurrentControl();
-        
+
         assertEquals( 1, modifyRequest.getControls().size() );
         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 request with a (optional) Control element with Base64 Value
      */
@@ -117,7 +118,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyRequestTest.class.getResource( "request_with_1_control_base64_value.xml" ).getFile() );
+            parser.setInputFile( ModifyRequestTest.class.getResource( "request_with_1_control_base64_value.xml" )
+                .getFile() );
 
             parser.parse();
         }
@@ -128,7 +130,7 @@
 
         ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = modifyRequest.getCurrentControl();
-        
+
         assertEquals( 1, modifyRequest.getControls().size() );
         assertTrue( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
@@ -158,7 +160,7 @@
 
         ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = modifyRequest.getCurrentControl();
-        
+
         assertEquals( 1, modifyRequest.getControls().size() );
         assertTrue( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
@@ -187,7 +189,7 @@
 
         ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = modifyRequest.getCurrentControl();
-        
+
         assertEquals( 2, modifyRequest.getControls().size() );
         assertFalse( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.789", control.getControlType() );
@@ -217,7 +219,7 @@
 
         ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = modifyRequest.getCurrentControl();
-        
+
         assertEquals( 3, modifyRequest.getControls().size() );
         assertTrue( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.456", control.getControlType() );
@@ -270,7 +272,8 @@
 
         assertEquals( "CN=John Smith, DC=microsoft, DC=com", attribute.get( 0 ) );
     }
-    
+
+
     /**
      * Test parsing of a request with a Modification element with Base64 Value
      * @throws NamingException 
@@ -282,7 +285,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyRequestTest.class.getResource( "request_with_1_modification_base64_value.xml" ).getFile() );
+            parser.setInputFile( ModifyRequestTest.class.getResource( "request_with_1_modification_base64_value.xml" )
+                .getFile() );
 
             parser.parse();
         }
@@ -305,7 +309,7 @@
 
         Attribute attribute = modification.getAttribute();
 
-        assertEquals( "cn=Emmanuel Lécharny, ou=people, dc=example, dc=com", new String( (byte[]) attribute.get( 0 ) ) );
+        assertEquals( "cn=Emmanuel Lécharny, ou=people, dc=example, dc=com", new String( ( byte[] ) attribute.get( 0 ) ) );
     }
 
 
@@ -335,7 +339,7 @@
 
         assertEquals( "sn", modifyRequest.getCurrentAttributeType() );
 
-        List<ModificationItemImpl>  modifications = modifyRequest.getModifications();
+        List<ModificationItemImpl> modifications = modifyRequest.getModifications();
 
         assertEquals( 2, modifications.size() );
 
@@ -479,7 +483,7 @@
 
         assertEquals( "directreport", modifyRequest.getCurrentAttributeType() );
 
-        List<ModificationItemImpl>  modifications = modifyRequest.getModifications();
+        List<ModificationItemImpl> modifications = modifyRequest.getModifications();
 
         ModificationItem modification = ( ModificationItem ) modifications.get( 0 );
 
@@ -516,7 +520,7 @@
 
         assertEquals( "directreport", modifyRequest.getCurrentAttributeType() );
 
-        List<ModificationItemImpl>  modifications = modifyRequest.getModifications();
+        List<ModificationItemImpl> modifications = modifyRequest.getModifications();
 
         assertEquals( 1, modifications.size() );
 
@@ -557,7 +561,7 @@
 
         assertEquals( "directreport", modifyRequest.getCurrentAttributeType() );
 
-        List<ModificationItemImpl>  modifications = modifyRequest.getModifications();
+        List<ModificationItemImpl> modifications = modifyRequest.getModifications();
 
         assertEquals( 1, modifications.size() );
 
@@ -567,5 +571,16 @@
 
         assertEquals( 1, attribute.size() );
         assertEquals( "", attribute.get( 0 ) );
+    }
+
+
+    /**
+     * Test parsing of a request with a needed requestID attribute
+     * 
+     * DIRSTUDIO-1
+     */
+    public void testRequestWithNeededRequestId()
+    {
+        testParsingFail( ModifyRequestTest.class, "request_with_needed_requestID.xml" );
     }
 }

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/searchRequest/SearchRequestTest.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/searchRequest/SearchRequestTest.java?view=diff&rev=515141&r1=515140&r2=515141
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/searchRequest/SearchRequestTest.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/java/org/apache/directory/ldapstudio/dsmlv2/searchRequest/SearchRequestTest.java Tue Mar  6 07:31:49 2007
@@ -112,8 +112,8 @@
 
         assertEquals( 456, searchRequest.getMessageId() );
     }
-    
-    
+
+
     /**
      * Test parsing of a request with the (optional) requestID attribute equals to 0
      */
@@ -144,13 +144,14 @@
 
         SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = searchRequest.getCurrentControl();
-        
+
         assertEquals( 1, searchRequest.getControls().size() );
         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 request with a (optional) Control element with Base64 value
      */
@@ -161,7 +162,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_1_control_base64_value.xml" ).getFile() );
+            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_1_control_base64_value.xml" )
+                .getFile() );
 
             parser.parse();
         }
@@ -172,7 +174,7 @@
 
         SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = searchRequest.getCurrentControl();
-        
+
         assertEquals( 1, searchRequest.getControls().size() );
         assertTrue( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
@@ -202,7 +204,7 @@
 
         SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = searchRequest.getCurrentControl();
-        
+
         assertEquals( 1, searchRequest.getControls().size() );
         assertTrue( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
@@ -231,7 +233,7 @@
 
         SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = searchRequest.getCurrentControl();
-        
+
         assertEquals( 2, searchRequest.getControls().size() );
         assertFalse( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.789", control.getControlType() );
@@ -261,7 +263,7 @@
 
         SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest();
         Control control = searchRequest.getCurrentControl();
-        
+
         assertEquals( 3, searchRequest.getControls().size() );
         assertTrue( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.456", control.getControlType() );
@@ -945,7 +947,8 @@
 
         assertEquals( "foobar", assertion.getAssertionValue() );
     }
-    
+
+
     /**
      * Test parsing of a request with an approxMatch Filter with base64 value
      */
@@ -956,8 +959,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "filters/request_with_approxMatch_base64_value.xml" )
-                .getFile() );
+            parser.setInputFile( SearchRequestTest.class.getResource(
+                "filters/request_with_approxMatch_base64_value.xml" ).getFile() );
 
             parser.parse();
         }
@@ -980,7 +983,7 @@
 
         assertEquals( "sn", assertion.getAttributeDesc() );
 
-        assertEquals( "DSMLv2.0 rocks!!", new String( (byte[]) assertion.getAssertionValue() ) );
+        assertEquals( "DSMLv2.0 rocks!!", new String( ( byte[] ) assertion.getAssertionValue() ) );
     }
 
 
@@ -1085,7 +1088,8 @@
 
         assertEquals( "foobar", assertion.getAssertionValue() );
     }
-    
+
+
     /**
      * Test parsing of a request with an greaterOrEqual Filter with base64 value
      */
@@ -1096,8 +1100,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "filters/request_with_greaterOrEqual_base64_value.xml" )
-                .getFile() );
+            parser.setInputFile( SearchRequestTest.class.getResource(
+                "filters/request_with_greaterOrEqual_base64_value.xml" ).getFile() );
 
             parser.parse();
         }
@@ -1120,7 +1124,7 @@
 
         assertEquals( "sn", assertion.getAttributeDesc() );
 
-        assertEquals( "DSMLv2.0 rocks!!", new String( (byte[]) assertion.getAssertionValue() ) );
+        assertEquals( "DSMLv2.0 rocks!!", new String( ( byte[] ) assertion.getAssertionValue() ) );
     }
 
 
@@ -1225,7 +1229,8 @@
 
         assertEquals( "foobar", assertion.getAssertionValue() );
     }
-    
+
+
     /**
      * Test parsing of a request with an lessOrEqual Filter with Base64 value
      */
@@ -1236,8 +1241,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "filters/request_with_lessOrEqual_base64_value.xml" )
-                .getFile() );
+            parser.setInputFile( SearchRequestTest.class.getResource(
+                "filters/request_with_lessOrEqual_base64_value.xml" ).getFile() );
 
             parser.parse();
         }
@@ -1260,7 +1265,7 @@
 
         assertEquals( "sn", assertion.getAttributeDesc() );
 
-        assertEquals( "DSMLv2.0 rocks!!", new String( (byte[]) assertion.getAssertionValue() ) );
+        assertEquals( "DSMLv2.0 rocks!!", new String( ( byte[] ) assertion.getAssertionValue() ) );
     }
 
 
@@ -1365,7 +1370,8 @@
 
         assertEquals( "foobar", assertion.getAssertionValue() );
     }
-    
+
+
     /**
      * Test parsing of a request with an Equality Filter with base64 value
      */
@@ -1376,8 +1382,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "filters/request_with_equalityMatch_base64_value.xml" )
-                .getFile() );
+            parser.setInputFile( SearchRequestTest.class.getResource(
+                "filters/request_with_equalityMatch_base64_value.xml" ).getFile() );
 
             parser.parse();
         }
@@ -1400,7 +1406,7 @@
 
         assertEquals( "sn", assertion.getAttributeDesc() );
 
-        assertEquals( "DSMLv2.0 rocks!!", new String( (byte[]) assertion.getAssertionValue() ) );
+        assertEquals( "DSMLv2.0 rocks!!", new String( ( byte[] ) assertion.getAssertionValue() ) );
     }
 
 
@@ -1541,7 +1547,8 @@
 
         assertEquals( false, extensibleMatchFilter.isDnAttributes() );
     }
-    
+
+
     /**
      * Test parsing of a request with an ExtensibleMatch Filter
      */
@@ -1552,8 +1559,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "filters/request_with_extensibleMatch_base64_value.xml" )
-                .getFile() );
+            parser.setInputFile( SearchRequestTest.class.getResource(
+                "filters/request_with_extensibleMatch_base64_value.xml" ).getFile() );
 
             parser.parse();
         }
@@ -1570,7 +1577,7 @@
 
         ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter ) filter;
 
-        assertEquals( "DSMLv2.0 rocks!!", new String( (byte[]) extensibleMatchFilter.getMatchValue() ) );
+        assertEquals( "DSMLv2.0 rocks!!", new String( ( byte[] ) extensibleMatchFilter.getMatchValue() ) );
 
         assertEquals( false, extensibleMatchFilter.isDnAttributes() );
     }
@@ -1900,7 +1907,8 @@
 
         assertEquals( "jack", substringFilter.getInitialSubstrings().toString() );
     }
-    
+
+
     /**
      * Test parsing of a request with a Substrings Filter with 1 Initial element with Base64 value
      */
@@ -1911,8 +1919,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "filters/request_with_substrings_1_base64_initial.xml" )
-                .getFile() );
+            parser.setInputFile( SearchRequestTest.class.getResource(
+                "filters/request_with_substrings_1_base64_initial.xml" ).getFile() );
 
             parser.parse();
         }
@@ -2065,12 +2073,13 @@
 
         SubstringFilter substringFilter = ( SubstringFilter ) filter;
 
-        List<String>initials = substringFilter.getAnySubstrings();
+        List<String> initials = substringFilter.getAnySubstrings();
 
         assertEquals( 1, initials.size() );
         assertEquals( "kate", initials.get( 0 ) );
     }
-    
+
+
     /**
      * Test parsing of a request with a Substrings Filter with 1 Any element
      */
@@ -2081,8 +2090,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "filters/request_with_substrings_1_base64_any.xml" )
-                .getFile() );
+            parser.setInputFile( SearchRequestTest.class.getResource(
+                "filters/request_with_substrings_1_base64_any.xml" ).getFile() );
 
             parser.parse();
         }
@@ -2246,7 +2255,8 @@
 
         assertEquals( "john", substringFilter.getFinalSubstrings().toString() );
     }
-    
+
+
     /**
      * Test parsing of a request with a Substrings Filter with 1 Final element
      */
@@ -2257,8 +2267,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "filters/request_with_substrings_1_base64_final.xml" )
-                .getFile() );
+            parser.setInputFile( SearchRequestTest.class.getResource(
+                "filters/request_with_substrings_1_base64_final.xml" ).getFile() );
 
             parser.parse();
         }
@@ -2342,6 +2352,16 @@
         assertEquals( "1.3.6.1.4.1.4203.1.10.1", control.getControlType() );
 
         assertEquals( "Some text", StringTools.utf8ToString( ( byte[] ) control.getControlValue() ) );
+    }
+
 
+    /**
+     * Test parsing of a request with a needed requestID attribute
+     * 
+     * DIRSTUDIO-1
+     */
+    public void testRequestWithNeededRequestId()
+    {
+        testParsingFail( SearchRequestTest.class, "request_with_needed_requestID.xml" );
     }
 }

Added: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/addRequest/request_with_needed_requestID.xml
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/addRequest/request_with_needed_requestID.xml?view=auto&rev=515141
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/addRequest/request_with_needed_requestID.xml (added)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/addRequest/request_with_needed_requestID.xml Tue Mar  6 07:31:49 2007
@@ -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">
+	<addRequest dn="CN=Bob Rush,OU=Dev,DC=Example,DC=COM">
+	</addRequest>
+</batchRequest>
\ No newline at end of file

Added: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/authRequest/request_with_needed_requestID.xml
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/authRequest/request_with_needed_requestID.xml?view=auto&rev=515141
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/authRequest/request_with_needed_requestID.xml (added)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/authRequest/request_with_needed_requestID.xml Tue Mar  6 07:31:49 2007
@@ -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">
+	<authRequest principal="CN=Bob Rush,OU=Dev,DC=Example,DC=COM">
+	</authRequest>
+</batchRequest>
\ No newline at end of file

Added: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/compareRequest/request_with_needed_requestID.xml
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/compareRequest/request_with_needed_requestID.xml?view=auto&rev=515141
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/compareRequest/request_with_needed_requestID.xml (added)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/compareRequest/request_with_needed_requestID.xml Tue Mar  6 07:31:49 2007
@@ -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 processing="parallel" responseOrder="unordered" xmlns="urn:oasis:names:tc:DSML:2.0:core">
+	<compareRequest dn="CN=Bob Rush,OU=Dev,DC=Example,DC=COM">
+		<assertion name="sn"><value>Johnson</value></assertion>
+	</compareRequest>
+</batchRequest>
\ No newline at end of file

Added: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/delRequest/request_with_needed_requestID.xml
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/delRequest/request_with_needed_requestID.xml?view=auto&rev=515141
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/delRequest/request_with_needed_requestID.xml (added)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/delRequest/request_with_needed_requestID.xml Tue Mar  6 07:31:49 2007
@@ -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">
+	<delRequest dn="CN=Bob Rush,OU=Dev,DC=Example,DC=COM">
+	</delRequest>
+</batchRequest>
\ No newline at end of file

Added: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/extendedRequest/request_with_needed_requestID.xml
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/extendedRequest/request_with_needed_requestID.xml?view=auto&rev=515141
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/extendedRequest/request_with_needed_requestID.xml (added)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/extendedRequest/request_with_needed_requestID.xml Tue Mar  6 07:31:49 2007
@@ -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 processing="parallel" responseOrder="unordered" xmlns="urn:oasis:names:tc:DSML:2.0:core">
+	<extendedRequest>
+		<requestName>1.3.563.52.425</requestName>
+	</extendedRequest>
+</batchRequest>
\ No newline at end of file

Added: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/modDNRequest/request_with_needed_requestID.xml
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/modDNRequest/request_with_needed_requestID.xml?view=auto&rev=515141
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/modDNRequest/request_with_needed_requestID.xml (added)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/modDNRequest/request_with_needed_requestID.xml Tue Mar  6 07:31:49 2007
@@ -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 processing="parallel" responseOrder="unordered" xmlns="urn:oasis:names:tc:DSML:2.0:core">
+	<modDNRequest dn="CN=Bob Rush,OU=Dev,DC=Example,DC=COM"
+								newrdn="CN=Bob Rush,OU=Dev,DC=Example,DC=COM2">
+	</modDNRequest>
+</batchRequest>
\ No newline at end of file

Added: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/modifyRequest/request_with_needed_requestID.xml
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/modifyRequest/request_with_needed_requestID.xml?view=auto&rev=515141
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/modifyRequest/request_with_needed_requestID.xml (added)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/modifyRequest/request_with_needed_requestID.xml Tue Mar  6 07:31:49 2007
@@ -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">
+<modifyRequest dn="CN=Bob Rush,OU=Dev,DC=Example,DC=COM">
+	</modifyRequest>
+</batchRequest>
\ No newline at end of file

Added: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/searchRequest/request_with_needed_requestID.xml
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/searchRequest/request_with_needed_requestID.xml?view=auto&rev=515141
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/searchRequest/request_with_needed_requestID.xml (added)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/test/resources/org/apache/directory/ldapstudio/dsmlv2/searchRequest/request_with_needed_requestID.xml Tue Mar  6 07:31:49 2007
@@ -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 processing="parallel" responseOrder="unordered" xmlns="urn:oasis:names:tc:DSML:2.0:core">
+<searchRequest dn="ou=marketing,dc=microsoft,dc=com"
+				scope="baseObject"
+				derefAliases="neverDerefAliases">
+		<filter>
+			<approxMatch name="sn">
+				<value>toto</value>
+			</approxMatch>
+		</filter>
+	</searchRequest>
+</batchRequest>
\ No newline at end of file



Mime
View raw message