httpunit-commit Mailing List for httpunit (Page 40)
Brought to you by:
russgold
You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(5) |
Sep
(31) |
Oct
(39) |
Nov
(18) |
Dec
(6) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(8) |
Feb
(5) |
Mar
(8) |
Apr
(25) |
May
(20) |
Jun
(23) |
Jul
(28) |
Aug
(10) |
Sep
(3) |
Oct
(32) |
Nov
(61) |
Dec
(24) |
| 2002 |
Jan
(50) |
Feb
(34) |
Mar
(35) |
Apr
(3) |
May
(25) |
Jun
(25) |
Jul
(30) |
Aug
(146) |
Sep
(49) |
Oct
(156) |
Nov
(121) |
Dec
(54) |
| 2003 |
Jan
(12) |
Feb
(79) |
Mar
(88) |
Apr
(26) |
May
(67) |
Jun
(29) |
Jul
(8) |
Aug
(16) |
Sep
(20) |
Oct
(17) |
Nov
|
Dec
(5) |
| 2004 |
Jan
|
Feb
(40) |
Mar
(30) |
Apr
(5) |
May
|
Jun
(83) |
Jul
(34) |
Aug
(20) |
Sep
(44) |
Oct
(46) |
Nov
|
Dec
(14) |
| 2005 |
Jan
(4) |
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(4) |
Oct
|
Nov
|
Dec
(1) |
| 2006 |
Jan
|
Feb
|
Mar
(26) |
Apr
(8) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(5) |
Nov
|
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
(36) |
May
(38) |
Jun
(1) |
Jul
(1) |
Aug
|
Sep
(4) |
Oct
|
Nov
(18) |
Dec
(4) |
| 2009 |
Jan
|
Feb
(2) |
Mar
(3) |
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(35) |
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
(9) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(21) |
Oct
(18) |
Nov
(1) |
Dec
|
|
From: Russell G. <rus...@us...> - 2002-12-22 14:06:54
|
Update of /cvsroot/httpunit/httpunit/jars
In directory sc8-pr-cvs1:/tmp/cvs-serv19688
Added Files:
rhino-patch.txt
Log Message:
add diff file for patched jar
--- NEW FILE ---
Index: js/rhino/src/org/mozilla/javascript/Interpreter.java
===================================================================
RCS file: /cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/Interpreter.java,v
retrieving revision 1.113
diff -r1.113 Interpreter.java
2029a2030,2036
> else if (lhs == undefined) {
> // special code for better error message for get property from undefined
>
> int i = getShort(iCode, pc-6);
> if (i != -1) lhs=strings[i];
> throw NativeGlobal.typeError1( "msg.is.not.defined", ScriptRuntime.toString(lhs),scope );
> }
|
|
From: Russell G. <rus...@us...> - 2002-12-22 13:59:15
|
Update of /cvsroot/httpunit/httpunit
In directory sc8-pr-cvs1:/tmp/cvs-serv17832
Modified Files:
build.xml
Log Message:
Added line breaks to manifest
Index: build.xml
===================================================================
RCS file: /cvsroot/httpunit/httpunit/build.xml,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -r1.60 -r1.61
--- build.xml 22 Dec 2002 13:26:00 -0000 1.60
+++ build.xml 22 Dec 2002 13:59:08 -0000 1.61
@@ -173,11 +173,12 @@
<!-- =================================================================== -->
<target name="jar" depends="compile">
<mkdir dir="${lib.dir}" />
- <echo file="${build.dir}/info.txt" message="Manifest-Version: 1.0" />
- <echo file="${build.dir}/info.txt" message="Sealed: false" append="yes" />
- <echo file="${build.dir}/info.txt" message="HttpUnit-Version: ${version}" append="yes" />
- <echo file="${build.dir}/info.txt" message="Build-Date: ${TODAY}" append="yes" />
- <echo file="${build.dir}/info.txt" message="Build-Time: ${TSTAMP}" append="yes" />
+ <echo file="${build.dir}/info.txt">Manifest-Version: 1.0
+Sealed: false
+HttpUnit-Version: ${version}
+Build-Date: ${TODAY}
+Build-Time: ${TSTAMP}
+</echo>
<jar jarfile="${lib.dir}/${name}.jar" basedir="${build.classes}" includes="com/**" manifest="${build.dir}/info.txt" />
</target>
|
|
From: Russell G. <rus...@us...> - 2002-12-22 13:26:03
|
Update of /cvsroot/httpunit/httpunit
In directory sc8-pr-cvs1:/tmp/cvs-serv9573
Modified Files:
build.xml
Log Message:
update version number
Index: build.xml
===================================================================
RCS file: /cvsroot/httpunit/httpunit/build.xml,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- build.xml 18 Dec 2002 13:09:55 -0000 1.59
+++ build.xml 22 Dec 2002 13:26:00 -0000 1.60
@@ -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" />
+ <property name="version" value="1.5.1" />
<property name="debug" value="on" />
<property name="deprecation" value="off" />
|
|
From: Russell G. <rus...@us...> - 2002-12-20 01:59:50
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit
In directory sc8-pr-cvs1:/tmp/cvs-serv24372/src/com/meterware/httpunit
Modified Files:
HTMLPage.java HTMLParser.java HttpUnitOptions.java
JTidyHTMLParser.java NekoHTMLParser.java NodeUtils.java
Added Files:
HTMLParserFactory.java
Log Message:
Add support for parser customization
***** Error reading new file[Errno 2] No such file or directory: 'HTMLParserFactory.java'
Index: HTMLPage.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/HTMLPage.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- HTMLPage.java 13 Dec 2002 12:57:11 -0000 1.18
+++ HTMLPage.java 20 Dec 2002 01:59:47 -0000 1.19
@@ -260,7 +260,7 @@
public void parse( String text, URL pageURL ) throws SAXException, IOException {
- HttpUnitOptions.getHTMLParser().parse( this, pageURL, text );
+ HTMLParserFactory.getHTMLParser().parse( this, pageURL, text );
}
Index: HTMLParser.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/HTMLParser.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- HTMLParser.java 24 Oct 2002 13:28:53 -0000 1.2
+++ HTMLParser.java 20 Dec 2002 01:59:47 -0000 1.3
@@ -19,15 +19,16 @@
* DEALINGS IN THE SOFTWARE.
*
*******************************************************************************************************************/
-import org.w3c.dom.Node;
import org.xml.sax.SAXException;
import java.net.URL;
import java.io.IOException;
/**
+ * A front end to a DOM parser that can handle HTML.
*
* @author <a href="mailto:rus...@ht...">Russell Gold</a>
+ * @author <a href="mailto:bw...@xm...">Bernhard Wagner</a>
**/
interface HTMLParser {
@@ -43,4 +44,16 @@
* an HTML entity as a special character. This method should convert that character to normal text.
*/
public String getCleanedText( String string );
+
+
+ /**
+ * Returns true if this parser supports preservation of the case of tag and attribute names.
+ */
+ public boolean supportsPreserveTagCase();
+
+
+ /**
+ * Returns true if this parser can return an HTMLDocument object.
+ */
+ public boolean supportsReturnHTMLDocument();
}
Index: HttpUnitOptions.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/HttpUnitOptions.java,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- HttpUnitOptions.java 26 Nov 2002 11:55:57 -0000 1.34
+++ HttpUnitOptions.java 20 Dec 2002 01:59:47 -0000 1.35
@@ -61,17 +61,6 @@
}
- public static HTMLParser getHTMLParser() {
- if (_nekoParser != null) {
- return _nekoParser;
- } else if (_jtidyParser != null) {
- return _jtidyParser;
- } else {
- throw new RuntimeException( "No HTML parser found. Make sure that either nekoHTML.jar or Tidy.jar is in the in classpath" );
- }
- }
-
-
/**
* Returns true if HttpUnit is accepting and saving cookies. The default is to accept them.
*/
@@ -517,28 +506,10 @@
private static boolean _exceptionsThrownOnScriptError = true;
- private static HTMLParser _jtidyParser;
-
- private static HTMLParser _nekoParser;
static {
_listeners = new Vector();
reset();
- try {
- Class.forName( "org.w3c.tidy.Parser" );
- _jtidyParser = (HTMLParser) Class.forName( "com.meterware.httpunit.JTidyHTMLParser" ).newInstance();
- } catch (InstantiationException e) {
- } catch (IllegalAccessException e) {
- } catch (ClassNotFoundException e) {
- }
-
- try {
- Class.forName( "org.cyberneko.html.HTMLConfiguration" );
- _nekoParser = (HTMLParser) Class.forName( "com.meterware.httpunit.NekoHTMLParser" ).newInstance();
- } catch (InstantiationException e) {
- } catch (IllegalAccessException e) {
- } catch (ClassNotFoundException e) {
- }
}
}
Index: JTidyHTMLParser.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/JTidyHTMLParser.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- JTidyHTMLParser.java 25 Nov 2002 22:41:07 -0000 1.3
+++ JTidyHTMLParser.java 20 Dec 2002 01:59:47 -0000 1.4
@@ -19,7 +19,6 @@
* DEALINGS IN THE SOFTWARE.
*
*******************************************************************************************************************/
-import org.w3c.dom.Node;
import org.w3c.tidy.Tidy;
import org.xml.sax.SAXException;
@@ -48,6 +47,17 @@
public String getCleanedText( String string ) {
return (string == null) ? "" : string.replace( NBSP, ' ' );
}
+
+
+ public boolean supportsPreserveTagCase() {
+ return false;
+ }
+
+
+ public boolean supportsReturnHTMLDocument() {
+ return false;
+ }
+
final private static char NBSP = (char) 160; // non-breaking space, defined by JTidy
Index: NekoHTMLParser.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/NekoHTMLParser.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- NekoHTMLParser.java 25 Nov 2002 22:41:07 -0000 1.3
+++ NekoHTMLParser.java 20 Dec 2002 01:59:47 -0000 1.4
@@ -39,13 +39,14 @@
/**
*
* @author <a href="mailto:rus...@ht...">Russell Gold</a>
+ * @author <a href="mailto:bw...@xm...">Bernhard Wagner</a>
**/
class NekoHTMLParser implements HTMLParser {
public void parse( HTMLPage page, URL pageURL, String pageText ) throws IOException, SAXException {
try {
- DOMParser parser = DOMParser.newParser(page);
+ DOMParser parser = DOMParser.newParser( page );
parser.parse( new InputSource( new StringReader( pageText ) ) );
page.setRootNode( parser.getDocument() );
} catch (DOMParser.ScriptException e) {
@@ -58,6 +59,17 @@
return (string == null) ? "" : string.replace( NBSP, ' ' );
}
+
+ public boolean supportsPreserveTagCase() {
+ return true;
+ }
+
+
+ public boolean supportsReturnHTMLDocument() {
+ return true;
+ }
+
+
final private static char NBSP = (char) 160; // non-breaking space, defined by nekoHTML
}
@@ -72,6 +84,12 @@
/** Filters property identifier. */
protected static final String FILTERS = "http://cyberneko.org/html/properties/filters";
+ /** Element case settings. possible values: "upper", "lower", "match" */
+ protected static final String ELEMS = "http://cyberneko.org/html/properties/names/elems";
+
+ /** Attribute case settings. possible values: "upper", "lower", "no-change" */
+ protected static final String ATTRS = "http://cyberneko.org/html/properties/names/attrs";
+
private HTMLPage _htmlPage;
private ScriptableDelegate _scriptableObject;
@@ -82,9 +100,23 @@
configuration.setFeature( AUGMENTATIONS, true );
final ScriptFilter javaScriptFilter = new ScriptFilter( configuration );
configuration.setProperty( FILTERS, new XMLDocumentFilter[] { javaScriptFilter } );
- final DOMParser domParser = new DOMParser( configuration, page );
- javaScriptFilter.setParser( domParser );
- return domParser;
+ if (HTMLParserFactory.isPreserveTagCase()) {
+ configuration.setProperty( ELEMS, "match" );
+ configuration.setProperty( ATTRS, "no-change" );
+ }
+
+ try {
+ final DOMParser domParser = new DOMParser( configuration, page );
+ domParser.setFeature( DEFER_NODE_EXPANSION, false );
+ if (HTMLParserFactory.isReturnHTMLDocument()) domParser.setProperty( DOCUMENT_CLASS_NAME, HTML_DOCUMENT_CLASS_NAME );
+ javaScriptFilter.setParser( domParser );
+ return domParser;
+ } catch (SAXNotRecognizedException e) {
+ throw new RuntimeException( e.toString() );
+ } catch (SAXNotSupportedException e) {
+ throw new RuntimeException( e.toString() );
+ }
+
}
@@ -124,15 +156,6 @@
DOMParser( HTMLConfiguration configuration, HTMLPage page ) {
super( configuration );
_htmlPage = page;
-
- try {
- setFeature( DEFER_NODE_EXPANSION, false );
- setProperty( DOCUMENT_CLASS_NAME, HTML_DOCUMENT_CLASS_NAME );
- } catch (SAXNotRecognizedException e) {
- throw new RuntimeException( e.toString() );
- } catch (SAXNotSupportedException e) {
- throw new RuntimeException( e.toString() );
- }
}
Index: NodeUtils.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/NodeUtils.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- NodeUtils.java 14 Oct 2002 04:19:06 -0000 1.13
+++ NodeUtils.java 20 Dec 2002 01:59:47 -0000 1.14
@@ -109,7 +109,7 @@
return true;
}
public void processTextNodeValue( String value ) {
- sb.append( HttpUnitOptions.getHTMLParser().getCleanedText( value ) );
+ sb.append( HTMLParserFactory.getHTMLParser().getCleanedText( value ) );
}
} );
return sb.toString();
|
|
From: Russell G. <rus...@us...> - 2002-12-20 01:59:50
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit
In directory sc8-pr-cvs1:/tmp/cvs-serv24372/test/com/meterware/httpunit
Modified Files:
HttpUnitSuite.java
Added Files:
ParserPropertiesTest.java
Log Message:
Add support for parser customization
***** Error reading new file[Errno 2] No such file or directory: 'ParserPropertiesTest.java'
Index: HttpUnitSuite.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/HttpUnitSuite.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- HttpUnitSuite.java 26 Nov 2002 11:55:57 -0000 1.28
+++ HttpUnitSuite.java 20 Dec 2002 01:59:47 -0000 1.29
@@ -57,8 +57,10 @@
result.addTest( WebClientTest.suite() );
result.addTest( MessageBodyRequestTest.suite() );
result.addTest( CookieTest.suite() );
- if (HttpUnitOptions.getHTMLParser().getClass().getName().indexOf("Tidy") >= 0) result.addTest( JTidyPrintWriterTest.suite() );
- if (HttpUnitOptions.getHTMLParser().getClass().getName().indexOf("NekoHTML") >= 0) result.addTest( NekoEnhancedScriptingTest.suite() );
+ result.addTest( ParserPropertiesTest.suite() );
+
+ if (HTMLParserFactory.getHTMLParser().getClass().getName().indexOf("Tidy") >= 0) result.addTest( JTidyPrintWriterTest.suite() );
+ if (HTMLParserFactory.getHTMLParser().getClass().getName().indexOf("NekoHTML") >= 0) result.addTest( NekoEnhancedScriptingTest.suite() );
addOptionalTestCase( result, "com.meterware.httpunit.XMLPageTest" );
addOptionalTestCase( result, "com.meterware.httpunit.FileUploadTest" );
addOptionalTestCase( result, "com.meterware.httpunit.javascript.JavaScriptTestSuite" );
|
|
From: Russell G. <rus...@us...> - 2002-12-20 01:59:50
|
Update of /cvsroot/httpunit/httpunit/doc
In directory sc8-pr-cvs1:/tmp/cvs-serv24372/doc
Modified Files:
release_notes.txt
Log Message:
Add support for parser customization
Index: release_notes.txt
===================================================================
RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v
retrieving revision 1.233
retrieving revision 1.234
diff -u -r1.233 -r1.234
--- release_notes.txt 18 Dec 2002 23:58:10 -0000 1.233
+++ release_notes.txt 20 Dec 2002 01:59:47 -0000 1.234
@@ -11,6 +11,13 @@
Revision History:
+19-Dec-2001
+ Thanks to Bernhard Wagner for adding some parser customization code.
+
+Additions:
+ You may call HTMLParserFactory.setPreserveTagCase and setReturnHTMLDocument to control whether the parser coerces
+ the case of tags and attributes or returns a HTMLDocument object, respectively.
+
18-Dec-2001
Acknowledgements:
Thanks to Bernhard Wagner for simplifying some string comparison code in ParsedHTML and WebTable
|
|
From: Russell G. <rus...@us...> - 2002-12-18 23:58:14
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit
In directory sc8-pr-cvs1:/tmp/cvs-serv23157/src/com/meterware/httpunit
Modified Files:
ParsedHTML.java WebTable.java
Log Message:
simplified some string handling
Index: ParsedHTML.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/ParsedHTML.java,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- ParsedHTML.java 27 Nov 2002 15:06:41 -0000 1.36
+++ ParsedHTML.java 18 Dec 2002 23:58:10 -0000 1.37
@@ -89,8 +89,7 @@
public WebForm getFormWithID( String ID ) {
WebForm[] forms = getForms();
for (int i = 0; i < forms.length; i++) {
- if (forms[i].getID().equals( ID )) return forms[i];
- else if (HttpUnitOptions.getMatchesIgnoreCase() && forms[i].getID().equalsIgnoreCase( ID )) return forms[i];
+ if (HttpUnitUtils.matches( ID, forms[i].getID() )) return forms[i];
}
return null;
}
@@ -102,8 +101,7 @@
public WebForm getFormWithName( String name ) {
WebForm[] forms = getForms();
for (int i = 0; i < forms.length; i++) {
- if (forms[i].getName().equals( name )) return forms[i];
- else if (HttpUnitOptions.getMatchesIgnoreCase() && forms[i].getName().equalsIgnoreCase( name )) return forms[i];
+ if (HttpUnitUtils.matches( name, forms[i].getName() )) return forms[i];
}
return null;
}
@@ -223,8 +221,7 @@
public WebImage getImageWithName( String name ) {
WebImage[] images = getImages();
for (int i = 0; i < images.length; i++) {
- if (images[i].getName().equals( name )) return images[i];
- else if (HttpUnitOptions.getMatchesIgnoreCase() && images[i].getName().equalsIgnoreCase( name )) return images[i];
+ if (HttpUnitUtils.matches( name, images[i].getName() )) return images[i];
}
return null;
}
@@ -236,8 +233,7 @@
public WebImage getImageWithSource( String source ) {
WebImage[] images = getImages();
for (int i = 0; i < images.length; i++) {
- if (images[i].getSource().equals( source )) return images[i];
- else if (HttpUnitOptions.getMatchesIgnoreCase() && images[i].getSource().equalsIgnoreCase( source )) return images[i];
+ if (HttpUnitUtils.matches( source, images[i].getSource() )) return images[i];
}
return null;
}
@@ -249,8 +245,7 @@
public WebImage getImageWithAltText( String altText ) {
WebImage[] images = getImages();
for (int i = 0; i < images.length; i++) {
- if (images[i].getSource().equals( altText )) return images[i];
- else if (HttpUnitOptions.getMatchesIgnoreCase() && images[i].getAltText().equalsIgnoreCase( altText )) return images[i];
+ if (HttpUnitUtils.matches( altText, images[i].getAltText() )) return images[i];
}
return null;
}
Index: WebTable.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebTable.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- WebTable.java 25 Nov 2002 17:02:21 -0000 1.20
+++ WebTable.java 18 Dec 2002 23:58:10 -0000 1.21
@@ -110,11 +110,7 @@
for (int j = 0; j < getColumnCount(); j++) {
if (_cells[i][j]!=null) {
idToCompare = NodeUtils.getNodeAttribute( _cells[i][j].getOriginalDOM(), "id" );
- if (HttpUnitOptions.getMatchesIgnoreCase())
- if (id.equalsIgnoreCase(idToCompare))
- return _cells[i][j];
- else if (id.equals(idToCompare))
- return _cells[i][j];
+ if (HttpUnitUtils.matches( id, idToCompare )) return _cells[i][j];
}
}
}
|
|
From: Russell G. <rus...@us...> - 2002-12-18 23:58:13
|
Update of /cvsroot/httpunit/httpunit/doc In directory sc8-pr-cvs1:/tmp/cvs-serv23157/doc Modified Files: release_notes.txt Log Message: simplified some string handling Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.232 retrieving revision 1.233 diff -u -r1.232 -r1.233 --- release_notes.txt 18 Dec 2002 13:09:55 -0000 1.232 +++ release_notes.txt 18 Dec 2002 23:58:10 -0000 1.233 @@ -11,6 +11,10 @@ Revision History: +18-Dec-2001 +Acknowledgements: + Thanks to Bernhard Wagner for simplifying some string comparison code in ParsedHTML and WebTable + 18-Dec-2002 1.5.1 Acknowledgements: |
|
From: Russell G. <rus...@us...> - 2002-12-18 13:09:58
|
Update of /cvsroot/httpunit/httpunit
In directory sc8-pr-cvs1:/tmp/cvs-serv13220
Modified Files:
build.xml
Log Message:
prepare for 1.5.1
Index: build.xml
===================================================================
RCS file: /cvsroot/httpunit/httpunit/build.xml,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- build.xml 26 Nov 2002 11:55:56 -0000 1.58
+++ build.xml 18 Dec 2002 13:09:55 -0000 1.59
@@ -228,7 +228,6 @@
<include name="examples/**" />
<include name="lib/*.*" />
<include name="jars/*.*" />
- <exclude name="**/Tidy.jar"/>
<exclude name="**/activation.jar"/>
<exclude name="**/mailapi.jar" />
<include name="doc/**/*.*" />
|
|
From: Russell G. <rus...@us...> - 2002-12-18 13:09:58
|
Update of /cvsroot/httpunit/httpunit/jars In directory sc8-pr-cvs1:/tmp/cvs-serv13220/jars Modified Files: jars.txt nekohtml.jar Log Message: prepare for 1.5.1 Index: jars.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/jars/jars.txt,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- jars.txt 25 Nov 2002 14:17:46 -0000 1.7 +++ jars.txt 18 Dec 2002 13:09:55 -0000 1.8 @@ -6,7 +6,7 @@ xerces 2.2 jtidy 04aug2000r7 rhino 1.5preR4 (patched) -NekoHTML 0.6.8 (patched) +NekoHTML 0.7.1 (for testing HttpUnit only) mail (javamail 1.2) Index: nekohtml.jar =================================================================== RCS file: /cvsroot/httpunit/httpunit/jars/nekohtml.jar,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 Binary files /tmp/cvs6g9FrZ and /tmp/cvs40JzoO differ |
|
From: Russell G. <rus...@us...> - 2002-12-18 13:09:58
|
Update of /cvsroot/httpunit/httpunit/doc
In directory sc8-pr-cvs1:/tmp/cvs-serv13220/doc
Modified Files:
release_notes.txt
Log Message:
prepare for 1.5.1
Index: release_notes.txt
===================================================================
RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v
retrieving revision 1.231
retrieving revision 1.232
diff -u -r1.231 -r1.232
--- release_notes.txt 13 Dec 2002 12:57:11 -0000 1.231
+++ release_notes.txt 18 Dec 2002 13:09:55 -0000 1.232
@@ -11,111 +11,58 @@
Revision History:
-12-Dec-2002
-Additions:
- 1. Added support for Document.cookie
-
-29-Nov-2002
-Additions:
- 1. Added support for most subproperties of the Location object - mostly r/o, but some read/write
-
-27-Nov-2002
-Problems fixed:
- 1. Bug #644642: changes to form parameters made from immediate scripts were being discarded
-
-26-Nov-2002
-Problems fixed:
- 1. Bug #641687: when neither NekoHTML.jar or Tidy.jar is in the classpath, an explanatory exception is now thrown
- 2. Javascript: multiple form parameters with the same name were only being treated as an array if they were checkboxes;
- otherwise, they were being ignored - this would result in a "undefined value has no properties" error message.
-
-25-Nov-2002
-Acknowledgements:
- Thanks to Larry Hamel for supplying an ant target to run Example.java
-
-Additions:
- 1. There is now an ant target to run the Example program.
- 2. The Rhino jar now includes a patch to improve error-reporting for unsupported DOM elements
-
-Problems fixed:
- 1. Table <th> elements were being handled *after* <td> elements in the same row
- 2. The <base> tag was not being used to find included scripts
-
-22-Nov-2002
-Notes:
- 1. The nekohtml.jar included has a patch supplied by the author (Andy Clark) to support applet parameter tags
-
-Additions:
- 1. Added support for applet parameters and archives
-
-20-Nov-2002
-Problems fixed:
- 1. HttpUnit now ignores empty parameters on form actions, as IE and Netscape do.
-
-18-Nov-2002
-Acknowledgements:
- Thanks to Neville Wylie for catching the top.parent and frame name index problems
-
-Problems fixed:
- 1. The parent attribute of the top frame was returning null rather than the frame.
- 2. Frame names used as indexes into the Window.frames array were not being recognized.
-
-17-Nov-2002
-Problems fixed:
- 1. Bug #637208 Link.click() no longer returns null when an 'onClick' event fails to return true.
-
-Additions:
- 1. Added support for Document.open, Document.close, and Document.write / writeln for new documents
-
-16-Nov-2002
-Problems fixed:
- 1. Bug #638304 Interframe dependancies for JavaScript at load time are now handled better.
-
-14-Nov-2002
-Problems fixed:
- 1. Bug #638406 Multi-line values in form data were using the platform-specific line ending rather than CRLF.
- 2. Bug #638306 Document.writeln was writing the value "13" rather than CRLF as its terminator.
+18-Dec-2002 1.5.1
-12-Nov-2002
-Acknowledgements:
- Thanks to Michael McCallum for adding handling for bad character-set headers and an ant target to build the examples
-
-Problems fixed:
- 1. Bad character-set headers from servers would result in an UnsupportedEncodingException.
-
-Additions:
- 1. Added support for the location.href property
-
- 9-Nov-2002
-Problems fixed:
- 1. As of 1.5, HttpUnit was not building if NekoHTML was not in the classpath. This is now fixed.
-
- 7-Nov-2002
Acknowledgements:
+ Thanks to Geert Bevin for fixing a problem with comparing cookies
+ Thanks to Troy Waldrep for pointing out the non-standard Refresh header definition accepted in popular browsers
Thanks to Raul Benito Garcia for pointing out the problem with no-action forms accessed with URL parameters
+ Thanks to Larry Hamel for supplying an ant target to run Example.java
Thanks to Charles Mendis for finding the bug in the proxy support
-Problems fixed:
- 1. When a form obtained using parameters as part of the URL has no action, those parameters are now sent
- as part of the form submission.
- 2. Bug #635273 Proxy port always interpreted as port 80 due to typo
-
- 6-Nov-2002
-Problems fixed:
- 1. Simply removing the NekoHTML parser jar from the classpath was not enough to re-enable JTidy. Now it is.
-
- 5-Nov-2002
-Acknowledgements:
- Thanks to Troy Waldrep for pointing out the non-standard Refresh header definition accepted in popular browsers
+ Thanks to Michael McCallum for adding handling for bad character-set headers and an ant target to build the examples
+ Thanks to Neville Wylie for catching the top.parent and frame name index problems
-Additions:
- 1. Added support for the Refresh header
+Problems Fixed:
+ Content and Parsing
+ 1. Adding both a "global" cookie and a server-based cookie with the same name caused a NullPointerException
+ 2. Simply removing the NekoHTML parser jar from the classpath was not enough to re-enable JTidy. Now it is.
+ 3. When a form obtained using parameters as part of the URL has no action, those parameters are now sent
+ as part of the form submission.
+ 4. Bug #635273 Proxy port always interpreted as port 80 due to typo
+ 5. As of 1.5, HttpUnit was not building if NekoHTML was not in the classpath. This is now fixed.
+ 6. Bad character-set headers from servers would result in an UnsupportedEncodingException.
+ 7. Bug #638406 Multi-line values in form data were using the platform-specific line ending rather than CRLF.
+ 8. HttpUnit now ignores empty parameters on form actions, as IE and Netscape do.
+ 9. Table <th> elements were being handled *after* <td> elements in the same row
+ 10. Bug #641687: when neither NekoHTML.jar or Tidy.jar is in the classpath, a class not found exception was thrown
+
+ JavaScript
+ 11. Bug #638306 Document.writeln was writing the value "13" rather than CRLF as its terminator.
+ 12. Bug #638304 Interframe dependancies for JavaScript at load time were causing frame data not to be found.
+ 13. Bug #637208 Link.click() no longer returns null when an 'onClick' event fails to return true.
+ 14. The parent attribute of the top frame was returning null rather than the frame.
+ 15. Frame names used as indexes into the Window.frames array were not being recognized.
+ 16. The <base> tag was not being used to find included scripts
+ 17. Multiple form parameters with the same name were only being treated as an array if they were checkboxes;
+ otherwise, they were being ignored - this would result in a "undefined value has no properties" error message.
+ 18. Bug #644642: changes to form parameters made from immediate scripts were being discarded
+
+Additions:
+ Content and Parsing
+ 1. Added support for the Refresh header
+ 2. Added support for applet parameters and archives
+ 3. There is now an ant target to run the Example program.
+
+ JavaScript
+ 4. Added support for the location.href property
+ 5. Added support for Document.open, Document.close, and Document.write / writeln for new documents
+ 6. The Rhino jar now includes a patch to improve error-reporting for unsupported DOM elements
+ 7. Added support for most subproperties of the Location object - mostly r/o, but some read/write
+ 8. Added support for Document.cookie
- 4-Nov-2002
-Acknowledgements:
- Thanks to Geert Bevin for fixing a problem with comparing cookies
+Notes:
+ 1. Upgraded NekoHTML to 0.7.1
-Problems Fixed:
- 1. Adding both a "global" cookie and a server-based cookie with the same name causes a NullPointerException
3-Nov-2002 1.5
Acknowledgements:
|
|
From: Russell G. <rus...@us...> - 2002-12-13 12:59:44
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit
In directory sc8-pr-cvs1:/tmp/cvs-serv17362/src/com/meterware/httpunit
Modified Files:
WebForm.java
Log Message:
Made WebForm.submit(SubmitButton) public
Index: WebForm.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebForm.java,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- WebForm.java 20 Nov 2002 13:04:15 -0000 1.70
+++ WebForm.java 13 Dec 2002 12:59:41 -0000 1.71
@@ -60,7 +60,7 @@
* Will usually return the result of that submission; however, if a scripted event is triggered which
* inhibits the submission, will return the updated contents of the frame containing this form.
**/
- WebResponse submit( SubmitButton button ) throws IOException, SAXException {
+ public WebResponse submit( SubmitButton button ) throws IOException, SAXException {
String event = getAttribute( "onsubmit" );
if (event.length() == 0 || getScriptableObject().doEvent( event )) return submitRequest( getRequest( button ) );
return getBaseResponse().getWindow().getFrameContents( getTarget() );
@@ -593,11 +593,6 @@
private FormControl[] _presetParameters;
private ArrayList _presets;
-
-
- private Object getObject( String name ) {
- return getParameter( name ).getScriptableObject();
- }
private SubmitButton getDefaultButton() {
|
|
From: Russell G. <rus...@us...> - 2002-12-13 12:57:15
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript
In directory sc8-pr-cvs1:/tmp/cvs-serv16278/test/com/meterware/httpunit/javascript
Modified Files:
ScriptingTest.java
Log Message:
Added support for Document.cookie
Index: ScriptingTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/ScriptingTest.java,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- ScriptingTest.java 29 Nov 2002 15:23:42 -0000 1.47
+++ ScriptingTest.java 13 Dec 2002 12:57:11 -0000 1.48
@@ -29,7 +29,7 @@
/**
*
- * @author <a href="mailto:rus...@ac...">Russell Gold</a>
+ * @author <a href="mailto:rus...@ht...">Russell Gold</a>
**/
public class ScriptingTest extends HttpUnitTest {
@@ -540,5 +540,31 @@
assertNull( "Alert should have been removed", wc.getNextAlert() );
}
+
+ public void testSimpleSetCookie() throws Exception {
+ defineResource( "OnCommand.html", "<html><head></head>\n" +
+ "<body onLoad='document.cookie=\"color=red;path=/\"'>\n" +
+ "</body></html>" );
+ WebConversation wc = new WebConversation();
+ wc.getResponse( getHostPath() + "/OnCommand.html" );
+ assertEquals( "Cookie 'color'", "red", wc.getCookieValue( "color" ) );
+ }
+
+
+ public void testReadCookies() throws Exception {
+ defineResource( "OnCommand.html", "<html><head><script language='JavaScript'>" +
+ "function viewCookies() { \n" +
+ " alert( 'cookies: ' + document.cookie );\n" +
+ "}" +
+ "</script></head>\n" +
+ "<body onLoad='viewCookies()'>\n" +
+ "</body></html>" );
+ addResourceHeader( "OnCommand.html", "Set-Cookie: age=12");
+ WebConversation wc = new WebConversation();
+ wc.addCookie( "height", "tall" );
+ wc.getResponse( getHostPath() + "/OnCommand.html" );
+ assertEquals( "Alert message 1", "cookies: age=12;height=tall", wc.popNextAlert() );
+ assertNull( "Alert should have been removed", wc.getNextAlert() );
+ }
}
|
|
From: Russell G. <rus...@us...> - 2002-12-13 12:57:14
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/javascript
In directory sc8-pr-cvs1:/tmp/cvs-serv16278/src/com/meterware/httpunit/javascript
Modified Files:
JavaScript.java
Log Message:
Added support for Document.cookie
Index: JavaScript.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/javascript/JavaScript.java,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- JavaScript.java 29 Nov 2002 15:23:40 -0000 1.41
+++ JavaScript.java 13 Dec 2002 12:57:11 -0000 1.42
@@ -494,7 +494,23 @@
public void jsSet_location( String urlString ) throws IOException, SAXException {
+ if (urlString.startsWith( "color" )) return;
getWindow().setLocation( urlString );
+ }
+
+
+ public String jsGet_cookie() {
+ return getDelegate().getCookie();
+ }
+
+
+ public void jsSet_cookie( String cookieSpec ) {
+ final int equalsIndex = cookieSpec.indexOf( '=' );
+ int endIndex = cookieSpec.indexOf( ";", equalsIndex );
+ if (endIndex < 0) endIndex = cookieSpec.length();
+ String name = cookieSpec.substring( 0, equalsIndex );
+ String value = cookieSpec.substring( equalsIndex+1, endIndex );
+ getDelegate().setCookie( name, value );
}
|
|
From: Russell G. <rus...@us...> - 2002-12-13 12:57:14
|
Update of /cvsroot/httpunit/httpunit/doc
In directory sc8-pr-cvs1:/tmp/cvs-serv16278/doc
Modified Files:
Javascript-support.html release_notes.txt
Log Message:
Added support for Document.cookie
Index: Javascript-support.html
===================================================================
RCS file: /cvsroot/httpunit/httpunit/doc/Javascript-support.html,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- Javascript-support.html 29 Nov 2002 15:23:36 -0000 1.30
+++ Javascript-support.html 13 Dec 2002 12:57:10 -0000 1.31
@@ -86,6 +86,7 @@
<li>links - an array of Link objects</li>
<li>title - readonly. The title of the page</li>
<li>location - a synonym for window.location</li>
+<li>cookie - access to the document-specific cookies.</li>
<li><name> - the name of a form, image, or link</li>
</ul>
<h4>methods</h4>
Index: release_notes.txt
===================================================================
RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v
retrieving revision 1.230
retrieving revision 1.231
diff -u -r1.230 -r1.231
--- release_notes.txt 29 Nov 2002 15:23:38 -0000 1.230
+++ release_notes.txt 13 Dec 2002 12:57:11 -0000 1.231
@@ -7,9 +7,14 @@
Limitations:
1. JDK 1.3.1 or higher is required
2. JavaScript support does not include some DOM properties
+ 3. Document.cookie= does not restrict the cookie by path and domain
Revision History:
+12-Dec-2002
+Additions:
+ 1. Added support for Document.cookie
+
29-Nov-2002
Additions:
1. Added support for most subproperties of the Location object - mostly r/o, but some read/write
|
|
From: Russell G. <rus...@us...> - 2002-12-13 12:57:14
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit
In directory sc8-pr-cvs1:/tmp/cvs-serv16278/src/com/meterware/httpunit
Modified Files:
HTMLPage.java WebClient.java WebResponse.java
Log Message:
Added support for Document.cookie
Index: HTMLPage.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/HTMLPage.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- HTMLPage.java 25 Nov 2002 22:41:06 -0000 1.17
+++ HTMLPage.java 13 Dec 2002 12:57:11 -0000 1.18
@@ -236,6 +236,16 @@
public void replaceText( String text, String contentType ) {
getResponse().replaceText( text, contentType );
}
+
+
+ public void setCookie( String name, String value ) {
+ getResponse().setCookie( name, value );
+ }
+
+
+ public String getCookie() {
+ return getResponse().getCookieHeader();
+ }
}
Index: WebClient.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebClient.java,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- WebClient.java 17 Nov 2002 00:17:07 -0000 1.47
+++ WebClient.java 13 Dec 2002 12:57:11 -0000 1.48
@@ -434,6 +434,11 @@
}
+ CookieJar getCookieJar() {
+ return _cookieJar;
+ }
+
+
void updateFrameContents( WebWindow requestWindow, String requestTarget, WebResponse response, RequestContext requestContext ) throws IOException, SAXException {
WebWindow window = getTargetWindow( requestWindow, requestTarget );
if (window != null) {
Index: WebResponse.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebResponse.java,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -r1.103 -r1.104
--- WebResponse.java 25 Nov 2002 22:41:07 -0000 1.103
+++ WebResponse.java 13 Dec 2002 12:57:11 -0000 1.104
@@ -1016,6 +1016,16 @@
}
+ void setCookie( String name, String value ) {
+ _client.addCookie( name, value );
+ }
+
+
+ String getCookieHeader() {
+ return _client.getCookieJar().getCookieHeaderField( getURL() );
+ }
+
+
//=======================================================================================
|
|
From: Russell G. <rus...@us...> - 2002-12-04 02:51:10
|
Update of /cvsroot/httpunit/httpunit/doc/manual In directory sc8-pr-cvs1:/tmp/cvs-serv22991/doc/manual Added Files: index.html toc.html Log Message: add initial toc and main page --- NEW FILE --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head><title>HttpUnit User Manual</title></head> <frameset cols="20%,80%"> <frame src="toc.html" name="tocFrame"> <frame src="introduction.html" name="mainFrame"> </frameset></html> <noframes> <a href="toc.html">HttpUnit User Manual (noframes)</a></noframes> --- NEW FILE --- <html> <head> <title>HttpUnit User Manual</title> <base target="mainFrame"> </head> <body> <h2>Table of Contents</h2> <h3>1. Getting Started</h3> <a href="introduction.html">Introduction</a><br> <a href="installing.html">Installing HttpUnit</a><br> <a href="retrieving.html">Retrieving a page from a URL</a><br> <br><a href="section2.html" class="toc-section">Working with Links and Forms</a><br> <br><a href="section3.html" class="toc-section">Deciphering Tables</a><br> <br><a href="section4.html" class="toc-section">Handling Frame structure</a><br> <br><a href="section5.html" class="toc-section">Using JavaScript</a><br> <br><a href="../api/index.html" target="_top">HttpUnit API</a><br> <!-- <a href="LICENSE">License</a><br> <a href="feedback.html">Feedback and Troubleshooting</a><br> <br> <a href="credits.html">Authors</a><br> --> </body> </html> |
|
From: Russell G. <rus...@us...> - 2002-11-29 15:24:15
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/pseudoserver
In directory sc8-pr-cvs1:/tmp/cvs-serv18304/src/com/meterware/pseudoserver
Modified Files:
HttpUserAgentTest.java
Log Message:
Added support for Location subproperties
Index: HttpUserAgentTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/pseudoserver/HttpUserAgentTest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- HttpUserAgentTest.java 15 Nov 2002 00:07:33 -0000 1.4
+++ HttpUserAgentTest.java 29 Nov 2002 15:23:41 -0000 1.5
@@ -22,6 +22,7 @@
import java.util.Vector;
import java.util.Enumeration;
import java.util.StringTokenizer;
+import java.io.IOException;
import junit.framework.TestCase;
@@ -96,6 +97,11 @@
protected String getHostPath() {
return _hostPath;
+ }
+
+
+ protected int getHostPort() throws IOException {
+ return _server.getConnectedPort();
}
|
|
From: Russell G. <rus...@us...> - 2002-11-29 15:24:15
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/javascript
In directory sc8-pr-cvs1:/tmp/cvs-serv18304/src/com/meterware/httpunit/javascript
Modified Files:
JavaScript.java
Log Message:
Added support for Location subproperties
Index: JavaScript.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/javascript/JavaScript.java,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- JavaScript.java 17 Nov 2002 16:43:41 -0000 1.40
+++ JavaScript.java 29 Nov 2002 15:23:40 -0000 1.41
@@ -605,6 +605,49 @@
}
+ public String jsGet_protocol() {
+ return _url.getProtocol() + ':';
+ }
+
+
+ public String jsGet_host() {
+ return _url.getHost() + ':' + _url.getPort();
+ }
+
+
+ public String jsGet_hostname() {
+ return _url.getHost();
+ }
+
+
+ public String jsGet_port() {
+ return String.valueOf( _url.getPort() );
+ }
+
+
+ public String jsGet_pathname() {
+ return _url.getPath();
+ }
+
+
+ public void jsSet_pathname( String newPath ) throws SAXException, IOException {
+ if (!newPath.startsWith( "/" )) newPath = '/' + newPath;
+ URL newURL = new URL( _url, newPath );
+ _window.setLocation( newURL.toExternalForm() );
+ }
+
+
+ public String jsGet_search() {
+ return '?' + _url.getQuery();
+ }
+
+
+ public void jsSet_search( String newSearch ) throws SAXException, IOException {
+ if (!newSearch.startsWith( "?" )) newSearch = '?' + newSearch;
+ _window.setLocation( jsGet_protocol() + "//" + jsGet_host() + jsGet_pathname() + newSearch );
+ }
+
+
/**
* Returns the default value of this scriptable object. In this case, it returns simply the URL as a string.
* Note that this method is necessary, since Rhino will only call the toString method directly if there are no
|
|
From: Russell G. <rus...@us...> - 2002-11-29 15:24:14
|
Update of /cvsroot/httpunit/httpunit/doc
In directory sc8-pr-cvs1:/tmp/cvs-serv18304/doc
Modified Files:
Javascript-support.html release_notes.txt
Log Message:
Added support for Location subproperties
Index: Javascript-support.html
===================================================================
RCS file: /cvsroot/httpunit/httpunit/doc/Javascript-support.html,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- Javascript-support.html 17 Nov 2002 16:43:40 -0000 1.29
+++ Javascript-support.html 29 Nov 2002 15:23:36 -0000 1.30
@@ -65,7 +65,13 @@
<h3>Location</h3>
<h4>properties</h4>
<ul>
-<li>href - r/w the current window location. Setting this value initiates a new request to the server</li>
+<li>href - r/w the current window location. Setting this value initiates a new request to the server</li>
+<li>host - r/o the host and port portion of the current window location</li>
+<li>hostname - r/o the host portion of the current window location</li>
+<li>port - r/o the port portion of the current window location</li>
+<li>protocol - r/o the port portion of the current window location</li>
+<li>pathname - r/w the path portion of the current window location. Setting this value initiates a new request to the server</li>
+<li>search - r/w the query portion of the current window location. Setting this value initiates a new request to the server</li>
</ul>
<h4>methods</h4>
<ul>
Index: release_notes.txt
===================================================================
RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v
retrieving revision 1.229
retrieving revision 1.230
diff -u -r1.229 -r1.230
--- release_notes.txt 27 Nov 2002 15:06:40 -0000 1.229
+++ release_notes.txt 29 Nov 2002 15:23:38 -0000 1.230
@@ -10,6 +10,10 @@
Revision History:
+29-Nov-2002
+Additions:
+ 1. Added support for most subproperties of the Location object - mostly r/o, but some read/write
+
27-Nov-2002
Problems fixed:
1. Bug #644642: changes to form parameters made from immediate scripts were being discarded
|
|
From: Russell G. <rus...@us...> - 2002-11-29 15:23:49
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript
In directory sc8-pr-cvs1:/tmp/cvs-serv18304/test/com/meterware/httpunit/javascript
Modified Files:
ScriptingTest.java
Log Message:
Added support for Location subproperties
Index: ScriptingTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/ScriptingTest.java,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- ScriptingTest.java 25 Nov 2002 22:41:07 -0000 1.46
+++ ScriptingTest.java 29 Nov 2002 15:23:42 -0000 1.47
@@ -426,6 +426,55 @@
}
+ public void testLocationReadableSubproperties() throws Exception {
+ defineResource( "Target.html", "You made it!" );
+ defineResource( "location.js", "function show() {" +
+ "alert('host is ' + window.location.host);" +
+ "alert('hostname is ' + document.location.hostname);" +
+ "alert('port is ' + window.location.port);" +
+ "alert('pathname is ' + window.location.pathname);" +
+ "alert('protocol is ' + document.location.protocol);" +
+ "alert('search is ' + window.location.search);" +
+ "}" );
+ defineResource( "simple/OnCommand.html?point=center",
+ "<html><head><title>Amazing!</title>" +
+ "<script language='JavaScript' src='/location.js'></script>" +
+ "</head>" +
+ "<body onLoad='show()'>" +
+ "</body>" );
+ WebConversation wc = new WebConversation();
+ wc.getResponse( getHostPath() + "/simple/OnCommand.html?point=center" );
+ assertEquals( "Alert message 1", "host is " + getHostPath().substring( 7 ), wc.popNextAlert() );
+ assertEquals( "Alert message 2", "hostname is localhost", wc.popNextAlert() );
+ assertEquals( "Alert message 3", "port is " + getHostPort(), wc.popNextAlert() );
+ assertEquals( "Alert message 4", "pathname is /simple/OnCommand.html", wc.popNextAlert() );
+ assertEquals( "Alert message 5", "protocol is http:", wc.popNextAlert() );
+ assertEquals( "Alert message 6", "search is ?point=center", wc.popNextAlert() );
+ }
+
+
+ public void testLocationWriteableSubproperties() throws Exception {
+ defineResource( "Target.html", "You made it!" );
+ defineResource( "OnCommand.html?where=here", "You found it!" );
+ defineResource( "OnCommand.html", "<html><head><title>Amazing!</title>" +
+ "</head>" +
+ "<body'>" +
+ "<a href='#' onMouseOver=\"window.location.pathname='/Target.html';\">go</a>" +
+ "<a href='#' onMouseOver=\"document.location.search='?where=here';\">go</a>" +
+ "</body>" );
+ WebConversation wc = new WebConversation();
+ WebResponse response = wc.getResponse( getHostPath() + "/OnCommand.html" );
+ response.getLinks()[0].mouseOver();
+ assertEquals( "2nd page URL", getHostPath() + "/Target.html", wc.getCurrentPage().getURL().toExternalForm() );
+ assertEquals( "2nd page", "You made it!", wc.getCurrentPage().getText() );
+
+ response = wc.getResponse( getHostPath() + "/OnCommand.html" );
+ response.getLinks()[1].mouseOver();
+ assertEquals( "3rd page URL", getHostPath() + "/OnCommand.html?where=here", wc.getCurrentPage().getURL().toExternalForm() );
+ assertEquals( "3rd page", "You found it!", wc.getCurrentPage().getText() );
+ }
+
+
public void testScriptDisabled() throws Exception {
HttpUnitOptions.setScriptingEnabled( false );
defineResource( "nothing.html", "Should get here" );
|
|
From: Fritz, M. <Mar...@ot...> - 2002-11-28 10:02:45
|
Hello everybody,
I have problems with the attached HTML-page. When I use the method
webResponse.getFrameNames() I get the names "dummy" and "inhalt" as
expected.
When I use the method webResponse.getSubFrameContent("inhalt") I get a
NoSuchFrameException.
Any ideas?
#####################################################
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<!-- Anweisung an den Browser: keinen Cache benutzen, sondern von
Originalseite laden.-->
<meta http-equiv="cache-control" content="no-cache"/>
<!--HTML-Datei wird in jedem Fall von der Original-Adresse geladen wird.-->
<meta http-equiv="expires" content="0"/>
<!--Meta-Angabe zur Bestimmung des Zeichensatzes-->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<!--An Proxy-Agenten: Datei bitte nicht auf Proxy-Server speichern!-->
<meta http-equiv="pragma" content="no-cache"/>
<!--javascript as default-->
<meta http-equiv="Content-Script-Type" content="text/javascript">
<!--css as default-->
<meta http-equiv="Content-Style-Type" content="text/css">
<HEAD>
<TITLE>Entry Server</TITLE>
</HEAD>
<FRAMESET cols="0,*" frameborder="0" framespacing="0" border="0">
<FRAME name="dummy" border="0" noresize>
<FRAME name="inhalt" src="portal/home.do" marginheight="0" marginwidth="0"
scrolling="auto" border="0">
<NOFRAMES>
<BODY>
<P>This page uses frames, but your browser doesn't support them.</P>
</BODY>
</NOFRAMES>
</FRAMESET>
</HTML>
|
|
From: Russell G. <rus...@us...> - 2002-11-27 15:06:47
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript
In directory sc8-pr-cvs1:/tmp/cvs-serv31599/test/com/meterware/httpunit/javascript
Modified Files:
FormScriptingTest.java
Log Message:
644642: fixed discarded changes to form parameters made in immediate scripts
Index: FormScriptingTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/FormScriptingTest.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- FormScriptingTest.java 17 Nov 2002 00:17:07 -0000 1.14
+++ FormScriptingTest.java 27 Nov 2002 15:06:41 -0000 1.15
@@ -666,4 +666,17 @@
}
+ public void testSetFromEmbeddedScript() throws Exception {
+ defineWebPage( "OnCommand", "<form name=\"testform\">" +
+ "<input type=text name=\"testfield\" value=\"old\">" +
+ "</form>" +
+ "<script language=\"JavaScript\">" +
+ " document.testform.testfield.value=\"new\"" +
+ "</script>" );
+ WebConversation wc = new WebConversation();
+ WebResponse response = wc.getResponse( getHostPath() + "/OnCommand.html" );
+ assertEquals( "Form parameter value", "new", response.getForms()[0].getParameterValue( "testfield") );
+ }
+
+
}
|
|
From: Russell G. <rus...@us...> - 2002-11-27 15:06:46
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit
In directory sc8-pr-cvs1:/tmp/cvs-serv31599/src/com/meterware/httpunit
Modified Files:
ParsedHTML.java
Log Message:
644642: fixed discarded changes to form parameters made in immediate scripts
Index: ParsedHTML.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/ParsedHTML.java,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- ParsedHTML.java 25 Nov 2002 22:41:07 -0000 1.35
+++ ParsedHTML.java 27 Nov 2002 15:06:41 -0000 1.36
@@ -40,11 +40,19 @@
private String _characterSet;
+ private WebResponse _response;
+
+ private boolean _updateForms;
private WebForm[] _forms;
+
+ private boolean _updateImages;
private WebImage[] _images;
+
+ private boolean _updateLinks;
private WebLink[] _links;
+
+ private boolean _updateApplets;
private WebApplet[] _applets;
- private WebResponse _response;
ParsedHTML( WebResponse response, URL baseURL, String baseTarget, Node rootNode, String characterSet ) {
@@ -60,12 +68,15 @@
* Returns the forms found in the page in the order in which they appear.
**/
public WebForm[] getForms() {
- if (_forms == null) {
+ if (_forms == null || _updateForms) {
NodeList forms = NodeUtils.getElementsByTagName( getRootNode(), "form" );
-
+ WebForm[] oldForms = _forms;
_forms = new WebForm[ forms.getLength() ];
- for (int i = 0; i < _forms.length; i++) {
+
+ if (oldForms != null) System.arraycopy( oldForms, 0, _forms, 0, oldForms.length );
+ for (int i = (oldForms == null ? 0 : oldForms.length); i < _forms.length; i++) {
_forms[i] = new WebForm( _response, _baseURL, _baseTarget, forms.item( i ), _characterSet );
+ _updateForms = false;
}
}
return _forms;
@@ -102,7 +113,7 @@
* Returns the links found in the page in the order in which they appear.
**/
public WebLink[] getLinks() {
- if (_links == null) {
+ if (_links == null || _updateLinks) {
final ArrayList list = new ArrayList();
NodeUtils.processNodes( getRootNode().getChildNodes(), new NodeUtils.NodeAction() {
public boolean processElement( Element element ) {
@@ -113,7 +124,9 @@
public void processTextNodeValue( String value ) {
}
} );
+ if (_links != null) for (int i = 0; i < _links.length; i++) list.set( i, _links[i] );
_links = (WebLink[]) list.toArray( new WebLink[ list.size() ] );
+ _updateLinks = false;
}
return _links;
@@ -189,13 +202,16 @@
* Returns the images found in the page in the order in which they appear.
**/
public WebImage[] getImages() {
- if (_images == null) {
+ if (_images == null || _updateImages) {
NodeList images = NodeUtils.getElementsByTagName( getRootNode(), "img" );
+ WebImage[] oldImages = _images;
_images = new WebImage[ images.getLength() ];
- for (int i = 0; i < _images.length; i++) {
+ if (oldImages != null) System.arraycopy( oldImages, 0, _images, 0, oldImages.length );
+ for (int i = (oldImages == null ? 0 : oldImages.length); i < _images.length; i++) {
_images[i] = new WebImage( _response, this, _baseURL, images.item( i ), _baseTarget );
}
+ _updateImages = false;
}
return _images;
}
@@ -244,13 +260,16 @@
* Returns a proxy for each applet found embedded in this page.
*/
public WebApplet[] getApplets() {
- if (_applets == null) {
+ if (_applets == null || _updateApplets) {
NodeList applets = NodeUtils.getElementsByTagName( getRootNode(), "applet" );
+ WebApplet[] oldApplets = _applets;
_applets = new WebApplet[ applets.getLength() ];
- for (int i = 0; i < _applets.length; i++) {
+ if (oldApplets != null) System.arraycopy( oldApplets, 0, _applets, 0, oldApplets.length );
+ for (int i = (oldApplets == null ? 0 : oldApplets.length); i < _applets.length; i++) {
_applets[i] = new WebApplet( _response, applets.item( i ), _baseTarget );
}
+ _updateApplets = false;
}
return _applets;
}
@@ -342,9 +361,7 @@
throw new IllegalStateException( "The root node has already been defined as " + _rootNode + " and cannot be redefined as " + rootNode );
_rootNode = rootNode;
- _links = null;
- _forms = null;
- _images = null;
+ _updateLinks = _updateForms = _updateImages = _updateApplets = true;
}
|
|
From: Russell G. <rus...@us...> - 2002-11-27 15:06:46
|
Update of /cvsroot/httpunit/httpunit/doc
In directory sc8-pr-cvs1:/tmp/cvs-serv31599/doc
Modified Files:
release_notes.txt
Log Message:
644642: fixed discarded changes to form parameters made in immediate scripts
Index: release_notes.txt
===================================================================
RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v
retrieving revision 1.228
retrieving revision 1.229
diff -u -r1.228 -r1.229
--- release_notes.txt 27 Nov 2002 01:28:34 -0000 1.228
+++ release_notes.txt 27 Nov 2002 15:06:40 -0000 1.229
@@ -10,6 +10,10 @@
Revision History:
+27-Nov-2002
+Problems fixed:
+ 1. Bug #644642: changes to form parameters made from immediate scripts were being discarded
+
26-Nov-2002
Problems fixed:
1. Bug #641687: when neither NekoHTML.jar or Tidy.jar is in the classpath, an explanatory exception is now thrown
|