Java Doc for MockWebConnection.java in  » Testing » htmlunit » com » gargoylesoftware » htmlunit » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » htmlunit » com.gargoylesoftware.htmlunit 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.gargoylesoftware.htmlunit.WebConnectionImpl
      com.gargoylesoftware.htmlunit.MockWebConnection

MockWebConnection
public class MockWebConnection extends WebConnectionImpl (Code)
A fake WebConnection designed to mock out the actual http connections.
version:
   $Revision: 2132 $
author:
   Mike Bowler
author:
   Noboru Sinohara
author:
   Marc Guillemot
author:
   Brad Clarke
author:
   Ahmed Ashour



Constructor Summary
public  MockWebConnection(WebClient webClient)
    

Method Summary
public  MapgetLastAdditionalHeaders()
     Return the additional headers that were used in the in the last call to MockWebConnection.getResponse(WebRequestSettings) .
public  SubmitMethodgetLastMethod()
    
public  ListgetLastParameters()
    
public  WebRequestSettingsgetLastWebRequestSettings()
     Return the WebRequestSettings that was used in the in the last call to MockWebConnection.getResponse(WebRequestSettings) .
final protected  LoggetLog()
    
public  WebResponsegetResponse(WebRequestSettings webRequestSettings)
    
public  HttpStategetState()
    
public  voidsetDefaultResponse(String content, int statusCode, String statusMessage, String contentType)
     Set the response that will be returned when a url is requested that does not have a specific content set for it.
public  voidsetDefaultResponse(byte[] content, int statusCode, String statusMessage, String contentType)
     Set the response that will be returned when a url is requested that does not have a specific content set for it.
public  voidsetDefaultResponse(String content)
     Set the response that will be returned when a url is requested that does not have a specific content set for it.
public  voidsetResponse(URL url, String content, int statusCode, String statusMessage, String contentType, List responseHeaders)
     Set the response that will be returned when the specified url is requested.
public  voidsetResponse(URL url, byte[] content, int statusCode, String statusMessage, String contentType, List responseHeaders)
     Set the response that will be returned when the specified url is requested.
public  voidsetResponse(URL url, String content)
     Convenience method that is the same as calling MockWebConnection.setResponse(URL,String,int,String,String,List) with a status of "200 OK", a content type of "text/html" and no additional headers.
public  voidsetResponse(URL url, String content, String contentType)
     Convenience method that is the same as calling MockWebConnection.setResponse(URL,String,int,String,String,List) with a status of "200 OK" and no additional headers.
public  voidsetResponseAsGenericHtml(URL url, String title)
     Specify a generic html page that will be returned when the given url is specified.


Constructor Detail
MockWebConnection
public MockWebConnection(WebClient webClient)(Code)
Create an instance
Parameters:
  webClient - The web client




Method Detail
getLastAdditionalHeaders
public Map getLastAdditionalHeaders()(Code)
Return the additional headers that were used in the in the last call to MockWebConnection.getResponse(WebRequestSettings) . See above



getLastMethod
public SubmitMethod getLastMethod()(Code)
Return the method that was used in the last call to submitRequest() See above



getLastParameters
public List getLastParameters()(Code)
Return the parameters that were used in the last call to submitRequest() See above



getLastWebRequestSettings
public WebRequestSettings getLastWebRequestSettings()(Code)
Return the WebRequestSettings that was used in the in the last call to MockWebConnection.getResponse(WebRequestSettings) . See above



getLog
final protected Log getLog()(Code)
Return the log that is being used for all scripting objects The log.



getResponse
public WebResponse getResponse(WebRequestSettings webRequestSettings) throws IOException(Code)
Submit a request and retrieve a response
Parameters:
  webRequestSettings - Settings to make the request with See above
throws:
  IOException - (only for extending classes)



getState
public HttpState getState()(Code)
Return the HttpState The state.



setDefaultResponse
public void setDefaultResponse(String content, int statusCode, String statusMessage, String contentType)(Code)
Set the response that will be returned when a url is requested that does not have a specific content set for it.
Parameters:
  content - The content to return
Parameters:
  statusCode - The status code to return
Parameters:
  statusMessage - The status message to return
Parameters:
  contentType - The content type to return



setDefaultResponse
public void setDefaultResponse(byte[] content, int statusCode, String statusMessage, String contentType)(Code)
Set the response that will be returned when a url is requested that does not have a specific content set for it.
Parameters:
  content - The content to return
Parameters:
  statusCode - The status code to return
Parameters:
  statusMessage - The status message to return
Parameters:
  contentType - The content type to return



setDefaultResponse
public void setDefaultResponse(String content)(Code)
Set the response that will be returned when a url is requested that does not have a specific content set for it.
Parameters:
  content - The content to return



setResponse
public void setResponse(URL url, String content, int statusCode, String statusMessage, String contentType, List responseHeaders)(Code)
Set the response that will be returned when the specified url is requested.
Parameters:
  url - The url that will return the given response
Parameters:
  content - The content to return
Parameters:
  statusCode - The status code to return
Parameters:
  statusMessage - The status message to return
Parameters:
  contentType - The content type to return
Parameters:
  responseHeaders - A list of KeyValuePairs that will be returned asresponse headers.



setResponse
public void setResponse(URL url, byte[] content, int statusCode, String statusMessage, String contentType, List responseHeaders)(Code)
Set the response that will be returned when the specified url is requested.
Parameters:
  url - The url that will return the given response
Parameters:
  content - The content to return
Parameters:
  statusCode - The status code to return
Parameters:
  statusMessage - The status message to return
Parameters:
  contentType - The content type to return
Parameters:
  responseHeaders - A list of KeyValuePairs that will be returned asresponse headers.



setResponse
public void setResponse(URL url, String content)(Code)
Convenience method that is the same as calling MockWebConnection.setResponse(URL,String,int,String,String,List) with a status of "200 OK", a content type of "text/html" and no additional headers.
Parameters:
  url - The url that will return the given response
Parameters:
  content - The content to return



setResponse
public void setResponse(URL url, String content, String contentType)(Code)
Convenience method that is the same as calling MockWebConnection.setResponse(URL,String,int,String,String,List) with a status of "200 OK" and no additional headers.
Parameters:
  url - The url that will return the given response
Parameters:
  content - The content to return
Parameters:
  contentType - The content type to return



setResponseAsGenericHtml
public void setResponseAsGenericHtml(URL url, String title)(Code)
Specify a generic html page that will be returned when the given url is specified. The page will contain only minimal html to satisfy the html parser but will contain the specified title so that tests can check for titleText.
Parameters:
  url - The url that will return the given response
Parameters:
  title - The title of the page



Methods inherited from com.gargoylesoftware.htmlunit.WebConnectionImpl
abstract public WebResponse getResponse(WebRequestSettings webRequestSettings) throws IOException(Code)(Java Doc)
abstract public HttpState getState()(Code)(Java Doc)
final public WebClient getWebClient()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.