[Httpunit-commit] CVS: httpunit/src/com/meterware/httpunit WebForm.java,1.81,1.82 WebLink.java,1.39,
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2003-03-14 17:41:34
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit
In directory sc8-pr-cvs1:/tmp/cvs-serv754/src/com/meterware/httpunit
Modified Files:
WebForm.java WebLink.java WebRequestSource.java WebWindow.java
Log Message:
Return resultant page from WebClient.getResponse
Index: WebForm.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebForm.java,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -r1.81 -r1.82
--- WebForm.java 13 Mar 2003 20:19:02 -0000 1.81
+++ WebForm.java 14 Mar 2003 17:41:27 -0000 1.82
@@ -61,9 +61,7 @@
* this will not run any event associated with the specified submit button. Use SubmitButton#click for that.
**/
public WebResponse submit( SubmitButton button ) throws IOException, SAXException {
- String event = getAttribute( "onsubmit" );
- if (event.length() == 0 || getScriptableObject().doEvent( event )) return submitRequest( getRequest( button ) );
- return getBaseResponse().getWindow().getFrameContents( getPageFrame() );
+ return submitRequest( getAttribute( "onsubmit" ), getRequest( button ) );
}
Index: WebLink.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebLink.java,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- WebLink.java 27 Feb 2003 23:36:01 -0000 1.39
+++ WebLink.java 14 Mar 2003 17:41:28 -0000 1.40
@@ -84,11 +84,7 @@
* that frame will not be returned by this method.
**/
public WebResponse click() throws IOException, SAXException {
- WebResponse response = null;
- String event = getAttribute( "onclick" );
- if (event.length() == 0 || getScriptableObject().doEvent( event )) response = submitRequest();
- if (response == null) response = getBaseResponse().getWindow().getFrameContents( getPageFrame() );
- return response;
+ return submitRequest( getAttribute( "onclick" ), getRequest() );
}
Index: WebRequestSource.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebRequestSource.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- WebRequestSource.java 27 Feb 2003 23:36:01 -0000 1.24
+++ WebRequestSource.java 14 Mar 2003 17:41:29 -0000 1.25
@@ -201,12 +201,12 @@
}
- /**
- * Submits a request to the web client from which this request source was originally obtained.
- **/
- final
- protected WebResponse submitRequest() throws IOException, SAXException {
- return submitRequest( getRequest() );
+
+ protected WebResponse submitRequest( String event, final WebRequest request ) throws IOException, SAXException {
+ WebResponse response = null;
+ if (event.length() == 0 || getScriptableDelegate().doEvent( event )) response = submitRequest( request );
+ if (response == null) response = getBaseResponse().getWindow().getFrameContents( getPageFrame() );
+ return response;
}
Index: WebWindow.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebWindow.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- WebWindow.java 27 Feb 2003 23:36:02 -0000 1.9
+++ WebWindow.java 14 Mar 2003 17:41:30 -0000 1.10
@@ -109,7 +109,7 @@
final RequestContext requestContext = new RequestContext();
final WebResponse response = getSubframeResponse( request, requestContext );
requestContext.runScripts();
- return response;
+ return response == null ? null : getFrameContents( response.getFrameName() );
}
|