[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit FormParametersTest.java,1.16,1.17
Brought to you by:
russgold
From: Russell G. <rus...@us...> - 2002-10-03 12:35:21
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit In directory usw-pr-cvs1:/tmp/cvs-serv18765/test/com/meterware/httpunit Modified Files: FormParametersTest.java Log Message: Refactored to facilitate multiple window feature Index: FormParametersTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/FormParametersTest.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- FormParametersTest.java 2 Oct 2002 13:57:56 -0000 1.16 +++ FormParametersTest.java 3 Oct 2002 12:35:18 -0000 1.17 @@ -4,12 +4,12 @@ * * Copyright (c) 2000-2002, Russell Gold * -* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -* documentation files (the "Software"), to deal in the Software without restriction, including without limitation +* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +* documentation files (the "Software"), to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and * to permit persons to whom the Software is furnished to do so, subject to the following conditions: * -* The above copyright notice and this permission notice shall be included in all copies or substantial portions +* The above copyright notice and this permission notice shall be included in all copies or substantial portions * of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO @@ -37,8 +37,8 @@ public static void main(String args[]) { junit.textui.TestRunner.run( suite() ); } - - + + public static Test suite() { return new TestSuite( FormParametersTest.class ); } @@ -53,8 +53,8 @@ super.setUp(); _wc = new WebConversation(); } - - + + public void testChoiceParameterValidationBypass() throws Exception { HttpUnitOptions.setParameterValuesValidated( false ); defineWebPage( "Default", "<form method=GET action = \"/ask\">" + @@ -72,7 +72,7 @@ request.setParameter( "fish", new String[] { "red", "pink" } ); } - + public void testChoiceParameterValidation() throws Exception { defineWebPage( "Default", "<form method=GET action = \"/ask\">" + "<Select name=colors><Option>blue<Option>red</Select>" + @@ -88,7 +88,7 @@ validateSetParameterRejected( request, "media", "CDRom", "setting list to illegal value" ); validateSetParameterRejected( request, "colors", new String[] { "blue", "red" }, "setting multiple values on choice" ); validateSetParameterRejected( request, "media", new String[] { "TV", "CDRom" }, "setting one bad value in a group" ); - + request.setParameter( "colors", "blue" ); request.setParameter( "fish", "red" ); request.setParameter( "media", "TV" ); @@ -158,7 +158,7 @@ try { request.setParameter( "secret", "zork" ); fail( "Should have rejected set of unknown parameter" ); - } catch (NoSuchParameterException e) { + } catch (WebForm.NoSuchParameterException e) { } } @@ -363,7 +363,7 @@ } } - + private void validateSetParameterRejected( WebRequest request, String parameterName, String[] values, String comment ) throws Exception { try { request.setParameter( parameterName, values ); |