httpunit-commit Mailing List for httpunit (Page 13)
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...> - 2004-10-05 11:40:45
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/dom In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4049/src/com/meterware/httpunit/dom Log Message: Directory /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/dom added to the repository |
From: Russell G. <rus...@us...> - 2004-10-05 11:30:04
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/parsing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1278/src/com/meterware/httpunit/parsing Modified Files: JTidyPrintWriter.java NekoDOMParser.java Log Message: Removed compile-time incompatibility with JDK 1.5 Index: JTidyPrintWriter.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/parsing/JTidyPrintWriter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- JTidyPrintWriter.java 25 Dec 2002 15:23:11 -0000 1.2 +++ JTidyPrintWriter.java 5 Oct 2004 11:29:52 -0000 1.3 @@ -198,17 +198,17 @@ } private void reportError( String msg, int line, int column ) { - Enumeration enum = HTMLParserFactory.getHTMLParserListeners().elements(); - while (enum.hasMoreElements()) { - ((HTMLParserListener) enum.nextElement()).error( _url, msg, line, column ); + Enumeration listeners = HTMLParserFactory.getHTMLParserListeners().elements(); + while (listeners.hasMoreElements()) { + ((HTMLParserListener) listeners.nextElement()).error( _url, msg, line, column ); } } private void reportWarning( String msg, int line, int column ) { - Enumeration enum = HTMLParserFactory.getHTMLParserListeners().elements(); - while (enum.hasMoreElements()) { - ((HTMLParserListener) enum.nextElement()).warning( _url, msg, line, column ); + Enumeration listeners = HTMLParserFactory.getHTMLParserListeners().elements(); + while (listeners.hasMoreElements()) { + ((HTMLParserListener) listeners.nextElement()).warning( _url, msg, line, column ); } } } \ No newline at end of file Index: NekoDOMParser.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/parsing/NekoDOMParser.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- NekoDOMParser.java 12 Mar 2003 17:34:07 -0000 1.2 +++ NekoDOMParser.java 5 Oct 2004 11:29:52 -0000 1.3 @@ -142,17 +142,17 @@ System.out.println( "At line " + warningException.getLineNumber() + ", column " + warningException.getColumnNumber() + ": " + warningException.getMessage() ); } - Enumeration enum = HTMLParserFactory.getHTMLParserListeners().elements(); - while (enum.hasMoreElements()) { - ((HTMLParserListener) enum.nextElement()).warning( _url, warningException.getMessage(), warningException.getLineNumber(), warningException.getColumnNumber() ); + Enumeration listeners = HTMLParserFactory.getHTMLParserListeners().elements(); + while (listeners.hasMoreElements()) { + ((HTMLParserListener) listeners.nextElement()).warning( _url, warningException.getMessage(), warningException.getLineNumber(), warningException.getColumnNumber() ); } } public void error( String domain, String key, XMLParseException errorException ) throws XNIException { - Enumeration enum = HTMLParserFactory.getHTMLParserListeners().elements(); - while (enum.hasMoreElements()) { - ((HTMLParserListener) enum.nextElement()).error( _url, errorException.getMessage(), errorException.getLineNumber(), errorException.getColumnNumber() ); + Enumeration listeners = HTMLParserFactory.getHTMLParserListeners().elements(); + while (listeners.hasMoreElements()) { + ((HTMLParserListener) listeners.nextElement()).error( _url, errorException.getMessage(), errorException.getLineNumber(), errorException.getColumnNumber() ); } } |
From: Russell G. <rus...@us...> - 2004-10-05 11:30:03
|
Update of /cvsroot/httpunit/httpunit/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1278/doc Modified Files: release_notes.txt Log Message: Removed compile-time incompatibility with JDK 1.5 Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.379 retrieving revision 1.380 diff -u -r1.379 -r1.380 --- release_notes.txt 5 Oct 2004 00:11:20 -0000 1.379 +++ release_notes.txt 5 Oct 2004 11:29:52 -0000 1.380 @@ -14,6 +14,13 @@ Revision History: +5-Oct-2004: + Acknowledgements: + Thanks to Hanson Char for identifying a JDK 1.5 incompatibility. + + Problems fixed: + 1. Renamed local variables which conflicted with new JDK 1.5 keyword "enum." + 4-Oct-2004 Problems fixed: 1. bug #1039989 Did not compile with JDK 1.3 |
From: Russell G. <rus...@us...> - 2004-10-05 03:45:26
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28866/test/com/meterware/httpunit Modified Files: ConditionalTestSuite.java Log Message: Miscellaneous build cleanup Index: ConditionalTestSuite.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/ConditionalTestSuite.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ConditionalTestSuite.java 26 Nov 2002 11:55:57 -0000 1.1 +++ ConditionalTestSuite.java 5 Oct 2004 03:45:16 -0000 1.2 @@ -1,15 +1,8 @@ package com.meterware.httpunit; - -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; - -import junit.framework.TestSuite; -import junit.framework.TestCase; - /******************************************************************************************************************** * $Id$ * - * Copyright (c) 2002, Russell Gold + * Copyright (c) 2002-2004, 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 @@ -26,6 +19,11 @@ * DEALINGS IN THE SOFTWARE. * *******************************************************************************************************************/ +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; + +import junit.framework.TestSuite; +import junit.framework.TestCase; /** * @@ -48,7 +46,7 @@ System.out.println( "Note: test suite " + testCaseName + " not a TestClass and has no suite() method" ); } } catch (ClassNotFoundException e) { - System.out.println( "Note: skipping optional test suite " + testCaseName + " since it was not build." ); + System.out.println( "Note: skipping optional test suite " + testCaseName + " since it was not built." ); } catch (Exception e) { System.out.println( "Note: unable to add " + testCaseName + ": " + e ); } |
From: Russell G. <rus...@us...> - 2004-10-05 03:45:25
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28866/src/com/meterware/httpunit Modified Files: WebResponse.java Log Message: Miscellaneous build cleanup Index: WebResponse.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebResponse.java,v retrieving revision 1.137 retrieving revision 1.138 diff -u -r1.137 -r1.138 --- WebResponse.java 29 Sep 2004 17:15:25 -0000 1.137 +++ WebResponse.java 5 Oct 2004 03:45:16 -0000 1.138 @@ -940,21 +940,6 @@ } - private byte[] readFromStream1( InputStream inputStream, int maxBytes ) throws IOException { - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - byte[] buffer = new byte[8 * 1024]; - int count = 0; - do { - outputStream.write( buffer, 0, count ); - maxBytes -= count; - if (maxBytes <= 0) break; - count = inputStream.read( buffer, 0, Math.min( maxBytes, buffer.length ) ); - } while (count != -1); - - byte[] bytes = outputStream.toByteArray(); - return bytes; - } - private byte[] readFromStream( InputStream inputStream, int maxBytes ) throws IOException { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); byte[] buffer = new byte[8 * 1024]; |
From: Russell G. <rus...@us...> - 2004-10-05 03:45:25
|
Update of /cvsroot/httpunit/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28866 Modified Files: build.xml Log Message: Miscellaneous build cleanup Index: build.xml =================================================================== RCS file: /cvsroot/httpunit/httpunit/build.xml,v retrieving revision 1.76 retrieving revision 1.77 diff -u -r1.76 -r1.77 --- build.xml 3 Oct 2004 13:58:28 -0000 1.76 +++ build.xml 5 Oct 2004 03:45:15 -0000 1.77 @@ -234,6 +234,7 @@ <include name="site.css" /> <include name="favicon.ico" /> <include name="src/**" /> + <include name="META-INF/**" /> <include name="test/**" /> <include name="examples/**" /> <include name="lib/*.*" /> |
From: Russell G. <rus...@us...> - 2004-10-05 00:11:32
|
Update of /cvsroot/httpunit/httpunit/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15264/doc Modified Files: release_notes.txt Log Message: bug #1035949 Following a link from the top frame to a _parent target no longer results in a NullPointerException. Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.378 retrieving revision 1.379 diff -u -r1.378 -r1.379 --- release_notes.txt 4 Oct 2004 23:45:35 -0000 1.378 +++ release_notes.txt 5 Oct 2004 00:11:20 -0000 1.379 @@ -17,6 +17,7 @@ 4-Oct-2004 Problems fixed: 1. bug #1039989 Did not compile with JDK 1.3 + 2. bug #1035949 Following a link from the top frame to a _parent target no longer results in a NullPointerException. 3-Oct-2004 1.6 Acknowledgements: |
From: Russell G. <rus...@us...> - 2004-10-05 00:11:32
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15264/test/com/meterware/httpunit Modified Files: WebFrameTest.java Log Message: bug #1035949 Following a link from the top frame to a _parent target no longer results in a NullPointerException. Index: WebFrameTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/WebFrameTest.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- WebFrameTest.java 22 Sep 2004 02:19:49 -0000 1.21 +++ WebFrameTest.java 5 Oct 2004 00:11:21 -0000 1.22 @@ -95,6 +95,14 @@ } + public void testParentTargetFromTopFrame() throws Exception { + defineWebPage( "Target", "This is another page with <a href=Form.html target='_parent'>one link</a>" ); + WebResponse resp = _wc.getResponse( getHostPath() + "/Target.html" ); + resp = _wc.getResponse( resp.getLinks()[0].getRequest() ); + assertMatchingSet( "Frames after second response", new String[] { "_top" }, _wc.getFrameNames() ); + } + + public void testFrameRequests() throws Exception { WebResponse response = _wc.getResponse( getHostPath() + "/Frames.html" ); WebRequest[] requests = response.getFrameRequests(); |
From: Russell G. <rus...@us...> - 2004-10-05 00:11:32
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15264/src/com/meterware/httpunit Modified Files: FrameHolder.java Log Message: bug #1035949 Following a link from the top frame to a _parent target no longer results in a NullPointerException. Index: FrameHolder.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/FrameHolder.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- FrameHolder.java 22 Sep 2004 02:19:49 -0000 1.13 +++ FrameHolder.java 5 Oct 2004 00:11:21 -0000 1.14 @@ -158,7 +158,7 @@ } else if (WebRequest.SAME_FRAME.equalsIgnoreCase( request.getTarget() )) { return request.getSourceFrame(); } else if (WebRequest.PARENT_FRAME.equalsIgnoreCase( request.getTarget() )) { - return request.getSourceFrame().getParent(); + return request.getSourceFrame().getParent() == null ? _topFrame : request.getSourceFrame().getParent(); } else if (request.getSourceFrame().getName().equalsIgnoreCase( request.getTarget() )) { return request.getSourceFrame(); } else { |
From: Russell G. <rus...@us...> - 2004-10-04 23:45:51
|
Update of /cvsroot/httpunit/httpunit/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9187/doc Modified Files: release_notes.txt Log Message: bug 1039989: removed JDK 1.4 code dependencies Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.377 retrieving revision 1.378 diff -u -r1.377 -r1.378 --- release_notes.txt 3 Oct 2004 13:58:29 -0000 1.377 +++ release_notes.txt 4 Oct 2004 23:45:35 -0000 1.378 @@ -14,6 +14,10 @@ Revision History: +4-Oct-2004 + Problems fixed: + 1. bug #1039989 Did not compile with JDK 1.3 + 3-Oct-2004 1.6 Acknowledgements: Thanks to Chris Hane for making it easier to add support for javascript properties and for providing support for |
From: Russell G. <rus...@us...> - 2004-10-04 23:45:50
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9187/test/com/meterware/httpunit Modified Files: WebClientTest.java Log Message: bug 1039989: removed JDK 1.4 code dependencies Index: WebClientTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/WebClientTest.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- WebClientTest.java 26 Sep 2004 01:30:37 -0000 1.23 +++ WebClientTest.java 4 Oct 2004 23:45:35 -0000 1.24 @@ -61,7 +61,7 @@ fail( "Should have rejected the request" ); } catch (UnknownHostException e) { } catch (IOException e) { - if (!(e.getCause() instanceof UnknownHostException)) throw e; +// if (!(e.getCause() instanceof UnknownHostException)) throw e; } } |
From: Russell G. <rus...@us...> - 2004-10-04 23:45:50
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/servletunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9187/src/com/meterware/servletunit Modified Files: WebApplication.java Log Message: bug 1039989: removed JDK 1.4 code dependencies Index: WebApplication.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/servletunit/WebApplication.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- WebApplication.java 24 Sep 2004 19:13:45 -0000 1.25 +++ WebApplication.java 4 Oct 2004 23:45:35 -0000 1.26 @@ -144,8 +144,8 @@ if (listener instanceof ServletContextAttributeListener) _contextAttributeListeners.add( listener ); if (listener instanceof HttpSessionListener) _sessionListeners.add( listener ); if (listener instanceof HttpSessionAttributeListener) _sessionAttributeListeners.add( listener ); - } catch (Throwable x) { - throw new RuntimeException("Unable to load context listener " + listenerName, x); + } catch (Throwable e) { + throw new RuntimeException("Unable to load context listener " + listenerName + ": " + e.toString() ); } } } @@ -631,7 +631,7 @@ } catch (IllegalAccessException e) { throw new ServletException( "Filter class " + getClassName() + " lacks a public no-arg constructor" ); } catch (InstantiationException e) { - throw new ServletException( "Filter class " + getClassName() + " instantiation threw" + e.getCause() ); + throw new ServletException( "Filter class " + getClassName() + " could not be instantiated." ); } catch (ClassCastException e) { throw new ServletException( "Filter class " + getClassName() + " does not implement" + Filter.class.getName() ); } |
From: Russell G. <rus...@us...> - 2004-10-03 14:05:04
|
Update of /cvsroot/httpunit/httpunit/sitedocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31813/sitedocs Modified Files: site.xml Log Message: establish 1.6 as the current version Index: site.xml =================================================================== RCS file: /cvsroot/httpunit/httpunit/sitedocs/site.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- site.xml 23 Jun 2004 09:53:45 -0000 1.3 +++ site.xml 3 Oct 2004 14:03:32 -0000 1.4 @@ -11,7 +11,7 @@ <fragment source="sitedocs/doc/license.html"/> </page> - <external location="http://prdownloads.sourceforge.net/httpunit/httpunit-1.5.4.zip?download" item="Download 1.5.4"/> + <external location="http://prdownloads.sourceforge.net/httpunit/httpunit-1.6.zip?download" item="Download 1.6"/> <space/> <page location="doc/cookbook.html" title="Cookbook"> |
From: Russell G. <rus...@us...> - 2004-10-03 13:59:45
|
Update of /cvsroot/httpunit/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30620 Modified Files: build.xml Log Message: establish 1.6 as the current version Index: build.xml =================================================================== RCS file: /cvsroot/httpunit/httpunit/build.xml,v retrieving revision 1.75 retrieving revision 1.76 diff -u -r1.75 -r1.76 --- build.xml 23 Jul 2004 01:28:56 -0000 1.75 +++ build.xml 3 Oct 2004 13:58:28 -0000 1.76 @@ -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.5.5" /> + <property name="version" value="1.6" /> <property name="debug" value="on" /> <property name="deprecation" value="off" /> |
From: Russell G. <rus...@us...> - 2004-10-03 13:59:45
|
Update of /cvsroot/httpunit/httpunit/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30620/doc Modified Files: release_notes.txt Log Message: establish 1.6 as the current version Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.376 retrieving revision 1.377 diff -u -r1.376 -r1.377 --- release_notes.txt 29 Sep 2004 17:15:24 -0000 1.376 +++ release_notes.txt 3 Oct 2004 13:58:29 -0000 1.377 @@ -14,7 +14,7 @@ Revision History: -28-Sep-2004 1.6 +3-Oct-2004 1.6 Acknowledgements: Thanks to Chris Hane for making it easier to add support for javascript properties and for providing support for getAttribute() to handle any property defined in the underlying Node. @@ -133,7 +133,7 @@ 27. bug #1029139: infinite recursion in frameset page when a frame has src="#" JavaScript 28. A frameset 'onload' event is now invoked after all of its subframes have been loaded - 29. HttpUnit no longer complains about not being able to find the Rhino jar (js.jar) is scripting is disabled + 29. HttpUnit no longer complains about not being able to find the Rhino jar (js.jar) if scripting is disabled before any pages are read. 30. bug #823433: document.cookie now defaults to the empty string, like IE and Mozilla, rather than null 31. Using JavaScript to write into an empty frame could change all empty frames to the same value |
From: Russell G. <rus...@us...> - 2004-09-29 17:16:04
|
Update of /cvsroot/httpunit/httpunit/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13602/doc Modified Files: release_notes.txt Log Message: Clean up documentation for 1.6 Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.375 retrieving revision 1.376 diff -u -r1.375 -r1.376 --- release_notes.txt 28 Sep 2004 09:52:24 -0000 1.375 +++ release_notes.txt 29 Sep 2004 17:15:24 -0000 1.376 @@ -10,308 +10,159 @@ 1. JDK 1.3.1 or higher is required 2. JavaScript support does not include some DOM properties 3. The JavaScript assignment Document.cookie= does not restrict the cookie by path and domain + 4. Only table cells and explicit paragraphs are recognized as text blocks Revision History: -27-Sep-2004: - Problems fixed: - 1. bug #1032440: An explanatory exception is now thrown on an attempt to use a mailto: URL in a form submission - -24-Sep-2004: - Acknowledgements: - Thanks to Dave Brosius for adding hashCode to Cookie and QuerySpec - - Problems fixed: - 1. bug #1034067: ServletConfig.getServletName now returns the name specified in web.xml for registered servlets. - Additions: - 1. patch #1026566 The Cookie class now implements hashCode properly. - -23-Sep-2004: - Additions: - 1. ServletUnit now implements HttpSession.getServletContext(). - -21-Sep-2004: - Acknowledgements: - Thanks to Bart Vanhaute for finding a fixing an infinite recursion problem with frame loading. - - Problems fixed: - 1. Proxy server settings no longer apply to the entire VM; however, accessing a proxy server is not thread-safe - 2. bug #1029139: infinite recursion in frameset page when a frame has src="#" - - Additions: - 1. A username and password may now be specified when accessing a proxy server. - -12-Sep-2004: - Problems fixed: - 1. bug #1025968: Cookies with max-age attribute will now expire (max-age=0 is treated as immediate expiration) -10-Sep-2004: - Problems fixed: - 1. bug #1013045: Form, Link, and Image id tags are now recognizable from JavaScript where a name tag would be - - 9-Sep-2004: - Problems fixed: - 1. Slashes in URL parameters were being misinterpeted as navigation - - 8-Sep-2004: - Additions: - 1. ServletRunner and ServletUnitClient now support a getSession() method to return the HTTP session to be used - by the next request or modified by the last request. - -25-Aug-2004: - Additions: - 1. ServletRunner now takes a reference to a web.xml as a File object in its constructor. - -10-Aug-2004: - Additions: - 1. rfe #901172: "application/xhtml+xml" is now recognized as a valid HTML "content-type" - 2. Added convenience method setParameter( String, File ) to simplify file uploading - - 9-Aug-2004 - Problems fixed: - 1. When a form has no action specified and its URL contains parameters whose names match those of parameters - in the form, the form values are used instead. - - 8-Aug-2004 - Thanks to Guillaume Dandurand <Gui...@cn...> for supplying code to get the onload event when the page - is a frameset rather than a regular page. - - Problems fixed: - 1. A frameset 'onload' event is now invoked after all of its subframes have been loaded - 2. ServletUnit's HttpServletRequest.getCookies() method was only returning the first cookie defined in the request - - Additions: - 1. Added preliminary support for lists - -28-Jul-2004 - Additions: - 1. rfe #986876: The WebClient.addCookie method has been deprecated, since its behavior is actually a bit confusing - and replaced with "putCookie" allowing subsequent the replacement of a cookie value defined by a previous - call to "putCookie." - -22-Jul-2004 - Acknowledgements: - Thanks to Kazuaki Matsuhashi <mat...@qu...> for correcting the handling of non-Latin link parameters - - Problems fixed: - 1. patch #995853: decode link parameters based on page character set - -21-Jul-2004 - Acknowledgements: - Thanks to Darrell DeBoer <bi...@us...> for providing a patch for select box functionality - - Additions: - 1. patch #879193: Select now behaves as a multiselect listbox if it has size > 1 or if multiple is set and the size is not set to 1. - 2. patch #879193: The name of a select box may now be treated as an array of options. - -20-Jul-2004 - Problems fixed: - 1. bug #990914: WebFrame scriptables are now accessible by getElementById - - 9-Jul-2004 - Additions: - 1. rfe #974791: WebForm now supports submitNoButton to submit a form without any of its buttons. This permits - testing of server response to a Javascript-style submit without using JavaScript. - - Problems fixed: - 1. bug #986397: Subframe included fragments in their source attributes now ignore those fragments when generating requests. - -29-Jun-2004 - Problems fixed: - 1. bug #805921: WebForm.selectImageButtonPosition was misleadingly public and should not have been used. - It has been made package-private, and new means are provided to submit positional image buttons (see additions). - 2. bug #982097: http urls being used as request parameters were being mangled - 3. bug #803041: HTML entity & now recognized in refresh URL tag - 4. bug #803095: Absolute URLs now supported in refresh URL tag - - Additions: - 1. rfe #766768: getText() methods now translate <br> tags as newlines. - 2. HttpUnit now catches an attempt to load an included script from a page included with "getResource" rather than - "getResponse." - 3. Click positions on image buttons may now be specified using one of: - form.submit( button, x, y ) - button.click( x, y ) - -28-Jun-2004 - Additions: - 1. rfe #901172: "text/xhtml" is now recognized as a valid HTML "content-type" - - Problems fixed: - 1. bug #959918: Javascript setting of numeric values included trailing zeros after the decimal point. - 2. bug #957882: URL path elements containing leading '.' were being stripped of those periods. - 3. bug #830856: WebLink URLs broken across lines are now handled correctly - -27-Jun-2004 - Thanks to Fabrizio Giustina for adding an entity-resolver to support local use of ServletUnit with a regular web.xml - - Additions: - 1. patch #915296: Local copies of the 2.2 and 2.3 web.xml dtds are now consulted if specified, - rather than connecting to the Sun website. - 2. HTMLElement now supports a getText() method to return the text contents of any element - 3. WebResponse now supports getTextBlocks and getFirstMatchingTextBlock to retrieve headers and paragraphs from a page. - -25-Jun-2004 - Problems fixed: - 1. bug #960307 meta tags within <noscript> tags were not being ignored when scripting was disabled - -24-Jun-2004 - Problems fixed: - 1. bug #978770 Clicking on a button outside of a form is now supported - 2. bug #838947 Document.getElementById now returns null if no such element exists - -23-Jun-2004 - Problems fixed: - 1. bug #974380 When using a DNS listener, host header no longer includes ':-1' if the port is not specified - -22-Jun-2004 - Problems fixed: - 1. bug #964940 The Referer header was not being sent again if the original request was redirected - -21-Jun-2004 - Problems fixed: - 1. bug #974675 Javascript function Window.open did not honor "_self" tag for window name. - -18-Jun-2004 - Additions: - 1. Enhanced http logging to show target server, request header line, and received URL - -15-Jun-2004 - Thanks to Phil Zampino for finding a fixing a problem in PseudoServer's handling of very long requests. - - Problems fixed: - 1. PseudoServer would hang when sent a very long request. - -13-Jun-2004 - Problems fixed: - 1. bug #737167: Nested frame names are now as specified, previous included names of parent frames. - 2. Return from a request that wrote to a new frame is now the result of that request, was the original page. - 3. Return from a request specifying an unknown frame now opens a new window; previously created a subframe - in the requesting window. - - 3-Jun-2004 - Additions: - 1. WebForm now supports the newUnvalidatedRequest method, which should be used in preference to - HttpUnitOptions.setParametersValidated( false ). This creates a web request copied from the form - but not tied to it, so that parameters can be set without validation. - -20-Apr-2004 - Problems fixed: - 1. PseudoServer now accepts a full http URL to permit testing of interaction with proxy servers. - -14-Mar-2004 - Additions: - 1. RFE #909922: ServletUnit now supports HttpServletRequest.getHeaders - 2. setCheckbox() and toggleCheckbox() have now been expanded to select one of a group of checkboxes by specifying - its name. - Problems fixed: - 1. bug #872129: Cookie header set on a web request was ignored in servletunit - -9-Mar-2004 - Problems fixed: - 1. bug #861866: Support JavaScript changing "disabled" attribute on form controls - 2. Forms defined after a <script> section which accessed document.forms would not be found if document.forms - was also accessed in a subsequent <script> section after the new form definition. - Notes: - 1. Upgraded NekoHTML to 0.9.1 - 2. Upgraded Xerces to 2.5.0 - 3. Upgraded Rhino to 1.5R4.1 - - -Revision History: -1-Mar-2004 - Acknowledgements: - 1. Thanks to Dan Frankow for supplying an implementation of ServletContext.getMimeType and correcting the - implementation of HttpSession.setAttribute when the value is null - 2. Thanks to Michael Corum for making the Button.disabled property settable from JavaScript. - - Problems fixed: - 1. ServletUnit now applies character encoding in interpreting post parameters - 2. Patch #873911: ServletUnit now supports ServletContext.getMimeType - 3. Patch #873914: ServletUnit HttpSession.setAttribute( name, null ) now properly removes the named attribute - 4. Patch #812709: Support JavaScript changing "disabled" attribute on Buttons - -26-Feb-2004 -Additions: - 1. Added support for filters - -14-Feb-2004 -Additions: - 1. Added support for ServletContextAttributeListener and HttpSessionAttributeListener - -12-Feb-2004 -Acknowledgements: - Thanks to Jarom Smith for finding some typos in the tutorial. - Thanks to Jay Dunning for providing an implementation of HttpServletResponse.containsHeader - and implementing support for ServletContextListeners. - -Problems fixed: - 1. Window.open() using an empty name was replacing the main window rather than creating a new one. - 2. bug #883293 - typos in tutorial task 1 step 4 - 3. bug #883301 - more typos in tutorial task 1 step 4 - 4. bug #873169 - Cookie headers were generated with no space after the semicolon (unlike IE, Netscape, and Mozilla) - 5. Cookie domains without leading dots are now accepted, as per RFC 2965. - -Additions: - 1. Patch #890995 - Implemented ServletUnitHttpResponse.containsHeader - 2. Patch #890936 - Added ServletContextListener support - 3. Added HttpSessionListener support - - 4-Dec-2003 +28-Sep-2004 1.6 Acknowledgements: + Thanks to Chris Hane for making it easier to add support for javascript properties and for providing support for + getAttribute() to handle any property defined in the underlying Node. + Thanks to Patrick Lightbody for adding JavaScript support for the Style object + Thanks to Phil Zampino for finding a fixing a problem in PseudoServer's handling of very long requests. Thanks to Andrew Bickerton for adding the following JavaScript support: Form.length - returns the number of controls in a form Control.type - returns a test description of the control type Control.defaultValue - returns the default value for text controls Initial page tokenizing now skips JavaScript while looking for header tags Writing into an empty frame no longer corrupts all empty frames - -Problems fixed: - 1. Using JavaScript to write into an empty frame could change all empty frames to the same value - -17-Oct-2003 -Problems fixed: - 1. Bug #823433: document.cookie now defaults to the empty string, like IE and Mozilla, rather than null - - 1-Oct-2003 -Acknowledgements: - Thanks to Patrick Lightbody for adding JavaScript support for the Style object + Thanks to Jarom Smith for finding some typos in the tutorial. + Thanks to Jay Dunning for providing an implementation of HttpServletResponse.containsHeader + and implementing support for ServletContextListeners. + Thanks to Fabrizio Giustina for adding an entity-resolver to support local use of ServletUnit with a regular web.xml + Thanks to Kazuaki Matsuhashi for correcting the handling of non-Latin link parameters + Thanks to Dan Frankow for supplying an implementation of ServletContext.getMimeType and correcting the + implementation of HttpSession.setAttribute when the value is null + Thanks to Guillaume Dandurand for supplying code to get the onload event when the page + is a frameset rather than a regular page. + Thanks to Michael Corum for making the Button.disabled property settable from JavaScript. + Thanks to Darrell DeBoer for providing a patch for select box functionality + Thanks to Bart Vanhaute for finding a fixing an infinite recursion problem with frame loading. + Thanks to Dave Brosius for adding hashCode to Cookie and QuerySpec Additions: - 1. Added support for javascript HTMLElement.style property + Content and Parsing + 1. rfe #766768: getText() methods now translate <br> tags as newlines. + 2. rfe #901172: content-types "text/xhtml" and "application/xhtml+xml" are now recognized as valid HTML + 3. rfe #974791: WebForm now supports submitNoButton to submit a form without any of its buttons. This permits + testing of server response to a Javascript-style submit without using JavaScript. + 4. rfe #986876: The WebClient.addCookie method has been deprecated, since its behavior is actually a bit confusing + and replaced with "putCookie" allowing subsequent the replacement of a cookie value defined by a previous + call to "putCookie." + 5. patch #1026566 The Cookie class now implements hashCode properly. + 6. patch #879193: The name of a select box may now be treated as an array of options. + 7. patch #879193: Select now behaves as a multiselect listbox if it has size > 1 or if multiple is set and the size is not set to 1. + 8. Patch #795698: HTMLElement now supports a getAttribute method to return the value of any named attribute. + 9. WebResponse and TableCell now support getElementsWithAttribute to return all contained HTML elements + with a specified attribute. + 10. setCheckbox() and toggleCheckbox() have now been expanded to select one of a group of checkboxes by specifying + its name. + 11. WebForm now supports the newUnvalidatedRequest method, which should be used in preference to + HttpUnitOptions.setParametersValidated( false ). This creates a web request copied from the form + but not tied to it, so that parameters can be set without validation. + 12. Enhanced http logging to show target server, request header line, and received URL + 13. HTMLElement now supports a getText() method to return the text contents of any element + 14. WebResponse now supports getTextBlocks and getFirstMatchingTextBlock to retrieve headers and paragraphs from a page. + 15. HttpUnit now catches an attempt to load an included script from a page included with "getResource" rather than + "getResponse." + 16. Click positions on image buttons may now be specified using one of: + form.submit( button, x, y ) + button.click( x, y ) + 17. Added preliminary support for lists + 18. Added convenience method setParameter( String, File ) to simplify file uploading + 19. A username and password may now be specified when accessing a proxy server. + JavaScript + 20. Added support for javascript Input.tabindex and Text.maxlength properties (read-only) + 21. Added support for javascript HTMLElement.style property + ServletUnit + 22. Patch #890995 - Implemented ServletUnitHttpResponse.containsHeader + 23. Patch #890936 - Added ServletContextListener support + 24. Added HttpSessionListener support + 25. Added support for ServletContextAttributeListener and HttpSessionAttributeListener + 26. Added support for filters + 27. rfe #909922: ServletUnit now supports HttpServletRequest.getHeaders + 28. patch #915296: Local copies of the 2.2 and 2.3 web.xml dtds are now consulted if specified, + rather than connecting to the Sun website. + 29. ServletRunner now takes a reference to a web.xml as a File object in its constructor. + 30. ServletRunner and ServletUnitClient now support a getSession() method to return the HTTP session to be used + by the next request or modified by the last request. + 31. ServletUnit now implements HttpSession.getServletContext(). + PseudoServer + 32. PseudoServer now pools its ServerSocket's in order to be more gracious regarding system resources. Pooling can + be controlled via the properties: socketReleaseWaitTime and waitThreshhold. + 33. PseudoServer can now received chunked requests, and will not send a "Content-Length" header if a + "Transfer-Encoding: chunked" has been defined. + 34. PseudoServer now accepts a full http URL to permit testing of interaction with proxy servers. -30-Sep-2003 Problems fixed: - 1. HttpUnit no longer complains about not being able to find the Rhino jar (js.jar) is scripting is disabled - before any pages are read. - -16-Sep-2003 -Acknowledgements: - Thanks to Chris Hane for making it easier to add support for javascript properties and for providing support for - getAttribute() to handle any property defined in the underlying Node - -Additions: - 1. Patch #795698: HTMLElement now supports a getAttribute method to return the value of any named attribute. - 2. PseudoServer can now received chunked requests, and will not send a "Content-Length" header if a - "Transfer-Encoding: chunked" has been defined. - 3. Added support for javascript Input.tabindex and Text.maxlength properties (read-only) + Documentation + 1. bug #804585: the javascript documentation referred to the old location of the + getNextAlert and popNextAlert methods + 2. bug #804559: unimplemented links have been removed from the incomplete user manual. + 3. A number of typos in the tutorial have been corrected + Content and Parsing + 4. bug #978770 Clicking on a button outside of a form is now supported + 5. bug #838947 Document.getElementById now returns null if no such element exists + 6. bug #957882: URL path elements containing leading '.' were being stripped of those periods. + 7. bug #830856: WebLink URLs broken across lines are now handled correctly + 8. bug #805921: WebForm.selectImageButtonPosition was misleadingly public and should not have been used. + It has been made package-private, and new means are provided to submit positional image buttons (see additions). + 9. bug #982097: http urls being used as request parameters were being mangled + 10. bug #803041: HTML entity & now recognized in refresh URL tag + 11. bug #803095: Absolute URLs now supported in refresh URL tag + 12. bug #986397: Subframe included fragments in their source attributes now ignore those fragments when generating requests. + 13. bug #990914: WebFrame scriptables are now accessible by getElementById + 14. patch #995853: decode link parameters based on page character set + 15. When a form has no action specified and its URL contains parameters whose names match those of parameters + in the form, the form values are used instead. + 16. Slashes in URL parameters were being misinterpeted as navigation + Request handling + 17. The HeadMethodWebRequest was actually sending the GET method, as was any HeaderOnlyWebRequest. + 18. bug #964940 The Referer header was not being sent again if the original request was redirected + 19. bug #974380 When using a DNS listener, host header no longer includes ':-1' if the port is not specified + 20. bug #1032440: An explanatory exception is now thrown on an attempt to use a mailto: URL in a form submission + Cookie handling + 21. bug #873169 - Cookie headers were generated with no space after the semicolon (unlike IE, Netscape, and Mozilla) + 22. Cookie domains without leading dots are now accepted, as per RFC 2965. + 23. bug #1025968: Cookies with max-age attribute will now expire (max-age=0 is treated as immediate expiration) + Frame handling + 24. bug #737167: Nested frame names are now as specified, previous included names of parent frames. + 25. Return from a request that wrote to a new frame is now the result of that request, was the original page. + 26. Return from a request specifying an unknown frame now opens a new window; previously created a subframe + in the requesting window. + 27. bug #1029139: infinite recursion in frameset page when a frame has src="#" + JavaScript + 28. A frameset 'onload' event is now invoked after all of its subframes have been loaded + 29. HttpUnit no longer complains about not being able to find the Rhino jar (js.jar) is scripting is disabled + before any pages are read. + 30. bug #823433: document.cookie now defaults to the empty string, like IE and Mozilla, rather than null + 31. Using JavaScript to write into an empty frame could change all empty frames to the same value + 32. Window.open() using an empty name was replacing the main window rather than creating a new one. + 33. Patch #812709: Support JavaScript changing "disabled" attribute on Buttons + 34. bug #861866: Support JavaScript changing "disabled" attribute on form controls + 35. Forms defined after a <script> section which accessed document.forms would not be found if document.forms + was also accessed in a subsequent <script> section after the new form definition. + 36. bug #974675 Javascript function Window.open did not honor "_self" tag for window name. + 37. bug #960307 meta tags within <noscript> tags were not being ignored when scripting was disabled + 38. bug #959918: Javascript setting of numeric values included trailing zeros after the decimal point. + 39. bug #1013045: Form, Link, and Image id tags are now recognizable from JavaScript where a name tag would be + ServletUnit + 40. ServletUnit now applies character encoding in interpreting post parameters + 41. Patch #873911: ServletContext.getMimeType is supported + 42. Patch #873914: HttpSession.setAttribute( name, null ) now properly removes the named attribute + 43. bug #872129: Cookie header set on a web request was ignored in servletunit + 44. HttpServletRequest.getCookies() method was only returning the first cookie defined in the request + 45. bug #1034067: ServletConfig.getServletName now returns the name specified in web.xml for registered servlets. + PseudoServer + 46. PseudoServer now supports any method handled by a PseudoServlet. Previously, it only handled GET, POST, and PUT. + It is simply necessary to override the getResponse method to make this work. + 47. PseudoServer would hang when sent a very long request. -11-Sep-2003 -Additions: - 1. PseudoServer now pools its ServerSocket's in order to be more gracious regarding system resources. Pooling can - be controlled via the properties: socketReleaseWaitTime and waitThreshhold. -Problems fixed: - 1. The HeadMethodWebRequest was actually sending the GET method, as was any HeaderOnlyWebRequest. - 2. PseudoServer now supports any method handled by a PseudoServlet. Previously, it only handled GET, POST, and PUT. - It is simple necessary to override the getResponse method to make this work. - 3. Bug #804585: Undocumented method in API: the javascript documentation referred to the old location of the - getNextAlert and popNextAlert methods - 4. Bug #804559: Documentation incomplete in download: removed the pending links from the incomplete user manual. - 5. The tutorial referred to a method without specifying the object to which it belongs - 6. The HeadMethodWebRequest was actually sending a GET method + Notes: + 1. Upgraded NekoHTML to 0.9.1 + 2. Upgraded Xerces to 2.4.0 + 3. Upgraded Rhino to 1.5R4.1 -26-Aug-2003 -Additions: - 1. WebResponse and TableCell now support getElementsWithAttribute to return all contained HTML elements with - the specified attribute. 21-Aug-2003 1.5.4 Acknowledgements: |
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13602/src/com/meterware/httpunit Modified Files: BlockElement.java FrameSelector.java HTMLElement.java HTMLSegment.java HttpUnitOptions.java HttpUnitUtils.java MessageBodyWebRequest.java PostMethodWebRequest.java SubmitButton.java TableCell.java TextBlock.java UnsupportedActionException.java WebClient.java WebForm.java WebLink.java WebList.java WebRequestSource.java WebResponse.java Log Message: Clean up documentation for 1.6 Index: BlockElement.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/BlockElement.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- BlockElement.java 8 Aug 2004 17:45:30 -0000 1.2 +++ BlockElement.java 29 Sep 2004 17:15:24 -0000 1.3 @@ -29,6 +29,8 @@ * Represents a block-level element such as a paragraph or table cell, which can contain other elements. * * @author <a href="mailto:rus...@ht...">Russell Gold</a> + * + * @since 1.6 **/ abstract public class BlockElement extends ParsedHTML implements HTMLSegment, HTMLElement { Index: FrameSelector.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/FrameSelector.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- FrameSelector.java 13 Jun 2004 21:52:02 -0000 1.1 +++ FrameSelector.java 29 Sep 2004 17:15:24 -0000 1.2 @@ -21,8 +21,11 @@ *******************************************************************************************************************/ /** + * An immutable class which describes the position of a frame in the window hierarchy. * * @author <a href="mailto:rus...@ht...">Russell Gold</a> + * + * @since 1.6 **/ public class FrameSelector { @@ -34,7 +37,7 @@ private FrameSelector _parent; - public FrameSelector() { + FrameSelector() { _name = super.toString(); } Index: HTMLElement.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/HTMLElement.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- HTMLElement.java 27 Jun 2004 19:29:15 -0000 1.5 +++ HTMLElement.java 29 Sep 2004 17:15:24 -0000 1.6 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * - * Copyright (c) 2002, Russell Gold + * Copyright (c) 2002-2004, 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 @@ -57,12 +57,16 @@ /** * Returns the value of the attribute of this element with the specified name. * Returns the empty string if no such attribute exists. + * + * @since 1.6 */ String getAttribute( String name ); /** * Returns true if this element may have an attribute with the specified name. + * + * @since 1.6 */ boolean isSupportedAttribute( String name ); @@ -75,6 +79,8 @@ /** * Returns the contents of this element, converted to a string. + * + * @since 1.6 */ String getText(); } Index: HTMLSegment.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/HTMLSegment.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- HTMLSegment.java 8 Aug 2004 17:45:30 -0000 1.14 +++ HTMLSegment.java 29 Sep 2004 17:15:24 -0000 1.15 @@ -44,6 +44,8 @@ /** * Returns the HTMLElements found with the specified attribute value. + * + * @since 1.6 */ public HTMLElement[] getElementsWithAttribute( String name, String value ) throws SAXException; @@ -162,6 +164,8 @@ /** * Returns the top-level block elements found in the page in the order in which they appear. * @exception SAXException thrown if there is an error parsing the segment. + * + * @since 1.6 */ public TextBlock[] getTextBlocks() throws SAXException; Index: HttpUnitOptions.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/HttpUnitOptions.java,v retrieving revision 1.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- HttpUnitOptions.java 8 Aug 2004 17:38:18 -0000 1.42 +++ HttpUnitOptions.java 29 Sep 2004 17:15:24 -0000 1.43 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * -* Copyright (c) 2000-2003, Russell Gold +* Copyright (c) 2000-2004, 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 @@ -219,7 +219,7 @@ /** * Returns true if form parameter settings are checked. * - * @deprecated use WebForm#newUnvalidatedRequest() to obtain a request without parameter validation. + * @deprecated as of 1.6, use WebForm#newUnvalidatedRequest() to obtain a request without parameter validation. **/ public static boolean getParameterValuesValidated() { return _parameterValuesValidated; @@ -233,7 +233,7 @@ * with this option disabled will not only not be checked for correctness, its parameter submission * order will not be guaranteed, and changing parameters will not trigger Javascript onChange / onClick events. * - * @deprecated use WebForm#newUnvalidatedRequest() to obtain a request without parameter validation. + * @deprecated as of 1.6, use WebForm#newUnvalidatedRequest() to obtain a request without parameter validation. **/ public static void setParameterValuesValidated( boolean validated ) { _parameterValuesValidated = validated; Index: HttpUnitUtils.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/HttpUnitUtils.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- HttpUnitUtils.java 23 Jul 2004 01:31:04 -0000 1.19 +++ HttpUnitUtils.java 29 Sep 2004 17:15:24 -0000 1.20 @@ -68,6 +68,8 @@ /** * Returns an interpretation of the specified URL-encoded string, using the iso-8859-1 character set. + * + * @since 1.6 **/ public static String decode( String byteString ) { return decode( byteString, "iso-8859-1" ); Index: MessageBodyWebRequest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/MessageBodyWebRequest.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- MessageBodyWebRequest.java 4 Jun 2004 01:20:03 -0000 1.11 +++ MessageBodyWebRequest.java 29 Sep 2004 17:15:24 -0000 1.12 @@ -63,6 +63,8 @@ /** * Constructs a web request for a form submitted via a button. + * + * @since 1.6 **/ protected MessageBodyWebRequest( WebForm sourceForm, ParameterHolder parameterHolder, SubmitButton button, int x, int y ) { super( sourceForm, parameterHolder, button, x, y ); Index: PostMethodWebRequest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/PostMethodWebRequest.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- PostMethodWebRequest.java 4 Jun 2004 01:20:03 -0000 1.26 +++ PostMethodWebRequest.java 29 Sep 2004 17:15:24 -0000 1.27 @@ -124,7 +124,7 @@ } - public PostMethodWebRequest( WebForm sourceForm, ParameterHolder parameterHolder, SubmitButton button, int x, int y ) { + PostMethodWebRequest( WebForm sourceForm, ParameterHolder parameterHolder, SubmitButton button, int x, int y ) { super( sourceForm, parameterHolder, button, x, y ); } Index: SubmitButton.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/SubmitButton.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- SubmitButton.java 11 Jul 2004 03:11:32 -0000 1.19 +++ SubmitButton.java 29 Sep 2004 17:15:24 -0000 1.20 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * -* Copyright (c) 2000-2003, Russell Gold +* Copyright (c) 2000-2004, 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 @@ -48,7 +48,7 @@ * Performs the action associated with clicking this button after running any 'onClick' script. * For a submit button this typically submits the form. * - * @since 1.5.5 + * @since 1.6 */ public void click( int x, int y ) throws IOException, SAXException { if (!isImageButton()) throw new IllegalStateException( "May only specify positions for an image button" ); Index: TableCell.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/TableCell.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- TableCell.java 27 Jun 2004 19:29:15 -0000 1.18 +++ TableCell.java 29 Sep 2004 17:15:24 -0000 1.19 @@ -51,7 +51,7 @@ /** * Returns the text value of this cell. - * @deprecated as of 1.5.5, use #getText() + * @deprecated as of 1.6, use #getText() */ public String asText() { return getText(); Index: TextBlock.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/TextBlock.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TextBlock.java 8 Aug 2004 17:45:31 -0000 1.1 +++ TextBlock.java 29 Sep 2004 17:15:24 -0000 1.2 @@ -23,11 +23,12 @@ import java.net.URL; import java.util.ArrayList; -import java.util.Enumeration; /** + * A class which represents a block of text in a web page. Experimental. * * @author <a href="mailto:rus...@ht...">Russell Gold</a> + * @since 1.6 **/ public class TextBlock extends BlockElement { @@ -43,6 +44,9 @@ } + /** + * Returns any lists embedded in this text block. + */ public WebList[] getLists() { return (WebList[]) (_lists.toArray( new WebList[ _lists.size() ] ) ); } @@ -53,7 +57,7 @@ } - public String[] getFormats( int characterPosition ) { + String[] getFormats( int characterPosition ) { return null; } Index: UnsupportedActionException.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/UnsupportedActionException.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- UnsupportedActionException.java 28 Sep 2004 09:52:24 -0000 1.1 +++ UnsupportedActionException.java 29 Sep 2004 17:15:24 -0000 1.2 @@ -24,6 +24,7 @@ * An exception thrown when an action URL is not supported. * * @author <a href="mailto:rus...@ht...">Russell Gold</a> + * @since 1.6 **/ public class UnsupportedActionException extends RuntimeException { Index: WebClient.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebClient.java,v retrieving revision 1.61 retrieving revision 1.62 diff -u -r1.61 -r1.62 --- WebClient.java 22 Sep 2004 02:02:09 -0000 1.61 +++ WebClient.java 29 Sep 2004 17:15:24 -0000 1.62 @@ -135,7 +135,7 @@ * Returns the response associated with the specified frame name in the main window. * Throws a runtime exception if no matching frame is defined. * - * @since 1.5.5 + * @since 1.6 **/ public WebResponse getFrameContents( FrameSelector targetFrame ) { return _mainWindow.getFrameContents( targetFrame ); @@ -164,7 +164,7 @@ /** * Defines a cookie to be sent to the server on every request. - * @deprecated as of 1.5.5, use #putCookie instead. + * @deprecated as of 1.6, use #putCookie instead. **/ public void addCookie( String name, String value ) { _cookieJar.addCookie( name, value ); @@ -238,6 +238,8 @@ /** * Specifies a proxy server to use, along with a user and password for authentication. + * + * @since 1.6 */ public void setProxyServer( String proxyHost, int proxyPort, String userName, String password ) { setProxyServer( proxyHost, proxyPort ); Index: WebForm.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebForm.java,v retrieving revision 1.100 retrieving revision 1.101 diff -u -r1.100 -r1.101 --- WebForm.java 28 Sep 2004 09:52:24 -0000 1.100 +++ WebForm.java 29 Sep 2004 17:15:25 -0000 1.101 @@ -75,7 +75,7 @@ * Will usually return the result of that submission; however, if the submit button's 'onclick' * or the form's 'onsubmit' event is triggered and * inhibits the submission, will return the updated contents of the frame containing this form. - * @since 1.5.5 + * @since 1.6 **/ public WebResponse submit( SubmitButton button, int x, int y ) throws IOException, SAXException { return button.doOnClickEvent() ? doFormSubmit( button, x, y ) : getCurrentFrameContents(); @@ -84,7 +84,7 @@ /** * Submits this form using the web client from which it was originally obtained, ignoring any buttons defined for the form. - * @since 1.5.5 + * @since 1.6 **/ public WebResponse submitNoButton() throws SAXException, IOException { return submit( SubmitButton.createFakeSubmitButton( this /* fake */ ) ); @@ -626,7 +626,7 @@ /** * Sets the single value of a file upload parameter in this form. * A more convenient way to do this than using {@link #setParameter(String,UploadFileSpec[])} - * @since 1.5.5 + * @since 1.6 */ public void setParameter( String name, File file ) { setParameter( name, new UploadFileSpec[] { new UploadFileSpec( file ) } ); @@ -653,7 +653,7 @@ * @param value of the checkbox parameter * @throws IllegalArgumentException if the specified parameter is not a checkbox or if there is no checkbox * with the specified name and value. - * @since 1.5.5 + * @since 1.6 */ public void toggleCheckbox( String name, String value ) { FormParameter parameter = getParameter( name ); @@ -684,7 +684,7 @@ * @param state the new state of the checkbox * @throws IllegalArgumentException if the specified parameter is not a checkbox or if there is no checkbox * with the specified name and value. - * @since 1.5.5 + * @since 1.6 */ public void setCheckbox( String name, String value, boolean state ) { FormParameter parameter = getParameter( name ); Index: WebLink.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebLink.java,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- WebLink.java 12 Sep 2004 03:31:58 -0000 1.46 +++ WebLink.java 29 Sep 2004 17:15:25 -0000 1.47 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * -* Copyright (c) 2000-2003, Russell Gold +* Copyright (c) 2000-2004, 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 @@ -67,6 +67,7 @@ /** * Returns the text value of this link. + * @since 1.6 **/ public String getText() { if (getNode().getNodeName().equalsIgnoreCase( "area" )) { @@ -79,7 +80,7 @@ /** * Returns the text value of this link. - * @deprecated use #getText instead + * @deprecated as of 1.6, use #getText instead **/ public String asText() { return getText(); Index: WebList.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebList.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- WebList.java 8 Aug 2004 17:45:32 -0000 1.1 +++ WebList.java 29 Sep 2004 17:15:25 -0000 1.2 @@ -28,13 +28,19 @@ import com.meterware.httpunit.scripting.ScriptableDelegate; /** + * Represents an HTML list. Experimental. * * @author <a href="mailto:rus...@ht...">Russell Gold</a> + * @since 1.6 **/ public class WebList extends HTMLElementBase { + /** Indicator of an ordered list (HTML tag <ol>) */ + public static final int ORDERED_LIST = 1; + + /** Indicator of a bullet list (HTML tag <ul>) */ + public static final int BULLET_LIST = 2; - public static int ORDERED_LIST = 0; private WebResponse _response; private FrameSelector _frame; private URL _baseURL; @@ -42,10 +48,16 @@ private String _characterSet; private ArrayList _items = new ArrayList(); + private int _listType; public WebList( WebResponse response, FrameSelector frame, URL baseURL, String baseTarget, Element element, String characterSet ) { super( element ); + if (element.getNodeName().equalsIgnoreCase( "ol" )) { + _listType = ORDERED_LIST; + } else if (element.getNodeName().equalsIgnoreCase( "ul" )) { + _listType = BULLET_LIST; + } _response = response; _frame = frame; _baseURL = baseURL; @@ -55,7 +67,7 @@ public int getListType() { - return 0; + return _listType; } Index: WebRequestSource.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebRequestSource.java,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- WebRequestSource.java 28 Sep 2004 09:52:25 -0000 1.41 +++ WebRequestSource.java 29 Sep 2004 17:15:25 -0000 1.42 @@ -86,7 +86,7 @@ /** * Returns the name of the frame containing this request source. - * @deprecated as of 1.5.5, use #getFrame + * @deprecated as of 1.6, use #getFrame */ public String getPageFrame() { return _frame.getName(); Index: WebResponse.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebResponse.java,v retrieving revision 1.136 retrieving revision 1.137 diff -u -r1.136 -r1.137 --- WebResponse.java 26 Sep 2004 01:30:37 -0000 1.136 +++ WebResponse.java 29 Sep 2004 17:15:25 -0000 1.137 @@ -345,6 +345,7 @@ /** * Returns the HTMLElements found with the specified attribute value. + * @since 1.6 */ public HTMLElement[] getElementsWithAttribute( String name, String value ) throws SAXException { return getReceivedPage().getElementsWithAttribute( name, value ); @@ -501,7 +502,7 @@ /** * Returns an array of text blocks found in the page. - * @since 1.5.5 + * @since 1.6 */ public TextBlock[] getTextBlocks() throws SAXException { return getReceivedPage().getTextBlocks(); @@ -510,7 +511,7 @@ /** * Returns the text block after the specified block, if any. - * @since 1.5.5 + * @since 1.6 */ public TextBlock getNextTextBlock( TextBlock block ) throws SAXException { return getReceivedPage().getNextTextBlock( block ); @@ -519,7 +520,7 @@ /** * Returns the first link found in the page matching the specified criteria. - * @since 1.5.5 + * @since 1.6 * @exception SAXException thrown if there is an error parsing the response. **/ public TextBlock getFirstMatchingTextBlock( HTMLElementPredicate predicate, Object criteria ) throws SAXException { |
From: Russell G. <rus...@us...> - 2004-09-29 17:15:56
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13602/test/com/meterware/httpunit Modified Files: TextBlockTest.java Log Message: Clean up documentation for 1.6 Index: TextBlockTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/TextBlockTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- TextBlockTest.java 8 Aug 2004 17:45:32 -0000 1.3 +++ TextBlockTest.java 29 Sep 2004 17:15:27 -0000 1.4 @@ -113,13 +113,21 @@ "<p id='unordered'><ul><li>Red<li>Green<li>Blue</ul></p>" ); WebConversation wc = new WebConversation(); WebResponse response = wc.getResponse( getHostPath() + "/SimplePage.html" ); - TextBlock paragraph = (TextBlock) response.getElementWithID( "ordered" ); - WebList[] lists = paragraph.getLists(); - assertTrue( "No lists found", lists.length > 0); + TextBlock paragraph1 = (TextBlock) response.getElementWithID( "ordered" ); + WebList[] lists = paragraph1.getLists(); + assertEquals( "Number of lists found", 1, lists.length); WebList orderedList = lists[0]; assertEquals( "ordered list type", WebList.ORDERED_LIST, orderedList.getListType() ); assertEquals( "ordered list size", 3, orderedList.getItems().length ); assertEquals( "Second ordered list item", "Two", orderedList.getItems()[1].getText() ); + + TextBlock paragraph2 = (TextBlock) response.getElementWithID( "unordered" ); + lists = paragraph2.getLists(); + assertEquals( "Number of lists found", 1, lists.length); + WebList unorderedList = lists[0]; + assertEquals( "bullet list type", WebList.BULLET_LIST, unorderedList.getListType() ); + assertEquals( "bullet list size", 3, unorderedList.getItems().length ); + assertEquals( "First bullet list item", "Red", unorderedList.getItems()[0].getText() ); } |
From: Russell G. <rus...@us...> - 2004-09-29 17:15:56
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/servletunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13602/src/com/meterware/servletunit Modified Files: InvocationContext.java ServletRunner.java ServletUnitClient.java Log Message: Clean up documentation for 1.6 Index: InvocationContext.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/servletunit/InvocationContext.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- InvocationContext.java 13 Jun 2004 20:57:27 -0000 1.9 +++ InvocationContext.java 29 Sep 2004 17:15:26 -0000 1.10 @@ -51,6 +51,7 @@ /** * Invokes the current servlet or filter. + * @since 1.6 */ void service() throws ServletException, IOException; @@ -71,6 +72,7 @@ /** * Returns the target frame for the original request. + * @since 1.6 */ FrameSelector getFrame(); @@ -95,18 +97,21 @@ /** * Returns true if the current context is a filter, rather than a servlet. + * @since 1.6 */ boolean isFilterActive(); /** * Returns the current active filter object. Only valid to call if {@link #isFilterActive} returns true. + * @since 1.6 */ Filter getFilter() throws ServletException; /** * Returns the current filter chain. Only valid to call if {@link #isFilterActive} returns true. + * @since 1.6 */ FilterChain getFilterChain(); @@ -121,6 +126,7 @@ * * @param request the request to pass to the next filter. May be a wrapper. * @param response the response object to pass to the next filter. May be a wrapper. + * @since 1.6 */ void pushFilter( ServletRequest request, ServletResponse response ); Index: ServletRunner.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/servletunit/ServletRunner.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- ServletRunner.java 23 Sep 2004 22:48:19 -0000 1.29 +++ ServletRunner.java 29 Sep 2004 17:15:26 -0000 1.30 @@ -55,7 +55,7 @@ /** * Constructor which expects the full path to the web.xml for the * application. - * @deprecated as of 1.5.5, use {@link #ServletRunner(File)} + * @deprecated as of 1.6, use {@link #ServletRunner(File)} * * @param webXMLFileSpec the full path to the web.xml file */ @@ -68,7 +68,7 @@ /** * Constructor which expects the full path to the web.xml for the * application and a context path under which to mount it. - * @deprecated as of 1.5.5, use {@link #ServletRunner(File,String)} + * @deprecated as of 1.6, use {@link #ServletRunner(File,String)} * * @param webXMLFileSpec the full path to the web.xml file * @param contextPath the context path @@ -83,7 +83,7 @@ * application. * * @param webXml the web.xml file - * @since 1.5.5 + * @since 1.6 */ public ServletRunner( File webXml ) throws IOException, SAXException { _application = new WebApplication( HttpUnitUtils.newParser().parse( webXml ) ); @@ -97,7 +97,7 @@ * * @param webXml the web.xml file * @param contextPath the context path - * @since 1.5.5 + * @since 1.6 */ public ServletRunner( File webXml, String contextPath ) throws IOException, SAXException { _application = new WebApplication( HttpUnitUtils.newParser().parse( webXml ), webXml.getParentFile().getParentFile(), contextPath ); @@ -164,7 +164,7 @@ /** * Returns the session to be used by the next request. * @param create if true, will create a new session if no valid session is defined. - * @since 1.5.5 + * @since 1.6 */ public HttpSession getSession( boolean create ) { return getClient().getSession( create ); Index: ServletUnitClient.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/servletunit/ServletUnitClient.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- ServletUnitClient.java 9 Sep 2004 00:16:40 -0000 1.14 +++ ServletUnitClient.java 29 Sep 2004 17:15:26 -0000 1.15 @@ -90,7 +90,7 @@ /** * Returns the session that would be used by the next request (if it asks for one). * @param create if true, will create a new session if no valid session is defined. - * @since 1.5.5 + * @since 1.6 */ public HttpSession getSession( boolean create ) { HttpSession session = _invocationContextFactory.getSession( getCookieValue( ServletUnitHttpSession.SESSION_COOKIE_NAME ), create ); |
From: Russell G. <rus...@us...> - 2004-09-29 17:15:37
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/cookies In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13602/src/com/meterware/httpunit/cookies Modified Files: CookieJar.java Log Message: Clean up documentation for 1.6 Index: CookieJar.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/cookies/CookieJar.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- CookieJar.java 28 Jul 2004 09:02:26 -0000 1.10 +++ CookieJar.java 29 Sep 2004 17:15:26 -0000 1.11 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * - * Copyright (c) 2002, Russell Gold + * Copyright (c) 2002-2004, 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 @@ -85,7 +85,7 @@ /** * Defines a cookie to be sent to the server on every request. This bypasses the normal mechanism by which only * certain cookies are sent based on their host and path. - * @deprecated as of 1.5.5, use #setCookie + * @deprecated as of 1.6, use #putCookie **/ public void addCookie( String name, String value ) { _globalCookies.add( new Cookie( name, value ) ); @@ -95,6 +95,7 @@ /** * Defines a cookie to be sent to the server on every request. This bypasses the normal mechanism by which only * certain cookies are sent based on their host and path. + * @since 1.6 **/ public void putCookie( String name, String value ) { for (Iterator iterator = _globalCookies.iterator(); iterator.hasNext();) { |
From: Russell G. <rus...@us...> - 2004-09-29 17:15:37
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/pseudoserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13602/src/com/meterware/pseudoserver Modified Files: HttpRequest.java Log Message: Clean up documentation for 1.6 Index: HttpRequest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/pseudoserver/HttpRequest.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- HttpRequest.java 30 Sep 2003 00:15:05 -0000 1.7 +++ HttpRequest.java 29 Sep 2004 17:15:26 -0000 1.8 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * -* Copyright (c) 2001-2003, Russell Gold +* Copyright (c) 2001-2004, 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 @@ -30,8 +30,10 @@ /** * Represents a single HTTP request, extracted from the input stream. + * + * @since 1.6 */ -public class HttpRequest extends ReceivedHttpMessage { +class HttpRequest extends ReceivedHttpMessage { private String _protocol; private String _command; |
From: Russell G. <rus...@us...> - 2004-09-28 09:52:41
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28474/test/com/meterware/httpunit Modified Files: FormSubmitTest.java Log Message: bug #1032440: An explanatory exception is now thrown on an attempt to use a mailto: URL in a form submission Index: FormSubmitTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/FormSubmitTest.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- FormSubmitTest.java 9 Aug 2004 22:13:52 -0000 1.33 +++ FormSubmitTest.java 28 Sep 2004 09:52:25 -0000 1.34 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * -* Copyright (c) 2000-2002, Russell Gold +* Copyright (c) 2000-2004, 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 @@ -25,6 +25,7 @@ import com.meterware.pseudoserver.PseudoServlet; import com.meterware.pseudoserver.WebResource; +import org.xml.sax.SAXException; /** @@ -539,6 +540,25 @@ } + public void testMailtoActionRejected() throws Exception { + defineWebPage( "abc/form", "<form name='test' action='mailto:rus...@ht...'>" + + " <input type='text' name='text_field'>" + + " <input type='submit' name='apply' value='Apply'>" + + "</form>" ); + + WebResponse wr = _wc.getResponse( getHostPath() + "/abc/form.html" ); + WebForm form = wr.getForms()[0]; + form.setParameter( "text_field", "a value" ); + + try { + form.submit(); + fail( "Should have thrown an UnsupportedActionException" ); + } catch (UnsupportedActionException success) { + assertTrue( "Did not include mention of bad URL type", success.getMessage().indexOf( "mailto" ) >= 0 ); + } + } + + //---------------------------------------------- private members ------------------------------------------------ |
From: Russell G. <rus...@us...> - 2004-09-28 09:52:41
|
Update of /cvsroot/httpunit/httpunit/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28474/doc Modified Files: release_notes.txt Log Message: bug #1032440: An explanatory exception is now thrown on an attempt to use a mailto: URL in a form submission Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.374 retrieving revision 1.375 diff -u -r1.374 -r1.375 --- release_notes.txt 24 Sep 2004 20:13:16 -0000 1.374 +++ release_notes.txt 28 Sep 2004 09:52:24 -0000 1.375 @@ -13,6 +13,10 @@ Revision History: +27-Sep-2004: + Problems fixed: + 1. bug #1032440: An explanatory exception is now thrown on an attempt to use a mailto: URL in a form submission + 24-Sep-2004: Acknowledgements: Thanks to Dave Brosius for adding hashCode to Cookie and QuerySpec |
From: Russell G. <rus...@us...> - 2004-09-28 09:52:41
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28474/src/com/meterware/httpunit Modified Files: WebForm.java WebRequestSource.java Added Files: UnsupportedActionException.java Log Message: bug #1032440: An explanatory exception is now thrown on an attempt to use a mailto: URL in a form submission ***** Error reading new file[Errno 2] No such file or directory: 'UnsupportedActionException.java' Index: WebForm.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebForm.java,v retrieving revision 1.99 retrieving revision 1.100 diff -u -r1.99 -r1.100 --- WebForm.java 22 Sep 2004 03:15:22 -0000 1.99 +++ WebForm.java 28 Sep 2004 09:52:24 -0000 1.100 @@ -25,6 +25,7 @@ import java.io.IOException; import java.io.File; import java.net.URL; +import java.net.UnknownServiceException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -90,6 +91,15 @@ } + protected WebResponse submitRequest( String event, WebRequest request ) throws IOException, SAXException { + try { + return super.submitRequest( event, request ); + } catch (UnknownServiceException e) { + throw new UnsupportedActionException( "HttpUnit does not support " + request.getURL().getProtocol() + " URLs in form submissions" ); + } + } + + /** * Submits the form without also invoking the button's "onclick" event. */ Index: WebRequestSource.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebRequestSource.java,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- WebRequestSource.java 10 Aug 2004 20:28:52 -0000 1.40 +++ WebRequestSource.java 28 Sep 2004 09:52:25 -0000 1.41 @@ -27,9 +27,13 @@ import java.net.URL; import java.util.StringTokenizer; import java.io.IOException; -import java.io.File; +/** + * Base class for objects which can be clicked to generate new web requests. + * + * @author <a href="mailto:rus...@ht...">Russell Gold</a> + */ abstract public class WebRequestSource extends ParameterHolder implements HTMLElement { |
From: Russell G. <rus...@us...> - 2004-09-26 01:30:51
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22324/src/com/meterware/httpunit Modified Files: WebResponse.java Log Message: patch #1015466: HTTP 1.1 messages without specified lengths are now handled with a read timeout of .5 sec Index: WebResponse.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebResponse.java,v retrieving revision 1.135 retrieving revision 1.136 diff -u -r1.135 -r1.136 --- WebResponse.java 10 Aug 2004 20:28:52 -0000 1.135 +++ WebResponse.java 26 Sep 2004 01:30:37 -0000 1.136 @@ -48,11 +48,13 @@ abstract public class WebResponse implements HTMLSegment, CookieSource { - final private static String HTML_CONTENT = "text/html"; - final private static String XHTML_CONTENT = "application/xhtml+xml"; - final private static String FAUX_XHTML_CONTENT = "text/xhtml"; - - final private static int UNINITIALIZED_INT = -2; + private static final String HTML_CONTENT = "text/html"; + private static final String XHTML_CONTENT = "application/xhtml+xml"; + private static final String FAUX_XHTML_CONTENT = "text/xhtml"; + + private static final int UNINITIALIZED_INT = -2; + private static final int UNKNOWN_LENGTH_TIMEOUT = 500; + private static final int UNKNOWN_LENGTH_RETRY_INTERVAL = 10; private FrameSelector _frame; @@ -937,7 +939,7 @@ } - private byte[] readFromStream( InputStream inputStream, int maxBytes ) throws IOException { + private byte[] readFromStream1( InputStream inputStream, int maxBytes ) throws IOException { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); byte[] buffer = new byte[8 * 1024]; int count = 0; @@ -952,6 +954,41 @@ return bytes; } + private byte[] readFromStream( InputStream inputStream, int maxBytes ) throws IOException { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + byte[] buffer = new byte[8 * 1024]; + int count = 0; + if (maxBytes > 0) { + do { + outputStream.write( buffer, 0, count ); + maxBytes -= count; + if (maxBytes <= 0) break; + count = inputStream.read( buffer, 0, Math.min( maxBytes, buffer.length ) ); + } while (count != -1); + } else { + do { + outputStream.write( buffer, 0, count ); + int available = getAvailableBytes( inputStream ); + count = (available == 0) ? -1 : inputStream.read( buffer, 0, buffer.length ); + } while (count != -1); + } + + byte[] bytes = outputStream.toByteArray(); + return bytes; + } + + + private int getAvailableBytes( InputStream inputStream ) throws IOException { + int timeLeft = UNKNOWN_LENGTH_TIMEOUT; + int available; + do { + timeLeft -= UNKNOWN_LENGTH_RETRY_INTERVAL; + try { Thread.sleep( UNKNOWN_LENGTH_RETRY_INTERVAL ); } catch (InterruptedException e) {} + available = inputStream.available(); + } while (available == 0 && timeLeft > 0); + return available; + } + private void readTags( byte[] rawMessage ) throws UnsupportedEncodingException, MalformedURLException { ByteTagParser parser = new ByteTagParser( rawMessage ); |