httpunit-commit Mailing List for httpunit (Page 10)
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
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/dom In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11573/src/com/meterware/httpunit/dom Added Files: AttrImpl.java CharacterDataImpl.java DocumentImpl.java DocumentTypeImpl.java ElementImpl.java HTMLAnchorElementImpl.java HTMLAreaElementImpl.java HTMLBaseElementImpl.java HTMLBodyElementImpl.java HTMLCollectionImpl.java HTMLControl.java HTMLDocumentImpl.java HTMLElementImpl.java HTMLFormElementImpl.java HTMLHeadElementImpl.java HTMLHtmlElementImpl.java HTMLImageElementImpl.java HTMLInputElementImpl.java HTMLLinkElementImpl.java HTMLMetaElementImpl.java HTMLOptionElementImpl.java HTMLSelectElementImpl.java HTMLStyleElementImpl.java HTMLTextAreaElementImpl.java HTMLTitleElementImpl.java NamedNodeMapImpl.java NodeImpl.java NodeListImpl.java TextImpl.java Log Message: Created custom DOM ***** Error reading new file[Errno 2] No such file or directory: 'AttrImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'CharacterDataImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'DocumentImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'DocumentTypeImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'ElementImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'HTMLAnchorElementImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'HTMLAreaElementImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'HTMLBaseElementImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'HTMLBodyElementImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'HTMLCollectionImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'HTMLControl.java' ***** Error reading new file[Errno 2] No such file or directory: 'HTMLDocumentImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'HTMLElementImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'HTMLFormElementImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'HTMLHeadElementImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'HTMLHtmlElementImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'HTMLImageElementImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'HTMLInputElementImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'HTMLLinkElementImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'HTMLMetaElementImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'HTMLOptionElementImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'HTMLSelectElementImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'HTMLStyleElementImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'HTMLTextAreaElementImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'HTMLTitleElementImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'NamedNodeMapImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'NodeImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'NodeListImpl.java' ***** Error reading new file[Errno 2] No such file or directory: 'TextImpl.java' |
From: Russell G. <rus...@us...> - 2006-03-28 00:52:19
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/dom In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11573/test/com/meterware/httpunit/dom Added Files: AbstractHTMLElementTest.java AttributesTest.java DocumentImportTest.java DomTestSuite.java HTMLElementTest.java HTMLFormTest.java HTMLSelectTest.java NodeTest.java Log Message: Created custom DOM ***** Error reading new file[Errno 2] No such file or directory: 'AbstractHTMLElementTest.java' ***** Error reading new file[Errno 2] No such file or directory: 'AttributesTest.java' ***** Error reading new file[Errno 2] No such file or directory: 'DocumentImportTest.java' ***** Error reading new file[Errno 2] No such file or directory: 'DomTestSuite.java' ***** Error reading new file[Errno 2] No such file or directory: 'HTMLElementTest.java' ***** Error reading new file[Errno 2] No such file or directory: 'HTMLFormTest.java' ***** Error reading new file[Errno 2] No such file or directory: 'HTMLSelectTest.java' ***** Error reading new file[Errno 2] No such file or directory: 'NodeTest.java' |
From: Russell G. <rus...@us...> - 2006-03-28 00:52:19
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11573/test/com/meterware/httpunit/javascript Modified Files: FormScriptingTest.java NekoEnhancedScriptingTest.java ScriptingTest.java Log Message: Created custom DOM Index: FormScriptingTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/FormScriptingTest.java,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- FormScriptingTest.java 26 Dec 2004 20:33:35 -0000 1.35 +++ FormScriptingTest.java 28 Mar 2006 00:52:15 -0000 1.36 @@ -1285,24 +1285,4 @@ } - public void testFormsCaching() throws Exception { - defineWebPage( "OnCommand", "<form>" + - " <input type='text' name='color' value='blue' >" + - "</form>" + - "<script type='JavaScript'>" + - " alert( document.forms[0].color.value );" + - "</script>" + - "<form>" + - " <input type='text' name='size' value='3' >" + - "</form>" + - "<script type='JavaScript'>" + - " alert( document.forms[1].size.value );" + - "</script>" ); - WebConversation wc = new WebConversation(); - wc.getResponse( getHostPath() + "/OnCommand.html" ); - assertEquals( "Message 1", "blue", wc.popNextAlert() ); - assertEquals( "Message 2", "3", wc.popNextAlert() ); - } - - } Index: NekoEnhancedScriptingTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/NekoEnhancedScriptingTest.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- NekoEnhancedScriptingTest.java 17 Oct 2004 20:48:11 -0000 1.6 +++ NekoEnhancedScriptingTest.java 28 Mar 2006 00:52:15 -0000 1.7 @@ -26,6 +26,7 @@ /** + * Tests that work under NekoHTML but not JTidy due to the ability to do script processing during parsing. * * @author <a href="mailto:rus...@ht...">Russell Gold</a> **/ @@ -138,6 +139,31 @@ /** + * Verifies that nodes defined before a script section are available to that script section, even if a preceding + * script section has caused them to be cached. Currently does not work with JTidy since there is no way to parse + * only to a specific position in the document. It may be possible to fix this with some logic changes... + */ + public void testFormsCaching() throws Exception { + defineWebPage( "OnCommand", "<form>" + + " <input type='text' name='color' value='blue' >" + + "</form>" + + "<script type='JavaScript'>" + + " alert( document.forms[0].color.value );" + + "</script>" + + "<form>" + + " <input type='text' name='size' value='3' >" + + "</form>" + + "<script type='JavaScript'>" + + " alert( document.forms[1].size.value );" + + "</script>" ); + WebConversation wc = new WebConversation(); + wc.getResponse( getHostPath() + "/OnCommand.html" ); + assertEquals( "Message 1", "blue", wc.popNextAlert() ); + assertEquals( "Message 2", "3", wc.popNextAlert() ); + } + + + /** * Verifies that a script can write part of the frameset. */ public void testScriptedFrames() throws Exception { Index: ScriptingTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/ScriptingTest.java,v retrieving revision 1.69 retrieving revision 1.70 diff -u -r1.69 -r1.70 --- ScriptingTest.java 5 Sep 2005 23:41:39 -0000 1.69 +++ ScriptingTest.java 28 Mar 2006 00:52:15 -0000 1.70 @@ -782,7 +782,7 @@ defineResource( "HasScript.html", "Javascript is enabled!" ); defineResource( "Start.html", "<html><head>" + " <noscript>" + - " <meta http-equiv='refresh' content='0;url=NoScript.html>'" + + " <meta http-equiv='refresh' content='0;url=NoScript.html'>" + " </noscript></head>" + "<body onload='document.form.submit()'>" + "<form name='form' action='HasScript.html'></form>" + |
From: Russell G. <rus...@us...> - 2006-03-28 00:52:18
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/parsing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11573/test/com/meterware/httpunit/parsing Modified Files: ParserPropertiesTest.java Log Message: Created custom DOM Index: ParserPropertiesTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/parsing/ParserPropertiesTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ParserPropertiesTest.java 24 Dec 2002 17:17:05 -0000 1.1 +++ ParserPropertiesTest.java 28 Mar 2006 00:52:15 -0000 1.2 @@ -45,8 +45,8 @@ public static TestSuite suite() { TestSuite ts = new TestSuite(); - boolean isJTidy = parserClassHasSubstring( "Tidy" ); - if (!isJTidy) ts.addTest( new ParserPropertiesTest( "testKeepCase" ) ); + boolean supportsKeepCase = HTMLParserFactory.getHTMLParser().supportsPreserveTagCase(); + if (supportsKeepCase) ts.addTest( new ParserPropertiesTest( "testKeepCase" ) ); return ts; } @@ -57,11 +57,6 @@ } - private static boolean parserClassHasSubstring( final String parserCode ) { - return HTMLParserFactory.getHTMLParser().getClass().getName().indexOf( parserCode ) >= 0; - } - - public ParserPropertiesTest( String name ) { super( name ); } |
From: Russell G. <rus...@us...> - 2006-03-28 00:52:18
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11573/test/com/meterware/httpunit Modified Files: HttpUnitSuite.java WebPageTest.java Log Message: Created custom DOM Index: HttpUnitSuite.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/HttpUnitSuite.java,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- HttpUnitSuite.java 23 Jul 2004 01:31:04 -0000 1.34 +++ HttpUnitSuite.java 28 Mar 2006 00:52:15 -0000 1.35 @@ -34,7 +34,11 @@ public class HttpUnitSuite extends ConditionalTestSuite { public static void main( String[] args ) { - junit.textui.TestRunner.run( suite() ); + try { + junit.textui.TestRunner.run( suite() ); + } catch (Exception e) { + e.printStackTrace(); //To change body of catch statement use Options | File Templates. + } } Index: WebPageTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/WebPageTest.java,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- WebPageTest.java 10 Aug 2004 20:28:53 -0000 1.40 +++ WebPageTest.java 28 Mar 2006 00:52:15 -0000 1.41 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * -* Copyright (c) 2000-2003, Russell Gold +* Copyright (c) 2000-2004, Russell Gold * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation @@ -27,6 +27,8 @@ import junit.framework.Test; import junit.framework.TestSuite; +import org.w3c.dom.html.HTMLDocument; +import org.w3c.dom.Document; @@ -102,6 +104,20 @@ } + public void testHtmlDocument() throws Exception { + defineWebPage( "SimplePage", + "This has no forms but it does\n" + + "have <a href=\"/other.html\">an <b>active</b> link</A>\n" + + " and <a name=here>an anchor</a>\n" + + "<a href=\"basic.html\"><IMG SRC=\"/images/arrow.gif\" ALT=\"Next -->\" WIDTH=1 HEIGHT=4></a>\n" ); + WebConversation wc = new WebConversation(); + WebResponse simplePage = wc.getResponse( getHostPath() + "/SimplePage.html" ); + Document dom = simplePage.getDOM(); + assertNotNull( "No DOM created for document", dom ); + assertTrue( "returned dom does not implement HTMLDocument, but is " + dom.getClass().getName(), dom instanceof HTMLDocument ); + } + + public void testTitle() throws Exception { defineResource( "SimplePage.html", "<html><head><title>A Sample Page</title></head>\n" + |
From: Russell G. <rus...@us...> - 2006-03-28 00:52:17
|
Update of /cvsroot/httpunit/httpunit/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11573/doc Modified Files: release_notes.txt Log Message: Created custom DOM Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.399 retrieving revision 1.400 diff -u -r1.399 -r1.400 --- release_notes.txt 27 Mar 2006 03:12:13 -0000 1.399 +++ release_notes.txt 28 Mar 2006 00:52:15 -0000 1.400 @@ -14,7 +14,12 @@ Revision History: -27-Mar-2006: +27-Mar-2006 + Additions: + Content and Parsing: + 1. Created a custom HttpUnit DOM + +27-Mar-2006 1.6.2: Acknowledgements: Thanks for Fabrizio Giustina for suggesting a way to make the TableRow object publically accessible. |
From: Russell G. <rus...@us...> - 2006-03-27 03:12:16
|
Update of /cvsroot/httpunit/httpunit/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10722/doc Modified Files: release_notes.txt Log Message: Prepare for 1.6.2 release Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.398 retrieving revision 1.399 diff -u -r1.398 -r1.399 --- release_notes.txt 24 Mar 2006 20:19:23 -0000 1.398 +++ release_notes.txt 27 Mar 2006 03:12:13 -0000 1.399 @@ -14,24 +14,19 @@ Revision History: -24-Mar-2006: - Additions: - 1. Added support for Servlet API 2.4 - 2. Implemented ServletContext.getServletContextName - 3. (PseudoServer) made HttpRequest class public - Problems fixed: - 1. ServletContext.getRealPath() now handles relative paths that do not start with a "/" - - 8-Mar-2006: +27-Mar-2006: Acknowledgements: Thanks for Fabrizio Giustina for suggesting a way to make the TableRow object publically accessible. - Additions: - 1. patch #1413171 Web table rows are now directly accessible in a TableRow element. - - 5-Sep-2005: Problems fixed: 1. bug #1063494 HTML entity replacement was looping indefinitely on strings with '&' and no ';' + 2. ServletContext.getRealPath() now handles relative paths that do not start with a "/" + + Additions: + 1. patch #1413171 Web table rows are now directly accessible in a TableRow element. + 2. Added support for Servlet API 2.4 + 3. Implemented ServletContext.getServletContextName + 4. (PseudoServer) made HttpRequest class public 6-Mar-2005 1.6.1 Acknowledgements: |
From: Russell G. <rus...@us...> - 2006-03-24 20:19:31
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/pseudoserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23421/src/com/meterware/pseudoserver Modified Files: HttpRequest.java Log Message: Made HttpRequest class public to permit access from pseudo servlets Index: HttpRequest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/pseudoserver/HttpRequest.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- HttpRequest.java 29 Sep 2004 17:15:26 -0000 1.8 +++ HttpRequest.java 24 Mar 2006 20:19:23 -0000 1.9 @@ -33,7 +33,7 @@ * * @since 1.6 */ -class HttpRequest extends ReceivedHttpMessage { +public class HttpRequest extends ReceivedHttpMessage { private String _protocol; private String _command; |
From: Russell G. <rus...@us...> - 2006-03-24 20:19:26
|
Update of /cvsroot/httpunit/httpunit/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23421/doc Modified Files: release_notes.txt Log Message: Made HttpRequest class public to permit access from pseudo servlets Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.397 retrieving revision 1.398 diff -u -r1.397 -r1.398 --- release_notes.txt 24 Mar 2006 19:59:12 -0000 1.397 +++ release_notes.txt 24 Mar 2006 20:19:23 -0000 1.398 @@ -14,10 +14,11 @@ Revision History: -23-Mar-2006: +24-Mar-2006: Additions: 1. Added support for Servlet API 2.4 2. Implemented ServletContext.getServletContextName + 3. (PseudoServer) made HttpRequest class public Problems fixed: 1. ServletContext.getRealPath() now handles relative paths that do not start with a "/" |
From: Russell G. <rus...@us...> - 2006-03-24 19:59:24
|
Update of /cvsroot/httpunit/httpunit/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12362/doc Modified Files: release_notes.txt Log Message: servletunit upgrades Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.396 retrieving revision 1.397 diff -u -r1.396 -r1.397 --- release_notes.txt 9 Mar 2006 01:52:28 -0000 1.396 +++ release_notes.txt 24 Mar 2006 19:59:12 -0000 1.397 @@ -14,6 +14,13 @@ Revision History: +23-Mar-2006: + Additions: + 1. Added support for Servlet API 2.4 + 2. Implemented ServletContext.getServletContextName + Problems fixed: + 1. ServletContext.getRealPath() now handles relative paths that do not start with a "/" + 8-Mar-2006: Acknowledgements: Thanks for Fabrizio Giustina for suggesting a way to make the TableRow object publically accessible. |
From: Russell G. <rus...@us...> - 2006-03-24 19:59:21
|
Update of /cvsroot/httpunit/httpunit/jars In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12362/jars Modified Files: servlet.jar Log Message: servletunit upgrades Index: servlet.jar =================================================================== RCS file: /cvsroot/httpunit/httpunit/jars/servlet.jar,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 Binary files /tmp/cvsh9JYe6 and /tmp/cvsQwYPHL differ |
From: Russell G. <rus...@us...> - 2006-03-24 19:59:20
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/servletunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12362/test/com/meterware/servletunit Modified Files: RequestContextTest.java WebXMLString.java WebXMLTest.java Log Message: servletunit upgrades Index: RequestContextTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/servletunit/RequestContextTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- RequestContextTest.java 27 Oct 2004 00:57:34 -0000 1.4 +++ RequestContextTest.java 24 Mar 2006 19:59:12 -0000 1.5 @@ -367,6 +367,22 @@ public String getRealPath( String s ) { return null; } + + public int getRemotePort() { + return 0; //To change body of implemented methods use File | Settings | File Templates. + } + + public String getLocalName() { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public String getLocalAddr() { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public int getLocalPort() { + return 0; //To change body of implemented methods use File | Settings | File Templates. + } } Index: WebXMLString.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/servletunit/WebXMLString.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- WebXMLString.java 27 Jun 2004 16:00:50 -0000 1.6 +++ WebXMLString.java 24 Mar 2006 19:59:12 -0000 1.7 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * - * Copyright (c) 2001-2004, Russell Gold + * Copyright (c) 2001-2004, 2006 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 @@ -35,6 +35,8 @@ **/ class WebXMLString { + private String _displayName; + private ArrayList _servlets = new ArrayList(); private ArrayList _mappings = new ArrayList(); private ArrayList _servletNames = new ArrayList(); @@ -66,6 +68,7 @@ // 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" ); + if (_displayName != null) result.append( " <display-name>" ).append( _displayName ).append( "</display-name>" ); for (Iterator i = _contextParams.entrySet().iterator(); i.hasNext();) { Map.Entry entry = (Map.Entry) i.next(); result.append( " <context-param>\n <param-name>" ).append( entry.getKey() ); @@ -142,6 +145,8 @@ _mappings.add( urlPattern ); _servletNames.add( name ); } + + void addServlet( String name, String urlPattern, Class servletClass, Properties initParams ) { _initParams.put( name, initParams ); addServlet( name, urlPattern, servletClass ); @@ -232,6 +237,10 @@ } return result; } + + void setDisplayName( String displayName ) { + _displayName = displayName; + } } Index: WebXMLTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/servletunit/WebXMLTest.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- WebXMLTest.java 24 Sep 2004 20:31:27 -0000 1.24 +++ WebXMLTest.java 24 Mar 2006 19:59:12 -0000 1.25 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * -* Copyright (c) 2001-2004, Russell Gold +* Copyright (c) 2001-2004,2006, 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 @@ -69,8 +69,30 @@ } + public void testRealPath() throws Exception { + + WebXMLString wxs = new WebXMLString(); + wxs.addServlet( "/SimpleServlet", SimpleGetServlet.class ); + File webXml = createWebXml( new File( "build/base" ), wxs ); + + assertRealPath( "path with no context", new ServletRunner( webXml ), new File( "something.txt" ), "/something.txt" ); + assertRealPath( "path with context", new ServletRunner( webXml, "/testing" ), new File( "build/base/something.txt" ), "/something.txt" ); + assertRealPath( "path with no context, no slash", new ServletRunner( webXml ), new File( "something.txt" ), "something.txt" ); + assertRealPath( "path with context, no slash", new ServletRunner( webXml, "/testing" ), new File( "build/base/something.txt" ), "something.txt" ); + } + + private void assertRealPath( String comment, ServletRunner sr, File expectedFile, String relativePath ) { + String realPath = sr.getSession(true).getServletContext().getRealPath( relativePath ); + assertEquals( comment, expectedFile.getAbsolutePath(), realPath ); + } + + private File createWebXml( WebXMLString wxs ) throws IOException { - File dir = new File( "build/META-INF" ); + return createWebXml( new File("build"), wxs ); + } + + private File createWebXml( File parent, WebXMLString wxs ) throws IOException { + File dir = new File( parent, "META-INF" ); dir.mkdirs(); File webXml = new File( dir, "web.xml" ); FileOutputStream fos = new FileOutputStream( webXml ); @@ -117,6 +139,35 @@ } + /** + * Verifies that the default display name is null. + */ + public void testDefaultContextNameConfiguration() throws Exception { + WebXMLString wxs = new WebXMLString(); + WebApplication app = new WebApplication( newDocument( wxs.asText() ) ); + assertNull( "Context name should default to null", app.getDisplayName() ); + } + + + /** + * Verifies that a web application can read its display name from the configuration. + * @throws Exception + */ + public void testContextNameConfiguration() throws Exception { + WebXMLString wxs = new WebXMLString(); + wxs.setDisplayName( "samples" ); + wxs.addServlet( "simple", "/SimpleServlet", SimpleGetServlet.class ); + WebApplication app = new WebApplication( newDocument( wxs.asText() ) ); + assertEquals( "Display name", "samples", app.getDisplayName() ); + + ServletRunner sr = new ServletRunner( wxs.asInputStream() ); + ServletUnitClient client = sr.newClient(); + InvocationContext ic = client.newInvocation( "http://localhost/SimpleServlet" ); + ServletContext servletContext = ic.getServlet().getServletConfig().getServletContext(); + assertEquals( "Context name", "samples", servletContext.getServletContextName() ); + } + + public void testServletParameters() throws Exception { WebXMLString wxs = new WebXMLString(); Properties params = new Properties(); |
From: Russell G. <rus...@us...> - 2006-03-24 19:59:20
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/servletunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12362/src/com/meterware/servletunit Modified Files: ServletUnitHttpRequest.java ServletUnitHttpResponse.java ServletUnitServletContext.java WebApplication.java Log Message: servletunit upgrades Index: ServletUnitHttpRequest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/servletunit/ServletUnitHttpRequest.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- ServletUnitHttpRequest.java 6 Mar 2005 20:18:32 -0000 1.36 +++ ServletUnitHttpRequest.java 24 Mar 2006 19:59:12 -0000 1.37 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * -* Copyright (c) 2000-2005, Russell Gold +* Copyright (c) 2000-2006, 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 @@ -486,7 +486,7 @@ } -//--------------------------------- methods added to ServletRequest in JSDK 2.2 ------------------------------------------------ +//--------------------------------- methods added to ServletRequest in Servlet API 2.2 ------------------------------------------------ /** @@ -582,7 +582,7 @@ -//--------------------------------- methods added to HttpServletRequest in JSDK 2.2 ------------------------------------------------ +//--------------------------------- methods added to HttpServletRequest in Servlet API 2.2 ------------------------------------------------ /** @@ -629,7 +629,7 @@ } -//--------------------------------------- methods added to ServletRequest in JSDK 2.3 ---------------------------- +//--------------------------------------- methods added to ServletRequest in Servlet API 2.3 ---------------------------- /** * Returns a java.util.Map of the parameters of this request. @@ -655,7 +655,7 @@ } -//--------------------------------------- methods added to HttpServletRequest in JSDK 2.3 ---------------------------- +//--------------------------------------- methods added to HttpServletRequest in Servlet API 2.3 ---------------------------- /** @@ -683,6 +683,24 @@ } +//--------------------------------------- methods added to ServletRequest in Servlet API 2.4 ---------------------------- + + public int getRemotePort() { + return 0; //To change body of implemented methods use File | Settings | File Templates. + } + + public String getLocalName() { + return "localhost"; + } + + public String getLocalAddr() { + return "127.0.0.1"; + } + + public int getLocalPort() { + return 0; //To change body of implemented methods use File | Settings | File Templates. + } + //--------------------------------------------- package members ---------------------------------------------- Index: ServletUnitHttpResponse.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/servletunit/ServletUnitHttpResponse.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- ServletUnitHttpResponse.java 13 Oct 2004 21:57:50 -0000 1.21 +++ ServletUnitHttpResponse.java 24 Mar 2006 19:59:12 -0000 1.22 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * -* Copyright (c) 2000-2003, Russell Gold +* Copyright (c) 2000-2004,2006, 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 @@ -394,7 +394,7 @@ **/ public void reset() { resetBuffer(); - _headers = new Hashtable(); + _headers.clear(); _headersComplete = false; _status = SC_OK; } @@ -448,14 +448,6 @@ //---------------------------------------------- package methods -------------------------------------------------- /** - * Returns the content type defined for this response. - **/ - String getContentType() { - return _contentType; - } - - - /** * Returns the contents of this response. **/ byte[] getContents() { @@ -502,7 +494,7 @@ String getHeaderField( String name ) { if (!_headersComplete) completeHeaders(); - ArrayList values = null; + ArrayList values; synchronized (_headers) { values = (ArrayList) _headers.get( name.toUpperCase() ); } @@ -520,7 +512,7 @@ */ public String[] getHeaderFields(String name) { if (!_headersComplete) completeHeaders(); - ArrayList values = null; + ArrayList values; synchronized (_headers) { values = (ArrayList) _headers.get(name.toUpperCase()); } @@ -531,6 +523,20 @@ } +//--------------------------------------- methods added to ServletRequest in Servlet API 2.4 ---------------------------- + + public void setCharacterEncoding(String string) { + _encoding = string; + } + + /** + * Returns the content type defined for this response. + **/ + public String getContentType() { + return _contentType; + } + + //------------------------------------------- private members ------------------------------------ @@ -548,7 +554,7 @@ private String _statusMessage = "OK"; - private Hashtable _headers = new Hashtable(); + private final Hashtable _headers = new Hashtable(); private boolean _headersComplete; Index: ServletUnitServletContext.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/servletunit/ServletUnitServletContext.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- ServletUnitServletContext.java 3 Mar 2004 01:12:51 -0000 1.14 +++ ServletUnitServletContext.java 24 Mar 2006 19:59:12 -0000 1.15 @@ -63,7 +63,7 @@ /** * Returns the major version of the Java Servlet API that this servlet container supports. - * All implementations that comply with Version 2.3 must have this method return the integer 2. + * All implementations that comply with Version 2.4 must have this method return the integer 2. **/ public int getMajorVersion() { return 2; @@ -72,10 +72,10 @@ /** * Returns the minor version of the Servlet API that this servlet container supports. - * All implementations that comply with Version 2.3 must have this method return the integer 3. + * All implementations that comply with Version 2.4 must have this method return the integer 4. **/ public int getMinorVersion() { - return 3; + return 4; } @@ -345,7 +345,7 @@ * @since HttpUnit 1.3 */ public String getServletContextName() { - return null; + return _application.getDisplayName(); } //------------------------------------------- package members ---------------------------------------------------- Index: WebApplication.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/servletunit/WebApplication.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- WebApplication.java 4 Oct 2004 23:45:35 -0000 1.26 +++ WebApplication.java 24 Mar 2006 19:59:12 -0000 1.27 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * - * Copyright (c) 2001-2004, Russell Gold + * Copyright (c) 2001-2004, 2006 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 @@ -90,6 +90,8 @@ private ServletUnitServletContext _servletContext; + private String _displayName; + /** * Constructs a default application spec with no information. @@ -122,6 +124,9 @@ if (contextPath != null && contextPath.length() > 0 && !contextPath.startsWith( "/" )) throw new IllegalArgumentException( "Context path " + contextPath + " must start with '/'" ); _contextDir = file; _contextPath = contextPath == null ? "" : contextPath; + NodeList nl = document.getElementsByTagName( "display-name" ); + if (nl.getLength() > 0) _displayName = XMLUtils.getTextValue( nl.item(0) ).trim(); + registerServlets( document ); registerFilters( document ); extractSecurityConstraints( document ); @@ -336,10 +341,11 @@ File getResourceFile( String path ) { + String relativePath = path.startsWith( "/" ) ? path.substring(1) : path; if (_contextDir == null) { - return new File( path.substring(1) ); + return new File( relativePath ); } else { - return new File( _contextDir, path.substring(1) ); + return new File( _contextDir, relativePath ); } } @@ -501,6 +507,9 @@ return urlPattern.equals( urlPath ); } + String getDisplayName() { + return _displayName; + } //============================================= SecurityCheckServlet class ============================================= |
From: Russell G. <rus...@us...> - 2006-03-09 01:52:31
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18879/src/com/meterware/httpunit Modified Files: ParsedHTML.java WebTable.java Added Files: TableRow.java Log Message: patch 1413171: expose TableRow element ***** Error reading new file[Errno 2] No such file or directory: 'TableRow.java' Index: ParsedHTML.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/ParsedHTML.java,v retrieving revision 1.62 retrieving revision 1.63 diff -u -r1.62 -r1.63 --- ParsedHTML.java 2 Dec 2004 00:54:59 -0000 1.62 +++ ParsedHTML.java 9 Mar 2006 01:52:28 -0000 1.63 @@ -569,19 +569,19 @@ } protected boolean addToContext() { return true; } protected void addToLists( NodeUtils.PreOrderTraversal pot, HTMLElement htmlElement ) { - getWebTable( pot ).addRow( (WebTable.TableRow) htmlElement ); + getWebTable( pot ).addRow( (TableRow) htmlElement ); } } static class TableCellFactory extends HTMLElementFactory { HTMLElement toHTMLElement( NodeUtils.PreOrderTraversal pot, ParsedHTML parsedHTML, Element element ) { - WebTable.TableRow tr = getTableRow( pot ); + TableRow tr = getTableRow( pot ); if (tr == null) return null; return tr.newTableCell( element ); } - private WebTable.TableRow getTableRow( NodeUtils.PreOrderTraversal pot ) { - return (WebTable.TableRow) getClosestContext( pot, WebTable.TableRow.class ); + private TableRow getTableRow( NodeUtils.PreOrderTraversal pot ) { + return (TableRow) getClosestContext( pot, TableRow.class ); } protected boolean addToContext() { return true; } protected void addToLists( NodeUtils.PreOrderTraversal pot, HTMLElement htmlElement ) { Index: WebTable.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebTable.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- WebTable.java 13 Jan 2005 04:15:46 -0000 1.30 +++ WebTable.java 9 Mar 2006 01:52:28 -0000 1.31 @@ -303,47 +303,20 @@ TableRow newTableRow( Element element ) { - return new TableRow( element ); + return new TableRow( this, element ); } - private TableRow[] getRows() { + /** + * Returns an array of rows for this table. + */ + public TableRow[] getRows() { return (TableRow[]) _rows.toArray( new TableRow[ _rows.size() ] ); } - class TableRow extends HTMLElementBase { - - private ArrayList _cells = new ArrayList(); - - TableRow( Element rowNode ) { - super( rowNode ); - } - - - TableCell[] getCells() { - return (TableCell[]) _cells.toArray( new TableCell[ _cells.size() ]); - } - - - TableCell newTableCell( Element element ) { - return new TableCell( _response, _frameName, element, _url, _baseTarget, _characterSet ); - } - - - void addTableCell( TableCell cell ) { - _cells.add( cell ); - } - - - protected ScriptableDelegate newScriptable() { - return new HTMLElementScriptable( this ); - } - - - protected ScriptableDelegate getParentDelegate() { - return _response.getScriptableObject().getDocument(); - } + TableCell newTableCell( Element element ) { + return new TableCell( _response, _frameName, element, _url, _baseTarget, _characterSet ); } |
From: Russell G. <rus...@us...> - 2006-03-09 01:52:31
|
Update of /cvsroot/httpunit/httpunit/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18879/doc Modified Files: release_notes.txt Log Message: patch 1413171: expose TableRow element Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.395 retrieving revision 1.396 diff -u -r1.395 -r1.396 --- release_notes.txt 5 Sep 2005 23:41:39 -0000 1.395 +++ release_notes.txt 9 Mar 2006 01:52:28 -0000 1.396 @@ -14,6 +14,13 @@ Revision History: + 8-Mar-2006: + Acknowledgements: + Thanks for Fabrizio Giustina for suggesting a way to make the TableRow object publically accessible. + + Additions: + 1. patch #1413171 Web table rows are now directly accessible in a TableRow element. + 5-Sep-2005: Problems fixed: 1. bug #1063494 HTML entity replacement was looping indefinitely on strings with '&' and no ';' |
From: Russell G. <rus...@us...> - 2006-03-09 01:51:45
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18482/test/com/meterware/httpunit Modified Files: WebClientTest.java Log Message: remove test that only works if there is web server running on port 80 Index: WebClientTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/WebClientTest.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- WebClientTest.java 4 Oct 2004 23:45:35 -0000 1.24 +++ WebClientTest.java 9 Mar 2006 01:51:36 -0000 1.25 @@ -535,7 +535,7 @@ }); defineResource( "whereAmI", new PseudoServlet() { - public WebResource getGetResponse() throws IOException { + public WebResource getGetResponse() { WebResource webResource = new WebResource( "found host header: " + getHeader( "Host" ) ); webResource.addHeader( "Set-Cookie: type=short" ); return webResource; @@ -543,7 +543,7 @@ } ); defineResource( "checkCookies", new PseudoServlet() { - public WebResource getGetResponse() throws IOException { + public WebResource getGetResponse() { return new WebResource( "found cookies: " + getHeader( "Cookie" ) ); } } ); @@ -558,20 +558,4 @@ } - 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) { - } catch (SocketException e) { - } - - assertEquals( "Submitted host header", "meterware.com", wc.getHeaderField( "Host" ) ); - } - - } |
From: victor li <vic...@ya...> - 2005-12-13 01:13:36
|
Hi, I am fairly new to httpunit testing. I encountered a problem. I used the following code: WebForm form = response.getFormWithName("test"); form.setParameter("mytest", "test , test"); form.submit(); In the java servlet, when I call request.getParameter("mytest"), I always get value "test+%2Ftest", it is not properly decoded. I tried to submit the form using web brawser, and the when I call request.getParamter() in the servlet deployed on tomcat, I can get the decoded value "test ,test". Does anyone know how to set parameter via using webform and get decoded value in the servlet? Thanks in advance for the help. ~Victor --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping |
From: Russell G. <rus...@us...> - 2005-09-05 23:41:53
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31549/test/com/meterware/httpunit/javascript Modified Files: ScriptingTest.java Log Message: bug #1063494 HTML entity replacement was looping indefinitely on strings with '&' and no ';' Index: ScriptingTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/ScriptingTest.java,v retrieving revision 1.68 retrieving revision 1.69 diff -u -r1.68 -r1.69 --- ScriptingTest.java 2 Dec 2004 03:43:20 -0000 1.68 +++ ScriptingTest.java 5 Sep 2005 23:41:39 -0000 1.69 @@ -64,7 +64,7 @@ public void testJavaScriptURLWithNoValue() throws Exception { defineResource( "OnCommand.html", "<html><head></head>" + "<body>" + - "<a href='javascript:alert( \"Hi there!\" )'>go</a>" + + "<a href=\"javascript:alert( 'Hi there!' )\">go</a>" + "</body></html>" ); WebConversation wc = new WebConversation(); WebResponse response = wc.getResponse( getHostPath() + "/OnCommand.html" ); |
From: Russell G. <rus...@us...> - 2005-09-05 23:41:53
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31549/test/com/meterware/httpunit Modified Files: EncodingTest.java Log Message: bug #1063494 HTML entity replacement was looping indefinitely on strings with '&' and no ';' Index: EncodingTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/EncodingTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- EncodingTest.java 23 Jul 2004 04:04:28 -0000 1.2 +++ EncodingTest.java 5 Sep 2005 23:41:39 -0000 1.3 @@ -234,4 +234,22 @@ } + public void testSimpleEntityReplacement() throws Exception { + String rawString = "Cox&&Forkum"; + assertEquals( "After substitution", "Cox&&Forkum", HttpUnitUtils.replaceEntities( rawString ) ); + } + + + public void testSkipEntityReplacementOnBadString() throws Exception { + String rawString = "Cox&Forkum"; + assertEquals( "After substitution", "Cox&Forkum", HttpUnitUtils.replaceEntities( rawString ) ); + } + + + public void testSkipEntityReplacementOnUnhandledEntity() throws Exception { + String rawString = "<something>"; + assertEquals( "After substitution", "<something>", HttpUnitUtils.replaceEntities( rawString ) ); + } + + } |
From: Russell G. <rus...@us...> - 2005-09-05 23:41:51
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31549/src/com/meterware/httpunit Modified Files: HttpUnitUtils.java Log Message: bug #1063494 HTML entity replacement was looping indefinitely on strings with '&' and no ';' Index: HttpUnitUtils.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/HttpUnitUtils.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- HttpUnitUtils.java 26 Dec 2004 20:33:34 -0000 1.21 +++ HttpUnitUtils.java 5 Sep 2005 23:41:39 -0000 1.22 @@ -269,12 +269,12 @@ int ampIndex; while ((ampIndex = string.indexOf( '&', i )) >= 0) { int semiColonIndex = string.indexOf( ';', ampIndex+1 ); - if (semiColonIndex < 0) continue; + if (semiColonIndex < 0) break; + i = ampIndex+1; String entityName = string.substring( ampIndex+1, semiColonIndex ); if (entityName.equalsIgnoreCase( "amp" )) { string = string.substring( 0, ampIndex ) + '&' + string.substring( semiColonIndex+1 ); - i = ampIndex + 1; } } |
From: Russell G. <rus...@us...> - 2005-09-05 23:41:48
|
Update of /cvsroot/httpunit/httpunit/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31549/doc Modified Files: release_notes.txt Log Message: bug #1063494 HTML entity replacement was looping indefinitely on strings with '&' and no ';' Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.394 retrieving revision 1.395 diff -u -r1.394 -r1.395 --- release_notes.txt 6 Mar 2005 20:30:45 -0000 1.394 +++ release_notes.txt 5 Sep 2005 23:41:39 -0000 1.395 @@ -14,6 +14,10 @@ Revision History: + 5-Sep-2005: + Problems fixed: + 1. bug #1063494 HTML entity replacement was looping indefinitely on strings with '&' and no ';' + 6-Mar-2005 1.6.1 Acknowledgements: Thanks to Hanson Char for identifying a JDK 1.5 incompatibility. |
From: Russell G. <rus...@us...> - 2005-03-06 20:31:03
|
Update of /cvsroot/httpunit/httpunit/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9000/doc Modified Files: release_notes.txt Log Message: Prepare for 1.6.1 Index: release_notes.txt =================================================================== RCS file: /cvsroot/httpunit/httpunit/doc/release_notes.txt,v retrieving revision 1.393 retrieving revision 1.394 diff -u -r1.393 -r1.394 --- release_notes.txt 26 Dec 2004 20:33:34 -0000 1.393 +++ release_notes.txt 6 Mar 2005 20:30:45 -0000 1.394 @@ -14,60 +14,44 @@ Revision History: -26-Dec-2004: - Problems fixed: - 1. bug #1087180 setting a numeric value into a form parameter was appending a trailing decimal zero - - 1-Dec-2004: - Acknowledgements: - Thanks to Yaqoub Jaiousi for identifying the problem with buttons outside of forms. - - Problems fixed: - 1. bug #1074232 buttons outside of forms were only recognized if defined with the <button> tag, not <input> - 2. bug #1073810 a null pointer exception is no longer thrown when javascript sets a control value to null - 3. bug #1052779 window.open() with javascript URL no longer throws a null pointer exception or class cast exception - -28-Oct-2004: - Acknowledgements: - Thanks to Vladimir Korenev for providing an implementation for style.visibility, element.tagName, and element.nodeName - - Problems fixed: - 1. patch #1046516 property style.visibility is now supported - -25-Oct-2004: - Problems fixed: - 1. bug #1051123 ServletUnit handling of parameter encoding was not cleaning up url-encodings - -17-Oct-2004: - Problems fixed: - 1. bug #1047367 frames defined by javascript were not being detected. - -14-Oct-2004: - Problems fixed: - 1. bug #1046597 tables nested inside paragraphs were not being seen by the enclosing page. This bug was introduced - in 1.6 and has now been corrected. - -13-Oct-2004: + 6-Mar-2005 1.6.1 Acknowledgements: + Thanks to Hanson Char for identifying a JDK 1.5 incompatibility. Thanks to Satish Kolli for fixing bug #1040770 Thanks to Fabrizio Guistina for supplying an implementation of locale handling for ServletUnitHttpResponse + Thanks to Vladimir Korenev for providing an implementation for style.visibility, element.tagName, and element.nodeName + Thanks to Yaqoub Jaiousi for identifying the problem with buttons outside of forms. Problems fixed: - 1. bug #1040770 the Image.name JavaScript property is now supported - 2. bug #1044820 ServletUnit now implements HttpServletResponse.getLocale() and setLocale() - -5-Oct-2004: - Acknowledgements: - Thanks to Hanson Char for identifying a JDK 1.5 incompatibility. - - Problems fixed: - 1. Renamed local variables which conflicted with new JDK 1.5 keyword "enum." - 2. bug #1040508 Using the setCheckbox and toggleCheckbox methods was not triggering the onclick event + JDK compatibility + 1. bug #1039989 Did not compile with JDK 1.3. This bug was introduced in HttpUnit 1.6 and has now been corrected. + 2. Renamed local variables which conflicted with new JDK 1.5 keyword "enum." + + Content and Parsing + 3. bug #1046597 tables nested inside paragraphs were not being seen by the enclosing page. This bug was introduced + in 1.6 and has now been corrected. + 4. bug #1074232 buttons outside of forms were only recognized if defined with the <button> tag, not <input> + + Window handling + 5. bug #1035949 Following a link from the top frame to a _parent target no longer results in a NullPointerException. + + JavaScript + 6. bug #1040508 Using the setCheckbox and toggleCheckbox methods was not triggering the onclick event + 7. bug #1040770 the Image.name JavaScript property is now supported + 8. bug #1047367 frames defined by javascript were not being detected. + 9. patch #1046516 property style.visibility is now supported + 10. bug #1073810 a null pointer exception is no longer thrown when javascript sets a control value to null + 11. bug #1052779 window.open() with javascript URL no longer throws a null pointer exception or class cast exception + 12. bug #1087180 setting a numeric value into a form parameter was appending a trailing decimal zero + + ServletUnit + 13. bug #1044820 ServletUnit now implements HttpServletResponse.getLocale() and setLocale() + 14. bug #1051123 ServletUnit handling of parameter encoding was not cleaning up url-encodings + 15. bug #1151277 only the first user-defined cookie was recognized in ServletUnit if multiple were set + + PseudoServer + 16. Made all WebResource constructors public -4-Oct-2004 - Problems fixed: - 1. bug #1039989 Did not compile with JDK 1.3. This bug was introduced in HttpUnit 1.6 and has now been corrected. - 2. bug #1035949 Following a link from the top frame to a _parent target no longer results in a NullPointerException. 3-Oct-2004 1.6 Acknowledgements: |
From: Russell G. <rus...@us...> - 2005-03-06 20:31:03
|
Update of /cvsroot/httpunit/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9000 Modified Files: build.xml Log Message: Prepare for 1.6.1 Index: build.xml =================================================================== RCS file: /cvsroot/httpunit/httpunit/build.xml,v retrieving revision 1.78 retrieving revision 1.79 diff -u -r1.78 -r1.79 --- build.xml 21 Jan 2005 00:06:23 -0000 1.78 +++ build.xml 6 Mar 2005 20:30:44 -0000 1.79 @@ -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.6" /> + <property name="version" value="1.6.1" /> <property name="debug" value="on" /> <property name="deprecation" value="off" /> |
From: Russell G. <rus...@us...> - 2005-03-06 20:20:20
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/pseudoserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6396/src/com/meterware/pseudoserver Modified Files: WebResource.java Log Message: Make all constructors in WebResource public Index: WebResource.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/pseudoserver/WebResource.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- WebResource.java 26 Sep 2004 01:30:37 -0000 1.9 +++ WebResource.java 6 Mar 2005 20:20:10 -0000 1.10 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * -* Copyright (c) 2000-2002, Russell Gold +* Copyright (c) 2000-2005, 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 @@ -82,19 +82,19 @@ } - WebResource( String contents, int responseCode ) { + public WebResource( String contents, int responseCode ) { this( contents, DEFAULT_CONTENT_TYPE, responseCode ); } - WebResource( String contents, String contentType, int responseCode ) { + public WebResource( String contents, String contentType, int responseCode ) { _string = contents; _contentType = contentType; _responseCode = responseCode; } - WebResource( byte[] contents, String contentType, int responseCode ) { + public WebResource( byte[] contents, String contentType, int responseCode ) { _contents = contents; _contentType = contentType; _responseCode = responseCode; |
From: Russell G. <rus...@us...> - 2005-03-06 20:18:42
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/servletunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5909/test/com/meterware/servletunit Modified Files: HttpServletRequestTest.java Log Message: bug #1151277: fix cookie parsing in ServletUnit Index: HttpServletRequestTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/servletunit/HttpServletRequestTest.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- HttpServletRequestTest.java 2 Dec 2004 02:07:10 -0000 1.26 +++ HttpServletRequestTest.java 6 Mar 2005 20:18:32 -0000 1.27 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * -* Copyright (c) 2000-2003 by Russell Gold +* Copyright (c) 2000-2005 by 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 @@ -33,6 +33,7 @@ import javax.servlet.ServletException; import com.meterware.httpunit.*; +import com.meterware.httpunit.cookies.CookieProperties; import junit.framework.Test; import junit.framework.TestSuite; @@ -292,6 +293,36 @@ assertNull( "New request should still not have a request session ID", request.getRequestedSessionId() ); } + /** + * Test recognition of cookies defined on the client. + */ + public void testGetUserCookies() throws Exception { + String FIRST_COOKIE = "RANDOM_COOKIE"; + String SECOND_COOKIE = "ANOTHER_COOKIE"; + String FIRST_COOKIE_VALUE = "cookie1"; + String SECOND_COOKIE_VALUE = "cookie2"; + + ServletRunner sr = new ServletRunner(); + sr.registerServlet( "testServlet", "ServletName" ); + ServletUnitClient m_sc = sr.newClient(); + m_sc.putCookie( FIRST_COOKIE, FIRST_COOKIE_VALUE ); + m_sc.putCookie( SECOND_COOKIE, SECOND_COOKIE_VALUE ); + + InvocationContext invocation = m_sc.newInvocation( "http://localhost/testServlet" ); + HttpServletRequest requ = invocation.getRequest(); + + Cookie[] cookies = requ.getCookies(); + assertEquals( 2, cookies.length ); + Cookie firstActualCookie = cookies[0]; + Cookie secondActualCookie = cookies[1]; + + assertEquals( FIRST_COOKIE, firstActualCookie.getName() ); + assertEquals( SECOND_COOKIE, secondActualCookie.getName() ); + + assertEquals( FIRST_COOKIE_VALUE, firstActualCookie.getValue() ); + assertEquals( SECOND_COOKIE_VALUE, secondActualCookie.getValue() ); + } + /** * Verifies that even when session creation is not explicitly requested, the inclusion of a session cookie |