httpunit-commit Mailing List for httpunit (Page 19)
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-06-27 16:01:01
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/servletunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17034/test/com/meterware/servletunit Modified Files: WebXMLString.java WebXMLTest.java Log Message: from Fabrizio Giustina: Added entity resolver to handle local DTDs for ServletUnit Index: WebXMLString.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/servletunit/WebXMLString.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- WebXMLString.java 26 Feb 2004 17:36:47 -0000 1.5 +++ WebXMLString.java 27 Jun 2004 16:00:50 -0000 1.6 @@ -59,7 +59,12 @@ String asText() { - StringBuffer result = new StringBuffer( "<?xml version='1.0' encoding='UTF-8'?>\n<web-app>\n" ); + StringBuffer result = new StringBuffer( "<?xml version='1.0' encoding='UTF-8'?>\n" ); + result.append( "<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'>" ); + result.append( "<web-app>\n" ); +// result.append( "<web-app version='2.4' xmlns='http://java.sun.com/xml/ns/j2ee'\n " ); +// result.append( " xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'\n" ); +// result.append( " xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd'>\n" ); for (Iterator i = _contextParams.entrySet().iterator(); i.hasNext();) { Map.Entry entry = (Map.Entry) i.next(); Index: WebXMLTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/servletunit/WebXMLTest.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- WebXMLTest.java 23 Feb 2004 02:04:53 -0000 1.20 +++ WebXMLTest.java 27 Jun 2004 16:00:50 -0000 1.21 @@ -32,8 +32,6 @@ import javax.servlet.*; import javax.servlet.http.*; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; import org.xml.sax.SAXException; @@ -149,9 +147,9 @@ } - private Document newDocument( String contents ) throws UnsupportedEncodingException, SAXException, IOException, ParserConfigurationException { - DocumentBuilderFactory fac = DocumentBuilderFactory.newInstance(); - return fac.newDocumentBuilder().parse( toInputStream( contents ) ); } + private Document newDocument( String contents ) throws UnsupportedEncodingException, SAXException, IOException { + return HttpUnitUtils.newParser().parse( toInputStream( contents ) ); + } private ByteArrayInputStream toInputStream( String contents ) throws UnsupportedEncodingException { |
From: Russell G. <rus...@us...> - 2004-06-27 16:01:01
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17034/src/com/meterware/httpunit Modified Files: HttpUnitUtils.java Log Message: from Fabrizio Giustina: Added entity resolver to handle local DTDs for ServletUnit Index: HttpUnitUtils.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/HttpUnitUtils.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- HttpUnitUtils.java 23 May 2003 03:24:49 -0000 1.13 +++ HttpUnitUtils.java 27 Jun 2004 16:00:49 -0000 1.14 @@ -20,12 +20,16 @@ * *******************************************************************************************************************/ import java.util.StringTokenizer; +import java.io.IOException; +import java.net.URL; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.xml.sax.SAXException; +import org.xml.sax.InputSource; +import org.xml.sax.EntityResolver; /** * Utility code shared by httpunit and servletunit. @@ -95,7 +99,9 @@ public static DocumentBuilder newParser() throws SAXException { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - return factory.newDocumentBuilder(); + DocumentBuilder builder = factory.newDocumentBuilder(); + builder.setEntityResolver( new HttpUnitUtils.ClasspathEntityResolver() ); + return builder; } catch (ParserConfigurationException ex) { // redirect the new exception for code compatibility throw new SAXException( ex ); @@ -177,4 +183,23 @@ static boolean isJavaScriptURL( String urlString ) { return urlString.toLowerCase().startsWith( "javascript:" ); } + + + static class ClasspathEntityResolver implements EntityResolver { + + public InputSource resolveEntity( String publicID, String systemID ) { + if (systemID == null) return null; + + String localName = systemID; + if (localName.indexOf( "/" ) > 0) { + localName = localName.substring( localName.lastIndexOf( "/" ) + 1, localName.length() ); + } + + try { + return new InputSource( getClass().getClassLoader().getResourceAsStream( localName ) ); + } catch (Exception e) { + return null; + } + } + } } \ No newline at end of file |
From: Russell G. <rus...@us...> - 2004-06-27 16:01:00
|
Update of /cvsroot/httpunit/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17034 Modified Files: build.xml Log Message: from Fabrizio Giustina: Added entity resolver to handle local DTDs for ServletUnit Index: build.xml =================================================================== RCS file: /cvsroot/httpunit/httpunit/build.xml,v retrieving revision 1.72 retrieving revision 1.73 diff -u -r1.72 -r1.73 --- build.xml 23 Jun 2004 01:24:48 -0000 1.72 +++ build.xml 27 Jun 2004 16:00:33 -0000 1.73 @@ -91,6 +91,9 @@ <exclude name="**/JUnitServlet.java" unless="junit.present" /> <exclude name="**/javascript/*" unless="rhino.present" /> </javac> + <copy todir="${build.classes}"> + <fileset dir="META-INF" includes="*.dtd"/> + </copy> </target> |
From: Russell G. <rus...@us...> - 2004-06-27 16:00:59
|
Update of /cvsroot/httpunit/httpunit/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17034/doc Modified Files: release_notes.txt Log Message: from Fabrizio Giustina: Added entity resolver to handle local DTDs for ServletUnit Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.340 retrieving revision 1.341 diff -u -r1.340 -r1.341 --- release_notes.txt 24 Jun 2004 23:35:18 -0000 1.340 +++ release_notes.txt 27 Jun 2004 16:00:49 -0000 1.341 @@ -13,6 +13,13 @@ Revision History: +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. Local copies of the 2.2 and 2.3 web.xml dtds are now consulted if specified, rather than connecting to + the Sun website. + 24-Jun-2004 Problems fixed: 1. bug #978770 Clicking on a button outside of a form is now supported |
From: Russell G. <rus...@us...> - 2004-06-27 16:00:58
|
Update of /cvsroot/httpunit/httpunit/META-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17034/META-INF Added Files: web-app_2_2.dtd web-app_2_3.dtd web-app_2_4.xsd Log Message: from Fabrizio Giustina: Added entity resolver to handle local DTDs for ServletUnit --- NEW FILE --- <!-- Copyright 1999 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, CA 94303, U.S.A. All rights reserved. This product or document is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation. No part of this product or documentation may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. Third party software, including font technology, is copyrighted and licensed from Sun suppliers. Sun, Sun Microsystems, the Sun Logo, Solaris, Java, JavaServer Pages, Java Naming and Directory Interface, JDBC, JDK, JavaMail and Enterprise JavaBeans, are trademarks or registered trademarks of Sun Microsystems, Inc in the U.S. and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc. PostScript is a registered trademark of Adobe Systems, Inc. Federal Acquisitions: Commercial Software - Government Users Subject to Standard License Terms and Conditions. DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. _________________________________________________________________________ Copyright 1999 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, CA 94303, Etats-Unis. Tous droits re'serve's. Ce produit ou document est prote'ge' par un copyright et distribue' avec des licences qui en restreignent l'utilisation, la copie, la distribution, et la de'compilation. Aucune partie de ce produit ou de sa documentation associe'e ne peut e^tre reproduite sous aucune forme, par quelque moyen que ce soit, sans l'autorisation pre'alable et e'crite de Sun et de ses bailleurs de licence, s'il y en a. Le logiciel de'tenu par des tiers, et qui comprend la technologie relative aux polices de caracte`res, est prote'ge' par un copyright et licencie' par des fournisseurs de Sun. Sun, Sun Microsystems, le logo Sun, Solaris, Java, JavaServer Pages, Java Naming and Directory Interface, JDBC, JDK, JavaMail, et Enterprise JavaBeans, sont des marques de fabrique ou des marques de'pose'es de Sun Microsystems, Inc. aux Etats-Unis et dans d'autres pays. Toutes les marques SPARC sont utilise'es sous licence et sont des marques de fabrique ou des marques de'pose'es de SPARC International, Inc. aux Etats-Unis et dans d'autres pays. Les produits portant les marques SPARC sont base's sur une architecture de'veloppe'e par Sun Microsystems, Inc. Postcript est une marque enregistre'e d'Adobe Systems Inc. LA DOCUMENTATION EST FOURNIE "EN L'ETAT" ET TOUTES AUTRES CONDITIONS, DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT EXCLUES, DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A L'APTITUDE A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE CONTREFACON. --> <!-- The web-app element is the root of the deployment descriptor for a web application --> <!ELEMENT web-app (icon?, display-name?, description?, distributable?, context-param*, servlet*, servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?, error-page*, taglib*, resource-ref*, security-constraint*, login-config?, security-role*, env-entry*, ejb-ref*)> <!-- The icon element contains a small-icon and a large-icon element which specify the location within the web application for a small and large image used to represent the web application in a GUI tool. At a minimum, tools must accept GIF and JPEG format images. --> <!ELEMENT icon (small-icon?, large-icon?)> <!-- The small-icon element contains the location within the web application of a file containing a small (16x16 pixel) icon image. --> <!ELEMENT small-icon (#PCDATA)> <!-- The large-icon element contains the location within the web application of a file containing a large (32x32 pixel) icon image. --> <!ELEMENT large-icon (#PCDATA)> <!-- The display-name element contains a short name that is intended to be displayed by GUI tools --> <!ELEMENT display-name (#PCDATA)> <!-- The description element is used to provide descriptive text about the parent element. --> <!ELEMENT description (#PCDATA)> <!-- The distributable element, by its presence in a web application deployment descriptor, indicates that this web application is programmed appropriately to be deployed into a distributed servlet container --> <!ELEMENT distributable EMPTY> <!-- The context-param element contains the declaration of a web application's servlet context initialization parameters. --> <!ELEMENT context-param (param-name, param-value, description?)> <!-- The param-name element contains the name of a parameter. --> <!ELEMENT param-name (#PCDATA)> <!-- The param-value element contains the value of a parameter. --> <!ELEMENT param-value (#PCDATA)> <!-- The servlet element contains the declarative data of a servlet. If a jsp-file is specified and the load-on-startup element is present, then the JSP should be precompiled and loaded. --> <!ELEMENT servlet (icon?, servlet-name, display-name?, description?, (servlet-class|jsp-file), init-param*, load-on-startup?, security-role-ref*)> <!-- The servlet-name element contains the canonical name of the servlet. --> <!ELEMENT servlet-name (#PCDATA)> <!-- The servlet-class element contains the fully qualified class name of the servlet. --> <!ELEMENT servlet-class (#PCDATA)> <!-- The jsp-file element contains the full path to a JSP file within the web application. --> <!ELEMENT jsp-file (#PCDATA)> <!-- The init-param element contains a name/value pair as an initialization param of the servlet --> <!ELEMENT init-param (param-name, param-value, description?)> <!-- The load-on-startup element indicates that this servlet should be loaded on the startup of the web application. The optional contents of these element must be a positive integer indicating the order in which the servlet should be loaded. Lower integers are loaded before higher integers. If no value is specified, or if the value specified is not a positive integer, the container is free to load it at any time in the startup sequence. --> <!ELEMENT load-on-startup (#PCDATA)> <!-- The servlet-mapping element defines a mapping between a servlet and a url pattern --> <!ELEMENT servlet-mapping (servlet-name, url-pattern)> <!-- The url-pattern element contains the url pattern of the mapping. Must follow the rules specified in Section 10 of the Servlet API Specification. --> <!ELEMENT url-pattern (#PCDATA)> <!-- The session-config element defines the session parameters for this web application. --> <!ELEMENT session-config (session-timeout?)> <!-- The session-timeout element defines the default session timeout interval for all sessions created in this web application. The specified timeout must be expressed in a whole number of minutes. --> <!ELEMENT session-timeout (#PCDATA)> <!-- The mime-mapping element defines a mapping between an extension and a mime type. --> <!ELEMENT mime-mapping (extension, mime-type)> <!-- The extension element contains a string describing an extension. example: "txt" --> <!ELEMENT extension (#PCDATA)> <!-- The mime-type element contains a defined mime type. example: "text/plain" --> <!ELEMENT mime-type (#PCDATA)> <!-- The welcome-file-list contains an ordered list of welcome files elements. --> <!ELEMENT welcome-file-list (welcome-file+)> <!-- The welcome-file element contains file name to use as a default welcome file, such as index.html --> <!ELEMENT welcome-file (#PCDATA)> <!-- The taglib element is used to describe a JSP tag library. --> <!ELEMENT taglib (taglib-uri, taglib-location)> <!-- The taglib-uri element describes a URI, relative to the location of the web.xml document, identifying a Tag Library used in the Web Application. --> <!ELEMENT taglib-uri (#PCDATA)> <!-- the taglib-location element contains the location (as a resource relative to the root of the web application) where to find the Tag Libary Description file for the tag library. --> <!ELEMENT taglib-location (#PCDATA)> <!-- The error-page element contains a mapping between an error code or exception type to the path of a resource in the web application --> <!ELEMENT error-page ((error-code | exception-type), location)> <!-- The error-code contains an HTTP error code, ex: 404 --> <!ELEMENT error-code (#PCDATA)> <!-- The exception type contains a fully qualified class name of a Java exception type. --> <!ELEMENT exception-type (#PCDATA)> <!-- The location element contains the location of the resource in the web application --> <!ELEMENT location (#PCDATA)> <!-- The resource-ref element contains a declaration of a Web Application's reference to an external resource. --> <!ELEMENT resource-ref (description?, res-ref-name, res-type, res-auth)> <!-- The res-ref-name element specifies the name of the resource factory reference name. --> <!ELEMENT res-ref-name (#PCDATA)> <!-- The res-type element specifies the (Java class) type of the data source. --> <!ELEMENT res-type (#PCDATA)> <!-- The res-auth element indicates whether the application component code performs resource signon programmatically or whether the container signs onto the resource based on the principle mapping information supplied by the deployer. Must be CONTAINER or SERVLET --> <!ELEMENT res-auth (#PCDATA)> <!-- The security-constraint element is used to associate security constraints with one or more web resource collections --> <!ELEMENT security-constraint (web-resource-collection+, auth-constraint?, user-data-constraint?)> <!-- The web-resource-collection element is used to identify a subset of the resources and HTTP methods on those resources within a web application to which a security constraint applies. If no HTTP methods are specified, then the security constraint applies to all HTTP methods. --> <!ELEMENT web-resource-collection (web-resource-name, description?, url-pattern*, http-method*)> <!-- The web-resource-name contains the name of this web resource collection --> <!ELEMENT web-resource-name (#PCDATA)> <!-- The http-method contains an HTTP method (GET | POST |...) --> <!ELEMENT http-method (#PCDATA)> <!-- The user-data-constraint element is used to indicate how data communicated between the client and container should be protected --> <!ELEMENT user-data-constraint (description?, transport-guarantee)> <!-- The transport-guarantee element specifies that the communication between client and server should be NONE, INTEGRAL, or CONFIDENTIAL. NONE means that the application does not require any transport guarantees. A value of INTEGRAL means that the application requires that the data sent between the client and server be sent in such a way that it can't be changed in transit. CONFIDENTIAL means that the application requires that the data be transmitted in a fashion that prevents other entities from observing the contents of the transmission. In most cases, the presence of the INTEGRAL or CONFIDENTIAL flag will indicate that the use of SSL is required. --> <!ELEMENT transport-guarantee (#PCDATA)> <!-- The auth-constraint element indicates the user roles that should be permitted access to this resource collection. The role used here must appear in a security-role-ref element. --> <!ELEMENT auth-constraint (description?, role-name*)> <!-- The role-name element contains the name of a security role. --> <!ELEMENT role-name (#PCDATA)> <!-- The login-config element is used to configure the authentication method that should be used, the realm name that should be used for this application, and the attributes that are needed by the form login mechanism. --> <!ELEMENT login-config (auth-method?, realm-name?, form-login-config?)> <!-- The realm name element specifies the realm name to use in HTTP Basic authorization --> <!ELEMENT realm-name (#PCDATA)> <!-- The form-login-config element specifies the login and error pages that should be used in form based login. If form based authentication is not used, these elements are ignored. --> <!ELEMENT form-login-config (form-login-page, form-error-page)> <!-- The form-login-page element defines the location in the web app where the page that can be used for login can be found --> <!ELEMENT form-login-page (#PCDATA)> <!-- The form-error-page element defines the location in the web app where the error page that is displayed when login is not successful can be found --> <!ELEMENT form-error-page (#PCDATA)> <!-- The auth-method element is used to configure the authentication mechanism for the web application. As a prerequisite to gaining access to any web resources which are protected by an authorization constraint, a user must have authenticated using the configured mechanism. Legal values for this element are "BASIC", "DIGEST", "FORM", or "CLIENT-CERT". --> <!ELEMENT auth-method (#PCDATA)> <!-- The security-role element contains the declaration of a security role which is used in the security-constraints placed on the web application. --> <!ELEMENT security-role (description?, role-name)> <!-- The role-name element contains the name of a role. This element must contain a non-empty string. --> <!ELEMENT security-role-ref (description?, role-name, role-link)> <!-- The role-link element is used to link a security role reference to a defined security role. The role-link element must contain the name of one of the security roles defined in the security-role elements. --> <!ELEMENT role-link (#PCDATA)> <!-- The env-entry element contains the declaration of an application's environment entry. This element is required to be honored on in J2EE compliant servlet containers. --> <!ELEMENT env-entry (description?, env-entry-name, env-entry-value?, env-entry-type)> <!-- The env-entry-name contains the name of an application's environment entry --> <!ELEMENT env-entry-name (#PCDATA)> <!-- The env-entry-value element contains the value of an application's environment entry --> <!ELEMENT env-entry-value (#PCDATA)> <!-- The env-entry-type element contains the fully qualified Java type of the environment entry value that is expected by the application code. The following are the legal values of env-entry-type: java.lang.Boolean, java.lang.String, java.lang.Integer, java.lang.Double, java.lang.Float. --> <!ELEMENT env-entry-type (#PCDATA)> <!-- The ejb-ref element is used to declare a reference to an enterprise bean. --> <!ELEMENT ejb-ref (description?, ejb-ref-name, ejb-ref-type, home, remote, ejb-link?)> <!-- The ejb-ref-name element contains the name of an EJB reference. This is the JNDI name that the servlet code uses to get a reference to the enterprise bean. --> <!ELEMENT ejb-ref-name (#PCDATA)> <!-- The ejb-ref-type element contains the expected java class type of the referenced EJB. --> <!ELEMENT ejb-ref-type (#PCDATA)> <!-- The ejb-home element contains the fully qualified name of the EJB's home interface --> <!ELEMENT home (#PCDATA)> <!-- The ejb-remote element contains the fully qualified name of the EJB's remote interface --> <!ELEMENT remote (#PCDATA)> <!-- The ejb-link element is used in the ejb-ref element to specify that an EJB reference is linked to an EJB in an encompassing Java2 Enterprise Edition (J2EE) application package. The value of the ejb-link element must be the ejb-name of and EJB in the J2EE application package. --> <!ELEMENT ejb-link (#PCDATA)> <!-- The ID mechanism is to allow tools to easily make tool-specific references to the elements of the deployment descriptor. This allows tools that produce additional deployment information (i.e information beyond the standard deployment descriptor information) to store the non-standard information in a separate file, and easily refer from these tools-specific files to the information in the standard web-app deployment descriptor. --> <!ATTLIST web-app id ID #IMPLIED> <!ATTLIST icon id ID #IMPLIED> <!ATTLIST small-icon id ID #IMPLIED> <!ATTLIST large-icon id ID #IMPLIED> <!ATTLIST display-name id ID #IMPLIED> <!ATTLIST description id ID #IMPLIED> <!ATTLIST distributable id ID #IMPLIED> <!ATTLIST context-param id ID #IMPLIED> <!ATTLIST param-name id ID #IMPLIED> <!ATTLIST param-value id ID #IMPLIED> <!ATTLIST servlet id ID #IMPLIED> <!ATTLIST servlet-name id ID #IMPLIED> <!ATTLIST servlet-class id ID #IMPLIED> <!ATTLIST jsp-file id ID #IMPLIED> <!ATTLIST init-param id ID #IMPLIED> <!ATTLIST load-on-startup id ID #IMPLIED> <!ATTLIST servlet-mapping id ID #IMPLIED> <!ATTLIST url-pattern id ID #IMPLIED> <!ATTLIST session-config id ID #IMPLIED> <!ATTLIST session-timeout id ID #IMPLIED> <!ATTLIST mime-mapping id ID #IMPLIED> <!ATTLIST extension id ID #IMPLIED> <!ATTLIST mime-type id ID #IMPLIED> <!ATTLIST welcome-file-list id ID #IMPLIED> <!ATTLIST welcome-file id ID #IMPLIED> <!ATTLIST taglib id ID #IMPLIED> <!ATTLIST taglib-uri id ID #IMPLIED> <!ATTLIST taglib-location id ID #IMPLIED> <!ATTLIST error-page id ID #IMPLIED> <!ATTLIST error-code id ID #IMPLIED> <!ATTLIST exception-type id ID #IMPLIED> <!ATTLIST location id ID #IMPLIED> <!ATTLIST resource-ref id ID #IMPLIED> <!ATTLIST res-ref-name id ID #IMPLIED> <!ATTLIST res-type id ID #IMPLIED> <!ATTLIST res-auth id ID #IMPLIED> <!ATTLIST security-constraint id ID #IMPLIED> <!ATTLIST web-resource-collection id ID #IMPLIED> <!ATTLIST web-resource-name id ID #IMPLIED> <!ATTLIST http-method id ID #IMPLIED> <!ATTLIST user-data-constraint id ID #IMPLIED> <!ATTLIST transport-guarantee id ID #IMPLIED> <!ATTLIST auth-constraint id ID #IMPLIED> <!ATTLIST role-name id ID #IMPLIED> <!ATTLIST login-config id ID #IMPLIED> <!ATTLIST realm-name id ID #IMPLIED> <!ATTLIST form-login-config id ID #IMPLIED> <!ATTLIST form-login-page id ID #IMPLIED> <!ATTLIST form-error-page id ID #IMPLIED> <!ATTLIST auth-method id ID #IMPLIED> <!ATTLIST security-role id ID #IMPLIED> <!ATTLIST security-role-ref id ID #IMPLIED> <!ATTLIST role-link id ID #IMPLIED> <!ATTLIST env-entry id ID #IMPLIED> <!ATTLIST env-entry-name id ID #IMPLIED> <!ATTLIST env-entry-value id ID #IMPLIED> <!ATTLIST env-entry-type id ID #IMPLIED> <!ATTLIST ejb-ref id ID #IMPLIED> <!ATTLIST ejb-ref-name id ID #IMPLIED> <!ATTLIST ejb-ref-type id ID #IMPLIED> <!ATTLIST home id ID #IMPLIED> <!ATTLIST remote id ID #IMPLIED> <!ATTLIST ejb-link id ID #IMPLIED> --- NEW FILE --- <!-- Copyright (c) 2000 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, California 94303, U.S.A. All rights reserved. Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is described in this document. In particular, and without limitation, these intellectual property rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or more additional patents or pending patent applications in the U.S. and in other countries. This document and the product to which it pertains are distributed under licenses restricting their use, copying, distribution, and decompilation. This document may be reproduced and distributed but may not be changed without prior written authorization of Sun and its licensors, if any. [...1024 lines suppressed...] <!ATTLIST security-role id ID #IMPLIED> <!ATTLIST security-role-ref id ID #IMPLIED> <!ATTLIST servlet id ID #IMPLIED> <!ATTLIST servlet-class id ID #IMPLIED> <!ATTLIST servlet-mapping id ID #IMPLIED> <!ATTLIST servlet-name id ID #IMPLIED> <!ATTLIST session-config id ID #IMPLIED> <!ATTLIST session-timeout id ID #IMPLIED> <!ATTLIST small-icon id ID #IMPLIED> <!ATTLIST taglib id ID #IMPLIED> <!ATTLIST taglib-location id ID #IMPLIED> <!ATTLIST taglib-uri id ID #IMPLIED> <!ATTLIST transport-guarantee id ID #IMPLIED> <!ATTLIST url-pattern id ID #IMPLIED> <!ATTLIST user-data-constraint id ID #IMPLIED> <!ATTLIST web-app id ID #IMPLIED> <!ATTLIST web-resource-collection id ID #IMPLIED> <!ATTLIST web-resource-name id ID #IMPLIED> <!ATTLIST welcome-file id ID #IMPLIED> <!ATTLIST welcome-file-list id ID #IMPLIED> --- NEW FILE --- <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://java.sun.com/xml/ns/j2ee" xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.4"> <xsd:annotation> <xsd:documentation> @(#)web-app_2_4.xsds 1.60 03/08/26 </xsd:documentation> </xsd:annotation> <xsd:annotation> <xsd:documentation> Copyright 2003 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, California 94303, U.S.A. All rights [...1194 lines suppressed...] <xsd:sequence> <xsd:element name="welcome-file" type="xsd:string" maxOccurs="unbounded"> <xsd:annotation> <xsd:documentation> The welcome-file element contains file name to use as a default welcome file, such as index.html </xsd:documentation> </xsd:annotation> </xsd:element> </xsd:sequence> <xsd:attribute name="id" type="xsd:ID"/> </xsd:complexType> </xsd:schema> |
From: Russell G. <rus...@us...> - 2004-06-27 15:59:01
|
Update of /cvsroot/httpunit/httpunit/META-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16653/META-INF Log Message: Directory /cvsroot/httpunit/httpunit/META-INF added to the repository |
From: Russell G. <rus...@us...> - 2004-06-24 23:35:28
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18194/test/com/meterware/httpunit/javascript Modified Files: HTMLElementTest.java Log Message: bug #838947 Document.getElementById now returns null if no such element exists Index: HTMLElementTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/HTMLElementTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- HTMLElementTest.java 23 Sep 2003 12:13:44 -0000 1.5 +++ HTMLElementTest.java 24 Jun 2004 23:35:18 -0000 1.6 @@ -71,6 +71,24 @@ } + public void testElementByIdReturnsNull() throws Exception { + defineResource( "start.html", + "<html><head><script language='JavaScript'>" + + "function showNone() {" + + " alert( 'It returned ' + document.getElementById( 'zork' ) )" + + "}</script>" + + "</head><body onLoad='showNone();'>" + + "<div id=myDiv title=first><a href='somewhere' id='there' title=second>here</a>" + + "<table id=grouping title=third><tr><td id='aCell' title=fourth>" + + "<form id='perform' title=fifth><input type='submit' id='doIt' title=sixth></form>" + + "</td></tr></table></div>" ); + WebConversation wc = new WebConversation(); + wc.getResponse( getHostPath() + "/start.html" ); + + assertEquals( "Null test alert", "It returned null", wc.popNextAlert() ); + } + + public void testNameProperty() throws Exception { defineResource( "start.html", "<html><head><script language='JavaScript'>" + |
From: Russell G. <rus...@us...> - 2004-06-24 23:35:28
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/javascript In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18194/src/com/meterware/httpunit/javascript Modified Files: JavaScript.java Log Message: bug #838947 Document.getElementById now returns null if no such element exists Index: JavaScript.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/javascript/JavaScript.java,v retrieving revision 1.59 retrieving revision 1.60 diff -u -r1.59 -r1.60 --- JavaScript.java 24 Jun 2004 23:32:30 -0000 1.59 +++ JavaScript.java 24 Jun 2004 23:35:18 -0000 1.60 @@ -532,7 +532,8 @@ public Object jsFunction_getElementById( String id ) { - return toScriptable( getDelegate().getElementWithID( id ) ); + ScriptableDelegate elementWithID = getDelegate().getElementWithID( id ); + return elementWithID == null ? null : toScriptable( elementWithID ); } |
From: Russell G. <rus...@us...> - 2004-06-24 23:35:27
|
Update of /cvsroot/httpunit/httpunit/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18194/doc Modified Files: release_notes.txt Log Message: bug #838947 Document.getElementById now returns null if no such element exists Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.339 retrieving revision 1.340 diff -u -r1.339 -r1.340 --- release_notes.txt 24 Jun 2004 23:32:22 -0000 1.339 +++ release_notes.txt 24 Jun 2004 23:35:18 -0000 1.340 @@ -1,4 +1,4 @@ -HttpUnit release notes +HttpUnit release notes Known problems: 1. The "accept-charset" attribute for forms is ignored; the page content character set is used to encode any response. @@ -16,6 +16,7 @@ 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: |
From: Russell G. <rus...@us...> - 2004-06-24 23:33:19
|
Update of /cvsroot/httpunit/httpunit/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17312/doc Modified Files: release_notes.txt Log Message: bug #978770: support buttons outside of forms Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.338 retrieving revision 1.339 diff -u -r1.338 -r1.339 --- release_notes.txt 23 Jun 2004 23:24:00 -0000 1.338 +++ release_notes.txt 24 Jun 2004 23:32:22 -0000 1.339 @@ -13,6 +13,10 @@ Revision History: +24-Jun-2004 + Problems fixed: + 1. bug #978770 Clicking on a button outside of a form is now supported + 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 |
From: Russell G. <rus...@us...> - 2004-06-24 23:32:44
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17312/test/com/meterware/httpunit/javascript Modified Files: ScriptingTest.java Log Message: bug #978770: support buttons outside of forms Index: ScriptingTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/ScriptingTest.java,v retrieving revision 1.60 retrieving revision 1.61 diff -u -r1.60 -r1.61 --- ScriptingTest.java 21 Jun 2004 23:25:27 -0000 1.60 +++ ScriptingTest.java 24 Jun 2004 23:32:30 -0000 1.61 @@ -710,4 +710,15 @@ assertNull( "Alert should have been removed", wc.getNextAlert() ); } + + public void testButtonWithoutForm() throws Exception { + defineWebPage( "OnCommand", "<button id='mybutton' onclick='alert( \"I heard you!\" )'>" ); + WebConversation wc = new WebConversation(); + WebResponse response = wc.getResponse( getHostPath() + "/OnCommand.html" ); + Button button = (Button) response.getElementWithID( "mybutton" ); + button.click(); + assertEquals( "Alert message 1", "I heard you!", wc.popNextAlert() ); + } + + } |
From: Russell G. <rus...@us...> - 2004-06-24 23:32:44
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/javascript In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17312/src/com/meterware/httpunit/javascript Modified Files: JavaScript.java Log Message: bug #978770: support buttons outside of forms Index: JavaScript.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/javascript/JavaScript.java,v retrieving revision 1.58 retrieving revision 1.59 diff -u -r1.58 -r1.59 --- JavaScript.java 9 Mar 2004 21:49:18 -0000 1.58 +++ JavaScript.java 24 Jun 2004 23:32:30 -0000 1.59 @@ -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 @@ -1018,7 +1018,7 @@ void initialize( JavaScriptEngine parent, ScriptableDelegate scriptable ) throws JavaScriptException, NotAFunctionException, PropertyException, SAXException { super.initialize( parent, scriptable ); - _form = (Form) parent; + if (parent instanceof Form) _form = (Form) parent; } |
From: Russell G. <rus...@us...> - 2004-06-24 23:32:44
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17312/src/com/meterware/httpunit Modified Files: Button.java ParsedHTML.java Log Message: bug #978770: support buttons outside of forms Index: Button.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/Button.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- Button.java 9 Mar 2004 20:31:03 -0000 1.13 +++ Button.java 24 Jun 2004 23:32:24 -0000 1.14 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * - * Copyright (c) 2002-2003, 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 @@ -38,6 +38,7 @@ static final public HTMLElementPredicate WITH_LABEL; private String _onClickEvent = ""; + private WebResponse _baseResponse; public String getType() { @@ -56,6 +57,13 @@ } + Button( WebResponse response, Node node ) { + super( null, node ); + _onClickEvent = NodeUtils.getNodeAttribute( node, "onclick" ); + _baseResponse = response; + } + + /** * Returns the value associated with this button. **/ @@ -114,6 +122,12 @@ } + protected ScriptableDelegate getParentDelegate() { + if (getForm() != null) return super.getParentDelegate(); + return _baseResponse.getScriptableObject().getDocument(); + } + + class Scriptable extends FormControl.Scriptable { public void click() throws IOException, SAXException { Index: ParsedHTML.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/ParsedHTML.java,v retrieving revision 1.52 retrieving revision 1.53 diff -u -r1.52 -r1.53 --- ParsedHTML.java 13 Jun 2004 20:57:25 -0000 1.52 +++ ParsedHTML.java 24 Jun 2004 23:32:29 -0000 1.53 @@ -518,13 +518,25 @@ HTMLElement toHTMLElement( NodeUtils.PreOrderTraversal pot, ParsedHTML parsedHTML, Element element ) { final WebForm form = getForm( pot ); - return form == null ? null : form.newFormControl( element ); + return form == null ? newControlWithoutForm( parsedHTML, element ) : form.newFormControl( element ); } + + private HTMLElement newControlWithoutForm( ParsedHTML parsedHTML, Element element ) { + if (element.getNodeName().equalsIgnoreCase( "button" ) && + NodeUtils.getNodeAttribute( element, "type" ).equals( "" )) { + return parsedHTML.toButtonWithoutForm( element ); + } else { + return null; + } + } + private WebForm getForm( NodeUtils.PreOrderTraversal pot ) { return getRootContext( pot )._activeForm; } + protected void addToLists( NodeUtils.PreOrderTraversal pot, HTMLElement htmlElement ) { - getForm( pot ).addFormControl( (FormControl) htmlElement ); + WebForm form = getForm( pot ); + if (form != null) form.addFormControl( (FormControl) htmlElement ); } } @@ -589,6 +601,11 @@ } + private Button toButtonWithoutForm( Element element ) { + return new Button( _response, element ); + } + + private WebForm toWebForm( Element element ) { return new WebForm( _response, _baseURL, element, _frame, _baseTarget, _characterSet ); } |
From: Russell G. <rus...@us...> - 2004-06-23 23:24:09
|
Update of /cvsroot/httpunit/httpunit/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30315/doc Modified Files: release_notes.txt Log Message: bug #974380 When using a DNS listener, host header no longer includes ':-1' if the port is not specified Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.337 retrieving revision 1.338 diff -u -r1.337 -r1.338 --- release_notes.txt 23 Jun 2004 01:30:17 -0000 1.337 +++ release_notes.txt 23 Jun 2004 23:24:00 -0000 1.338 @@ -13,6 +13,10 @@ Revision History: +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 |
From: Russell G. <rus...@us...> - 2004-06-23 23:24:09
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30315/test/com/meterware/httpunit Modified Files: WebClientTest.java Log Message: bug #974380 When using a DNS listener, host header no longer includes ':-1' if the port is not specified Index: WebClientTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/WebClientTest.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- WebClientTest.java 23 Jun 2004 01:30:18 -0000 1.18 +++ WebClientTest.java 23 Jun 2004 23:24:00 -0000 1.19 @@ -30,6 +30,7 @@ import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.UnknownHostException; +import java.net.ConnectException; import java.util.ArrayList; import java.util.List; import java.util.zip.GZIPOutputStream; @@ -491,4 +492,18 @@ } + public void testHostHeaderWithDNSOverride() throws Exception { + WebConversation wc = new WebConversation(); + wc.getClientProperties().setDnsListener( new DNSListener() { + public String getIpAddress( String hostName ) { return "127.0.0.1"; } + }); + + try { + wc.getResponse( "http://meterware.com" ); + } catch (ConnectException e) {} + + assertEquals( "Submitted host header", "meterware.com", wc.getHeaderField( "Host" ) ); + } + + } |
From: Russell G. <rus...@us...> - 2004-06-23 23:24:09
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30315/src/com/meterware/httpunit Modified Files: WebConversation.java Log Message: bug #974380 When using a DNS listener, host header no longer includes ':-1' if the port is not specified Index: WebConversation.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebConversation.java,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- WebConversation.java 23 Jun 2004 01:30:17 -0000 1.35 +++ WebConversation.java 23 Jun 2004 23:24:00 -0000 1.36 @@ -74,7 +74,8 @@ if (dnsListener == null) return request.getURL(); String hostName = request.getURL().getHost(); - setHeaderField( "Host", hostName + ':' + request.getURL().getPort() ); + String portPortion = request.getURL().getPort() == -1 ? "" : (":" + request.getURL().getPort()); + setHeaderField( "Host", hostName + portPortion ); String actualHost = dnsListener.getIpAddress( hostName ); if (HttpUnitOptions.isLoggingHttpHeaders()) System.out.println( "Rerouting request to :: " + actualHost ); return new URL( request.getURL().getProtocol(), actualHost, request.getURL().getPort(), request.getURL().getFile() ); |
From: Russell G. <rus...@us...> - 2004-06-23 09:53:56
|
Update of /cvsroot/httpunit/httpunit/sitedocs/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22715/sitedocs/doc Modified Files: cookbook.html Log Message: update site info Index: cookbook.html =================================================================== RCS file: /cvsroot/httpunit/httpunit/sitedocs/doc/cookbook.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- cookbook.html 18 May 2003 13:01:06 -0000 1.1 +++ cookbook.html 23 Jun 2004 09:53:45 -0000 1.2 @@ -28,7 +28,7 @@ for the <CODE>WebResponse</CODE> class, above. That page could therefore be obtained as follows: <PRE> WebConversation wc = <b>new</b> WebConversation(); - WebResponse resp = wc.getResponse( "http://www.httpunit.org/doc/Cookbook.html" ); // read this page + WebResponse resp = wc.getResponse( "http://www.httpunit.org/doc/cookbook.html" ); // read this page WebLink link = resp.getLinkWith( "response" ); // find the link link.click(); // follow it WebResponse jdoc = wc.getCurrentPage(); // retrieve the referenced page |
From: Russell G. <rus...@us...> - 2004-06-23 09:53:56
|
Update of /cvsroot/httpunit/httpunit/sitedocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22715/sitedocs Modified Files: news.xml site.xml welcome.html Log Message: update site info Index: news.xml =================================================================== RCS file: /cvsroot/httpunit/httpunit/sitedocs/news.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- news.xml 21 Aug 2003 11:52:37 -0000 1.2 +++ news.xml 23 Jun 2004 09:53:45 -0000 1.3 @@ -1,6 +1,12 @@ <?xml version='1.0' ?> <news> + <item date="16-June-2004" url="http://www.httpunit.org/prerelease/httpunit-1.5.5-d-16Jun.zip"> +Prerelease: Massive reworking of target functionality, PseudoServer handles large messages</item> + <item date="29-Apr-2004" url="http://www.httpunit.org/prerelease/httpunit-1.5.5-d-29Apr.zip"> +Prerelease: ServletUnit now supports filters and listeners, PseudoServer emulates proxy server</item> + <item date="19-Sep-2003" url="http://www.httpunit.org/prerelease/httpunit-1.5.5-d-19Sep.zip"> +Prerelease: Added attributes for HTMLElement, improved PseudoServer</item> <item date="21-Aug-2003">HttpUnit 1.5.4 released</item> <item date="16-May-2003">New web site format created</item> <item date="4-Apr-2003">HttpUnit 1.5.3 released</item> -</news> \ No newline at end of file +</news> Index: site.xml =================================================================== RCS file: /cvsroot/httpunit/httpunit/sitedocs/site.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- site.xml 2 Mar 2004 10:51:39 -0000 1.2 +++ site.xml 23 Jun 2004 09:53:45 -0000 1.3 @@ -11,7 +11,7 @@ <fragment source="sitedocs/doc/license.html"/> </page> - <external location="http://prdownloads.sourceforge.net/httpunit/httpunit-1.5.3.zip?download" item="Download 1.5.3"/> + <external location="http://prdownloads.sourceforge.net/httpunit/httpunit-1.5.4.zip?download" item="Download 1.5.4"/> <space/> <page location="doc/cookbook.html" title="Cookbook"> @@ -53,4 +53,4 @@ <project-page type="enhancements" item="Feature Requests" /> <space/> <project-page type="donations" item="Support HttpUnit"/> -</site> \ No newline at end of file +</site> Index: welcome.html =================================================================== RCS file: /cvsroot/httpunit/httpunit/sitedocs/welcome.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- welcome.html 18 May 2003 05:20:47 -0000 1.1 +++ welcome.html 23 Jun 2004 09:53:45 -0000 1.2 @@ -11,7 +11,7 @@ <p>In either case, you need to be able to bypass the browser and access your site from a program. HttpUnit makes this easy. Written in Java, HttpUnit emulates the relevant portions of browser behavior, including -form submission, <a href="doc/Javascript-support.html">JavaScript</a>, +form submission, <a href="doc/javascript-support.html">JavaScript</a>, basic <A HREF="ftp://ftp.isi.edu/in-notes/rfc2617.txt">http authentication</A>, cookies and automatic page redirection, and allows Java test code to examine returned pages either as text, an XML DOM, or containers of forms, tables, and links. When @@ -23,9 +23,9 @@ <h2>Documentation</h2> Several working example files come with the distribution download. -A rudimentary <A HREF="doc/Cookbook.html">Cookbook</A> is available, as are +A rudimentary <A HREF="doc/cookbook.html">Cookbook</A> is available, as are a <a href="doc/tutorial/index.html">tutorial</a>, a <A HREF="doc/faq.html">FAQ</A> and the <A HREF="doc/api/index.html">javadoc</A>. Work has also begun on a <a href="doc/manual/index.html">User's Manual</a> </body> -</html> \ No newline at end of file +</html> |
From: Russell G. <rus...@us...> - 2004-06-23 01:30:27
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5988/src/com/meterware/httpunit Modified Files: HttpWebResponse.java WebClient.java WebConversation.java WebRequest.java WebResponse.java Log Message: bug #964940: now send Referer header even after redirect Index: HttpWebResponse.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/HttpWebResponse.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- HttpWebResponse.java 18 Jun 2004 21:05:37 -0000 1.31 +++ HttpWebResponse.java 23 Jun 2004 01:30:17 -0000 1.32 @@ -41,6 +41,8 @@ **/ class HttpWebResponse extends WebResponse { + private String _referer; + /** * Constructs a response object from an input stream. @@ -61,6 +63,13 @@ } + HttpWebResponse( WebConversation client, FrameSelector frame, WebRequest request, URLConnection connection, boolean throwExceptionOnError ) throws IOException { + this( client, frame, request.getURL(), connection, throwExceptionOnError ); + _referer = request.getReferer(); + } + + + private InputStream getInputStream( URLConnection connection ) throws IOException { return isResponseOnErrorStream( connection ) ? ((HttpURLConnection) connection).getErrorStream() @@ -130,6 +139,11 @@ } + String getReferer() { + return _referer; + } + + //------------------------------------- private members ------------------------------------- Index: WebClient.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebClient.java,v retrieving revision 1.56 retrieving revision 1.57 diff -u -r1.56 -r1.57 --- WebClient.java 16 Jun 2004 01:10:55 -0000 1.56 +++ WebClient.java 23 Jun 2004 01:30:17 -0000 1.57 @@ -648,6 +648,7 @@ RedirectWebRequest( WebResponse response ) throws MalformedURLException { super( response.getURL(), response.getHeaderField( "Location" ), response.getFrame(), response.getFrameName() ); + if (response.getReferer() != null) setHeaderField( "Referer", response.getReferer() ); } Index: WebConversation.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebConversation.java,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- WebConversation.java 18 Jun 2004 21:05:38 -0000 1.34 +++ WebConversation.java 23 Jun 2004 01:30:17 -0000 1.35 @@ -65,7 +65,7 @@ sendHeaders( connection, getHeaderFields( request.getURL() ) ); sendHeaders( connection, request.getHeaderDictionary() ); request.completeRequest( connection ); - return new HttpWebResponse( this, targetFrame, request.getURL(), connection, getExceptionsThrownOnErrorStatus() ); + return new HttpWebResponse( this, targetFrame, request, connection, getExceptionsThrownOnErrorStatus() ); } Index: WebRequest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebRequest.java,v retrieving revision 1.59 retrieving revision 1.60 diff -u -r1.59 -r1.60 --- WebRequest.java 13 Jun 2004 20:57:26 -0000 1.59 +++ WebRequest.java 23 Jun 2004 01:30:17 -0000 1.60 @@ -34,6 +34,8 @@ abstract public class WebRequest { + static final String REFERER_HEADER_NAME = "Referer"; + private static URLStreamHandler JAVASCRIPT_STREAM_HANDLER = new JavascriptURLStreamHandler(); private static URLStreamHandler HTTPS_STREAM_HANDLER = new HttpsURLStreamHandler(); @@ -48,6 +50,7 @@ private SubmitButton _button; + /** * Sets the value of a header to be sent with this request. A header set here will override any matching header set * in the WebClient when the request is actually sent. @@ -363,7 +366,7 @@ protected WebRequest( WebRequestSource requestSource, ParameterHolder parameterHolder ) { this( requestSource.getBaseURL(), requestSource.getRelativePage(), requestSource.getFrame(), requestSource.getTarget(), parameterHolder ); _webRequestSource = requestSource; - setHeaderField( "Referer", requestSource.getBaseURL().toExternalForm() ); + setHeaderField( REFERER_HEADER_NAME, requestSource.getBaseURL().toExternalForm() ); } @@ -519,6 +522,11 @@ return _headers; } + + String getReferer() { + return _headers == null ? null : (String) _headers.get( REFERER_HEADER_NAME ); + } + } Index: WebResponse.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebResponse.java,v retrieving revision 1.126 retrieving revision 1.127 diff -u -r1.126 -r1.127 --- WebResponse.java 21 Jun 2004 23:25:26 -0000 1.126 +++ WebResponse.java 23 Jun 2004 01:30:17 -0000 1.127 @@ -1113,6 +1113,11 @@ } + String getReferer() { + return null; + } + + //======================================================================================= |
From: Russell G. <rus...@us...> - 2004-06-23 01:30:26
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5988/test/com/meterware/httpunit Modified Files: WebClientTest.java Log Message: bug #964940: now send Referer header even after redirect Index: WebClientTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/WebClientTest.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- WebClientTest.java 4 Jun 2004 01:20:03 -0000 1.17 +++ WebClientTest.java 23 Jun 2004 01:30:18 -0000 1.18 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * - * Copyright (c) 2002-2003, 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 @@ -260,6 +260,30 @@ } + public void testRedirectedRefererHeader() throws Exception { + String linkSource = "fromLink"; + String linkTarget = "anOldOne"; + String resourceName = "tellMe"; + + defineResource( linkSource, "<html><head></head><body><a href='" + linkTarget + "'>Go</a></body></html>" ); + + defineResource( linkTarget, "ignored content", HttpURLConnection.HTTP_MOVED_PERM ); + addResourceHeader( linkTarget, "Location: " + getHostPath() + '/' + resourceName ); + + defineResource( resourceName, new PseudoServlet() { + public WebResource getGetResponse() { + String referer = getHeader( "Referer" ); + return new WebResource( referer == null ? "null" : referer, "text/plain" ); + } + } ); + + WebConversation wc = new WebConversation(); + WebResponse response = wc.getResponse( getHostPath() + '/' + linkSource ); + response = wc.getResponse( response.getLinks()[0].getRequest() ); + assertEquals( "Link Referer header", getHostPath() + '/' + linkSource, response.getText().trim() ); + } + + public void testGZIPDisabled() throws Exception { String expectedResponse = "Here is my answer"; defineResource( "Compressed.html", new CompressedPseudoServlet( expectedResponse ) ); |
From: Russell G. <rus...@us...> - 2004-06-23 01:30:26
|
Update of /cvsroot/httpunit/httpunit/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5988/doc Modified Files: release_notes.txt Log Message: bug #964940: now send Referer header even after redirect Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.336 retrieving revision 1.337 diff -u -r1.336 -r1.337 --- release_notes.txt 21 Jun 2004 23:25:14 -0000 1.336 +++ release_notes.txt 23 Jun 2004 01:30:17 -0000 1.337 @@ -13,6 +13,10 @@ Revision History: +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. |
From: Russell G. <rus...@us...> - 2004-06-23 01:24:57
|
Update of /cvsroot/httpunit/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4862 Modified Files: build.xml Log Message: Include tutorial in website update Index: build.xml =================================================================== RCS file: /cvsroot/httpunit/httpunit/build.xml,v retrieving revision 1.71 retrieving revision 1.72 diff -u -r1.71 -r1.72 --- build.xml 29 Feb 2004 15:25:20 -0000 1.71 +++ build.xml 23 Jun 2004 01:24:48 -0000 1.72 @@ -282,7 +282,7 @@ <!-- =================================================================== --> <target name="update-website" depends="compile-site"> <copy todir="${web.dir}"> - <fileset dir="." includes="site.css,favicon.ico,doc/images/**" /> + <fileset dir="." includes="site.css,favicon.ico,doc/images/**,doc/tutorial/*.html" /> </copy> <java classname="com.meterware.httpunit.site.WebSite" fork="yes" > <classpath> |
From: Russell G. <rus...@us...> - 2004-06-21 23:25:35
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1806/src/com/meterware/httpunit Modified Files: WebResponse.java Log Message: bug #974675: Window.open( ..., _self ) now updates current window. Index: WebResponse.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebResponse.java,v retrieving revision 1.125 retrieving revision 1.126 diff -u -r1.125 -r1.126 --- WebResponse.java 13 Jun 2004 20:57:27 -0000 1.125 +++ WebResponse.java 21 Jun 2004 23:25:26 -0000 1.126 @@ -658,11 +658,14 @@ if (urlString == null || urlString.trim().length() == 0) urlString = "about:"; GetMethodWebRequest request = new GetMethodWebRequest( getURL(), urlString ); + // TODO this logic is so close to that used for regular links (except that it ignores subframe names), isn't there a way to combine them? + WebWindow[] windows = _client.getOpenWindows(); for (int i = 0; i < windows.length; i++) { WebWindow window = windows[i]; if (window.getName().equals( name )) return window.getResponse( request ).getScriptableObject(); } + if (WebRequest.SAME_FRAME.equalsIgnoreCase( name )) return WebResponse.this.getWindow().getResponse( request ).getScriptableObject(); return _client.openInNewWindow( request, name, WebResponse.this ).getScriptableObject(); } |
From: Russell G. <rus...@us...> - 2004-06-21 23:25:35
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1806/test/com/meterware/httpunit/javascript Modified Files: ScriptingTest.java Log Message: bug #974675: Window.open( ..., _self ) now updates current window. Index: ScriptingTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/ScriptingTest.java,v retrieving revision 1.59 retrieving revision 1.60 diff -u -r1.59 -r1.60 --- ScriptingTest.java 12 Feb 2004 06:23:09 -0000 1.59 +++ ScriptingTest.java 21 Jun 2004 23:25:27 -0000 1.60 @@ -305,6 +305,29 @@ } + public void testWindowOpenWithSelf() throws Exception { + defineResource( "Target.txt", "You made it!", "text/plain" ); + defineResource( "OnCommand.html", "<html><head><title>Amazing!</title></head>" + + "<body><script language='JavaScript'>var otherWindow;</script>" + + "<a href='#' onClick=\"otherWindow = window.open( '" + getHostPath() + "/Target.txt', '_self' );\">go</a>" + + "<a href='#' onClick=\"otherWindow.close();\">go</a>" + + "<a href='#' onClick=\"alert( 'window is ' + (otherWindow.closed ? '' : 'not ') + 'closed' );\">go</a>" + + "</body></html>" ); + final ArrayList windowsOpened = new ArrayList(); + WebConversation wc = new WebConversation(); + wc.addWindowListener( new WebWindowListener() { + public void windowOpened( WebClient client, WebWindow window ) { windowsOpened.add( window ); } + public void windowClosed( WebClient client, WebWindow window ) {} + } ); + WebResponse response = wc.getResponse( getHostPath() + "/OnCommand.html" ); + response.getLinks()[0].click(); + + assertTrue( "Opened a new window", windowsOpened.isEmpty() ); + assertEquals( "New window message", "You made it!", wc.getCurrentPage().getText() ); + assertEquals( "Number of open windows", 1, wc.getOpenWindows().length ); + } + + public void testJavascriptURLWithFragment() throws Exception { defineResource( "Target.txt", "You made it!", "text/plain" ); defineResource( "OnCommand.html", "<html><head><title>Amazing!</title></head>" + |
From: Russell G. <rus...@us...> - 2004-06-21 23:25:34
|
Update of /cvsroot/httpunit/httpunit/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1806/doc Modified Files: release_notes.txt Log Message: bug #974675: Window.open( ..., _self ) now updates current window. Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.335 retrieving revision 1.336 diff -u -r1.335 -r1.336 --- release_notes.txt 18 Jun 2004 21:05:36 -0000 1.335 +++ release_notes.txt 21 Jun 2004 23:25:14 -0000 1.336 @@ -13,6 +13,10 @@ Revision History: +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 |