httpunit-commit Mailing List for httpunit (Page 5)
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: <wol...@us...> - 2008-12-02 22:14:59
|
Revision: 1015
http://httpunit.svn.sourceforge.net/httpunit/?rev=1015&view=rev
Author: wolfgang_fahl
Date: 2008-12-02 22:14:56 +0000 (Tue, 02 Dec 2008)
Log Message:
-----------
added test case for discussing 2373755
Modified Paths:
--------------
trunk/httpunit/test/com/meterware/httpunit/XMLPageTest.java
Modified: trunk/httpunit/test/com/meterware/httpunit/XMLPageTest.java
===================================================================
--- trunk/httpunit/test/com/meterware/httpunit/XMLPageTest.java 2008-12-02 02:23:17 UTC (rev 1014)
+++ trunk/httpunit/test/com/meterware/httpunit/XMLPageTest.java 2008-12-02 22:14:56 UTC (rev 1015)
@@ -2,7 +2,7 @@
/********************************************************************************************************************
* $Id$
*
-* Copyright (c) 2000-2002, Russell Gold
+* Copyright (c) 2000-2008, 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
@@ -56,6 +56,24 @@
WebResponse simplePage = wc.getResponse( request );
simplePage.getDOM();
}
+
+ /**
+ * test case for BR [2373755] by Frank Waldheim
+ * deactivated since it is the opposite of 1281655
+ * @throws Exception
+ */
+ public void xtestXMLisHTML() throws Exception {
+ String originalXml = "<?xml version=\"1.0\" ?><main><title>See me now</title></main>";
+ defineResource("SimplePage.xml", originalXml, "text/xml");
+ WebConversation wc = new WebConversation();
+ WebRequest request = new GetMethodWebRequest(getHostPath()+"/SimplePage.xml");
+ WebResponse simplePage = wc.getResponse(request);
+ // we do not have an html result
+ assertFalse("xml result is not HTML",simplePage.isHTML());
+ // get the main element as root
+ assertNotNull("we do have an root-element",simplePage.getDOM().getDocumentElement());
+ assertEquals("the actual root must be the root of our test-xml",simplePage.getDOM().getDocumentElement().getTagName(),"main");
+ }
public void testTraversal() throws Exception {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2008-12-02 02:23:22
|
Revision: 1014
http://httpunit.svn.sourceforge.net/httpunit/?rev=1014&view=rev
Author: wolfgang_fahl
Date: 2008-12-02 02:23:17 +0000 (Tue, 02 Dec 2008)
Log Message:
-----------
Fix for BR[2264431] Revisited by Brendan Boesen
Modified Paths:
--------------
trunk/httpunit/src/com/meterware/httpunit/WebForm.java
trunk/httpunit/test/com/meterware/httpunit/FormSubmitTest.java
Modified: trunk/httpunit/src/com/meterware/httpunit/WebForm.java
===================================================================
--- trunk/httpunit/src/com/meterware/httpunit/WebForm.java 2008-11-15 01:22:53 UTC (rev 1013)
+++ trunk/httpunit/src/com/meterware/httpunit/WebForm.java 2008-12-02 02:23:17 UTC (rev 1014)
@@ -103,11 +103,9 @@
**/
public WebResponse submit( SubmitButton button, int x, int y ) throws IOException, SAXException {
WebResponse result=null;
- if (button==null || !button.doOnClickSequence(x, y)) {
- result= doFormSubmit( button, x, y );
- } else {
- result=getCurrentFrameContents();
- }
+ if (button == null) throw new IllegalSubmitButtonException( "?", "?" );
+ button.doOnClickSequence(x, y);
+ result=getCurrentFrameContents();
return result;
}
Modified: trunk/httpunit/test/com/meterware/httpunit/FormSubmitTest.java
===================================================================
--- trunk/httpunit/test/com/meterware/httpunit/FormSubmitTest.java 2008-11-15 01:22:53 UTC (rev 1013)
+++ trunk/httpunit/test/com/meterware/httpunit/FormSubmitTest.java 2008-12-02 02:23:17 UTC (rev 1014)
@@ -257,12 +257,44 @@
} catch (IllegalStateException e) {}
}
+ /**
+ * test for bug report [2264431] double submit problem
+ * version 1.7 would have problem with double submits
+ */
+ public void testDoubleSubmitProblem() throws Exception {
+ boolean states[]={false,true};
+ String expected[]={"","1"};
+ for (int i=0;i<states.length;i++) {
+ // countMySelf Tipp from http://www.tipstrs.com/tip/1084/Static-variables-in-Javascript
+ defineWebPage( "Default", "<form method=GET action = \"Default.html\" onsubmit=\"javascript:countMyself();\">" +
+ "<script type='JavaScript'>\n" +
+ "function countMyself() {\n"+
+ " // Check to see if the counter has been initialized\n"+
+ " if ( typeof countMyself.counter == 'undefined' ) {\n"+
+ " // It has not... perform the initilization\n"+
+ " countMyself.counter = 0;\n"+
+ " }\n"+
+ "\n"+
+ " // Do something stupid to indicate the value\n"+
+ " alert(++countMyself.counter);\n"+
+ "}\n"+
+ "</script>" +
+ "<Input type=submit name='update' onclick='return "+states[i]+";'></form>" +
+ "</form>" );
+ WebResponse page = _wc.getResponse( getHostPath() + "/Default.html" );
+ WebForm form = page.getForms()[0];
+ form.submit();
+ String alert=_wc.popNextAlert();
+ assertEquals( "There should be "+expected[i]+" submits for onclick state '"+states[i]+"' but there are "+alert,alert,expected[i]);
+ }
+ }
+
/**
* test self disabling submit Buttons
* test for bug report [ 1289151 ] Order of events in button.click() is wrong
*/
public void testSelfDisablingSubmitButton() throws Exception {
- defineWebPage( "Default", "<form method=GET action = \"Default.html\">" +
+ defineWebPage( "Default", "<form method=GET action = \"Default.html\">" +
"<Input type=submit name='update' onclick='javascript:this.disabled=true;'></form>" +
"</form>" );
WebResponse page = _wc.getResponse( getHostPath() + "/Default.html" );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2008-11-15 01:23:02
|
Revision: 1013
http://httpunit.svn.sourceforge.net/httpunit/?rev=1013&view=rev
Author: wolfgang_fahl
Date: 2008-11-15 01:22:53 +0000 (Sat, 15 Nov 2008)
Log Message:
-----------
Patch [ 1968504 ] Avoid '"event" is not defined'
by Mattias Jiderhamn
Modified Paths:
--------------
trunk/httpunit/src/com/meterware/httpunit/javascript/JavaScript.java
Modified: trunk/httpunit/src/com/meterware/httpunit/javascript/JavaScript.java
===================================================================
--- trunk/httpunit/src/com/meterware/httpunit/javascript/JavaScript.java 2008-11-15 00:55:03 UTC (rev 1012)
+++ trunk/httpunit/src/com/meterware/httpunit/javascript/JavaScript.java 2008-11-15 01:22:53 UTC (rev 1013)
@@ -413,6 +413,10 @@
return delegate == null ? null : (Window) toScriptable( delegate );
}
+ /** The global "event" object is not supported, so return null (instead of causing '"event" is not defined') */
+ public Location jsGet_event() {
+ return null;
+ }
public void clearCaches() {
if (_document != null) _document.clearCaches();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2008-11-15 00:55:04
|
Revision: 1012
http://httpunit.svn.sourceforge.net/httpunit/?rev=1012&view=rev
Author: wolfgang_fahl
Date: 2008-11-15 00:55:03 +0000 (Sat, 15 Nov 2008)
Log Message:
-----------
Addition for BR [ 2100376 ] Unable to implement an XPath Predicate (which used to work)
by Stephane Mikaty
Modified Paths:
--------------
trunk/httpunit/test/com/meterware/httpunit/WebPageTest.java
Modified: trunk/httpunit/test/com/meterware/httpunit/WebPageTest.java
===================================================================
--- trunk/httpunit/test/com/meterware/httpunit/WebPageTest.java 2008-11-15 00:53:24 UTC (rev 1011)
+++ trunk/httpunit/test/com/meterware/httpunit/WebPageTest.java 2008-11-15 00:55:03 UTC (rev 1012)
@@ -503,7 +503,33 @@
final WebResponse targetResponse = wc.getOpenWindow(targetWindow).getCurrentPage();
assertEquals("Base URL of link in target document", targetBaseURL, targetResponse.getLinkWith("relative link").getBaseURL());
}
+
+ /**
+ * test case for BR [ 2100376 ] Unable to implement an XPath Predicate (which used to work)
+ * by Stephane Mikaty
+ * @throws Exception
+ */
+ public void testGetFirstMatchingForm() throws Exception {
+ defineResource( "SimplePage.html", "<html><title>Hello</title>"
+ + " <body><form action='blah' method='GET'><button type='Submit' value='Blah'>Blah</button></form>"
+ + " <form action='new' method='GET'>"
+ + " <p>Some Junk</p><button type='Submit' value='Save'>Save</button></form>"
+ + "</html>" );
+ defineResource( "new", "<html><body><p>Success.</p></body></html>" );
+ defineResource( "blah", "<html><body><p>Failure.</p></body></html>" );
+ WebConversation wc = new WebConversation();
+ WebResponse resp = wc.getResponse( getHostPath() + "/SimplePage.html" );
+
+ //find our desired Save form and submit it
+ WebForm form = resp.getFirstMatchingForm(new XPathPredicate( "//BUTTON[@value='Save']/ancestor::FORM" ),null );
+ assertNotNull("The form found should not be null",form);
+ resp = wc.sendRequest( form.getRequest() );
+
+ //check the response
+ assertTrue( resp.getText().indexOf( "Success" ) >= 0 );
+ }
+
/**
* Create a fragment of HTML defining JavaScript that writes a document into a different window.
* @param document the document to be written
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2008-11-15 00:53:29
|
Revision: 1011
http://httpunit.svn.sourceforge.net/httpunit/?rev=1011&view=rev
Author: wolfgang_fahl
Date: 2008-11-15 00:53:24 +0000 (Sat, 15 Nov 2008)
Log Message:
-----------
svn id set
Modified Paths:
--------------
trunk/httpunit/src/com/meterware/httpunit/XPathPredicate.java
Property Changed:
----------------
trunk/httpunit/src/com/meterware/httpunit/XPathPredicate.java
Modified: trunk/httpunit/src/com/meterware/httpunit/XPathPredicate.java
===================================================================
--- trunk/httpunit/src/com/meterware/httpunit/XPathPredicate.java 2008-11-15 00:51:40 UTC (rev 1010)
+++ trunk/httpunit/src/com/meterware/httpunit/XPathPredicate.java 2008-11-15 00:53:24 UTC (rev 1011)
@@ -1,5 +1,5 @@
/********************************************************************************************************************
- * $Id: HTMLElementPredicate.java 336 2002-09-13 14:17:26Z russgold $
+ * $Id$
*
* Copyright (c) 2008, Russell Gold
*
Property changes on: trunk/httpunit/src/com/meterware/httpunit/XPathPredicate.java
___________________________________________________________________
Modified: svn:keywords
- Id:Filename
+ Id Filename
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2008-11-15 00:51:46
|
Revision: 1010
http://httpunit.svn.sourceforge.net/httpunit/?rev=1010&view=rev
Author: wolfgang_fahl
Date: 2008-11-15 00:51:40 +0000 (Sat, 15 Nov 2008)
Log Message:
-----------
Addition for BR [ 2100376 ] Unable to implement an XPath Predicate (which used to work)
by Stephane Mikaty
Added Paths:
-----------
trunk/httpunit/src/com/meterware/httpunit/XPathPredicate.java
Added: trunk/httpunit/src/com/meterware/httpunit/XPathPredicate.java
===================================================================
--- trunk/httpunit/src/com/meterware/httpunit/XPathPredicate.java (rev 0)
+++ trunk/httpunit/src/com/meterware/httpunit/XPathPredicate.java 2008-11-15 00:51:40 UTC (rev 1010)
@@ -0,0 +1,108 @@
+/********************************************************************************************************************
+ * $Id: HTMLElementPredicate.java 336 2002-09-13 14:17:26Z russgold $
+ *
+ * Copyright (c) 2008, 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
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ *******************************************************************************************************************/
+package com.meterware.httpunit;
+
+import javax.xml.xpath.*;
+import org.w3c.dom.*;
+
+/**
+ * Provides an HTMLElement Predicate that is capable of matching based on an
+ * XPath node specification. This allows for very advanced matching techniques.
+ *
+ * THREAD: Instances are not thread safe, each thread should create its own
+ * instance with a specific xpath. (The same instance can be used for multiple
+ * documents, each change in document will result in its internal caches being
+ * flushed).
+ *
+ * @author <a href="mailto:ed...@di...">edA-qa mort-ora-y</a>
+ * @author <a href="mailto:ste...@mi...">Stephane Mikaty</a>
+ */
+public class XPathPredicate implements HTMLElementPredicate {
+
+ /** XPath which dictates matching nodes, from root */
+ private XPathExpression xpath;
+ private String path;
+ // set to true for debugging
+ public static final boolean DEBUG=false;
+
+ /**
+ * Constructs an HTMLElementPredicate that matches only those elements which
+ * match the provided XPath.
+ *
+ * @param path
+ * [in] XPath specification of valid/matching nodes
+ * @throws XPathExpressionException
+ * if the xpath is invalid
+ */
+ public XPathPredicate(String path) throws XPathExpressionException {
+ this.path=path;
+ this.xpath = XPathFactory.newInstance().newXPath().compile(path);
+ }
+
+ /**
+ * debug Output for node structure
+ * @param node
+ * @param indent
+ */
+ private void debugOut(Node node, String indent) {
+ System.out.print(indent+node.getNodeName()+":");
+ System.out.println(indent+node.getNodeValue());
+ NodeList nl=node.getChildNodes();
+ for (int i = 0; i < nl.getLength(); i++) {
+ debugOut(nl.item(i),indent+"\t");
+ }
+ }
+
+ /**
+ * check whether the given criteria are matched for the given element
+ * @param someElement - the element to check
+ * @param criteria - the criteria to check
+ */
+ public boolean matchesCriteria(final Object someElement,final Object criteria) {
+
+ // this condition should normally be false
+ if (!(someElement instanceof HTMLElement))
+ return false;
+
+ HTMLElement htmlElement = (HTMLElement) someElement;
+
+ Node htmlNode = htmlElement.getNode();
+ Document doc = htmlNode.getOwnerDocument();
+ if (DEBUG) {
+ debugOut(doc,"");
+ }
+
+ NodeList nodes;
+ try {
+ nodes = (NodeList) xpath.evaluate(doc, XPathConstants.NODESET);
+ final int nodeCount=nodes.getLength();
+ for (int i = 0; i < nodeCount; i++) {
+ if (nodes.item(i).equals(htmlNode)) {
+ return true;
+ }
+ }
+ } catch (XPathExpressionException e) {
+ throw new RuntimeException("unable to evaluate xpath '"+path+"'", e);
+ }
+ return false;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/httpunit/src/com/meterware/httpunit/XPathPredicate.java
___________________________________________________________________
Added: svn:keywords
+ Id:Filename
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2008-11-14 22:43:54
|
Revision: 1009
http://httpunit.svn.sourceforge.net/httpunit/?rev=1009&view=rev
Author: wolfgang_fahl
Date: 2008-11-14 22:43:50 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
Test added for BR [ 1964665 ] HeaderOnlyRequest cannot be constructed
Modified Paths:
--------------
trunk/httpunit/test/com/meterware/httpunit/MessageBodyRequestTest.java
Modified: trunk/httpunit/test/com/meterware/httpunit/MessageBodyRequestTest.java
===================================================================
--- trunk/httpunit/test/com/meterware/httpunit/MessageBodyRequestTest.java 2008-11-14 22:28:36 UTC (rev 1008)
+++ trunk/httpunit/test/com/meterware/httpunit/MessageBodyRequestTest.java 2008-11-14 22:43:50 UTC (rev 1009)
@@ -94,6 +94,13 @@
byte[] download = getDownload( response );
assertEquals( "Body response", binaryData, download );
}
+
+ /**
+ * test for BR [ 1964665 ] HeaderOnlyRequest cannot be constructed
+ */
+ public void testHeaderOnlyWebRequest() throws Exception {
+ HeaderOnlyWebRequest r = new HeaderOnlyWebRequest("http://www.google.com");
+ }
private byte[] getDownload( WebResponse response ) throws IOException {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2008-11-14 20:29:00
|
Revision: 1006
http://httpunit.svn.sourceforge.net/httpunit/?rev=1006&view=rev
Author: wolfgang_fahl
Date: 2008-11-14 20:28:49 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
fix BR [ 2076028 ] Cookies are handeled incorrectly
by Markus Gaisbauer
Modified Paths:
--------------
trunk/httpunit/src/com/meterware/httpunit/cookies/CookieJar.java
trunk/httpunit/test/com/meterware/httpunit/cookies/CookieTest.java
Modified: trunk/httpunit/src/com/meterware/httpunit/cookies/CookieJar.java
===================================================================
--- trunk/httpunit/src/com/meterware/httpunit/cookies/CookieJar.java 2008-11-14 19:49:45 UTC (rev 1005)
+++ trunk/httpunit/src/com/meterware/httpunit/cookies/CookieJar.java 2008-11-14 20:28:49 UTC (rev 1006)
@@ -375,6 +375,7 @@
*/
class CookiePress {
+ // the current value
private StringBuffer _value = new StringBuffer();
private HashMap _attributes = new HashMap();
private URL _sourceURL;
@@ -389,12 +390,20 @@
}
+ /**
+ * clear the attributes and the cookie value
+ */
void clear() {
_value.setLength(0);
_attributes.clear();
}
+ /**
+ * add the token content
+ * @param token
+ * @param lastChar
+ */
void addToken( String token, char lastChar ) {
_value.insert( 0, token );
if (lastChar != '=') _value.insert( 0, ',' );
@@ -408,13 +417,14 @@
* @param equalsIndex - the position of the equal sign
*/
void addTokenWithEqualsSign( CookieRecipe recipe, String token, int equalsIndex ) {
- String name = token.substring( 0, equalsIndex ).trim();
- String value= token.substring( equalsIndex + 1 ).trim();
+ final String name = token.substring( 0, equalsIndex ).trim();
+ final String value= token.substring( equalsIndex + 1 ).trim();
_value.insert( 0, value );
+ final String fvalue=_value.toString();
if (recipe.isCookieAttribute( name.toLowerCase() )) {
- _attributes.put( name.toLowerCase(), _value.toString() );
+ _attributes.put( name.toLowerCase(), value );
} else {
- addCookieIfValid( new Cookie( name, _value.toString(), _attributes ) );
+ addCookieIfValid( new Cookie( name, fvalue, _attributes ) );
_attributes.clear();
}
_value.setLength(0);
Modified: trunk/httpunit/test/com/meterware/httpunit/cookies/CookieTest.java
===================================================================
--- trunk/httpunit/test/com/meterware/httpunit/cookies/CookieTest.java 2008-11-14 19:49:45 UTC (rev 1005)
+++ trunk/httpunit/test/com/meterware/httpunit/cookies/CookieTest.java 2008-11-14 20:28:49 UTC (rev 1006)
@@ -254,6 +254,18 @@
}
/**
+ * test for bug report [ 2076028 ] Cookies are handeled incorrectly
+ */
+ public void testHttpOnlyCookiePath() throws Exception {
+ CookieJar jar = new CookieJar(
+ new TestSource( new URL( "http://www.meterware.com" ),
+ new String[] { "myStuff=1234; path=/; HttpOnly"} ) );
+ Cookie cookie=jar.getCookie("myStuff");
+ String expected="/";
+ assertEquals("The cookie should have the path '"+expected+"' but has "+cookie.getPath(),cookie.getPath(),expected);
+ }
+
+ /**
* test for bug report [ 1533762 ] Valid cookies are rejected
* by Alexey Bulat
* TODO enable when working patch is available
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2008-11-14 19:49:58
|
Revision: 1005
http://httpunit.svn.sourceforge.net/httpunit/?rev=1005&view=rev
Author: wolfgang_fahl
Date: 2008-11-14 19:49:45 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
modified according to suggestion by Stephen Cresswell
Modified Paths:
--------------
trunk/httpunit/test/com/meterware/httpunit/cookies/CookieTest.java
Modified: trunk/httpunit/test/com/meterware/httpunit/cookies/CookieTest.java
===================================================================
--- trunk/httpunit/test/com/meterware/httpunit/cookies/CookieTest.java 2008-11-14 19:05:56 UTC (rev 1004)
+++ trunk/httpunit/test/com/meterware/httpunit/cookies/CookieTest.java 2008-11-14 19:49:45 UTC (rev 1005)
@@ -199,7 +199,14 @@
assertNotNull( cookieName + " not null", cookie );
long expiredTime = cookie.getExpiredTime();
- assertEquals( cookieName + " expiration", expiredTime, expectedMilliSeconds[i] );
+ int grace = 3000;
+ assertTrue( cookieName + " expiration expect on or after" +
+ expectedMilliSeconds[i] + " but was " + expiredTime,
+ expectedMilliSeconds[i] <= expiredTime );
+ assertTrue( cookieName + " expiration expect before " +
+ (expectedMilliSeconds[i] + grace) + " but was " + expiredTime,
+ (expectedMilliSeconds[i]) + grace > expiredTime );
+ // assertEquals( cookieName + " expiration", expiredTime, expectedMilliSeconds[i] );
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2008-11-14 19:06:10
|
Revision: 1004
http://httpunit.svn.sourceforge.net/httpunit/?rev=1004&view=rev
Author: wolfgang_fahl
Date: 2008-11-14 19:05:56 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
Posttest added to the suite
Modified Paths:
--------------
trunk/httpunit/test/com/meterware/servletunit/ServletUnitSuite.java
Modified: trunk/httpunit/test/com/meterware/servletunit/ServletUnitSuite.java
===================================================================
--- trunk/httpunit/test/com/meterware/servletunit/ServletUnitSuite.java 2008-11-14 18:59:38 UTC (rev 1003)
+++ trunk/httpunit/test/com/meterware/servletunit/ServletUnitSuite.java 2008-11-14 19:05:56 UTC (rev 1004)
@@ -50,6 +50,7 @@
suite.addTest( FiltersTest.suite() );
suite.addTest( RequestContextTest.suite() );
suite.addTest( RequestDispatcherTest.suite() );
+ suite.addTest( PostTest.suite());
addOptionalTestCase( suite, "com.meterware.servletunit.JUnitServletTest" );
return suite;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2008-11-14 18:59:42
|
Revision: 1003
http://httpunit.svn.sourceforge.net/httpunit/?rev=1003&view=rev
Author: wolfgang_fahl
Date: 2008-11-14 18:59:38 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
jetty comment fixed
Modified Paths:
--------------
trunk/httpunit/pom.xml
Modified: trunk/httpunit/pom.xml
===================================================================
--- trunk/httpunit/pom.xml 2008-11-13 23:36:57 UTC (rev 1002)
+++ trunk/httpunit/pom.xml 2008-11-14 18:59:38 UTC (rev 1003)
@@ -168,9 +168,9 @@
<artifactId>mail</artifactId>
<version>1.4</version>
<scope>test</scope>
- <!--- Jetty libraries needed for Testing BR [ 2264431 ] form.submit() sends multiple HTTP POSTS
</dependency>
- <dependency>
+ <!--- Jetty libraries needed for Testing BR [ 2264431 ] form.submit() sends multiple HTTP POSTS
+ <dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<version>6.1.4</version>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2008-11-13 23:37:02
|
Revision: 1002
http://httpunit.svn.sourceforge.net/httpunit/?rev=1002&view=rev
Author: wolfgang_fahl
Date: 2008-11-13 23:36:57 +0000 (Thu, 13 Nov 2008)
Log Message:
-----------
Libraries for Test for [ 2264431 ] form.submit() sends multiple HTTP POSTS (as comment)
Modified Paths:
--------------
trunk/httpunit/.classpath
Modified: trunk/httpunit/.classpath
===================================================================
--- trunk/httpunit/.classpath 2008-11-13 23:34:19 UTC (rev 1001)
+++ trunk/httpunit/.classpath 2008-11-13 23:36:57 UTC (rev 1002)
@@ -17,5 +17,11 @@
<classpathentry kind="var" path="MAVEN_REPOSITORY/javax/activation/activation/1.1/activation-1.1.jar"/>
<classpathentry kind="var" path="MAVEN_REPOSITORY/javax/mail/mail/1.4/mail-1.4.jar"/>
<classpathentry kind="lib" path="jars/maven-ant-tasks-2.0.9.jar"/>
+ <!-- Libaries needed to test [ 2264431 ] form.submit() sends multiple HTTP POSTS
+ <classpathentry kind="var" path="MAVEN_REPOSITORY/org/mortbay/jetty/jetty/6.1.4/jetty-6.1.4.jar"/>
+ <classpathentry kind="var" path="MAVEN_REPOSITORY/org/mortbay/jetty/jetty-naming/6.1.4/jetty-naming-6.1.4.jar"/>
+ <classpathentry kind="var" path="MAVEN_REPOSITORY/org/mortbay/jetty/jetty-plus/6.1.4/jetty-plus-6.1.4.jar"/>
+ <classpathentry kind="var" path="MAVEN_REPOSITORY/org/mortbay/jetty/jetty-util/6.1.4/jetty-util-6.1.4.jar"/>
<classpathentry kind="output" path="bin"/>
+ -->
</classpath>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2008-11-13 23:34:22
|
Revision: 1001
http://httpunit.svn.sourceforge.net/httpunit/?rev=1001&view=rev
Author: wolfgang_fahl
Date: 2008-11-13 23:34:19 +0000 (Thu, 13 Nov 2008)
Log Message:
-----------
Libraries for Test for [ 2264431 ] form.submit() sends multiple HTTP POSTS (as comment)
Modified Paths:
--------------
trunk/httpunit/pom.xml
Modified: trunk/httpunit/pom.xml
===================================================================
--- trunk/httpunit/pom.xml 2008-11-13 23:32:30 UTC (rev 1000)
+++ trunk/httpunit/pom.xml 2008-11-13 23:34:19 UTC (rev 1001)
@@ -168,7 +168,28 @@
<artifactId>mail</artifactId>
<version>1.4</version>
<scope>test</scope>
+ <!--- Jetty libraries needed for Testing BR [ 2264431 ] form.submit() sends multiple HTTP POSTS
</dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ <version>6.1.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-naming</artifactId>
+ <version>6.1.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-plus</artifactId>
+ <version>6.1.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-util</artifactId>
+ <version>6.1.4</version>
+ </dependency> -->
</dependencies>
<pluginRepositories>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2008-11-13 23:32:32
|
Revision: 1000
http://httpunit.svn.sourceforge.net/httpunit/?rev=1000&view=rev
Author: wolfgang_fahl
Date: 2008-11-13 23:32:30 +0000 (Thu, 13 Nov 2008)
Log Message:
-----------
svn id keyword added
Modified Paths:
--------------
trunk/httpunit/test/com/meterware/servletunit/PostTest.java
Property Changed:
----------------
trunk/httpunit/test/com/meterware/servletunit/PostTest.java
Modified: trunk/httpunit/test/com/meterware/servletunit/PostTest.java
===================================================================
--- trunk/httpunit/test/com/meterware/servletunit/PostTest.java 2008-11-13 23:31:29 UTC (rev 999)
+++ trunk/httpunit/test/com/meterware/servletunit/PostTest.java 2008-11-13 23:32:30 UTC (rev 1000)
@@ -1,7 +1,7 @@
package com.meterware.servletunit;
/********************************************************************************************************************
- * $Id: StatefulTest.java 665 2004-09-09 00:16:40Z russgold $
+ * $Id$
*
* Copyright (c) 2008, Russell Gold
*
Property changes on: trunk/httpunit/test/com/meterware/servletunit/PostTest.java
___________________________________________________________________
Added: svn:keywords
+ Id Filename
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2008-11-13 23:31:32
|
Revision: 999
http://httpunit.svn.sourceforge.net/httpunit/?rev=999&view=rev
Author: wolfgang_fahl
Date: 2008-11-13 23:31:29 +0000 (Thu, 13 Nov 2008)
Log Message:
-----------
Test for [ 2264431 ] form.submit() sends multiple HTTP POSTS
Added Paths:
-----------
trunk/httpunit/test/com/meterware/servletunit/PostTest.java
Added: trunk/httpunit/test/com/meterware/servletunit/PostTest.java
===================================================================
--- trunk/httpunit/test/com/meterware/servletunit/PostTest.java (rev 0)
+++ trunk/httpunit/test/com/meterware/servletunit/PostTest.java 2008-11-13 23:31:29 UTC (rev 999)
@@ -0,0 +1,154 @@
+package com.meterware.servletunit;
+
+/********************************************************************************************************************
+ * $Id: StatefulTest.java 665 2004-09-09 00:16:40Z russgold $
+ *
+ * Copyright (c) 2008, 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
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ *******************************************************************************************************************/
+import java.io.*;
+import java.util.Enumeration;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.*;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import com.meterware.httpunit.*;
+import junit.framework.TestCase;
+import com.meterware.httpunit.WebConversation;
+import com.meterware.httpunit.WebResponse;
+import com.meterware.httpunit.WebForm;
+
+import java.io.IOException;
+
+import org.xml.sax.SAXException;
+/* uncomment this and the other jetty dependend parts and also activate the pom.xml and if you use eclipse the classpath settings
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.Request;
+import org.mortbay.jetty.servlet.ServletHandler;
+import org.mortbay.jetty.servlet.ServletHolder;
+*/
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletException;
+
+/**
+ * Tests for Bug Report [ 2264431 ] form.submit() sends multiple HTTP POSTS
+ */
+public class PostTest extends TestCase {
+
+ /*
+ Server jetty;
+
+ protected void setUp() {
+ jetty = new Server(8989);
+ }
+
+ protected void tearDown() throws Exception {
+ jetty.stop();
+ }
+ */
+ public static void main(String args[]) {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ public static Test suite() {
+ return new TestSuite(PostTest.class);
+ }
+
+ public PostTest(String name) {
+ super(name);
+ }
+ static final String resourceName = "test";
+
+ /**
+ * check the webresponse
+ * @param response
+ * @throws SAXException
+ * @throws IOException
+ */
+ public void check(WebResponse response) throws SAXException, IOException {
+ TestServlet.postCount=0;
+ WebForm form = response.getFormWithID("bug");
+ form.setParameter("handle", "steve");
+ form.setParameter("brainz", "has none");
+ form.submit();
+ int expected=1;
+ assertTrue("The postcount should be "+expected+" but is "+TestServlet.postCount,TestServlet.postCount==expected);
+ }
+
+ /*
+ public void testThatFormSubmitIssuesASinglePost() throws Exception {
+ TestServlet.location="http://localhost:8989/";
+ TestServlet servlet = new TestServlet();
+ ServletHandler handler = new ServletHandler();
+ handler.addServletWithMapping(new ServletHolder(servlet), "/"+resourceName);
+ jetty.setHandler(handler);
+ jetty.start();
+
+ WebConversation wc = new WebConversation();
+ WebResponse response = wc.getResponse(TestServlet.location+resourceName);
+
+ check(response);
+ }*/
+
+ public void testMultiplePosts() throws Exception {
+ TestServlet.location="http://localhost/";
+
+ try {
+ ServletRunner sr = new ServletRunner();
+ sr.registerServlet(resourceName, TestServlet.class.getName());
+
+ WebRequest request = new GetMethodWebRequest(TestServlet.location+resourceName);
+ WebResponse response = sr.getResponse(request);
+ check(response);
+ } catch (Throwable th) {
+ th.printStackTrace();
+ fail("There should be no exception but we got "+th.getMessage());
+ }
+ }
+
+ /**
+ * a Servlet that counts the posts being done
+ */
+ static class TestServlet extends HttpServlet {
+ public static int postCount = 0;
+ public static String location=null;
+
+ protected void doGet(HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ response.setContentType("text/html");
+ response
+ .getWriter()
+ .println(
+ "<html><body><form action='"+location+resourceName+"' method='post' id='bug'><input name='handle'/><input name='brainz'/></form></body></html>");
+ /*
+ if (request instanceof Request)
+ ((Request) request).setHandled(true);
+ */
+ }
+
+ protected void doPost(HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ postCount++;
+ }
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2008-11-06 00:12:52
|
Revision: 998
http://httpunit.svn.sourceforge.net/httpunit/?rev=998&view=rev
Author: wolfgang_fahl
Date: 2008-11-06 00:12:47 +0000 (Thu, 06 Nov 2008)
Log Message:
-----------
follow up on BR [ 1518901 ]
Modified Paths:
--------------
trunk/httpunit/src/com/meterware/httpunit/WebConversation.java
Modified: trunk/httpunit/src/com/meterware/httpunit/WebConversation.java
===================================================================
--- trunk/httpunit/src/com/meterware/httpunit/WebConversation.java 2008-11-06 00:10:06 UTC (rev 997)
+++ trunk/httpunit/src/com/meterware/httpunit/WebConversation.java 2008-11-06 00:12:47 UTC (rev 998)
@@ -68,10 +68,9 @@
}
URLConnection connection = openConnection( getRequestURL( request ) );
// [ 1518901 ] enable http connect and read timeouts (needs JDK 1.5)
- // XXX enable for 1.7 release in 2008
- // comment out if you need this and have JDK 1.5
- // if (_connectTimeout>=0) connection.setConnectTimeout( _connectTimeout );
- // if (_readTimeout>=0) connection.setReadTimeout( _readTimeout );
+ // comment the next two line if you do not need this and have JDK <1.5
+ if (_connectTimeout>=0) connection.setConnectTimeout( _connectTimeout );
+ if (_readTimeout>=0) connection.setReadTimeout( _readTimeout );
if (HttpUnitOptions.isLoggingHttpHeaders()) {
String urlString = request.getURLString();
System.out.println( "\nConnecting to " + request.getURL().getHost() );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2008-11-06 00:10:12
|
Revision: 997
http://httpunit.svn.sourceforge.net/httpunit/?rev=997&view=rev
Author: wolfgang_fahl
Date: 2008-11-06 00:10:06 +0000 (Thu, 06 Nov 2008)
Log Message:
-----------
BR [ 2212706 ] NullPointerException in MimeEncodedMessageBody
by Dawn Lambeth
Modified Paths:
--------------
trunk/httpunit/src/com/meterware/httpunit/protocol/MimeEncodedMessageBody.java
Modified: trunk/httpunit/src/com/meterware/httpunit/protocol/MimeEncodedMessageBody.java
===================================================================
--- trunk/httpunit/src/com/meterware/httpunit/protocol/MimeEncodedMessageBody.java 2008-11-06 00:08:28 UTC (rev 996)
+++ trunk/httpunit/src/com/meterware/httpunit/protocol/MimeEncodedMessageBody.java 2008-11-06 00:10:06 UTC (rev 997)
@@ -102,7 +102,7 @@
*/
public void addParameter( String name, String value, String characterSet ) throws IOException {
if (name == null || name.length() == 0) return;
-
+ if (value == null || value.length() == 0) return;
writeLn( _outputStream, "--" + BOUNDARY );
writeLn( _outputStream, "Content-Disposition: form-data; name=\"" + name + '"' ); // XXX need to handle non-ascii names here
writeLn( _outputStream, "Content-Type: text/plain; charset=" + getCharacterSet() );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2008-11-06 00:08:39
|
Revision: 996
http://httpunit.svn.sourceforge.net/httpunit/?rev=996&view=rev
Author: wolfgang_fahl
Date: 2008-11-06 00:08:28 +0000 (Thu, 06 Nov 2008)
Log Message:
-----------
javadoc added
Modified Paths:
--------------
trunk/httpunit/src/com/meterware/httpunit/protocol/MimeEncodedMessageBody.java
Modified: trunk/httpunit/src/com/meterware/httpunit/protocol/MimeEncodedMessageBody.java
===================================================================
--- trunk/httpunit/src/com/meterware/httpunit/protocol/MimeEncodedMessageBody.java 2008-11-05 23:34:58 UTC (rev 995)
+++ trunk/httpunit/src/com/meterware/httpunit/protocol/MimeEncodedMessageBody.java 2008-11-06 00:08:28 UTC (rev 996)
@@ -94,6 +94,12 @@
}
+ /**
+ * add the parameter with the given name value and characterSet
+ * @param name - the name
+ * @param value - the value to set
+ * @param characterSet - the name of the characterSet to use
+ */
public void addParameter( String name, String value, String characterSet ) throws IOException {
if (name == null || name.length() == 0) return;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2008-11-05 23:35:03
|
Revision: 995
http://httpunit.svn.sourceforge.net/httpunit/?rev=995&view=rev
Author: wolfgang_fahl
Date: 2008-11-05 23:34:58 +0000 (Wed, 05 Nov 2008)
Log Message:
-----------
FR [ 2163079 ] make form.name property mutable
by Peter De Bruycker
Modified Paths:
--------------
trunk/httpunit/src/com/meterware/httpunit/WebForm.java
trunk/httpunit/src/com/meterware/httpunit/javascript/JavaScript.java
trunk/httpunit/test/com/meterware/httpunit/javascript/FormScriptingTest.java
Modified: trunk/httpunit/src/com/meterware/httpunit/WebForm.java
===================================================================
--- trunk/httpunit/src/com/meterware/httpunit/WebForm.java 2008-11-05 22:27:09 UTC (rev 994)
+++ trunk/httpunit/src/com/meterware/httpunit/WebForm.java 2008-11-05 23:34:58 UTC (rev 995)
@@ -19,6 +19,7 @@
* DEALINGS IN THE SOFTWARE.
*
*******************************************************************************************************************/
+import com.meterware.httpunit.scripting.IdentifiedDelegate;
import com.meterware.httpunit.scripting.NamedDelegate;
import com.meterware.httpunit.scripting.ScriptableDelegate;
import com.meterware.httpunit.scripting.FormScriptable;
@@ -719,7 +720,12 @@
}
- public class Scriptable extends HTMLElementScriptable implements NamedDelegate, FormScriptable {
+ /**
+ *
+ * Scriptable implementation for the WebForm
+ *
+ */
+ public class Scriptable extends HTMLElementScriptable implements NamedDelegate, IdentifiedDelegate, FormScriptable {
public String getAction() { return WebForm.this.getAction(); }
public void setAction( String newAction ) { setDestination( newAction ); _presetParameters = null; }
@@ -734,9 +740,21 @@
}
+ /**
+ * return the name of the WebForm
+ * @return the name
+ */
public String getName() {
- return WebForm.this.getID().length() != 0 ? WebForm.this.getID() : WebForm.this.getName();
+ return WebForm.this.getName().length() != 0 ? WebForm.this.getName() : WebForm.this.getID();
}
+
+ /**
+ * return the id of the WebForm
+ * @return the id
+ */
+ public String getID() {
+ return WebForm.this.getID();
+ }
/**
@@ -771,6 +789,8 @@
setTargetAttribute( value.toString() );
} else if (propertyName.equals( "action" )) {
setAction( value.toString() );
+ } else if (propertyName.equals( "name" )) {
+ getElement().setAttribute( "name", value.toString() );
} else if (value instanceof String) {
setParameterValue( propertyName, (String) value );
} else if (value instanceof Number) {
Modified: trunk/httpunit/src/com/meterware/httpunit/javascript/JavaScript.java
===================================================================
--- trunk/httpunit/src/com/meterware/httpunit/javascript/JavaScript.java 2008-11-05 22:27:09 UTC (rev 994)
+++ trunk/httpunit/src/com/meterware/httpunit/javascript/JavaScript.java 2008-11-05 23:34:58 UTC (rev 995)
@@ -897,6 +897,10 @@
}
+ /**
+ * Form functions
+ *
+ */
static public class Form extends HTMLElement {
private ElementArray _controls;
@@ -908,6 +912,15 @@
public String jsGet_name() {
return getDelegate().getName();
}
+
+ /**
+ * @since FR [ 2163079 ] make form.name property mutable
+ * by Peter De Bruycker
+ * @param name
+ */
+ public void jsSet_name( String name ) {
+ getDelegate().set( "name", name );
+ }
public String jsGet_action() {
return getDelegate().getAction();
Modified: trunk/httpunit/test/com/meterware/httpunit/javascript/FormScriptingTest.java
===================================================================
--- trunk/httpunit/test/com/meterware/httpunit/javascript/FormScriptingTest.java 2008-11-05 22:27:09 UTC (rev 994)
+++ trunk/httpunit/test/com/meterware/httpunit/javascript/FormScriptingTest.java 2008-11-05 23:34:58 UTC (rev 995)
@@ -67,14 +67,39 @@
"<form id='the_form_with_id'/>" +
"<script type='JavaScript'>" +
" alert( document.forms[1].name );" +
+ "</script>" +
+ "<form id='the_form_with_id2' name='the_form_with_name2'/>" +
+ "<script type='JavaScript'>" +
+ " alert( document.forms[2].name );" +
"</script>" );
WebConversation wc = new WebConversation();
wc.getResponse( getHostPath() + "/OnCommand.html" );
assertEquals( "Message 1", "the_form_with_name", wc.popNextAlert() );
assertEquals( "Message 2", "the_form_with_id", wc.popNextAlert() );
+ assertEquals( "Message 3", "the_form_with_name2", wc.popNextAlert() );
}
/**
+ * FR [ 2163079 ] make form.name property mutable by Peter De Bruycker
+ *
+ * @throws Exception
+ */
+ public void testModifyingFormNameProperty() throws Exception {
+ WebConversation wc = new WebConversation();
+ defineWebPage(
+ "Default",
+ "<form id = 'the_form' name = 'form_name'/>"
+ + "<a href='#' name='doTell' onClick='document.forms[0].name=\"new_form_name\";'>tell</a>"
+ + "<a href='#' name='doShow' onClick='alert( document.forms[0].name );'>show</a>");
+ WebResponse page = wc.getResponse(getHostPath() + "/Default.html");
+ page.getLinkWithName("doShow").click();
+ assertEquals("Initial name", "form_name", wc.popNextAlert());
+ page.getLinkWithName("doTell").click();
+ page.getLinkWithName("doShow").click();
+ assertEquals("Current name", "new_form_name", wc.popNextAlert());
+ }
+
+ /**
* test to access attributes from java script
* @throws Exception
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2008-11-05 22:27:15
|
Revision: 994
http://httpunit.svn.sourceforge.net/httpunit/?rev=994&view=rev
Author: wolfgang_fahl
Date: 2008-11-05 22:27:09 +0000 (Wed, 05 Nov 2008)
Log Message:
-----------
FR [ 2025598 ] support javascript window.scrollTo()
Modified Paths:
--------------
trunk/httpunit/src/com/meterware/httpunit/dom/DomWindow.java
trunk/httpunit/src/com/meterware/httpunit/javascript/JavaScript.java
trunk/httpunit/test/com/meterware/httpunit/dom/DomWindowTest.java
Modified: trunk/httpunit/src/com/meterware/httpunit/dom/DomWindow.java
===================================================================
--- trunk/httpunit/src/com/meterware/httpunit/dom/DomWindow.java 2008-09-28 16:50:11 UTC (rev 993)
+++ trunk/httpunit/src/com/meterware/httpunit/dom/DomWindow.java 2008-11-05 22:27:09 UTC (rev 994)
@@ -155,8 +155,10 @@
public void moveTo( int x, int y ) {
}
+
+ public void scrollTo( int x, int y ) {
+ }
-
protected String getDocumentWriteBuffer() {
return _document.getWriteBuffer().toString();
}
Modified: trunk/httpunit/src/com/meterware/httpunit/javascript/JavaScript.java
===================================================================
--- trunk/httpunit/src/com/meterware/httpunit/javascript/JavaScript.java 2008-09-28 16:50:11 UTC (rev 993)
+++ trunk/httpunit/src/com/meterware/httpunit/javascript/JavaScript.java 2008-11-05 22:27:09 UTC (rev 994)
@@ -273,6 +273,10 @@
}
+ /**
+ * Window functions
+ *
+ */
static public class Window extends JavaScriptEngine {
private Document _document;
@@ -385,6 +389,9 @@
public void jsFunction_moveTo( int x, int y ) {
}
+
+ public void jsFunction_scrollTo( int x, int y ) {
+ }
public void jsFunction_focus() {
Modified: trunk/httpunit/test/com/meterware/httpunit/dom/DomWindowTest.java
===================================================================
--- trunk/httpunit/test/com/meterware/httpunit/dom/DomWindowTest.java 2008-09-28 16:50:11 UTC (rev 993)
+++ trunk/httpunit/test/com/meterware/httpunit/dom/DomWindowTest.java 2008-11-05 22:27:09 UTC (rev 994)
@@ -156,6 +156,7 @@
window.setTimeout( 40 );
window.focus();
window.moveTo( 10, 20 );
+ window.scrollTo(10,20);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2008-09-28 16:50:17
|
Revision: 993
http://httpunit.svn.sourceforge.net/httpunit/?rev=993&view=rev
Author: wolfgang_fahl
Date: 2008-09-28 16:50:11 +0000 (Sun, 28 Sep 2008)
Log Message:
-----------
removed deprecated as asked for in BR 2034206 by Hugh Winkler
Modified Paths:
--------------
trunk/httpunit/src/com/meterware/httpunit/WebClient.java
Modified: trunk/httpunit/src/com/meterware/httpunit/WebClient.java
===================================================================
--- trunk/httpunit/src/com/meterware/httpunit/WebClient.java 2008-09-28 16:45:48 UTC (rev 992)
+++ trunk/httpunit/src/com/meterware/httpunit/WebClient.java 2008-09-28 16:50:11 UTC (rev 993)
@@ -242,7 +242,7 @@
/**
* Sets a username and password for a basic authentication scheme.
- * @deprecated as of 1.7. Use #setAuthentication for more accurate emulation of browser behavior.
+ * Use #setAuthentication for more accurate emulation of browser behavior.
**/
public void setAuthorization( String userName, String password ) {
_fixedAuthorizationString = "Basic " + Base64.encode( userName + ':' + password );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2008-09-28 16:45:52
|
Revision: 992
http://httpunit.svn.sourceforge.net/httpunit/?rev=992&view=rev
Author: wolfgang_fahl
Date: 2008-09-28 16:45:48 +0000 (Sun, 28 Sep 2008)
Log Message:
-----------
test case for BR2034998 by Martin Burchell, Aptivate
Modified Paths:
--------------
trunk/httpunit/test/com/meterware/httpunit/FileUploadTest.java
Modified: trunk/httpunit/test/com/meterware/httpunit/FileUploadTest.java
===================================================================
--- trunk/httpunit/test/com/meterware/httpunit/FileUploadTest.java 2008-09-28 16:38:48 UTC (rev 991)
+++ trunk/httpunit/test/com/meterware/httpunit/FileUploadTest.java 2008-09-28 16:45:48 UTC (rev 992)
@@ -25,6 +25,7 @@
import java.io.*;
import java.util.StringTokenizer;
+import java.net.URL;
import java.net.URLEncoder;
import javax.activation.DataSource;
@@ -325,6 +326,37 @@
File file = createFile( "temp.new" , new byte[] { 1, 2, 3, 4, 0x7f, 0x23 });
doTestFileContentType(file,"x-application/new","x-application/new:message.name=temp.new&message.lines=1");
}
+
+ /**
+ * test submitting a file by
+ * Martin Burchell, Aptivate for BR 2034998
+ * @throws Exception
+ */
+ public void testSubmitFile() throws Exception
+ {
+ defineResource( "ListParams", new MimeEcho() );
+ defineWebPage( "Default", "<form method=POST action = \"ListParams\" enctype=\"multipart/form-data\"> " +
+ "<Input type=file name=message>" +
+ "</form>" );
+ WebConversation wc = new WebConversation();
+ WebRequest request = new GetMethodWebRequest( getHostPath() + "/Default.html" );
+ WebResponse simplePage = wc.getResponse( request );
+
+ WebForm form = simplePage.getForms()[0];
+ assertNotNull(form);
+
+ File file = new File( "temp.txt" );
+ FileWriter fw = new FileWriter( file );
+ PrintWriter pw = new PrintWriter( fw );
+ pw.println( "Not much text" );
+ pw.println( "But two lines" );
+ pw.close();
+
+ form.setParameter("message",new UploadFileSpec[] { new UploadFileSpec( file )} );
+ form.submit();
+
+ file.delete();
+ }
}
@@ -448,4 +480,7 @@
return value;
}
}
+
}
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2008-09-28 16:38:52
|
Revision: 991
http://httpunit.svn.sourceforge.net/httpunit/?rev=991&view=rev
Author: wolfgang_fahl
Date: 2008-09-28 16:38:48 +0000 (Sun, 28 Sep 2008)
Log Message:
-----------
Bug fix 2034998 by Tiago Luchini + fix of another bug
Modified Paths:
--------------
trunk/httpunit/src/com/meterware/httpunit/WebForm.java
trunk/httpunit/src/com/meterware/httpunit/protocol/UploadFileSpec.java
Modified: trunk/httpunit/src/com/meterware/httpunit/WebForm.java
===================================================================
--- trunk/httpunit/src/com/meterware/httpunit/WebForm.java 2008-09-20 06:50:16 UTC (rev 990)
+++ trunk/httpunit/src/com/meterware/httpunit/WebForm.java 2008-09-28 16:38:48 UTC (rev 991)
@@ -104,7 +104,7 @@
**/
public WebResponse submit( SubmitButton button, int x, int y ) throws IOException, SAXException {
WebResponse result=null;
- if (button==null || button.doOnClickSequence(x, y)) {
+ if (button==null || !button.doOnClickSequence(x, y)) {
result= doFormSubmit( button, x, y );
} else {
result=getCurrentFrameContents();
Modified: trunk/httpunit/src/com/meterware/httpunit/protocol/UploadFileSpec.java
===================================================================
--- trunk/httpunit/src/com/meterware/httpunit/protocol/UploadFileSpec.java 2008-09-20 06:50:16 UTC (rev 990)
+++ trunk/httpunit/src/com/meterware/httpunit/protocol/UploadFileSpec.java 2008-09-28 16:38:48 UTC (rev 991)
@@ -60,10 +60,20 @@
}
+ /**
+ * get the Inputstream - even if it has been closed previously
+ * @return the inputstream for the current file
+ * @throws IOException
+ */
public InputStream getInputStream() throws IOException {
if (_inputStream == null) {
_inputStream = new FileInputStream( _file );
}
+ try {
+ _inputStream.available();
+ } catch (IOException ex) {
+ _inputStream = new FileInputStream( _file );
+ }
return _inputStream;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2008-09-20 06:50:27
|
Revision: 990
http://httpunit.svn.sourceforge.net/httpunit/?rev=990&view=rev
Author: wolfgang_fahl
Date: 2008-09-20 06:50:16 +0000 (Sat, 20 Sep 2008)
Log Message:
-----------
made abstract on recommendation of James Abley
Modified Paths:
--------------
trunk/httpunit/test/com/meterware/httpunit/javascript/AbstractJavaScriptTest.java
Modified: trunk/httpunit/test/com/meterware/httpunit/javascript/AbstractJavaScriptTest.java
===================================================================
--- trunk/httpunit/test/com/meterware/httpunit/javascript/AbstractJavaScriptTest.java 2008-07-27 08:51:33 UTC (rev 989)
+++ trunk/httpunit/test/com/meterware/httpunit/javascript/AbstractJavaScriptTest.java 2008-09-20 06:50:16 UTC (rev 990)
@@ -9,9 +9,11 @@
* User: russgold
* Date: May 16, 2008
* Time: 3:20:40 PM
- * To change this template use File | Settings | File Templates.
+ * abstract base class for JavaScript tests of the httpunit framework
+ * supplies doTestJavaScript as a default operation for starting tests
*/
-public class AbstractJavaScriptTest extends HttpUnitTest {// set to true to get the static HTML Code on System.err
+public abstract class AbstractJavaScriptTest extends HttpUnitTest {
+// set to true to get the static HTML Code on System.err
public static boolean debugHTML=false;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2008-07-27 08:51:40
|
Revision: 989
http://httpunit.svn.sourceforge.net/httpunit/?rev=989&view=rev
Author: wolfgang_fahl
Date: 2008-07-27 08:51:33 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
comment fixed
Modified Paths:
--------------
trunk/httpunit/examples/GoogleMapsExample.java
Modified: trunk/httpunit/examples/GoogleMapsExample.java
===================================================================
--- trunk/httpunit/examples/GoogleMapsExample.java 2008-06-05 18:40:32 UTC (rev 988)
+++ trunk/httpunit/examples/GoogleMapsExample.java 2008-07-27 08:51:33 UTC (rev 989)
@@ -204,7 +204,7 @@
// create the conversation object which will maintain state for us
WebConversation wc = new WebConversation();
- // Obtain the main page on the meterware web site
+ // Obtain the main page on the google maps web site
WebRequest request = new GetMethodWebRequest(url);
request.setParameter("output", "html");
WebResponse response = wc.getResponse( request );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|