Java Doc for TestContext.java in  » Testing » jwebunit » net » sourceforge » jwebunit » util » 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 » jwebunit » net.sourceforge.jwebunit.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.sourceforge.jwebunit.util.TestContext

TestContext
public class TestContext (Code)
Establish context for tests (things such as locale, base url for the application, cookies, authorization). The context can be accessed through the net.sourceforge.jwebunit.WebTestCase or net.sourceforge.jwebunit.junit.WebTester .
author:
   Wilkes Joiner
author:
   Jim Weaver
author:
   Julien Henry



Constructor Summary
public  TestContext()
     Construct a test client context.

Method Summary
public  voidaddCookie(String name, String value, String domain)
     Add a cookie to the test context.
public  voidaddCookie(Cookie cookie)
     Add a cookie to the test context.
public  voidaddRequestHeader(String name, String value)
     Add a custom request header.
public  voidclearAuthorizations()
     Clear all authorizations (basic, digest, ntlm, proxy).
public  voidclearRequestHeaders()
     Clear custom request headers.
public  URLgetBaseUrl()
     Return the base URL for the test context.
public  ListgetCookies()
     Return the cookies which have been added to the test context.
public  StringgetDomain()
     Return the user domain.
public  LocalegetLocale()
     Return the locale established for the test context.
public  StringgetPassword()
     Return the user password.
public  StringgetProxyHost()
    
public  StringgetProxyPasswd()
    
public  intgetProxyPort()
    
public  StringgetProxyUser()
    
public  MapgetRequestHeaders()
     Get custom request headers.
public  StringgetResourceBundleName()
     Return the test context resource bundle for expected value lookups.
public  StringgetUser()
     Return the authorized user for the test context.
public  StringgetUserAgent()
    
public  booleanhasAuthorization()
     Return true if a basic authentication has been set on the context via TestContext.setAuthorization .
public  booleanhasCookies()
     Return true if one or more cookies have been added to the test context.
public  booleanhasNTLMAuthorization()
     Return true if a NTLM authentication has been set on the context via TestContext.setNTLMAuthorization .
public  booleanhasProxyAuthorization()
     Return true if a proxy authentication has been set on the context via TestContext.setProxyAuthorization .
public  booleanhasUserAgent()
    
public  voidremoveRequestHeader(String name)
     Remove a custom request header.
public  voidsetAuthorization(String user, String passwd)
     Set basic authentication information for the test context.
public  voidsetBaseUrl(String url)
     Set the base url for the test context.
public  voidsetBaseUrl(URL url)
     Set the base url for the test context.
Parameters:
  url - Base url value.
public  voidsetLocale(Locale locale)
     Set the locale for the test context.
public  voidsetNTLMAuthorization(String user, String passwd, String domain)
     Set NTLM authentication information for the test context.
public  voidsetProxyAuthorization(String user, String passwd, String host, int port)
     Set proxy authentication information for the test context.
public  voidsetResourceBundleName(String name)
     Set a resource bundle to use for the test context (will be used to lookup expected values by key in WebTester).
public  voidsetUserAgent(String userAgent)
    


Constructor Detail
TestContext
public TestContext()(Code)
Construct a test client context.




Method Detail
addCookie
public void addCookie(String name, String value, String domain)(Code)
Add a cookie to the test context. These cookies are set on the conversation when you use a {WebTester#beginAt}.
Parameters:
  name - cookie name.
Parameters:
  value - cookie value.
Parameters:
  domain - cookie domain (ie localhost or www.foo.bar).



addCookie
public void addCookie(Cookie cookie)(Code)
Add a cookie to the test context. These cookies are set on the conversation when you use a {WebTester#beginAt}.
Parameters:
  cookie - a cookie.



addRequestHeader
public void addRequestHeader(String name, String value)(Code)
Add a custom request header.
Parameters:
  name - header name.
Parameters:
  value - header value.



clearAuthorizations
public void clearAuthorizations()(Code)
Clear all authorizations (basic, digest, ntlm, proxy).



clearRequestHeaders
public void clearRequestHeaders()(Code)
Clear custom request headers.



getBaseUrl
public URL getBaseUrl()(Code)
Return the base URL for the test context. The default base URL is port 8080 on localhost.



getCookies
public List getCookies()(Code)
Return the cookies which have been added to the test context.



getDomain
public String getDomain()(Code)
Return the user domain.



getLocale
public Locale getLocale()(Code)
Return the locale established for the test context. If the locale has not been explicitly set, Locale.getDefault() will be returned.



getPassword
public String getPassword()(Code)
Return the user password.



getProxyHost
public String getProxyHost()(Code)
Return the proxy server name



getProxyPasswd
public String getProxyPasswd()(Code)
Return the proxy password



getProxyPort
public int getProxyPort()(Code)
Return the proxy server port



getProxyUser
public String getProxyUser()(Code)
Return the proxy user name



getRequestHeaders
public Map getRequestHeaders()(Code)
Get custom request headers.
Parameters:
  name - header name.
Parameters:
  value - header value.



getResourceBundleName
public String getResourceBundleName()(Code)
Return the test context resource bundle for expected value lookups.



getUser
public String getUser()(Code)
Return the authorized user for the test context.



getUserAgent
public String getUserAgent()(Code)



hasAuthorization
public boolean hasAuthorization()(Code)
Return true if a basic authentication has been set on the context via TestContext.setAuthorization .



hasCookies
public boolean hasCookies()(Code)
Return true if one or more cookies have been added to the test context.



hasNTLMAuthorization
public boolean hasNTLMAuthorization()(Code)
Return true if a NTLM authentication has been set on the context via TestContext.setNTLMAuthorization .



hasProxyAuthorization
public boolean hasProxyAuthorization()(Code)
Return true if a proxy authentication has been set on the context via TestContext.setProxyAuthorization .



hasUserAgent
public boolean hasUserAgent()(Code)



removeRequestHeader
public void removeRequestHeader(String name)(Code)
Remove a custom request header.
Parameters:
  name - header name.



setAuthorization
public void setAuthorization(String user, String passwd)(Code)
Set basic authentication information for the test context.
Parameters:
  user - user name
Parameters:
  passwd - password



setBaseUrl
public void setBaseUrl(String url)(Code)
Set the base url for the test context.
Parameters:
  url - Base url value - A trailing "/" is appended if not provided.



setBaseUrl
public void setBaseUrl(URL url)(Code)
Set the base url for the test context.
Parameters:
  url - Base url value. Anything after trailing "/" will be skipped.



setLocale
public void setLocale(Locale locale)(Code)
Set the locale for the test context.



setNTLMAuthorization
public void setNTLMAuthorization(String user, String passwd, String domain)(Code)
Set NTLM authentication information for the test context.
Parameters:
  user - user name
Parameters:
  passwd - password



setProxyAuthorization
public void setProxyAuthorization(String user, String passwd, String host, int port)(Code)
Set proxy authentication information for the test context.
Parameters:
  user - user name (null if none)
Parameters:
  passwd - password (null if none)
Parameters:
  host - proxy host name (null if applicable to any host).
Parameters:
  port - proxy port (negative if applicable to any port).



setResourceBundleName
public void setResourceBundleName(String name)(Code)
Set a resource bundle to use for the test context (will be used to lookup expected values by key in WebTester).
Parameters:
  name - path name of the resource bundle.



setUserAgent
public void setUserAgent(String userAgent)(Code)



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.