[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit FormSubmitTest.java,1.26,1.27
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2002-10-08 17:45:51
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit
In directory usw-pr-cvs1:/tmp/cvs-serv29043/test/com/meterware/httpunit
Modified Files:
FormSubmitTest.java
Log Message:
add test for multiple script hiding comments
Index: FormSubmitTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/FormSubmitTest.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- FormSubmitTest.java 5 Sep 2002 14:46:56 -0000 1.26
+++ FormSubmitTest.java 8 Oct 2002 17:45:13 -0000 1.27
@@ -29,6 +29,10 @@
import java.util.StringTokenizer;
import java.util.Vector;
import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+import com.meterware.pseudoserver.PseudoServlet;
+import com.meterware.pseudoserver.WebResource;
/**
@@ -484,6 +488,26 @@
req.setParameter( "aTextField", "test" );
assertEquals( getHostPath() + "/abc/go?size=3&time=now",
req.getURL().toExternalForm() );
+ }
+
+
+ public void testPostParameterEncoding() throws Exception {
+ defineWebPage( "abc/form", "<form name=\"test\" method='POST' action='/doit'>" +
+ " <input type='text' name='text_field-name*'>" +
+ " <input type='submit' name='apply' value='Apply'>" +
+ "</form>" );
+ setResourceCharSet( "abc/form.html", "iso-8859-3", true );
+ defineResource( "doit", new PseudoServlet() {
+ public WebResource getPostResponse() throws IOException {
+ return new WebResource( new String( getBody() ) );
+ }
+ } );
+
+ WebResponse wr = _wc.getResponse( getHostPath() + "/abc/form.html" );
+ WebForm form = wr.getForms()[0];
+ form.setParameter( "text_field-name*", "a value" );
+ WebResponse response = form.submit();
+ assertEquals( "posted parameters", "text_field-name*=a+value&apply=Apply", response.getText() );
}
|