directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r650166 [2/2] - in /directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2: ./ abandonRequest/ addRequest/ addResponse/ authRequest/ authResponse/ batchRequest/ batchResponse/ compareRequest/ compareRespo...
Date Mon, 21 Apr 2008 15:06:59 GMT
Modified: directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/extendedResponse/ExtendedResponseTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/extendedResponse/ExtendedResponseTest.java?rev=650166&r1=650165&r2=650166&view=diff
==============================================================================
--- directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/extendedResponse/ExtendedResponseTest.java (original)
+++ directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/extendedResponse/ExtendedResponseTest.java Mon Apr 21 08:06:54 2008
@@ -57,8 +57,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ExtendedResponseTest.class.getResource( "response_with_requestID_attribute.xml" )
-                .getFile() );
+            parser.setInput( ExtendedResponseTest.class.getResource( "response_with_requestID_attribute.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -71,8 +71,8 @@
 
         assertEquals( 456, extendedResponse.getMessageId() );
     }
-    
-    
+
+
     /**
      * Test parsing of a Response with the (optional) requestID attribute equals 0
      */
@@ -92,7 +92,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ExtendedResponseTest.class.getResource( "response_with_1_control.xml" ).getFile() );
+            parser.setInput( ExtendedResponseTest.class.getResource( "response_with_1_control.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -113,7 +114,8 @@
 
         assertEquals( "Some text", StringTools.utf8ToString( ( byte[] ) control.getControlValue() ) );
     }
-    
+
+
     /**
      * Test parsing of a response with a (optional) Control element with empty value
      */
@@ -124,7 +126,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ExtendedResponseTest.class.getResource( "response_with_1_control_empty_value.xml" ).getFile() );
+            parser.setInput( ExtendedResponseTest.class.getResource( "response_with_1_control_empty_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -135,7 +138,7 @@
 
         ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse();
         Control control = extendedResponse.getCurrentControl();
-        
+
         assertEquals( 1, extendedResponse.getControls().size() );
         assertTrue( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
@@ -153,7 +156,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ExtendedResponseTest.class.getResource( "response_with_2_controls.xml" ).getFile() );
+            parser.setInput( ExtendedResponseTest.class.getResource( "response_with_2_controls.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -186,8 +190,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ExtendedResponseTest.class.getResource( "response_with_3_controls_without_value.xml" )
-                .getFile() );
+            parser.setInput( ExtendedResponseTest.class.getResource( "response_with_3_controls_without_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -238,7 +242,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ExtendedResponseTest.class.getResource( "response_with_result_code.xml" ).getFile() );
+            parser.setInput( ExtendedResponseTest.class.getResource( "response_with_result_code.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -265,7 +270,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ExtendedResponseTest.class.getResource( "response_with_error_message.xml" ).getFile() );
+            parser.setInput( ExtendedResponseTest.class.getResource( "response_with_error_message.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -281,7 +287,8 @@
         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
      */
@@ -292,7 +299,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ExtendedResponseTest.class.getResource( "response_with_empty_error_message.xml" ).getFile() );
+            parser.setInput( ExtendedResponseTest.class.getResource( "response_with_empty_error_message.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -319,7 +327,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ExtendedResponseTest.class.getResource( "response_with_1_referral.xml" ).getFile() );
+            parser.setInput( ExtendedResponseTest.class.getResource( "response_with_1_referral.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -347,7 +356,8 @@
             fail();
         }
     }
-    
+
+
     /**
      * Test parsing of a response with a empty Referral
      */
@@ -358,7 +368,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ExtendedResponseTest.class.getResource( "response_with_1_empty_referral.xml" ).getFile() );
+            parser.setInput( ExtendedResponseTest.class.getResource( "response_with_1_empty_referral.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -387,7 +398,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ExtendedResponseTest.class.getResource( "response_with_2_referrals.xml" ).getFile() );
+            parser.setInput( ExtendedResponseTest.class.getResource( "response_with_2_referrals.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -438,8 +450,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ExtendedResponseTest.class.getResource(
-                "response_with_1_referral_and_error_message.xml" ).getFile() );
+            parser.setInput( ExtendedResponseTest.class.getResource( "response_with_1_referral_and_error_message.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -479,8 +491,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ExtendedResponseTest.class.getResource( "response_with_matchedDN_attribute.xml" )
-                .getFile() );
+            parser.setInput( ExtendedResponseTest.class.getResource( "response_with_matchedDN_attribute.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -516,7 +528,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ExtendedResponseTest.class.getResource( "response_with_responseName.xml" ).getFile() );
+            parser.setInput( ExtendedResponseTest.class.getResource( "response_with_responseName.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -536,7 +549,8 @@
             fail();
         }
     }
-    
+
+
     /**
      * Test parsing of a response with empty Response Name
      */
@@ -547,7 +561,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ExtendedResponseTest.class.getResource( "response_with_empty_responseName.xml" ).getFile() );
+            parser.setInput( ExtendedResponseTest.class.getResource( "response_with_empty_responseName.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -581,7 +596,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ExtendedResponseTest.class.getResource( "response_with_response.xml" ).getFile() );
+            parser.setInput( ExtendedResponseTest.class.getResource( "response_with_response.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -594,7 +610,8 @@
 
         assertEquals( "This is a response", extendedResponse.getResponse() );
     }
-    
+
+
     /**
      * Test parsing of a response with Base64 Response
      */
@@ -605,7 +622,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ExtendedResponseTest.class.getResource( "response_with_base64_response.xml" ).getFile() );
+            parser.setInput(
+                ExtendedResponseTest.class.getResource( "response_with_base64_response.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -616,9 +634,10 @@
 
         ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse();
 
-        assertEquals( "DSMLv2.0 rocks!!", new String( (byte[]) extendedResponse.getResponse() ) );
+        assertEquals( "DSMLv2.0 rocks!!", new String( ( byte[] ) extendedResponse.getResponse() ) );
     }
-    
+
+
     /**
      * Test parsing of a response with empty Response
      */
@@ -629,7 +648,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ExtendedResponseTest.class.getResource( "response_with_empty_response.xml" ).getFile() );
+            parser.setInput( ExtendedResponseTest.class.getResource( "response_with_empty_response.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -654,8 +674,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ExtendedResponseTest.class.getResource( "response_with_responseName_and_response.xml" )
-                .getFile() );
+            parser.setInput( ExtendedResponseTest.class.getResource( "response_with_responseName_and_response.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }

Modified: directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/modDNRequest/ModifyDNRequestTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/modDNRequest/ModifyDNRequestTest.java?rev=650166&r1=650165&r2=650166&view=diff
==============================================================================
--- directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/modDNRequest/ModifyDNRequestTest.java (original)
+++ directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/modDNRequest/ModifyDNRequestTest.java Mon Apr 21 08:06:54 2008
@@ -46,8 +46,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyDNRequestTest.class.getResource( "request_with_requestID_attribute.xml" )
-                .getFile() );
+            parser.setInput( ModifyDNRequestTest.class.getResource( "request_with_requestID_attribute.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -81,7 +81,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyDNRequestTest.class.getResource( "request_with_1_control.xml" ).getFile() );
+            parser.setInput( ModifyDNRequestTest.class.getResource( "request_with_1_control.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -110,8 +111,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyDNRequestTest.class.getResource( "request_with_1_control_base64_value.xml" )
-                .getFile() );
+            parser.setInput( ModifyDNRequestTest.class.getResource( "request_with_1_control_base64_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -140,8 +141,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyDNRequestTest.class.getResource( "request_with_1_control_empty_value.xml" )
-                .getFile() );
+            parser.setInput( ModifyDNRequestTest.class.getResource( "request_with_1_control_empty_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -170,7 +171,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyDNRequestTest.class.getResource( "request_with_2_controls.xml" ).getFile() );
+            parser.setInput( ModifyDNRequestTest.class.getResource( "request_with_2_controls.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -199,8 +201,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyDNRequestTest.class.getResource( "request_with_3_controls_without_value.xml" )
-                .getFile() );
+            parser.setInput( ModifyDNRequestTest.class.getResource( "request_with_3_controls_without_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -247,8 +249,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyDNRequestTest.class.getResource( "request_with_dn_and_newrdn_attributes.xml" )
-                .getFile() );
+            parser.setInput( ModifyDNRequestTest.class.getResource( "request_with_dn_and_newrdn_attributes.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -275,8 +277,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyDNRequestTest.class.getResource( "request_with_deleteoldrdn_true.xml" )
-                .getFile() );
+            parser.setInput(
+                ModifyDNRequestTest.class.getResource( "request_with_deleteoldrdn_true.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -301,7 +303,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyDNRequestTest.class.getResource( "request_with_deleteoldrdn_1.xml" ).getFile() );
+            parser.setInput( ModifyDNRequestTest.class.getResource( "request_with_deleteoldrdn_1.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -326,8 +329,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyDNRequestTest.class.getResource( "request_with_deleteoldrdn_false.xml" )
-                .getFile() );
+            parser.setInput( ModifyDNRequestTest.class.getResource( "request_with_deleteoldrdn_false.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -352,7 +355,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyDNRequestTest.class.getResource( "request_with_deleteoldrdn_0.xml" ).getFile() );
+            parser.setInput( ModifyDNRequestTest.class.getResource( "request_with_deleteoldrdn_0.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -386,8 +390,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyDNRequestTest.class.getResource( "request_with_newSuperior_attribute.xml" )
-                .getFile() );
+            parser.setInput( ModifyDNRequestTest.class.getResource( "request_with_newSuperior_attribute.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }

Modified: directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/modDNResponse/ModifyDNResponseTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/modDNResponse/ModifyDNResponseTest.java?rev=650166&r1=650165&r2=650166&view=diff
==============================================================================
--- directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/modDNResponse/ModifyDNResponseTest.java (original)
+++ directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/modDNResponse/ModifyDNResponseTest.java Mon Apr 21 08:06:54 2008
@@ -55,8 +55,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ModifyDNResponseTest.class.getResource( "response_with_requestID_attribute.xml" )
-                .getFile() );
+            parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_requestID_attribute.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -69,8 +69,8 @@
 
         assertEquals( 456, modifyDNResponse.getMessageId() );
     }
-    
-    
+
+
     /**
      * Test parsing of a Response with the (optional) requestID attribute equals 0
      */
@@ -90,7 +90,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ModifyDNResponseTest.class.getResource( "response_with_1_control.xml" ).getFile() );
+            parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_1_control.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -111,7 +112,8 @@
 
         assertEquals( "Some text", StringTools.utf8ToString( ( byte[] ) control.getControlValue() ) );
     }
-    
+
+
     /**
      * Test parsing of a response with a (optional) Control element with empty value
      */
@@ -122,7 +124,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ModifyDNResponseTest.class.getResource( "response_with_1_control_empty_value.xml" ).getFile() );
+            parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_1_control_empty_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -133,7 +136,7 @@
 
         ModifyDNResponse modifyDNResponse = ( ModifyDNResponse ) parser.getBatchResponse().getCurrentResponse();
         Control control = modifyDNResponse.getCurrentControl();
-        
+
         assertEquals( 1, modifyDNResponse.getControls().size() );
         assertTrue( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
@@ -151,7 +154,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ModifyDNResponseTest.class.getResource( "response_with_2_controls.xml" ).getFile() );
+            parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_2_controls.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -184,8 +188,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ModifyDNResponseTest.class.getResource( "response_with_3_controls_without_value.xml" )
-                .getFile() );
+            parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_3_controls_without_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -236,7 +240,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ModifyDNResponseTest.class.getResource( "response_with_result_code.xml" ).getFile() );
+            parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_result_code.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -263,7 +268,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ModifyDNResponseTest.class.getResource( "response_with_error_message.xml" ).getFile() );
+            parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_error_message.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -279,7 +285,8 @@
         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
      */
@@ -290,7 +297,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ModifyDNResponseTest.class.getResource( "response_with_empty_error_message.xml" ).getFile() );
+            parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_empty_error_message.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -317,7 +325,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ModifyDNResponseTest.class.getResource( "response_with_1_referral.xml" ).getFile() );
+            parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_1_referral.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -345,7 +354,8 @@
             fail();
         }
     }
-    
+
+
     /**
      * Test parsing of a response with an empty Referral
      */
@@ -356,7 +366,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ModifyDNResponseTest.class.getResource( "response_with_1_empty_referral.xml" ).getFile() );
+            parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_1_empty_referral.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -385,7 +396,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ModifyDNResponseTest.class.getResource( "response_with_2_referrals.xml" ).getFile() );
+            parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_2_referrals.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -436,8 +448,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ModifyDNResponseTest.class.getResource(
-                "response_with_1_referral_and_error_message.xml" ).getFile() );
+            parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_1_referral_and_error_message.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -477,8 +489,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ModifyDNResponseTest.class.getResource( "response_with_matchedDN_attribute.xml" )
-                .getFile() );
+            parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_matchedDN_attribute.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }

Modified: directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/modifyRequest/ModifyRequestTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/modifyRequest/ModifyRequestTest.java?rev=650166&r1=650165&r2=650166&view=diff
==============================================================================
--- directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/modifyRequest/ModifyRequestTest.java (original)
+++ directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/modifyRequest/ModifyRequestTest.java Mon Apr 21 08:06:54 2008
@@ -55,8 +55,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyRequestTest.class.getResource( "request_with_requestID_attribute.xml" )
-                .getFile() );
+            parser.setInput(
+                ModifyRequestTest.class.getResource( "request_with_requestID_attribute.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -90,7 +90,7 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyRequestTest.class.getResource( "request_with_1_control.xml" ).getFile() );
+            parser.setInput( ModifyRequestTest.class.getResource( "request_with_1_control.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -119,8 +119,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyRequestTest.class.getResource( "request_with_1_control_base64_value.xml" )
-                .getFile() );
+            parser.setInput( ModifyRequestTest.class.getResource( "request_with_1_control_base64_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -149,8 +149,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyRequestTest.class.getResource( "request_with_1_control_empty_value.xml" )
-                .getFile() );
+            parser.setInput( ModifyRequestTest.class.getResource( "request_with_1_control_empty_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -179,7 +179,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyRequestTest.class.getResource( "request_with_2_controls.xml" ).getFile() );
+            parser
+                .setInput( ModifyRequestTest.class.getResource( "request_with_2_controls.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -208,8 +209,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyRequestTest.class.getResource( "request_with_3_controls_without_value.xml" )
-                .getFile() );
+            parser.setInput( ModifyRequestTest.class.getResource( "request_with_3_controls_without_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -248,7 +249,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyRequestTest.class.getResource( "request_with_1_modification.xml" ).getFile() );
+            parser.setInput( ModifyRequestTest.class.getResource( "request_with_1_modification.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -287,8 +289,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyRequestTest.class.getResource( "request_with_1_modification_base64_value.xml" )
-                .getFile() );
+            parser.setInput( ModifyRequestTest.class.getResource( "request_with_1_modification_base64_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -331,7 +333,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyRequestTest.class.getResource( "request_with_2_modifications.xml" ).getFile() );
+            parser.setInput( ModifyRequestTest.class.getResource( "request_with_2_modifications.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -387,7 +390,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyRequestTest.class.getResource( "request_with_operation_add.xml" ).getFile() );
+            parser.setInput( ModifyRequestTest.class.getResource( "request_with_operation_add.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -413,7 +417,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyRequestTest.class.getResource( "request_with_operation_delete.xml" ).getFile() );
+            parser.setInput( ModifyRequestTest.class.getResource( "request_with_operation_delete.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -439,7 +444,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyRequestTest.class.getResource( "request_with_operation_replace.xml" ).getFile() );
+            parser.setInput( ModifyRequestTest.class.getResource( "request_with_operation_replace.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -474,8 +480,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyRequestTest.class.getResource( "request_with_modification_without_value.xml" )
-                .getFile() );
+            parser.setInput( ModifyRequestTest.class.getResource( "request_with_modification_without_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -511,8 +517,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyRequestTest.class.getResource( "request_with_modification_with_2_values.xml" )
-                .getFile() );
+            parser.setInput( ModifyRequestTest.class.getResource( "request_with_modification_with_2_values.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -552,8 +558,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( ModifyRequestTest.class.getResource( "request_with_modification_with_empty_value.xml" )
-                .getFile() );
+            parser.setInput( ModifyRequestTest.class.getResource( "request_with_modification_with_empty_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }

Modified: directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/modifyResponse/ModifyResponseTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/modifyResponse/ModifyResponseTest.java?rev=650166&r1=650165&r2=650166&view=diff
==============================================================================
--- directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/modifyResponse/ModifyResponseTest.java (original)
+++ directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/modifyResponse/ModifyResponseTest.java Mon Apr 21 08:06:54 2008
@@ -55,8 +55,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ModifyResponseTest.class.getResource( "response_with_requestID_attribute.xml" )
-                .getFile() );
+            parser.setInput( ModifyResponseTest.class.getResource( "response_with_requestID_attribute.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -69,8 +69,8 @@
 
         assertEquals( 456, modifyResponse.getMessageId() );
     }
-    
-    
+
+
     /**
      * Test parsing of a Response with the (optional) requestID attribute equals 0
      */
@@ -90,7 +90,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ModifyResponseTest.class.getResource( "response_with_1_control.xml" ).getFile() );
+            parser.setInput( ModifyResponseTest.class.getResource( "response_with_1_control.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -111,7 +112,8 @@
 
         assertEquals( "Some text", StringTools.utf8ToString( ( byte[] ) control.getControlValue() ) );
     }
-    
+
+
     /**
      * Test parsing of a response with a (optional) Control element with empty value
      */
@@ -122,7 +124,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ModifyResponseTest.class.getResource( "response_with_1_control_empty_value.xml" ).getFile() );
+            parser.setInput( ModifyResponseTest.class.getResource( "response_with_1_control_empty_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -133,7 +136,7 @@
 
         ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse();
         Control control = modifyResponse.getCurrentControl();
-        
+
         assertEquals( 1, modifyResponse.getControls().size() );
         assertTrue( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
@@ -151,7 +154,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ModifyResponseTest.class.getResource( "response_with_2_controls.xml" ).getFile() );
+            parser.setInput( ModifyResponseTest.class.getResource( "response_with_2_controls.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -184,8 +188,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ModifyResponseTest.class.getResource( "response_with_3_controls_without_value.xml" )
-                .getFile() );
+            parser.setInput( ModifyResponseTest.class.getResource( "response_with_3_controls_without_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -236,7 +240,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ModifyResponseTest.class.getResource( "response_with_result_code.xml" ).getFile() );
+            parser.setInput( ModifyResponseTest.class.getResource( "response_with_result_code.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -263,7 +268,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ModifyResponseTest.class.getResource( "response_with_error_message.xml" ).getFile() );
+            parser.setInput( ModifyResponseTest.class.getResource( "response_with_error_message.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -279,7 +285,8 @@
         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
      */
@@ -290,7 +297,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ModifyResponseTest.class.getResource( "response_with_empty_error_message.xml" ).getFile() );
+            parser.setInput( ModifyResponseTest.class.getResource( "response_with_empty_error_message.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -317,7 +325,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ModifyResponseTest.class.getResource( "response_with_1_referral.xml" ).getFile() );
+            parser.setInput( ModifyResponseTest.class.getResource( "response_with_1_referral.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -345,7 +354,8 @@
             fail();
         }
     }
-    
+
+
     /**
      * Test parsing of a response with an empty Referral
      */
@@ -356,7 +366,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ModifyResponseTest.class.getResource( "response_with_1_empty_referral.xml" ).getFile() );
+            parser.setInput( ModifyResponseTest.class.getResource( "response_with_1_empty_referral.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -385,7 +396,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ModifyResponseTest.class.getResource( "response_with_2_referrals.xml" ).getFile() );
+            parser.setInput( ModifyResponseTest.class.getResource( "response_with_2_referrals.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -436,8 +448,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ModifyResponseTest.class
-                .getResource( "response_with_1_referral_and_error_message.xml" ).getFile() );
+            parser.setInput( ModifyResponseTest.class.getResource( "response_with_1_referral_and_error_message.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -477,8 +489,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( ModifyResponseTest.class.getResource( "response_with_matchedDN_attribute.xml" )
-                .getFile() );
+            parser.setInput( ModifyResponseTest.class.getResource( "response_with_matchedDN_attribute.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }

Modified: directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchRequest/SearchRequestTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchRequest/SearchRequestTest.java?rev=650166&r1=650165&r2=650166&view=diff
==============================================================================
--- directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchRequest/SearchRequestTest.java (original)
+++ directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchRequest/SearchRequestTest.java Mon Apr 21 08:06:54 2008
@@ -73,7 +73,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_dn_attribute.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "request_with_dn_attribute.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -98,8 +99,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_requestID_attribute.xml" )
-                .getFile() );
+            parser.setInput(
+                SearchRequestTest.class.getResource( "request_with_requestID_attribute.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -133,7 +134,7 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_1_control.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "request_with_1_control.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -162,8 +163,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_1_control_base64_value.xml" )
-                .getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "request_with_1_control_base64_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -192,8 +193,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_1_control_empty_value.xml" )
-                .getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "request_with_1_control_empty_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -222,7 +223,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_2_controls.xml" ).getFile() );
+            parser
+                .setInput( SearchRequestTest.class.getResource( "request_with_2_controls.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -251,8 +253,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_3_controls_without_value.xml" )
-                .getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "request_with_3_controls_without_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -300,7 +302,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_scope_baseObject.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "request_with_scope_baseObject.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -326,7 +329,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_scope_singleLevel.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "request_with_scope_singleLevel.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -352,8 +356,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser
-                .setInputFile( SearchRequestTest.class.getResource( "request_with_scope_wholeSubtree.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "request_with_scope_wholeSubtree.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -397,8 +401,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_derefAliases_derefAlways.xml" )
-                .getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "request_with_derefAliases_derefAlways.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -424,8 +428,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource(
-                "request_with_derefAliases_derefFindingBaseObj.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "request_with_derefAliases_derefFindingBaseObj.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -451,8 +455,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_derefAliases_derefInSearching.xml" )
-                .getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "request_with_derefAliases_derefInSearching.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -478,8 +482,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class
-                .getResource( "request_with_derefAliases_neverDerefAliases.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "request_with_derefAliases_neverDerefAliases.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -515,8 +519,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_sizeLimit_attribute.xml" )
-                .getFile() );
+            parser.setInput(
+                SearchRequestTest.class.getResource( "request_with_sizeLimit_attribute.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -552,8 +556,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_timeLimit_attribute.xml" )
-                .getFile() );
+            parser.setInput(
+                SearchRequestTest.class.getResource( "request_with_timeLimit_attribute.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -588,7 +592,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_typesOnly_true.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "request_with_typesOnly_true.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -613,7 +618,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_typesOnly_1.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "request_with_typesOnly_1.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -638,7 +644,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_typesOnly_false.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "request_with_typesOnly_false.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -663,7 +670,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_typesOnly_0.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "request_with_typesOnly_0.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -706,8 +714,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_attributes_but_no_attribute.xml" )
-                .getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "request_with_attributes_but_no_attribute.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -740,8 +748,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_attributes_1_attribute.xml" )
-                .getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "request_with_attributes_1_attribute.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -775,8 +783,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_attributes_2_attribute.xml" )
-                .getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "request_with_attributes_2_attribute.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -831,7 +839,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "filters/request_with_and.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_and.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -858,7 +867,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "filters/request_with_or.xml" ).getFile() );
+            parser
+                .setInput( SearchRequestTest.class.getResource( "filters/request_with_or.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -885,7 +895,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "filters/request_with_not.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_not.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -921,8 +932,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "filters/request_with_approxMatch.xml" )
-                .getFile() );
+            parser.setInput(
+                SearchRequestTest.class.getResource( "filters/request_with_approxMatch.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -959,8 +970,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource(
-                "filters/request_with_approxMatch_base64_value.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_approxMatch_base64_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -997,8 +1008,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource(
-                "filters/request_with_approxMatch_with_empty_value.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource(
+                "filters/request_with_approxMatch_with_empty_value.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -1062,8 +1073,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "filters/request_with_greaterOrEqual.xml" )
-                .getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_greaterOrEqual.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -1100,8 +1111,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource(
-                "filters/request_with_greaterOrEqual_base64_value.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource(
+                "filters/request_with_greaterOrEqual_base64_value.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -1138,8 +1149,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource(
-                "filters/request_with_greaterOrEqual_with_empty_value.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource(
+                "filters/request_with_greaterOrEqual_with_empty_value.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -1203,8 +1214,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "filters/request_with_lessOrEqual.xml" )
-                .getFile() );
+            parser.setInput(
+                SearchRequestTest.class.getResource( "filters/request_with_lessOrEqual.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -1241,8 +1252,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource(
-                "filters/request_with_lessOrEqual_base64_value.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_lessOrEqual_base64_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -1279,8 +1290,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource(
-                "filters/request_with_lessOrEqual_with_empty_value.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource(
+                "filters/request_with_lessOrEqual_with_empty_value.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -1344,8 +1355,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "filters/request_with_equalityMatch.xml" )
-                .getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_equalityMatch.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -1382,8 +1393,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource(
-                "filters/request_with_equalityMatch_base64_value.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class
+                .getResource( "filters/request_with_equalityMatch_base64_value.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -1420,8 +1431,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource(
-                "filters/request_with_equalityMatch_with_empty_value.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource(
+                "filters/request_with_equalityMatch_with_empty_value.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -1485,7 +1496,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "filters/request_with_present.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_present.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -1525,8 +1537,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "filters/request_with_extensibleMatch.xml" )
-                .getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_extensibleMatch.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -1559,8 +1571,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource(
-                "filters/request_with_extensibleMatch_base64_value.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource(
+                "filters/request_with_extensibleMatch_base64_value.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -1593,8 +1605,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource(
-                "filters/request_with_extensibleMatch_with_empty_value.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource(
+                "filters/request_with_extensibleMatch_with_empty_value.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -1645,8 +1657,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource(
-                "filters/request_with_extensibleMatch_with_dnAttributes_true.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource(
+                "filters/request_with_extensibleMatch_with_dnAttributes_true.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -1677,8 +1689,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource(
-                "filters/request_with_extensibleMatch_with_dnAttributes_1.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource(
+                "filters/request_with_extensibleMatch_with_dnAttributes_1.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -1709,8 +1721,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource(
-                "filters/request_with_extensibleMatch_with_dnAttributes_false.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource(
+                "filters/request_with_extensibleMatch_with_dnAttributes_false.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -1741,8 +1753,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource(
-                "filters/request_with_extensibleMatch_with_dnAttributes_0.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource(
+                "filters/request_with_extensibleMatch_with_dnAttributes_0.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -1782,8 +1794,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource(
-                "filters/request_with_extensibleMatch_with_matchingRule.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource(
+                "filters/request_with_extensibleMatch_with_matchingRule.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -1814,8 +1826,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource(
-                "filters/request_with_extensibleMatch_with_name.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_extensibleMatch_with_name.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -1846,8 +1858,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser
-                .setInputFile( SearchRequestTest.class.getResource( "filters/request_with_substrings.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_substrings.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -1887,8 +1899,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "filters/request_with_substrings_1_initial.xml" )
-                .getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_substrings_1_initial.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -1919,8 +1931,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource(
-                "filters/request_with_substrings_1_base64_initial.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource(
+                "filters/request_with_substrings_1_base64_initial.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -1951,8 +1963,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource(
-                "filters/request_with_substrings_1_empty_initial.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class
+                .getResource( "filters/request_with_substrings_1_empty_initial.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -1983,8 +1995,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource(
-                "filters/request_with_substrings_1_initial_1_any.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class
+                .getResource( "filters/request_with_substrings_1_initial_1_any.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -2021,8 +2033,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource(
-                "filters/request_with_substrings_1_initial_1_final.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource(
+                "filters/request_with_substrings_1_initial_1_final.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -2055,8 +2067,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "filters/request_with_substrings_1_any.xml" )
-                .getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_substrings_1_any.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -2090,8 +2102,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource(
-                "filters/request_with_substrings_1_base64_any.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_substrings_1_base64_any.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -2125,8 +2137,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class
-                .getResource( "filters/request_with_substrings_1_empty_any.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_substrings_1_empty_any.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -2159,8 +2171,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "filters/request_with_substrings_2_any.xml" )
-                .getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_substrings_2_any.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -2197,8 +2209,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource(
-                "filters/request_with_substrings_1_any_1_final.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_substrings_1_any_1_final.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -2235,8 +2247,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource( "filters/request_with_substrings_1_final.xml" )
-                .getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_substrings_1_final.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -2267,8 +2279,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource(
-                "filters/request_with_substrings_1_base64_final.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_substrings_1_base64_final.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -2299,8 +2311,8 @@
         {
             parser = new Dsmlv2Parser();
 
-            parser.setInputFile( SearchRequestTest.class.getResource(
-                "filters/request_with_substrings_1_empty_final.xml" ).getFile() );
+            parser.setInput( SearchRequestTest.class.getResource( "filters/request_with_substrings_1_empty_final.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }

Modified: directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/SearchResponseTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/SearchResponseTest.java?rev=650166&r1=650165&r2=650166&view=diff
==============================================================================
--- directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/SearchResponseTest.java (original)
+++ directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/SearchResponseTest.java Mon Apr 21 08:06:54 2008
@@ -44,8 +44,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResponseTest.class.getResource( "response_with_requestID_attribute.xml" )
-                .getFile() );
+            parser.setInput( SearchResponseTest.class.getResource( "response_with_requestID_attribute.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -58,8 +58,8 @@
 
         assertEquals( 456, searchResponse.getMessageId() );
     }
-    
-    
+
+
     /**
      * Test parsing of a Response with the (optional) requestID attribute equals 0
      */
@@ -79,7 +79,7 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResponseTest.class.getResource( "response_with_1_SRD.xml" ).getFile() );
+            parser.setInput( SearchResponseTest.class.getResource( "response_with_1_SRD.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -104,7 +104,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResponseTest.class.getResource( "response_with_1_SRE_1_SRD.xml" ).getFile() );
+            parser.setInput( SearchResponseTest.class.getResource( "response_with_1_SRE_1_SRD.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -131,7 +132,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResponseTest.class.getResource( "response_with_1_SRR_1_SRD.xml" ).getFile() );
+            parser.setInput( SearchResponseTest.class.getResource( "response_with_1_SRR_1_SRD.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -158,8 +160,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResponseTest.class.getResource( "response_with_1_SRE_1_SRR_1_SRD.xml" )
-                .getFile() );
+            parser.setInput(
+                SearchResponseTest.class.getResource( "response_with_1_SRE_1_SRR_1_SRD.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -188,7 +190,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResponseTest.class.getResource( "response_with_2_SRE_1_SRD.xml" ).getFile() );
+            parser.setInput( SearchResponseTest.class.getResource( "response_with_2_SRE_1_SRD.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -215,7 +218,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResponseTest.class.getResource( "response_with_2_SRR_1_SRD.xml" ).getFile() );
+            parser.setInput( SearchResponseTest.class.getResource( "response_with_2_SRR_1_SRD.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -242,8 +246,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResponseTest.class.getResource( "response_with_2_SRE_2_SRR_1_SRD.xml" )
-                .getFile() );
+            parser.setInput(
+                SearchResponseTest.class.getResource( "response_with_2_SRE_2_SRR_1_SRD.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }

Modified: directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.java?rev=650166&r1=650165&r2=650166&view=diff
==============================================================================
--- directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.java (original)
+++ directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.java Mon Apr 21 08:06:54 2008
@@ -55,7 +55,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultDoneTest.class.getResource( "response_with_1_control.xml" ).getFile() );
+            parser.setInput( SearchResultDoneTest.class.getResource( "response_with_1_control.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -77,7 +78,8 @@
 
         assertEquals( "Some text", StringTools.utf8ToString( ( byte[] ) control.getControlValue() ) );
     }
-    
+
+
     /**
      * Test parsing of a response with a (optional) Control element with empty value
      */
@@ -88,7 +90,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultDoneTest.class.getResource( "response_with_1_control_empty_value.xml" ).getFile() );
+            parser.setInput( SearchResultDoneTest.class.getResource( "response_with_1_control_empty_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -100,7 +103,7 @@
         SearchResultDone searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
             .getSearchResultDone();
         Control control = searchResultDone.getCurrentControl();
-        
+
         assertEquals( 1, searchResultDone.getControls().size() );
         assertTrue( control.getCriticality() );
         assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
@@ -118,7 +121,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultDoneTest.class.getResource( "response_with_2_controls.xml" ).getFile() );
+            parser.setInput( SearchResultDoneTest.class.getResource( "response_with_2_controls.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -152,8 +156,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultDoneTest.class.getResource( "response_with_3_controls_without_value.xml" )
-                .getFile() );
+            parser.setInput( SearchResultDoneTest.class.getResource( "response_with_3_controls_without_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -187,8 +191,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultDoneTest.class.getResource( "response_with_requestID_attribute.xml" )
-                .getFile() );
+            parser.setInput( SearchResultDoneTest.class.getResource( "response_with_requestID_attribute.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -202,8 +206,8 @@
 
         assertEquals( 456, searchResultDone.getMessageId() );
     }
-    
-    
+
+
     /**
      * Test parsing of a Response with the (optional) requestID attribute equals 0
      */
@@ -241,7 +245,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultDoneTest.class.getResource( "response_with_result_code.xml" ).getFile() );
+            parser.setInput( SearchResultDoneTest.class.getResource( "response_with_result_code.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -269,7 +274,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultDoneTest.class.getResource( "response_with_error_message.xml" ).getFile() );
+            parser.setInput( SearchResultDoneTest.class.getResource( "response_with_error_message.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -286,7 +292,8 @@
         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
      */
@@ -297,7 +304,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultDoneTest.class.getResource( "response_with_empty_error_message.xml" ).getFile() );
+            parser.setInput( SearchResultDoneTest.class.getResource( "response_with_empty_error_message.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -325,7 +333,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultDoneTest.class.getResource( "response_with_1_referral.xml" ).getFile() );
+            parser.setInput( SearchResultDoneTest.class.getResource( "response_with_1_referral.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -354,7 +363,8 @@
             fail();
         }
     }
-    
+
+
     /**
      * Test parsing of a response with an empty Referral
      */
@@ -365,7 +375,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultDoneTest.class.getResource( "response_with_1_empty_referral.xml" ).getFile() );
+            parser.setInput( SearchResultDoneTest.class.getResource( "response_with_1_empty_referral.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -395,7 +406,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultDoneTest.class.getResource( "response_with_2_referrals.xml" ).getFile() );
+            parser.setInput( SearchResultDoneTest.class.getResource( "response_with_2_referrals.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -447,8 +459,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultDoneTest.class.getResource(
-                "response_with_1_referral_and_error_message.xml" ).getFile() );
+            parser.setInput( SearchResultDoneTest.class.getResource( "response_with_1_referral_and_error_message.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -489,8 +501,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultDoneTest.class.getResource( "response_with_matchedDN_attribute.xml" )
-                .getFile() );
+            parser.setInput( SearchResultDoneTest.class.getResource( "response_with_matchedDN_attribute.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }

Modified: directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/searchResultEntry/SearchResultEntryTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/searchResultEntry/SearchResultEntryTest.java?rev=650166&r1=650165&r2=650166&view=diff
==============================================================================
--- directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/searchResultEntry/SearchResultEntryTest.java (original)
+++ directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/searchResultEntry/SearchResultEntryTest.java Mon Apr 21 08:06:54 2008
@@ -54,7 +54,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultEntryTest.class.getResource( "response_with_1_control.xml" ).getFile() );
+            parser.setInput( SearchResultEntryTest.class.getResource( "response_with_1_control.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -88,8 +89,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultEntryTest.class.getResource( "response_with_1_control_empty_value.xml" )
-                .getFile() );
+            parser.setInput( SearchResultEntryTest.class.getResource( "response_with_1_control_empty_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -119,7 +120,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultEntryTest.class.getResource( "response_with_2_controls.xml" ).getFile() );
+            parser.setInput( SearchResultEntryTest.class.getResource( "response_with_2_controls.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -153,8 +155,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultEntryTest.class.getResource( "response_with_3_controls_without_value.xml" )
-                .getFile() );
+            parser.setInput( SearchResultEntryTest.class.getResource( "response_with_3_controls_without_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -206,7 +208,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultEntryTest.class.getResource( "response_with_dn_attribute.xml" ).getFile() );
+            parser.setInput( SearchResultEntryTest.class.getResource( "response_with_dn_attribute.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -232,8 +235,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultEntryTest.class.getResource( "response_with_requestID_attribute.xml" )
-                .getFile() );
+            parser.setInput( SearchResultEntryTest.class.getResource( "response_with_requestID_attribute.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -268,7 +271,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultEntryTest.class.getResource( "response_with_0_attr.xml" ).getFile() );
+            parser.setInput( SearchResultEntryTest.class.getResource( "response_with_0_attr.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -291,8 +295,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultEntryTest.class.getResource( "response_with_1_attr_0_value.xml" )
-                .getFile() );
+            parser.setInput(
+                SearchResultEntryTest.class.getResource( "response_with_1_attr_0_value.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -326,8 +330,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultEntryTest.class.getResource( "response_with_1_attr_1_value.xml" )
-                .getFile() );
+            parser.setInput(
+                SearchResultEntryTest.class.getResource( "response_with_1_attr_1_value.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -378,8 +382,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultEntryTest.class.getResource( "response_with_1_attr_1_base64_value.xml" )
-                .getFile() );
+            parser.setInput( SearchResultEntryTest.class.getResource( "response_with_1_attr_1_base64_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -433,8 +437,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultEntryTest.class.getResource( "response_with_1_attr_1_empty_value.xml" )
-                .getFile() );
+            parser.setInput( SearchResultEntryTest.class.getResource( "response_with_1_attr_1_empty_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -484,8 +488,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultEntryTest.class.getResource( "response_with_1_attr_2_value.xml" )
-                .getFile() );
+            parser.setInput(
+                SearchResultEntryTest.class.getResource( "response_with_1_attr_2_value.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -539,8 +543,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultEntryTest.class.getResource( "response_with_2_attr_1_value.xml" )
-                .getFile() );
+            parser.setInput(
+                SearchResultEntryTest.class.getResource( "response_with_2_attr_1_value.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }

Modified: directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/searchResultReference/SearchResultReferenceTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/searchResultReference/SearchResultReferenceTest.java?rev=650166&r1=650165&r2=650166&view=diff
==============================================================================
--- directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/searchResultReference/SearchResultReferenceTest.java (original)
+++ directory/studio/trunk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchResponse/searchResultReference/SearchResultReferenceTest.java Mon Apr 21 08:06:54 2008
@@ -51,8 +51,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser
-                .setInputFile( SearchResultReferenceTest.class.getResource( "response_with_1_control.xml" ).getFile() );
+            parser.setInput( SearchResultReferenceTest.class.getResource( "response_with_1_control.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -74,7 +74,8 @@
 
         assertEquals( "Some text", StringTools.utf8ToString( ( byte[] ) control.getControlValue() ) );
     }
-    
+
+
     /**
      * Test parsing of a response with a (optional) Control element with empty value
      */
@@ -85,8 +86,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser
-                .setInputFile( SearchResultReferenceTest.class.getResource( "response_with_1_control_empty_value.xml" ).getFile() );
+            parser.setInput( SearchResultReferenceTest.class.getResource( "response_with_1_control_empty_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -120,8 +121,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultReferenceTest.class.getResource( "response_with_2_controls.xml" )
-                .getFile() );
+            parser.setInput(
+                SearchResultReferenceTest.class.getResource( "response_with_2_controls.xml" ).openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -155,8 +156,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultReferenceTest.class.getResource(
-                "response_with_3_controls_without_value.xml" ).getFile() );
+            parser.setInput( SearchResultReferenceTest.class.getResource( "response_with_3_controls_without_value.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -190,8 +191,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultReferenceTest.class.getResource( "response_with_requestID_attribute.xml" )
-                .getFile() );
+            parser.setInput( SearchResultReferenceTest.class.getResource( "response_with_requestID_attribute.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -205,7 +206,8 @@
 
         assertEquals( 456, searchResultReference.getMessageId() );
     }
-    
+
+
     /**
      * Test parsing of a Response with the (optional) requestID attribute equals 0
      */
@@ -234,7 +236,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultReferenceTest.class.getResource( "response_with_1_ref.xml" ).getFile() );
+            parser.setInput( SearchResultReferenceTest.class.getResource( "response_with_1_ref.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }
@@ -259,7 +262,8 @@
             fail();
         }
     }
-    
+
+
     /**
      * Test parsing of a Response with 1 Ref
      */
@@ -270,7 +274,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultReferenceTest.class.getResource( "response_with_1_empty_ref.xml" ).getFile() );
+            parser.setInput( SearchResultReferenceTest.class.getResource( "response_with_1_empty_ref.xml" )
+                .openStream(), "UTF-8" );
 
             parser.parse();
         }
@@ -288,7 +293,6 @@
     }
 
 
-
     /**
      * Test parsing of a Response with 2 Ref
      */
@@ -299,7 +303,8 @@
         {
             parser = new Dsmlv2ResponseParser();
 
-            parser.setInputFile( SearchResultReferenceTest.class.getResource( "response_with_2_ref.xml" ).getFile() );
+            parser.setInput( SearchResultReferenceTest.class.getResource( "response_with_2_ref.xml" ).openStream(),
+                "UTF-8" );
 
             parser.parse();
         }



Mime
View raw message