httpunit-commit Mailing List for httpunit (Page 53)
Brought to you by:
russgold
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(5) |
Sep
(31) |
Oct
(39) |
Nov
(18) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(8) |
Feb
(5) |
Mar
(8) |
Apr
(25) |
May
(20) |
Jun
(23) |
Jul
(28) |
Aug
(10) |
Sep
(3) |
Oct
(32) |
Nov
(61) |
Dec
(24) |
2002 |
Jan
(50) |
Feb
(34) |
Mar
(35) |
Apr
(3) |
May
(25) |
Jun
(25) |
Jul
(30) |
Aug
(146) |
Sep
(49) |
Oct
(156) |
Nov
(121) |
Dec
(54) |
2003 |
Jan
(12) |
Feb
(79) |
Mar
(88) |
Apr
(26) |
May
(67) |
Jun
(29) |
Jul
(8) |
Aug
(16) |
Sep
(20) |
Oct
(17) |
Nov
|
Dec
(5) |
2004 |
Jan
|
Feb
(40) |
Mar
(30) |
Apr
(5) |
May
|
Jun
(83) |
Jul
(34) |
Aug
(20) |
Sep
(44) |
Oct
(46) |
Nov
|
Dec
(14) |
2005 |
Jan
(4) |
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(4) |
Oct
|
Nov
|
Dec
(1) |
2006 |
Jan
|
Feb
|
Mar
(26) |
Apr
(8) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(5) |
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
(36) |
May
(38) |
Jun
(1) |
Jul
(1) |
Aug
|
Sep
(4) |
Oct
|
Nov
(18) |
Dec
(4) |
2009 |
Jan
|
Feb
(2) |
Mar
(3) |
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(35) |
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
(9) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(21) |
Oct
(18) |
Nov
(1) |
Dec
|
From: Russell G. <rus...@us...> - 2002-09-06 15:06:55
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/javascript In directory usw-pr-cvs1:/tmp/cvs-serv22076/src/com/meterware/httpunit/javascript Modified Files: JavaScript.java Log Message: Ville Skyttä: Removed xerces test dependency Index: JavaScript.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/javascript/JavaScript.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- JavaScript.java 5 Sep 2002 19:10:44 -0000 1.19 +++ JavaScript.java 6 Sep 2002 15:06:52 -0000 1.20 @@ -99,6 +99,7 @@ public boolean performEvent( String eventScript ) { try { final Context context = Context.getCurrentContext(); + context.setOptimizationLevel( -1 ); Function f = context.compileFunction( this, "function x() { " + eventScript + "}", "httpunit", 0, null ); Object result = f.call( context, this, this, NO_ARGS ); return (result instanceof Boolean) ? ((Boolean) result).booleanValue() : true; |
From: Russell G. <rus...@us...> - 2002-09-06 15:06:54
|
Update of /cvsroot/httpunit/httpunit/doc In directory usw-pr-cvs1:/tmp/cvs-serv22076/doc Modified Files: release_notes.txt Log Message: Ville Skyttä: Removed xerces test dependency Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.157 retrieving revision 1.158 diff -u -r1.157 -r1.158 --- release_notes.txt 5 Sep 2002 19:29:54 -0000 1.157 +++ release_notes.txt 6 Sep 2002 15:06:52 -0000 1.158 @@ -11,7 +11,12 @@ Revision History: + 6-Sep-2002 +Acknowledgments: + 1. Thanks to Ville Skyttä for removing the test dependency on xerces. + 5-Sep-2002 + 1. The web XML tests will now work with any jaxp-compliant parser, not just xerces. Problems fixed: 1. An attempt to set a non-existent parameter now correctly throws NoSuchParameterException rather |
From: Russell G. <rus...@us...> - 2002-09-06 15:06:54
|
Update of /cvsroot/httpunit/httpunit In directory usw-pr-cvs1:/tmp/cvs-serv22076 Modified Files: build.xml Log Message: Ville Skyttä: Removed xerces test dependency Index: build.xml =================================================================== RCS file: /cvsroot/httpunit/httpunit/build.xml,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- build.xml 30 Aug 2002 18:27:00 -0000 1.46 +++ build.xml 6 Sep 2002 15:06:51 -0000 1.47 @@ -49,7 +49,7 @@ classpathref="base.classpath" /> <available property="javamail.present" classname="javax.mail.internet.MimeMultipart" classpathref="base.classpath" /> - <available property="xerces.present" classname="org.apache.xerces.parsers.DOMParser" + <available property="jaxp.present" classname="javax.xml.parsers.DocumentBuilderFactory" classpathref="base.classpath" /> <available property="rhino.present" classname="org.mozilla.javascript.Context" classpathref="base.classpath" /> @@ -92,7 +92,7 @@ </classpath> <exclude name="**/servletunit/*" unless="jsdk.present" /> <exclude name="**/FileUploadTest.java" unless="javamail.present" /> - <exclude name="**/XMLPageTest.java" unless="xerces.present" /> + <exclude name="**/XMLPageTest.java" unless="jaxp.present" /> <exclude name="**/javascript/*" unless="rhino.present" /> </javac> </target> |
From: Russell G. <rus...@us...> - 2002-09-05 19:29:58
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/pseudoserver In directory usw-pr-cvs1:/tmp/cvs-serv8075/test/com/meterware/pseudoserver Modified Files: PseudoServerTest.java Log Message: Improved handling of not found exceptions Index: PseudoServerTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/pseudoserver/PseudoServerTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- PseudoServerTest.java 5 Sep 2002 19:10:44 -0000 1.4 +++ PseudoServerTest.java 5 Sep 2002 19:29:55 -0000 1.5 @@ -19,13 +19,7 @@ * DEALINGS IN THE SOFTWARE. * *******************************************************************************************************************/ -import com.meterware.httpunit.WebConversation; -import com.meterware.httpunit.WebResponse; -import com.meterware.httpunit.HttpNotFoundException; -import com.meterware.httpunit.WebRequest; -import com.meterware.httpunit.GetMethodWebRequest; -import com.meterware.httpunit.HttpException; -import com.meterware.httpunit.PostMethodWebRequest; +import com.meterware.httpunit.*; import junit.framework.TestCase; import junit.framework.TestSuite; @@ -55,7 +49,8 @@ try { WebResponse response = wc.getResponse( "http://no.such.host" ); - } catch (HttpNotFoundException e) { + fail( "Should have rejected the request" ); + } catch (HttpServerNotFoundException e) { } } @@ -68,6 +63,7 @@ fail( "Should have rejected the request" ); } catch (HttpNotFoundException e) { assertEquals( "Response code", HttpURLConnection.HTTP_NOT_FOUND, e.getResponseCode() ); + assertEquals( "Response message", "unable to find /nothing.htm", e.getResponseMessage() ); } } |
From: Russell G. <rus...@us...> - 2002-09-05 19:29:58
|
Update of /cvsroot/httpunit/httpunit/doc In directory usw-pr-cvs1:/tmp/cvs-serv8075/doc Modified Files: release_notes.txt Log Message: Improved handling of not found exceptions Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.156 retrieving revision 1.157 diff -u -r1.156 -r1.157 --- release_notes.txt 5 Sep 2002 19:10:43 -0000 1.156 +++ release_notes.txt 5 Sep 2002 19:29:54 -0000 1.157 @@ -20,6 +20,10 @@ Additions: 1. The forms, images, links, and Form.elements arrays now handle string indexes + 2. When no response is received from a server, HttpUnit will now throw HttpServerNotFoundException, which is a + subclass of HttpNotFoundException. This should aid in diagnosing response failures. + 3. When a 404 (not found status) is received from a server, the accompanying message is now available + from HttpNotFoundException.getResponseMessage(). 30-Aug-2002 1.4.5 Acknowledgements: |
From: Russell G. <rus...@us...> - 2002-09-05 19:29:58
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit In directory usw-pr-cvs1:/tmp/cvs-serv8075/src/com/meterware/httpunit Modified Files: HttpNotFoundException.java HttpWebResponse.java WebClient.java Added Files: HttpServerNotFoundException.java Log Message: Improved handling of not found exceptions ***** Error reading new file[Errno 2] No such file or directory: 'HttpServerNotFoundException.java' Index: HttpNotFoundException.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/HttpNotFoundException.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- HttpNotFoundException.java 8 Nov 2001 22:07:52 -0000 1.4 +++ HttpNotFoundException.java 5 Sep 2002 19:29:55 -0000 1.5 @@ -30,13 +30,13 @@ **/ public class HttpNotFoundException extends HttpException { - - public HttpNotFoundException( URL url ) { - super( HttpURLConnection.HTTP_NOT_FOUND, "Not found", url ); + public HttpNotFoundException( String responseMessage, URL baseURL ) { + super( HttpURLConnection.HTTP_NOT_FOUND, responseMessage, baseURL ); } + public HttpNotFoundException( URL url, Throwable t ) { - super( HttpURLConnection.HTTP_NOT_FOUND, t.toString(), url ); + this( t.toString(), url ); } Index: HttpWebResponse.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/HttpWebResponse.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- HttpWebResponse.java 21 Aug 2002 03:44:26 -0000 1.25 +++ HttpWebResponse.java 5 Sep 2002 19:29:55 -0000 1.26 @@ -133,7 +133,7 @@ private void readResponseHeader( URLConnection connection ) { - if (connection.getHeaderField(0) == null) throw new HttpNotFoundException( connection.getURL() ); + if (connection.getHeaderField(0) == null) throw new HttpServerNotFoundException( connection.getURL() ); StringTokenizer st = new StringTokenizer( connection.getHeaderField(0) ); st.nextToken(); Index: WebClient.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebClient.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- WebClient.java 5 Sep 2002 14:46:55 -0000 1.30 +++ WebClient.java 5 Sep 2002 19:29:55 -0000 1.31 @@ -434,7 +434,7 @@ if (response.getResponseCode() == HttpURLConnection.HTTP_INTERNAL_ERROR) { throw new HttpInternalErrorException( response.getURL() ); } else if (response.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) { - throw new HttpNotFoundException( response.getURL() ); + throw new HttpNotFoundException( response.getResponseMessage(), response.getURL() ); } else if (response.getResponseCode() >= HttpURLConnection.HTTP_BAD_REQUEST) { throw new HttpException( response.getResponseCode(), response.getResponseMessage(), response.getURL() ); } |
From: Russell G. <rus...@us...> - 2002-09-05 19:29:58
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/servletunit In directory usw-pr-cvs1:/tmp/cvs-serv8075/src/com/meterware/servletunit Modified Files: WebApplication.java Log Message: Improved handling of not found exceptions Index: WebApplication.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/servletunit/WebApplication.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- WebApplication.java 24 Jul 2002 17:33:04 -0000 1.12 +++ WebApplication.java 5 Sep 2002 19:29:55 -0000 1.13 @@ -499,7 +499,7 @@ public Servlet getServlet() throws ServletException { - if (getConfiguration() == null) throw new HttpNotFoundException( _url ); + if (getConfiguration() == null) throw new HttpNotFoundException( "No servlet mapping defined", _url ); try { return getConfiguration().getServlet(); @@ -617,7 +617,7 @@ ServletRequest get( URL url ) { String file = url.getFile(); - if (!file.startsWith( _contextPath )) throw new HttpNotFoundException( url ); + if (!file.startsWith( _contextPath )) throw new HttpNotFoundException( "File path does not begin with '" + _contextPath + "'", url ); String servletName = getServletName( file.substring( _contextPath.length() ) ); |
From: Russell G. <rus...@us...> - 2002-09-05 19:10:47
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript In directory usw-pr-cvs1:/tmp/cvs-serv401/test/com/meterware/httpunit/javascript Modified Files: FormScriptingTest.java ScriptingTest.java Log Message: Add support for Javascript arrays with named indices Index: FormScriptingTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/FormScriptingTest.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- FormScriptingTest.java 5 Sep 2002 14:46:56 -0000 1.8 +++ FormScriptingTest.java 5 Sep 2002 19:10:44 -0000 1.9 @@ -58,7 +58,7 @@ "function listElements( form ) {\n" + " elements = form.elements;\n" + " alert( 'form has ' + elements.length + ' elements' );\n" + - " alert( 'value is ' + elements[0].value );\n" + + " alert( 'value is ' + elements['first'].value );\n" + " alert( 'index is ' + elements[1].selectedIndex );\n" + " elements[2].checked=true;\n" + "}" + @@ -140,6 +140,7 @@ "<form name=spectrum action='DoIt'>" + " <input type=text name=color value=green>" + " <input type=submit name=change value=color>" + + " <input type=submit name=keep value=nothing>" + "</form>" + "<a href='#' onClick='document.spectrum.submit(); return false;'>" + "</body></html>" ); Index: ScriptingTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/ScriptingTest.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- ScriptingTest.java 5 Sep 2002 14:46:56 -0000 1.20 +++ ScriptingTest.java 5 Sep 2002 19:10:44 -0000 1.21 @@ -210,6 +210,7 @@ "function viewForms() { " + " alert( \"found \" + document.forms.length + \" form(s)\" );" + " alert( getFound( document.realform ) + \"form 'realform'\" );" + + " alert( getFound( document.forms[\"realform\"] ) + \"form 'forms[\'realform\']'\" );" + " alert( getFound( document.noform ) + \"form 'noform'\" ); }" + "</script></head>" + "<body onLoad='viewForms()'>" + @@ -219,6 +220,7 @@ WebResponse response = wc.getResponse( getHostPath() + "/OnCommand.html" ); assertEquals( "Alert message", "found 1 form(s)", wc.popNextAlert() ); assertEquals( "Alert message", "found form 'realform'", wc.popNextAlert() ); + assertEquals( "Alert message", "found form 'forms[\'realform\']'", wc.popNextAlert() ); assertEquals( "Alert message", "did not find form 'noform'", wc.popNextAlert() ); assertNull( "Alert should have been removed", wc.getNextAlert() ); } @@ -232,6 +234,7 @@ "function viewLinks() { " + " alert( \"found \" + document.links.length + \" link(s)\" );" + " alert( getFound( document.reallink ) + \"link 'reallink'\" );" + + " alert( getFound( document.links[\"reallink\"] ) + \"link 'links[reallink]'\" );" + " alert( getFound( document.nolink ) + \"link 'nolink'\" );" + "}" + "</script></head>" + @@ -243,6 +246,7 @@ WebResponse response = wc.getResponse( getHostPath() + "/OnCommand.html" ); assertEquals( "Alert message", "found 2 link(s)", wc.popNextAlert() ); assertEquals( "Alert message", "found link 'reallink'", wc.popNextAlert() ); + assertEquals( "Alert message", "found link 'links[reallink]'", wc.popNextAlert() ); assertEquals( "Alert message", "did not find link 'nolink'", wc.popNextAlert() ); assertNull( "Alert should have been removed", wc.getNextAlert() ); } @@ -349,6 +353,7 @@ "function viewImages() { \n" + " alert( \"found \" + document.images.length + \" images(s)\" );\n" + " alert( getFound( document.realimage ) + \"image 'realimage'\" )\n;" + + " alert( getFound( document.images['realimage'] ) + \"image 'images[realimage]'\" )\n;" + " alert( getFound( document.noimage ) + \"image 'noimage'\" );\n" + " alert( '2nd image is ' + document.images[1].src ); }\n" + "</script></head>\n" + @@ -360,6 +365,7 @@ WebResponse response = wc.getResponse( getHostPath() + "/OnCommand.html" ); assertEquals( "Alert message", "found 2 images(s)", wc.popNextAlert() ); assertEquals( "Alert message", "found image 'realimage'", wc.popNextAlert() ); + assertEquals( "Alert message", "found image 'images[realimage]'", wc.popNextAlert() ); assertEquals( "Alert message", "did not find image 'noimage'", wc.popNextAlert() ); assertEquals( "Alert message", "2nd image is pict2.gif", wc.popNextAlert() ); assertNull( "Alert should have been removed", wc.getNextAlert() ); |
From: Russell G. <rus...@us...> - 2002-09-05 19:10:47
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/pseudoserver In directory usw-pr-cvs1:/tmp/cvs-serv401/test/com/meterware/pseudoserver Modified Files: PseudoServerTest.java Log Message: Add support for Javascript arrays with named indices Index: PseudoServerTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/pseudoserver/PseudoServerTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- PseudoServerTest.java 5 Sep 2002 14:46:56 -0000 1.3 +++ PseudoServerTest.java 5 Sep 2002 19:10:44 -0000 1.4 @@ -56,7 +56,6 @@ try { WebResponse response = wc.getResponse( "http://no.such.host" ); } catch (HttpNotFoundException e) { - e.printStackTrace(); } } |
From: Russell G. <rus...@us...> - 2002-09-05 19:10:47
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/javascript In directory usw-pr-cvs1:/tmp/cvs-serv401/src/com/meterware/httpunit/javascript Modified Files: JavaScript.java Log Message: Add support for Javascript arrays with named indices Index: JavaScript.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/javascript/JavaScript.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- JavaScript.java 30 Aug 2002 15:20:09 -0000 1.18 +++ JavaScript.java 5 Sep 2002 19:10:44 -0000 1.19 @@ -29,6 +29,7 @@ import com.meterware.httpunit.scripting.ScriptableDelegate; import com.meterware.httpunit.scripting.SelectionOption; import com.meterware.httpunit.scripting.SelectionOptions; +import com.meterware.httpunit.scripting.NamedDelegate; import java.lang.reflect.InvocationTargetException; import java.util.Arrays; @@ -73,6 +74,7 @@ ScriptableObject.defineClass( scope, Image.class ); ScriptableObject.defineClass( scope, Options.class ); ScriptableObject.defineClass( scope, Option.class ); + ScriptableObject.defineClass( scope, ElementArray.class ); } @@ -128,6 +130,11 @@ } + String getName() { + return _scriptable instanceof NamedDelegate ? ((NamedDelegate) _scriptable).getName() : ""; + } + + public boolean has( String propertyName, Scriptable scriptable ) { return super.has( propertyName, scriptable ) || (_scriptable != null && _scriptable.get( propertyName ) != null); @@ -266,9 +273,9 @@ static public class Document extends JavaScriptEngine { - private Scriptable _forms; - private Scriptable _links; - private Scriptable _images; + private ElementArray _forms; + private ElementArray _links; + private ElementArray _images; public String getClassName() { @@ -311,7 +318,8 @@ for (int i = 0; i < images.length; i++) { images[ i ] = (Image) toScriptable( scriptables[ i ] ); } - _images = Context.getCurrentContext().newArray( this, images ); + _images = (ElementArray) Context.getCurrentContext().newObject( this, "ElementArray" ); + _images.initialize( images ); } @@ -321,7 +329,8 @@ for (int i = 0; i < links.length; i++) { links[ i ] = (Link) toScriptable( scriptables[ i ] ); } - _links = Context.getCurrentContext().newArray( this, links ); + _links = (ElementArray) Context.getCurrentContext().newObject( this, "ElementArray" ); + _links.initialize( links ); } @@ -331,7 +340,8 @@ for (int i = 0; i < forms.length; i++) { forms[ i ] = (Form) toScriptable( scriptables[ i ] ); } - _forms = Context.getCurrentContext().newArray( this, forms ); + _forms = (ElementArray) Context.getCurrentContext().newObject( this, "ElementArray" ); + _forms.initialize( forms ); } @@ -363,6 +373,49 @@ } + static public class ElementArray extends ScriptableObject { + + private JavaScriptEngine _contents[] = new HTMLElement[0]; + + + public ElementArray() { + } + + + void initialize( JavaScriptEngine[] contents ) { + _contents = contents; + } + + + public int jsGet_length() { + return _contents.length; + } + + + public String getClassName() { + return "ElementArray"; + } + + + public Object get( int i, Scriptable scriptable ) { + if (i >= 0 && i < _contents.length) { + return _contents[i]; + } else { + return super.get( i, scriptable ); + } + } + + + public Object get( String name, Scriptable scriptable ) { + for (int i = 0; i < _contents.length; i++) { + JavaScriptEngine content = _contents[ i ]; + if (name.equalsIgnoreCase( content.getName() )) return content; + } + return super.get( name, scriptable ); + } + } + + abstract static public class HTMLElement extends JavaScriptEngine { private Document _document; @@ -405,7 +458,7 @@ static public class Form extends HTMLElement { - private Scriptable _controls; + private ElementArray _controls; public String getClassName() { return "Form"; @@ -458,7 +511,8 @@ for (int i = 0; i < controls.length; i++) { controls[ i ] = (Control) toScriptable( scriptables[ i ] ); } - _controls = Context.getCurrentContext().newArray( this, controls ); + _controls = (ElementArray) Context.getCurrentContext().newObject( this, "ElementArray" ); + _controls.initialize( controls ); } |
From: Russell G. <rus...@us...> - 2002-09-05 19:10:47
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit In directory usw-pr-cvs1:/tmp/cvs-serv401/src/com/meterware/httpunit Modified Files: FormControl.java WebForm.java WebImage.java WebLink.java Log Message: Add support for Javascript arrays with named indices Index: FormControl.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/FormControl.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- FormControl.java 5 Sep 2002 14:46:55 -0000 1.22 +++ FormControl.java 5 Sep 2002 19:10:43 -0000 1.23 @@ -22,6 +22,7 @@ import com.meterware.httpunit.scripting.SelectionOptions; import com.meterware.httpunit.scripting.SelectionOption; import com.meterware.httpunit.scripting.ScriptableDelegate; +import com.meterware.httpunit.scripting.NamedDelegate; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; @@ -301,11 +302,16 @@ } - class Scriptable extends ScriptableDelegate { + class Scriptable extends ScriptableDelegate implements NamedDelegate { + + public String getName() { + return FormControl.this.getName(); + } + public Object get( String propertyName ) { if (propertyName.equalsIgnoreCase( "name" )) { - return getName(); + return FormControl.this.getName(); } else { return super.get( propertyName ); } Index: WebForm.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebForm.java,v retrieving revision 1.62 retrieving revision 1.63 diff -u -r1.62 -r1.63 --- WebForm.java 5 Sep 2002 14:46:55 -0000 1.62 +++ WebForm.java 5 Sep 2002 19:10:44 -0000 1.63 @@ -20,6 +20,7 @@ * *******************************************************************************************************************/ import com.meterware.httpunit.scripting.ScriptableDelegate; +import com.meterware.httpunit.scripting.NamedDelegate; import java.io.IOException; import java.net.URL; @@ -482,7 +483,7 @@ } - public class Scriptable extends ScriptableDelegate { + public class Scriptable extends ScriptableDelegate implements NamedDelegate { public String getAction() { return WebForm.this.getAction(); } public void setAction( String newAction ) { setDestination( newAction ); } @@ -494,6 +495,11 @@ public void reset() throws IOException, SAXException { resetControls(); + } + + + public String getName() { + return WebForm.this.getName(); } Index: WebImage.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebImage.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- WebImage.java 29 Aug 2002 15:32:44 -0000 1.5 +++ WebImage.java 5 Sep 2002 19:10:44 -0000 1.6 @@ -20,6 +20,7 @@ * *******************************************************************************************************************/ import com.meterware.httpunit.scripting.ScriptableDelegate; +import com.meterware.httpunit.scripting.NamedDelegate; import java.net.URL; @@ -87,7 +88,12 @@ } - public class Scriptable extends ScriptableDelegate { + public class Scriptable extends ScriptableDelegate implements NamedDelegate { + + public String getName() { + return WebImage.this.getName(); + } + public Object get( String propertyName ) { if (propertyName.equalsIgnoreCase( "src" )) { Index: WebLink.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebLink.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- WebLink.java 29 Aug 2002 15:32:44 -0000 1.26 +++ WebLink.java 5 Sep 2002 19:10:44 -0000 1.27 @@ -20,6 +20,7 @@ * *******************************************************************************************************************/ import com.meterware.httpunit.scripting.ScriptableDelegate; +import com.meterware.httpunit.scripting.NamedDelegate; import java.io.IOException; import java.net.MalformedURLException; @@ -88,7 +89,12 @@ } - public class Scriptable extends ScriptableDelegate { + public class Scriptable extends ScriptableDelegate implements NamedDelegate { + + public String getName() { + return WebLink.this.getName(); + } + public Object get( String propertyName ) { if (propertyName.equalsIgnoreCase( "href" )) { |
From: Russell G. <rus...@us...> - 2002-09-05 19:10:47
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/scripting In directory usw-pr-cvs1:/tmp/cvs-serv401/src/com/meterware/httpunit/scripting Added Files: NamedDelegate.java Log Message: Add support for Javascript arrays with named indices ***** Error reading new file[Errno 2] No such file or directory: 'NamedDelegate.java' |
From: Russell G. <rus...@us...> - 2002-09-05 19:10:46
|
Update of /cvsroot/httpunit/httpunit/doc In directory usw-pr-cvs1:/tmp/cvs-serv401/doc Modified Files: release_notes.txt Log Message: Add support for Javascript arrays with named indices Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.155 retrieving revision 1.156 diff -u -r1.155 -r1.156 --- release_notes.txt 5 Sep 2002 14:46:55 -0000 1.155 +++ release_notes.txt 5 Sep 2002 19:10:43 -0000 1.156 @@ -18,6 +18,9 @@ than UnusedParameterValueException. 2. Obtaining the URL from a javascript: request no longer throws MalformedURLException. +Additions: + 1. The forms, images, links, and Form.elements arrays now handle string indexes + 30-Aug-2002 1.4.5 Acknowledgements: Thanks to Steve Heath for an example on how to make JSPs work with ServletUnit. |
From: Russell G. <rus...@us...> - 2002-09-05 14:46:59
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit In directory usw-pr-cvs1:/tmp/cvs-serv29932/test/com/meterware/httpunit Modified Files: FormParametersTest.java FormSubmitTest.java Log Message: Minor bug fixes Index: FormParametersTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/FormParametersTest.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- FormParametersTest.java 30 Aug 2002 18:19:13 -0000 1.13 +++ FormParametersTest.java 5 Sep 2002 14:46:56 -0000 1.14 @@ -148,7 +148,22 @@ assertEquals( "New hidden value", "new", form.getParameterValue( "secret" ) ); } - public void testMultipleTextParameterValidation() throws Exception { + + public void testUnknownParameter() throws Exception { + defineWebPage( "Default", "<form method=GET action = '/ask'>" + + "<Input type=submit></form>" ); + WebResponse page = _wc.getResponse( getHostPath() + "/Default.html" ); + WebRequest request = page.getForms()[0].getRequest(); + HttpUnitOptions.setParameterValuesValidated( true ); + try { + request.setParameter( "secret", "zork" ); + fail( "Should have rejected set of unknown parameter" ); + } catch (NoSuchParameterException e) { + } + } + + + public void testMultipleTextParameterValidation() throws Exception { defineWebPage( "Default", "<form method=GET action = \"/ask\">" + "<Input type=text name=color>" + "<Input type=password name=password>" + @@ -266,27 +281,27 @@ } -public void testFileParameterValue() throws Exception { - defineWebPage( "Default", "<form method=POST action='/ask'>" + - "<Input type=file name=File>" + - "<Input type=submit value=Upload></form>" ); - WebResponse page = _wc.getResponse( getHostPath() + "/Default.html" ); - WebForm form = page.getForms()[0]; - String[] values = form.getParameterValues( "File" ); - assertEquals( "Number of file parameter values", 1, values.length ); - assertEquals( "Default selected filename", "", values[0] ); - - final File file = new File( "dummy.txt" ); - form.setParameter( "File", new UploadFileSpec[] { new UploadFileSpec( file ) } ); - assertEquals( "Selected filename", file.getAbsolutePath(), form.getParameterValue( "File" ) ); - - WebRequest wr = form.getRequest(); - assertEquals( "File from validated request", file.getAbsolutePath(), wr.getParameterValues( "File" )[0] ); - - HttpUnitOptions.setParameterValuesValidated( false ); - wr = form.getRequest(); - assertEquals( "File from unvalidated request", file.getAbsolutePath(), wr.getParameterValues( "File" )[0] ); -} + public void testFileParameterValue() throws Exception { + defineWebPage( "Default", "<form method=POST action='/ask'>" + + "<Input type=file name=File>" + + "<Input type=submit value=Upload></form>" ); + WebResponse page = _wc.getResponse( getHostPath() + "/Default.html" ); + WebForm form = page.getForms()[0]; + String[] values = form.getParameterValues( "File" ); + assertEquals( "Number of file parameter values", 1, values.length ); + assertEquals( "Default selected filename", "", values[0] ); + + final File file = new File( "dummy.txt" ); + form.setParameter( "File", new UploadFileSpec[] { new UploadFileSpec( file ) } ); + assertEquals( "Selected filename", file.getAbsolutePath(), form.getParameterValue( "File" ) ); + + WebRequest wr = form.getRequest(); + assertEquals( "File from validated request", file.getAbsolutePath(), wr.getParameterValues( "File" )[0] ); + + HttpUnitOptions.setParameterValuesValidated( false ); + wr = form.getRequest(); + assertEquals( "File from unvalidated request", file.getAbsolutePath(), wr.getParameterValues( "File" )[0] ); + } //---------------------------------------------- private members ------------------------------------------------ Index: FormSubmitTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/FormSubmitTest.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- FormSubmitTest.java 29 Aug 2002 20:51:02 -0000 1.25 +++ FormSubmitTest.java 5 Sep 2002 14:46:56 -0000 1.26 @@ -471,6 +471,22 @@ } + public void testPostActionParametersAfterSetAction() throws Exception { + defineWebPage( "abc/form", "<form name=\"test\" method='POST' action='stop?ready=yes'>" + + " <input type=\"text\" name=\"aTextField\">" + + " <input type=\"submit\" name=\"apply\" value=\"Apply\">" + + "</form>" ); + + WebResponse wr = _wc.getResponse( getHostPath() + "/abc/form.html" ); + WebForm form = wr.getForms()[0]; + form.getScriptableObject().setAction( "go?size=3&time=now" ); + WebRequest req = form.getRequest( "apply" ); + req.setParameter( "aTextField", "test" ); + assertEquals( getHostPath() + "/abc/go?size=3&time=now", + req.getURL().toExternalForm() ); + } + + //---------------------------------------------- private members ------------------------------------------------ |
From: Russell G. <rus...@us...> - 2002-09-05 14:46:59
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/pseudoserver In directory usw-pr-cvs1:/tmp/cvs-serv29932/test/com/meterware/pseudoserver Modified Files: PseudoServerTest.java Log Message: Minor bug fixes Index: PseudoServerTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/pseudoserver/PseudoServerTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- PseudoServerTest.java 15 Aug 2002 00:06:32 -0000 1.2 +++ PseudoServerTest.java 5 Sep 2002 14:46:56 -0000 1.3 @@ -56,6 +56,7 @@ try { WebResponse response = wc.getResponse( "http://no.such.host" ); } catch (HttpNotFoundException e) { + e.printStackTrace(); } } |
From: Russell G. <rus...@us...> - 2002-09-05 14:46:59
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript In directory usw-pr-cvs1:/tmp/cvs-serv29932/test/com/meterware/httpunit/javascript Modified Files: FormScriptingTest.java ScriptingTest.java Log Message: Minor bug fixes Index: FormScriptingTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/FormScriptingTest.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- FormScriptingTest.java 27 Aug 2002 16:26:05 -0000 1.7 +++ FormScriptingTest.java 5 Sep 2002 14:46:56 -0000 1.8 @@ -151,6 +151,23 @@ } + public void testSubmitButtonlessFormViaScript() throws Exception { + defineResource( "DoIt?color=green", "You made it!" ); + defineResource( "OnCommand.html", "<html><head></head>" + + "<body>" + + "<form name=spectrum action='DoIt'>" + + " <input type=text name=color value=green>" + + "</form>" + + "<a href='#' onClick='document.spectrum.submit(); return false;'>" + + "</body></html>" ); + WebConversation wc = new WebConversation(); + WebResponse response = wc.getResponse( getHostPath() + "/OnCommand.html" ); + + response.getLinks()[ 0 ].click(); + assertEquals( "Result of submit", "You made it!", wc.getCurrentPage().getText() ); + } + + public void testSubmitViaScriptButton() throws Exception { defineResource( "DoIt?color=green", "You made it!" ); defineResource( "OnCommand.html", "<html><head></head>" + Index: ScriptingTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/ScriptingTest.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- ScriptingTest.java 30 Aug 2002 18:17:48 -0000 1.19 +++ ScriptingTest.java 5 Sep 2002 14:46:56 -0000 1.20 @@ -74,7 +74,9 @@ public void testInitialJavaScriptURL() throws Exception { WebConversation wc = new WebConversation(); - WebResponse response = wc.getResponse( "javascript:alert( 'Hi there!' )" ); + GetMethodWebRequest request = new GetMethodWebRequest( "javascript:alert( 'Hi there!' )" ); + assertEquals( "Javascript URL", "javascript:alert( 'Hi there!' )", request.getURL().toExternalForm() ); + WebResponse response = wc.getResponse( request ); assertEquals( "Alert message", "Hi there!", wc.popNextAlert() ); } |
From: Russell G. <rus...@us...> - 2002-09-05 14:46:58
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit In directory usw-pr-cvs1:/tmp/cvs-serv29932/src/com/meterware/httpunit Modified Files: FormControl.java WebClient.java WebForm.java WebRequest.java Log Message: Minor bug fixes Index: FormControl.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/FormControl.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- FormControl.java 27 Aug 2002 16:26:03 -0000 1.21 +++ FormControl.java 5 Sep 2002 14:46:55 -0000 1.22 @@ -265,7 +265,7 @@ return new TextAreaFormControl( node ); } else if (node.getNodeName().equals( "select" )) { return new SelectionFormControl( node ); - } else if (node.getNodeName().equals( "button" )) { + } else if (node.getNodeName().equalsIgnoreCase( "button" )) { final String type = NodeUtils.getNodeAttribute( node, "type", "submit" ); if (type.equalsIgnoreCase( "submit" )) { return new SubmitButton( form, node ); Index: WebClient.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebClient.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- WebClient.java 30 Aug 2002 15:20:09 -0000 1.29 +++ WebClient.java 5 Sep 2002 14:46:55 -0000 1.30 @@ -105,8 +105,7 @@ : wrs.getScriptableDelegate().evaluateURL( urlString ); if (result == null) return null; - URL url = new URL( "javascript", null, -1, urlString.substring( "javascript:".length() ), JAVASCRIPT_STREAM_HANDLER ); - return new DefaultWebResponse( this, request.getTarget(), url, result ); + return new DefaultWebResponse( this, request.getTarget(), request.getURL(), result ); } } @@ -424,8 +423,6 @@ private DialogResponder _dialogResponder = new DialogAdapter(); - private static URLStreamHandler JAVASCRIPT_STREAM_HANDLER = new JavascriptURLStreamHandler(); - /** * Examines the headers in the response and throws an exception if appropriate. @@ -537,18 +534,6 @@ } } - - - -//================================================================================================== - - -class JavascriptURLStreamHandler extends URLStreamHandler { - - protected URLConnection openConnection( URL u ) throws IOException { - return null; - } -} Index: WebForm.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebForm.java,v retrieving revision 1.61 retrieving revision 1.62 diff -u -r1.61 -r1.62 --- WebForm.java 27 Aug 2002 16:26:04 -0000 1.61 +++ WebForm.java 5 Sep 2002 14:46:55 -0000 1.62 @@ -477,7 +477,7 @@ public void setParameter( String name, final String[] values ) { FormParameter parameter = getParameter( name ); - if (parameter == null) throw new NoSuchParameterException( name ); + if (parameter == UNKNOWN_PARAMETER) throw new NoSuchParameterException( name ); parameter.setValues( values ); } Index: WebRequest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebRequest.java,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- WebRequest.java 29 Aug 2002 20:51:02 -0000 1.46 +++ WebRequest.java 5 Sep 2002 14:46:55 -0000 1.47 @@ -34,6 +34,7 @@ import java.net.URL; import java.net.URLConnection; import java.net.URLEncoder; +import java.net.URLStreamHandler; import java.util.Dictionary; import java.util.Enumeration; @@ -48,6 +49,8 @@ **/ abstract public class WebRequest { + + private static URLStreamHandler JAVASCRIPT_STREAM_HANDLER = new JavascriptURLStreamHandler(); private SubmitButton _button; /** @@ -85,7 +88,11 @@ * Creates a new URL, handling the case where the relative URL begins with a '?' */ private URL newURL( final URL base, final String spec ) throws MalformedURLException { - return spec.startsWith( "?" ) ? new URL( base + spec ) : new URL( base, spec ); + if (spec.toLowerCase().startsWith( "javascript:" )) { + return new URL( "javascript", null, -1, spec.substring( "javascript:".length() ), JAVASCRIPT_STREAM_HANDLER ); + } else { + return spec.startsWith( "?" ) ? new URL( base + spec ) : new URL( base, spec ); + } } @@ -595,6 +602,20 @@ } } +} + + + + + +//======================================== class JavaScriptURLStreamHandler ============================================ + + +class JavascriptURLStreamHandler extends URLStreamHandler { + + protected URLConnection openConnection( URL u ) throws IOException { + return null; + } } |
From: Russell G. <rus...@us...> - 2002-09-05 14:46:58
|
Update of /cvsroot/httpunit/httpunit/doc In directory usw-pr-cvs1:/tmp/cvs-serv29932/doc Modified Files: faq.html release_notes.txt Log Message: Minor bug fixes Index: faq.html =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/faq.html,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- faq.html 30 Aug 2002 18:32:14 -0000 1.16 +++ faq.html 5 Sep 2002 14:46:55 -0000 1.17 @@ -16,6 +16,7 @@ <LI><A HREF="#reload">Why do I get java.lang.IllegalAccessError when calling getResponse()?</A></LI> <LI><A HREF="#badPost">Why doesn't my servlet see parameters on a POST request?</A></LI> <LI><A HREF="#hidden">Why can't I change hidden parameters?</A></LI> +<LI><A HREF="#badType">The server is not sending a valid content type. How do I test HTML pages anyway?</A></LI> </OL> @@ -99,6 +100,13 @@ the underlying value in the form. This will behave the way JavaScript does - resetting the form will now restore this value, rather than the original one. </ul> + +<A name="#badType"><h2>The server is not sending a valid content type. How do I test HTML pages anyway?</h2></A> +By default, HttpUnit assumes a content type of "text/plain" unless the server sends the Content-Type header to override +it, as most servers do. If yours is not, you can +call<blockquote><code>HttpUnitOptions.setDefaultContentType( "text/html" );</code></blockquote>before running your tests. +If you are using JUnit, call this method in your <code>setUp()</code> method. + </BODY></HTML> Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.154 retrieving revision 1.155 diff -u -r1.154 -r1.155 --- release_notes.txt 30 Aug 2002 18:19:38 -0000 1.154 +++ release_notes.txt 5 Sep 2002 14:46:55 -0000 1.155 @@ -11,6 +11,13 @@ Revision History: + 5-Sep-2002 + +Problems fixed: + 1. An attempt to set a non-existent parameter now correctly throws NoSuchParameterException rather + than UnusedParameterValueException. + 2. Obtaining the URL from a javascript: request no longer throws MalformedURLException. + 30-Aug-2002 1.4.5 Acknowledgements: Thanks to Steve Heath for an example on how to make JSPs work with ServletUnit. |
From: Russell G. <rus...@us...> - 2002-08-30 21:29:39
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/servletunit In directory usw-pr-cvs1:/tmp/cvs-serv3312/src/com/meterware/servletunit Modified Files: JUnitServlet.java Log Message: Accomodate changes to JUnit 3.8 Index: JUnitServlet.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/servletunit/JUnitServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- JUnitServlet.java 3 Dec 2001 19:14:59 -0000 1.1 +++ JUnitServlet.java 30 Aug 2002 21:29:36 -0000 1.2 @@ -115,6 +115,18 @@ } + public void testStarted( String s ) { + } + + + public void testEnded( String s ) { + } + + + public void testFailed( int i, Test test, Throwable throwable ) { + } + + /** * Always use the StandardTestSuiteLoader. Overridden from * BaseTestRunner. |
From: Russell G. <rus...@us...> - 2002-08-30 21:29:39
|
Update of /cvsroot/httpunit/httpunit/jars In directory usw-pr-cvs1:/tmp/cvs-serv3312/jars Modified Files: jars.txt junit.jar Log Message: Accomodate changes to JUnit 3.8 Index: jars.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/jars/jars.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- jars.txt 26 Jun 2002 15:48:56 -0000 1.4 +++ jars.txt 30 Aug 2002 21:29:36 -0000 1.5 @@ -1,7 +1,7 @@ Jars used: (runtime) -junit 3.7 +junit 3.8 servlet 2.3 xerces 1.2.3 jtidy 04aug2000r7 Index: junit.jar =================================================================== RCS file: /cvsroot/httpunit/httpunit/jars/junit.jar,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 Binary files /tmp/cvsBpytGF and /tmp/cvsMK7sna differ |
From: Russell G. <rus...@us...> - 2002-08-30 18:32:17
|
Update of /cvsroot/httpunit/httpunit/doc In directory usw-pr-cvs1:/tmp/cvs-serv10767/doc Modified Files: faq.html Log Message: Prepare for 1.4.5 release Index: faq.html =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/faq.html,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- faq.html 15 Aug 2002 00:06:31 -0000 1.15 +++ faq.html 30 Aug 2002 18:32:14 -0000 1.16 @@ -32,7 +32,7 @@ <A NAME="javascript"><H2>How do I use HttpUnit to test my pages that use JavaScript?</H2></A> You should not have to do anything special; however, not all JavaScript constructs are supported as yet. See -<a href="javascript-support.html">the list of supported JavaScript features</a> for more information. +<a href="Javascript-support.html">the list of supported JavaScript features</a> for more information. <A NAME="#norhino"><H2>JavaScript is not being executed at all. Why not?</H2></A> If you do not have the Rhino JAR (js.jar) in your classpath, JavaScript features do not work. |
From: Russell G. <rus...@us...> - 2002-08-30 18:27:03
|
Update of /cvsroot/httpunit/httpunit In directory usw-pr-cvs1:/tmp/cvs-serv9262 Modified Files: build.xml Log Message: Prepare for 1.4.5 release Index: build.xml =================================================================== RCS file: /cvsroot/httpunit/httpunit/build.xml,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- build.xml 6 Aug 2002 21:42:08 -0000 1.45 +++ build.xml 30 Aug 2002 18:27:00 -0000 1.46 @@ -5,7 +5,7 @@ <project name="httpunit" default="jar" basedir="."> <property name="name" value="httpunit" /> <property name="Name" value="HttpUnit" /> - <property name="version" value="1.4.1" /> + <property name="version" value="1.4.5" /> <property name="debug" value="on" /> <property name="deprecation" value="off" /> |
From: Russell G. <rus...@us...> - 2002-08-30 18:19:40
|
Update of /cvsroot/httpunit/httpunit/doc In directory usw-pr-cvs1:/tmp/cvs-serv5883/doc Modified Files: Javascript-support.html release_notes.txt todo.txt Log Message: Prepare for 1.4.5 release Index: Javascript-support.html =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/Javascript-support.html,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- Javascript-support.html 27 Aug 2002 16:26:02 -0000 1.13 +++ Javascript-support.html 30 Aug 2002 18:19:38 -0000 1.14 @@ -4,8 +4,7 @@ <p> JavaScript support is very basic at present. The near-term goal is full JavaScript 1.1 support. Currently, we do not plan to support browser-specific JavaScript. Please let us know via the mailing list your priorities for missing features. -Inline deferred scripts (which define functions) are supported, -as are the following DOM elements: +Inline and included scripts are supported, as are the following DOM elements: <h3>Window</h3> <h4>properties</h4> @@ -13,6 +12,7 @@ <li>document - the associated Document object</li> <li>self - the Window itself</li> <li>window - a synonym for self</li> +<li>location - r/w full URL only</li> </ul> <h4>events</h4> <ul> @@ -21,7 +21,8 @@ <h4>methods</h4> <ul> <li>alert() - queues up an alert message, accessible via WebResponse.getNextAlert() or popNextAlert()</li> -<li>confirm() - invokes a callback supplied via WebClient.setDialogResponder to return the user's response</li> +<li>confirm() - invokes a callback supplied via WebClient.setDialogResponder to return the user's response. By default, + the callback returns true. Users may change this by supplying an implementation of DialogResponder.</li> <li>prompt() - invokes a callback supplied via WebClient.setDialogResponder to return the user's response</li> </ul> @@ -32,6 +33,7 @@ <li>images - an array of Image objects</li> <li>links - an array of Link objects</li> <li>title - readonly. The title of the page</li> +<li>location - a synonym for window.location</li> <li><name> - the name of a form, image, or link</li> </ul> Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.153 retrieving revision 1.154 diff -u -r1.153 -r1.154 --- release_notes.txt 30 Aug 2002 15:20:07 -0000 1.153 +++ release_notes.txt 30 Aug 2002 18:19:38 -0000 1.154 @@ -11,198 +11,80 @@ Revision History: -30-Aug-2002 -Additions: - 1. Added support for included scripts using <script src=...> - -29-Aug-2002 -Acknowledgements: - Thanks to Geert Bevin for implementing ServletUnit support for HttpServletRequest.getParameterMap - -Additions: - 1. ServletUnit now supports HttpServletRequest.getParameterMap - 2. WebImage now supports getRequest() to return a request for retrieving the image - -Problems fixed: - 1. Submitting a request created with parameter validation disabled would send disabled parameters as well as enabled ones. - 2. WebRequest.getRequestParameterNames now returns only the names of the parameters that will be submitted with the request. - -27-Aug-2002 -Additions: - 1. Reset buttons may now be clicked to reset the form - 2. WebForm supports getButtonWithID - 3. JavaScript: Form now supports reset() and onReset event. - -23-Aug-2002 -Additions: - 1. javascript URLs are now supported. - -22-Aug-2002 - +30-Aug-2002 1.4.5 Acknowledgements: + Thanks to Steve Heath for an example on how to make JSPs work with ServletUnit. + Thanks to Rajan Narasimhan for fixing the relative URL computation problem. + Thanks to Sebastien Rosset for pointing out the case sensitivity problem with WebResponse.isHTML + Thanks to Hans-Joerg Hessmann for a faster algorithm for the table lookups + Thanks to Peter Royal for fixing the handling of query-only relative URLs and the IllegalStateException when + scripting is disabled. Thanks to Michael Reardon for implementing the ServletUnit header method handling code and session.getAttributeNames Thanks to Geert Bevin for finding and fixing the ServletUnit POST parameters bug. + Thanks to Geert Bevin for implementing ServletUnit support for HttpServletRequest.getParameterMap -Additions: - 1. ServletUnit now supports HttpServletResponse header methods: setHeader, addHeader, setIntHeader, addIntHeader, - setDateHeader, and addDateHeader. - 2. ServletUnit now supports HttpSession.getAttributeNames. - 3. WebImage now supports a read-only 'altText' property. - 4. WebResponse and TableCell now support getImageWithAltText to find an image with a specified value in its 'alt' attribute. - -Problems fixed: - 1. ServletUnit was not recognizing form parameters on a POST request which contained a query string in the URL. - -21-Aug-2002 - -Additions: - 1. JavaScript - Window.confirm is now supported. By default, it always returns true. Users may change this by supplying an - implementation of DialogResponder to the WebClient. - 2. JavScript - Window.prompt is now supported. By default, it always returns the default value. Users may change this by supplying an - implementation of DialogResponder to the WebClient. - -20-Aug-2002 - -Problems fixed: - 1. JavaScript - HTML comments prevented JavaScript from working - 2. JavaScript - Errors were reported if Rhino was not present in the classpath - 3. Fixed handling of error statuses when information is still sent on input stream - -Additions: - 1. JavaScript - Added Checkbox.value property, along with Checkbox.defaultChecked and Input.name - 2. JavaScript - Added Radio.value, Radio.checked, and Radio.defaultChecked properties - 3. JavaScript - Added Radio.onClick event support - -19-Aug-2002 - -Additions: - 1. WebForm.getButtons() now returns all form buttons, including reset buttons and generic buttons. - 2. JavaScript: The "onClick" event is now supported for generic form buttons - 3. JavaScript: Form.submit() is now working - - -16-Aug-2002 -Acknowledgements: - Thanks to PeterRoyal for fixing the handling of query-only relative URLs and the IllegalStateException when - scripting is disable. - -Problems fixes: - 1. Relative URLs beginning with "?" were not being handled properly. - 2. Disabling scripting result in IllegalStateException being thrown. - -Additions: - 1. JavaScript: The select() method is now defined as a no-op for controls - 2. JavaScript: Form.elements is now defined - -14-Aug-2002 -Additions: - 1. The focus() method is now defined as a no-op for all controls - -Problems fixed: - 1. Embedded spaces in URLs are now encoded when a request is made - -13-Aug-2002 -Additions: - 1. The onChange event now works for Select controls, Text controls, and TextArea controls. - - 9-Aug-2002 -Additions: - 1. The SubmitButton class now supports a click() method to submit the form using that button. - - 8-Aug-2002 -Changes: - 1. The class com.meterware.httpunit.ScriptableObject has been renamed as com.meterware.httpunit.scripting.ScriptableDelegate - -Additions: - 1. The Option object now supports a constructor and writing to the text property - - 7-Aug-2002 -Additions: - 1. JavaScript: the Select control now supports the length, options, and selectedIndex properties - 2. JavaScript: the Option object now supports the index, defaultSelected, selected (r/w), value (r/w) and - text (read-only) properties - - 6-Aug-2002 -Acknowledgements: - Thanks to Hans-Joerg Hessmann for a faster algorithm for the table lookups - -Problems fixed: - 1. Table lookups should be faster, especially for complex and large tables - -Additions: - 1. JavaScript: the link.onClick event is now supported - 2. JavaScript: the form.onSubmit event is now supported - 3. JavaScript: the form.action property is read-write - - 5-Aug-2002 -Additions: - 1. The JavaScript link.href attribute is now readable. - 2. JavaScript: document.images and document.<image-name> are now supported - 3. JavaScript: The image.src property is read-write - 4. WebResponse now has a getImageWithName method - 5. JavaScript execution is now automatic. It may be enabled or disable via HttpUnitOptions - 6. JavaScript: the checkbox.clicked property is read-write - -Problems fixed: - A form request created after a call to getScriptableObject().setAction() now correctly uses the new action. - - 2-Aug-2002 -Additions: - 1. Added JavaScript support for document.links and document.<link name> and the link 'onMouseOver' event. - 2. You may now call link.mouseOver() to trigger the 'onMouseOver' event. - - 1-Aug-2002 -Additions: - 1. You may now follow a link by calling link.click() rather than client.getResponse( link.getRequest() ). - 2. You may now submit a form by calling form.submit() rather than client.getResponse( form.getRequest() ). In this - case you must set any parameters directly into the form. - 3. You may now obtain the current page from a web client by calling client.getCurrentPage() rather than - client.getFrameContents( "_top" ); - 4. Added JavaScript support for form.<text field>.value - -29-Jul-2002 -Acknowledgements: - Thanks to Sebastien Rosset for pointing out the case sensitivity problem with WebResponse.isHTML - -Problems fixed: - 1. WebResponses are now recognized as HTML even if the content type is not lower case. - -Acknowledgements: - Thanks to Rajan Narasimhan for fixing the relative URL computation problem. - -25-Jul-2002 -Problems fixed: - 1. Relative URLs were not being computed properly when the base URL had a query string containing a slash. - -24-Jul-2002 -Additions: - 1. PseudoServer and associated classes are now publically available and in their own package, pseudoserver. - 2. Experimental JavaScript is starting to be added: support is present for the following DOM objects: - Window properties: self, window, document methods: alert, events: onLoad - Document properties: title, forms, <form name> - -15-Jul-2002 Problems fixed: 1. The "_parent" frame target should now be handled correctly. + 2. Relative URLs were not being computed properly when the base URL had a query string containing a slash. + 3. WebResponses are now recognized as HTML even if the content type is not lower case. + 4. A form request created after a call to getScriptableObject().setAction() now correctly uses the new action. + 5. Table lookups should be faster, especially for complex and large tables + 6. Embedded spaces in URLs are now encoded when a request is made + 7. Relative URLs beginning with "?" were not being handled properly. + 8. Disabling scripting result in IllegalStateException being thrown. + 9. Fixed handling of error statuses when information is still sent on input stream + 10. ServletUnit was not recognizing form parameters on a POST request which contained a query string in the URL. + 11. Submitting a request created with parameter validation disabled would send disabled parameters as well as enabled ones. + 12. WebRequest.getRequestParameterNames now returns only the names of the parameters that will be submitted with the request. + +Additions: + Content and parsing enhancements: + 1. The HttpUnitOption property 'acceptCookies' now controls whether cookies received from the server will be saved + in a web client and sent on subsequent requests. The default is true. + 2. WebResponse and WebCell now support a new method, getImages, which returns an array of objects representing the + image tags found. + 3. WebResponse now has a getImageWithName method + 4. WebForm.getButtons() now returns all form buttons, including reset buttons and generic buttons. + 5. WebResponse and TableCell now support getImageWithAltText to find an image with a specified value in its 'alt' attribute. + 6. WebForm supports getButtonWithID + + Web navigation enhancements: + 7. You may now follow a link by calling link.click() rather than client.getResponse( link.getRequest() ). + 8. You may now submit a form by calling form.submit() rather than client.getResponse( form.getRequest() ). In this + case you must set any parameters directly into the form. + 9. You may now obtain the current page from a web client by calling client.getCurrentPage() rather than + client.getFrameContents( "_top" ); + 10. The SubmitButton class now supports a click() method to submit the form using that button. + 11. Reset buttons may now be clicked to reset the form + + ServletUnit enhancements: + 12. ServletContext.getRealPath is now supported. + 13. ServletUnit now supports JSPs. The JSP engine must be in the class path and identified by the + HttpUnitOptions.scriptEngineClassName property (the default is Jasper). JSPs are expected to be in the current + working directory unless a web.xml file is specified, in which case JSPs will be searched for in the application + context directory. + 14. HttpServletResponse header methods: setHeader, addHeader, setIntHeader, addIntHeader, + setDateHeader, and addDateHeader are now supported. + 15. HttpSession.getAttributeNames is now supported. + 16. HttpServletRequest.getParameterMap is now supported. + + Scripting enhancements: + 17. Much of JavaScript 1.1 is now supported. See <http://www.httpunit.org/doc/Javascript-support.html> for + details. + 18. javascript: URLs are now supported. + 19. WebLink.mouseOver() will trigger the associated 'onMouseOver' event, if defined + 20. The JavaScript function Window.alert() adds messages to a queue. WebClient.getNextAlert() returns the next alert + without affecting the queue. WebClient.popNextAlert() returns the next alert, removing it from the queue. + 21. WebClient.setDialogResponder() lets a user predefine responses to the JavaScript functions Window.confirm and + Window.prompt. By default, these functions return true and the default value, respectively. A base class, + DialogAdapter, provides default implementations of its methods. -10-Jul-2002 -Additions: - 1. WebResponse and WebCell now support a new method, getImages, which returns an array of objects representing the - image tags found. + Extra Testing support: + 22. PseudoServer and associated classes are now publically available and in their own package, pseudoserver. -25-Jun-2002 -Additions: - 1. The HttpUnitOption property 'acceptCookies' now controls whether cookies received from the server will be saved - in a web client and sent on subsequent requests. The default is true. - -23-Jun-2002 -Acknowledgements: - Thanks to Steve Heath for an example on how to make JSPs work with ServletUnit. +Notes: + 1. The class com.meterware.httpunit.ScriptableObject has been renamed as com.meterware.httpunit.scripting.ScriptableDelegate -Additions: - 1. ServletUnit now supports ServletContext.getRealPath - 2. ServletUnit now supports JSPs using Jasper. By default, JSPs are expected to be in the current working directory. - If an external web.xml file is specified, JSPs will be searched for in the application context directory. 20-Jun-2002 1.4.1 Acknowledgements: Index: todo.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/todo.txt,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- todo.txt 29 Aug 2002 15:32:44 -0000 1.30 +++ todo.txt 30 Aug 2002 18:19:38 -0000 1.31 @@ -9,7 +9,6 @@ JavaScript priorities: o Document.write - may required substantial parser rewrite -o Javascript includes o Navigator object Possibles: |
From: Russell G. <rus...@us...> - 2002-08-30 18:19:16
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit In directory usw-pr-cvs1:/tmp/cvs-serv5750/test/com/meterware/httpunit Modified Files: FormParametersTest.java Log Message: Corrected handling of file getParameterValue when validation is off Index: FormParametersTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/FormParametersTest.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- FormParametersTest.java 8 Apr 2002 18:40:23 -0000 1.12 +++ FormParametersTest.java 30 Aug 2002 18:19:13 -0000 1.13 @@ -279,6 +279,13 @@ final File file = new File( "dummy.txt" ); form.setParameter( "File", new UploadFileSpec[] { new UploadFileSpec( file ) } ); assertEquals( "Selected filename", file.getAbsolutePath(), form.getParameterValue( "File" ) ); + + WebRequest wr = form.getRequest(); + assertEquals( "File from validated request", file.getAbsolutePath(), wr.getParameterValues( "File" )[0] ); + + HttpUnitOptions.setParameterValuesValidated( false ); + wr = form.getRequest(); + assertEquals( "File from unvalidated request", file.getAbsolutePath(), wr.getParameterValues( "File" )[0] ); } |
From: Russell G. <rus...@us...> - 2002-08-30 18:19:16
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit In directory usw-pr-cvs1:/tmp/cvs-serv5750/src/com/meterware/httpunit Modified Files: UncheckedParameterHolder.java Log Message: Corrected handling of file getParameterValue when validation is off Index: UncheckedParameterHolder.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/UncheckedParameterHolder.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- UncheckedParameterHolder.java 29 Aug 2002 18:39:11 -0000 1.6 +++ UncheckedParameterHolder.java 30 Aug 2002 18:19:13 -0000 1.7 @@ -130,7 +130,7 @@ String[] result = new String[ values.length ]; for (int i = 0; i < result.length; i++) { - result[i] = values[i].toString(); + result[i] = values[i] instanceof UploadFileSpec ? ((UploadFileSpec) values[i]).getFileName() : values[i].toString(); } return result; } |