[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit WebFormTest.java,1.29,1.30
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2003-05-06 13:31:10
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit
In directory sc8-pr-cvs1:/tmp/cvs-serv1408/test/com/meterware/httpunit
Modified Files:
WebFormTest.java
Log Message:
Select first valid value for Selection control
Index: WebFormTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/WebFormTest.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- WebFormTest.java 26 Dec 2002 04:59:35 -0000 1.29
+++ WebFormTest.java 6 May 2003 13:31:04 -0000 1.30
@@ -311,6 +311,24 @@
}
+ public void testSingleSelectParameterOrdering() throws Exception {
+ StringBuffer sb = new StringBuffer( "<form action='sendIt' id='theform'>" );
+ for (int i= 0; i < 4; i++) {
+ sb.append( "<select name='enabled'><option value='true'>Enabled<option value='false' selected>Disabled</select>" );
+ }
+ sb.append( "</form>" );
+
+ defineWebPage( "OnCommand", sb.toString() );
+
+ WebConversation wc = new WebConversation();
+ WebResponse response = wc.getResponse( getHostPath() + "/OnCommand.html" );
+ WebForm form = response.getFormWithID( "theform" );
+ form.setParameter( "enabled", new String[] { "true", "false", "false", "true" } );
+ WebRequest request = form.getRequest();
+ assertEquals( "request", getHostPath() + "/sendIt?enabled=true&enabled=false&enabled=false&enabled=true", request.getURL().toExternalForm() );
+ }
+
+
public void testMultiSelect() throws Exception {
defineWebPage( "Default", "<form method=GET action = \"/ask\">" +
"<Select multiple size=4 name=colors>" +
|