[Httpunit-commit] CVS: httpunit/src/com/meterware/httpunit WebForm.java,1.68,1.69 WebLink.java,1.33,
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2002-10-31 15:17:51
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit
In directory usw-pr-cvs1:/tmp/cvs-serv12787/src/com/meterware/httpunit
Modified Files:
WebForm.java WebLink.java
Log Message:
Improve return from WebForm.submit and WebLink.click
Index: WebForm.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebForm.java,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- WebForm.java 13 Oct 2002 23:53:48 -0000 1.68
+++ WebForm.java 31 Oct 2002 15:17:06 -0000 1.69
@@ -57,11 +57,13 @@
/**
* Submits this form using the web client from which it was originally obtained.
+ * Will usually return the result of that submission; however, if a scripted event is triggered which
+ * inhibits the submission, will return the updated contents of the frame containing this form.
**/
WebResponse submit( SubmitButton button ) throws IOException, SAXException {
String event = getAttribute( "onsubmit" );
if (event.length() == 0 || getScriptableObject().doEvent( event )) return submitRequest( getRequest( button ) );
- return getBaseResponse();
+ return getBaseResponse().getWindow().getFrameContents( getTarget() );
}
Index: WebLink.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebLink.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- WebLink.java 14 Oct 2002 04:19:06 -0000 1.33
+++ WebLink.java 31 Oct 2002 15:17:14 -0000 1.34
@@ -78,11 +78,13 @@
/**
* Submits a request as though the user had clicked on this link. Will also fire the 'onClick' event if defined.
+ * If clicking results in submitting a request, will return the result of that submission; otherwise, will
+ * return the updated contents of the frame containing this link.
**/
public WebResponse click() throws IOException, SAXException {
String event = getAttribute( "onclick" );
if (event.length() == 0 || getScriptableObject().doEvent( event )) return submitRequest();
- return getBaseResponse();
+ return getBaseResponse().getWindow().getFrameContents( getTarget() );
}
|