Java Doc for WebClientTest.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) 


com.gargoylesoftware.htmlunit.WebTestCase
   com.gargoylesoftware.htmlunit.WebClientTest

WebClientTest
public class WebClientTest extends WebTestCase (Code)
Tests for WebClient .
version:
   $Revision: 2161 $
author:
   Mike Bowler
author:
   Christian Sell
author:
   Ben Curren
author:
   Marc Guillemot
author:
   David D. Kilzer
author:
   Chris Erskine
author:
   Hans Donner
author:
   Paul King
author:
   Ahmed Ashour



Constructor Summary
public  WebClientTest(String name)
    

Method Summary
protected  voidtearDown()
    
public  voidtestAccessKeys()
     Test pressing an accesskey.
public  voidtestAssertionFailed()
     Test that WebClient.assertionFailed(String) actually throws an exception.
public  voidtestBadCharset()
     Apparently if the browsers receive a charset that they don't understand, they ignore it and assume ISO-8895-1.
public  voidtestBinaryFileFromFileSystem()
     Test that no encoding disturb file reads from filesystem.
public  voidtestContentTypeCaseInsensitive()
     Test that content type is looked in a case insensitive way.
public  voidtestCredentialProvider_NoCredentials()
     Test the situation where credentials are required but they haven't been specified.
public  voidtestExpandUrl()
     Test WebClient.expandUrl(URLString) for the case where an anchor name was specified.
public  voidtestExpandUrlHandlesColonsInRelativeUrl()
     Colons are legal in the path of a url but WebClient.expandUrl(URLString) was blowing up on this case.
public  voidtestExpandUrlWithFile()
    
public  voidtestGetPageFailingStatusCode()
     Verifies that exceptions are thrown on failing status code and the returned page is still set as the current page in the WebWindow.
public  voidtestGetPageWithStringArg()
    
public  voidtestGuessContentType()
    
public  voidtestHtmlWindowEvents_changed()
     Test that the WebWindowEvent.CHANGE window event gets fired at the appropriate time.
public  voidtestHtmlWindowEvents_closedFromFrame()
     Test that the WebWindowEvent.CLOSE window event gets fired at the appropriate time.
public  voidtestHtmlWindowEvents_opened()
     Test that the WebWindowEvent.OPEN window event gets fired at the appropriate time.
public  voidtestKeyboard_NoTabbableElements()
     Test tabbing where there are no tabbable elements.
public  voidtestKeyboard_OneTabbableElement()
     Test tabbing where there is only one tabbable element.
public  voidtestLoadFilePage()
     Test loading a file page.
public  voidtestLoadFilePageWithExternalJS()
     Load a javascript function from an external file using src references inside a script element.
public  voidtestLoadFilePageXml()
     Test loading a file page with xml content.
public  voidtestLoadPage_EncodeRequest()
     Test that the path and query string are encoded to be valid.
public  voidtestLoadPage_PostWithParameters()
     Test loading a page with POST parameters.
public  voidtestLoadPage_SlashesInQueryString()
     Test that double / in query string are not changed.
public  voidtestLoadWebResponseInto()
    
public  voidtestNekoFlagSetters()
    
public  voidtestOnBeforeUnloadCalledOnCorrectPage()
     Verifies that WebClient.getPage(WebWindowWebRequestSettings) calls OnBeforeUnload on the specified window's page, not on the client's "current" page.
public  voidtestOpenerInFrameset()
    
public  voidtestPlusNotEncodedInUrl()
    
public  voidtestPressAccessKey_Button()
     Test that a button can be selected via accesskey.
public  voidtestProxyConfig()
    
public  voidtestProxyConfigForJS()
    
public  voidtestProxyConfigWithRedirect()
    
public  voidtestRedirectViaJavaScriptDuringInitialPageLoad()
     Test redirecting with javascript during page load.
public  voidtestRedirection301_MovedPermanently_GetMethod()
     Test a 301 redirection code where the original request was a GET.
public  voidtestRedirection301_MovedPermanently_PostMethod()
     From the http spec: If the 301 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.
public  voidtestRedirection302_MovedTemporarily_CommaInParameters()
     Test a 302 redirection code with "," in url parameters.
public  voidtestRedirection302_MovedTemporarily_GetMethod()
     Test a 302 redirection code.
public  voidtestRedirection302_MovedTemporarily_PostMethod()
     From the http spec: Note: RFC 1945 and RFC 2068 specify that the client is not allowed to change the method on the redirected request.
public  voidtestRedirection303_SeeOther_GetMethod()
     Tests a 303 redirection code.
public  voidtestRedirection303_SeeOther_PostMethod()
     Tests a 303 redirection code - this should be the same as a 302.
public  voidtestRedirection307_TemporaryRedirect_GetMethod()
     Tests a 307 redirection code.
public  voidtestRedirection307_TemporaryRedirect_PostMethod()
     Tests a 307 redirection code.
public  voidtestRedirectionSameURL()
     Browsers allow many redirections to the same url before to stop redirections.
public  voidtestRefreshHandlerAccessors()
    
public  voidtestRequestHeader()
     Test that additional header are correctly transmitted to the web connection.
public  voidtestReusingHtmlPageToSubmitFormMultipleTimes()
     Test reuse of a single HtmlPage object to submit the same form multiple times.
public  voidtestScriptPreProcessor()
    
public  voidtestScriptPreProcessor_UnimplementedJavascript()
     Test the ScriptPreProcessor's ability to filter out a javascript method that is not implemented without affecting the rest of the page.
public  voidtestSetPageCreator()
     Test WebClient.setPageCreator(PageCreator) .
public  voidtestSetPageCreator_null()
     Test passing in a null page creator.
public  voidtestTabNext()
     Test tabbing to the next element.
public  voidtestTabPrevious()
     Test tabbing to the previous element.


Constructor Detail
WebClientTest
public WebClientTest(String name)(Code)
Create an instance
Parameters:
  name - The name of the test




Method Detail
tearDown
protected void tearDown() throws Exception(Code)
Unset the static items set in tests here
throws:
  Exception - if superclass throws



testAccessKeys
public void testAccessKeys() throws Exception(Code)
Test pressing an accesskey.
throws:
  Exception - If something goes wrong.



testAssertionFailed
public void testAssertionFailed()(Code)
Test that WebClient.assertionFailed(String) actually throws an exception.



testBadCharset
public void testBadCharset() throws Exception(Code)
Apparently if the browsers receive a charset that they don't understand, they ignore it and assume ISO-8895-1. Ensure we do the same.
throws:
  Exception - If the test fails.



testBinaryFileFromFileSystem
public void testBinaryFileFromFileSystem() throws Exception(Code)
Test that no encoding disturb file reads from filesystem. For instance this test failed under Linux with LANG=de_DE.UTF-8 or LANG=C but worked for LANG=de_DE.ISO-8859-1
throws:
  Exception - if the test fails.



testContentTypeCaseInsensitive
public void testContentTypeCaseInsensitive() throws Exception(Code)
Test that content type is looked in a case insensitive way. Cf RFC 2045: "All media type values, subtype values, and parameter names as defined are case-insensitive".
throws:
  Exception - If something goes wrong.



testCredentialProvider_NoCredentials
public void testCredentialProvider_NoCredentials() throws Exception(Code)
Test the situation where credentials are required but they haven't been specified.
throws:
  Exception - If something goes wrong.



testExpandUrl
public void testExpandUrl() throws Exception(Code)
Test WebClient.expandUrl(URLString) for the case where an anchor name was specified.
throws:
  Exception - If the test fails.



testExpandUrlHandlesColonsInRelativeUrl
public void testExpandUrlHandlesColonsInRelativeUrl() throws Exception(Code)
Colons are legal in the path of a url but WebClient.expandUrl(URLString) was blowing up on this case. Ensure it's fixed.
throws:
  Exception - If the test fails.



testExpandUrlWithFile
public void testExpandUrlWithFile() throws Exception(Code)

throws:
  Exception - If the test fails.



testGetPageFailingStatusCode
public void testGetPageFailingStatusCode() throws Exception(Code)
Verifies that exceptions are thrown on failing status code and the returned page is still set as the current page in the WebWindow.
throws:
  Exception - if test fails



testGetPageWithStringArg
public void testGetPageWithStringArg() throws Exception(Code)
Test that WebClient.getPage(String) calls WebClient.getPage(URL) with the right URL
throws:
  Exception - if the test fails



testGuessContentType
public void testGuessContentType() throws Exception(Code)

throws:
  Exception - if an error occurs



testHtmlWindowEvents_changed
public void testHtmlWindowEvents_changed() throws Exception(Code)
Test that the WebWindowEvent.CHANGE window event gets fired at the appropriate time.
throws:
  Exception - If something goes wrong.



testHtmlWindowEvents_closedFromFrame
public void testHtmlWindowEvents_closedFromFrame() throws Exception(Code)
Test that the WebWindowEvent.CLOSE window event gets fired at the appropriate time.
throws:
  Exception - If something goes wrong.



testHtmlWindowEvents_opened
public void testHtmlWindowEvents_opened() throws Exception(Code)
Test that the WebWindowEvent.OPEN window event gets fired at the appropriate time.
throws:
  Exception - If something goes wrong.



testKeyboard_NoTabbableElements
public void testKeyboard_NoTabbableElements() throws Exception(Code)
Test tabbing where there are no tabbable elements.
throws:
  Exception - If something goes wrong.



testKeyboard_OneTabbableElement
public void testKeyboard_OneTabbableElement() throws Exception(Code)
Test tabbing where there is only one tabbable element.
throws:
  Exception - If something goes wrong.



testLoadFilePage
public void testLoadFilePage() throws Exception(Code)
Test loading a file page.
throws:
  Exception - If something goes wrong.



testLoadFilePageWithExternalJS
public void testLoadFilePageWithExternalJS() throws Exception(Code)
Load a javascript function from an external file using src references inside a script element.
throws:
  Exception - if the test fails



testLoadFilePageXml
public void testLoadFilePageXml() throws Exception(Code)
Test loading a file page with xml content. Regression test for bug 1113487.
throws:
  Exception - If something goes wrong.



testLoadPage_EncodeRequest
public void testLoadPage_EncodeRequest() throws Exception(Code)
Test that the path and query string are encoded to be valid.
throws:
  Exception - If something goes wrong.



testLoadPage_PostWithParameters
public void testLoadPage_PostWithParameters() throws Exception(Code)
Test loading a page with POST parameters.
throws:
  Exception - If something goes wrong.



testLoadPage_SlashesInQueryString
public void testLoadPage_SlashesInQueryString() throws Exception(Code)
Test that double / in query string are not changed.
throws:
  Exception - If something goes wrong.



testLoadWebResponseInto
public void testLoadWebResponseInto() throws Exception(Code)
Test WebClient.loadWebResponseInto(WebResponseWebWindow)
throws:
  Exception - If the test fails.



testNekoFlagSetters
public void testNekoFlagSetters() throws Exception(Code)
Test setting the NekoHTML logging and parsing flags
throws:
  Exception - if test fails



testOnBeforeUnloadCalledOnCorrectPage
public void testOnBeforeUnloadCalledOnCorrectPage() throws Exception(Code)
Verifies that WebClient.getPage(WebWindowWebRequestSettings) calls OnBeforeUnload on the specified window's page, not on the client's "current" page.
throws:
  Exception - if an error occurs



testOpenerInFrameset
public void testOpenerInFrameset() throws Exception(Code)
Test the value of window.opener when a link has target="_top"
throws:
  Exception - if test fails



testPlusNotEncodedInUrl
public void testPlusNotEncodedInUrl() throws Exception(Code)
Test that '+' is not encoded in urls
throws:
  Exception - if the test fails



testPressAccessKey_Button
public void testPressAccessKey_Button() throws Exception(Code)
Test that a button can be selected via accesskey.
throws:
  Exception - If something goes wrong.



testProxyConfig
public void testProxyConfig() throws Exception(Code)

throws:
  Exception - If the test fails.



testProxyConfigForJS
public void testProxyConfigForJS() throws Exception(Code)

throws:
  Exception - If the test fails.



testProxyConfigWithRedirect
public void testProxyConfigWithRedirect() throws Exception(Code)
Regression test for https://sourceforge.net/tracker/index.php?func=detail&aid=1669097&group_id=47038&atid=448266
throws:
  Exception - If the test fails.



testRedirectViaJavaScriptDuringInitialPageLoad
public void testRedirectViaJavaScriptDuringInitialPageLoad() throws Exception(Code)
Test redirecting with javascript during page load.
throws:
  Exception - If something goes wrong.



testRedirection301_MovedPermanently_GetMethod
public void testRedirection301_MovedPermanently_GetMethod() throws Exception(Code)
Test a 301 redirection code where the original request was a GET.
throws:
  Exception - If something goes wrong.



testRedirection301_MovedPermanently_PostMethod
public void testRedirection301_MovedPermanently_PostMethod() throws Exception(Code)
From the http spec: If the 301 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued. BUT Firefox follows the redirection
throws:
  Exception - If something goes wrong.



testRedirection302_MovedTemporarily_CommaInParameters
public void testRedirection302_MovedTemporarily_CommaInParameters() throws Exception(Code)
Test a 302 redirection code with "," in url parameters.
throws:
  Exception - If something goes wrong.



testRedirection302_MovedTemporarily_GetMethod
public void testRedirection302_MovedTemporarily_GetMethod() throws Exception(Code)
Test a 302 redirection code.
throws:
  Exception - If something goes wrong.



testRedirection302_MovedTemporarily_PostMethod
public void testRedirection302_MovedTemporarily_PostMethod() throws Exception(Code)
From the http spec: Note: RFC 1945 and RFC 2068 specify that the client is not allowed to change the method on the redirected request. However, most existing user agent implementations treat 302 as if it were a 303 response, performing a GET on the Location field-value regardless of the original request method. The status codes 303 and 307 have been added for servers that wish to make unambiguously clear which kind of reaction is expected of the client.
throws:
  Exception - If something goes wrong.



testRedirection303_SeeOther_GetMethod
public void testRedirection303_SeeOther_GetMethod() throws Exception(Code)
Tests a 303 redirection code. This should be the same as a 302.
throws:
  Exception - If something goes wrong.



testRedirection303_SeeOther_PostMethod
public void testRedirection303_SeeOther_PostMethod() throws Exception(Code)
Tests a 303 redirection code - this should be the same as a 302.
throws:
  Exception - If something goes wrong.



testRedirection307_TemporaryRedirect_GetMethod
public void testRedirection307_TemporaryRedirect_GetMethod() throws Exception(Code)
Tests a 307 redirection code.
throws:
  Exception - If something goes wrong.



testRedirection307_TemporaryRedirect_PostMethod
public void testRedirection307_TemporaryRedirect_PostMethod() throws Exception(Code)
Tests a 307 redirection code.
throws:
  Exception - If something goes wrong.



testRedirectionSameURL
public void testRedirectionSameURL() throws Exception(Code)
Browsers allow many redirections to the same url before to stop redirections. See Bug 1619765 and feature request 1472343.
throws:
  Exception - if the test fails.



testRefreshHandlerAccessors
public void testRefreshHandlerAccessors()(Code)
Test the accessors for refreshHandler



testRequestHeader
public void testRequestHeader() throws Exception(Code)
Test that additional header are correctly transmitted to the web connection.
throws:
  Exception - If something goes wrong.



testReusingHtmlPageToSubmitFormMultipleTimes
public void testReusingHtmlPageToSubmitFormMultipleTimes() throws Exception(Code)
Test reuse of a single HtmlPage object to submit the same form multiple times.
throws:
  Exception - if test fails



testScriptPreProcessor
public void testScriptPreProcessor() throws IOException(Code)
Test the script preprocessor
throws:
  IOException - if the test fails



testScriptPreProcessor_UnimplementedJavascript
public void testScriptPreProcessor_UnimplementedJavascript() throws Exception(Code)
Test the ScriptPreProcessor's ability to filter out a javascript method that is not implemented without affecting the rest of the page.
throws:
  Exception - if the test fails



testSetPageCreator
public void testSetPageCreator() throws Exception(Code)
Test WebClient.setPageCreator(PageCreator) .
throws:
  Exception - If something goes wrong.



testSetPageCreator_null
public void testSetPageCreator_null()(Code)
Test passing in a null page creator.



testTabNext
public void testTabNext() throws Exception(Code)
Test tabbing to the next element.
throws:
  Exception - If something goes wrong.



testTabPrevious
public void testTabPrevious() throws Exception(Code)
Test tabbing to the previous element.
throws:
  Exception - If something goes wrong.



Fields inherited from com.gargoylesoftware.htmlunit.WebTestCase
final public static String PROPERTY_GENERATE_TESTPAGES(Code)(Java Doc)
final public static URL URL_FIRST(Code)(Java Doc)
final public static URL URL_GARGOYLE(Code)(Java Doc)
final public static URL URL_SECOND(Code)(Java Doc)
final public static URL URL_THIRD(Code)(Java Doc)

Methods inherited from com.gargoylesoftware.htmlunit.WebTestCase
protected void assertEquals(URL expectedUrl, URL actualUrl)(Code)(Java Doc)
protected void assertEquals(String message, URL expectedUrl, URL actualUrl)(Code)(Java Doc)
protected void assertEquals(String expectedUrl, URL actualUrl)(Code)(Java Doc)
protected void assertEquals(String[] expected, List actual)(Code)(Java Doc)
protected void assertEquals(String message, String[] expected, List actual)(Code)(Java Doc)
protected void assertEquals(String message, String expectedUrl, URL actualUrl)(Code)(Java Doc)
public static void assertNull(Object object)(Code)(Java Doc)
protected void createTestPageForRealBrowserIfNeeded(String content, String[] expectedAlerts) throws IOException(Code)(Java Doc)
protected void createTestPageForRealBrowserIfNeeded(String content, List expectedAlerts) throws IOException(Code)(Java Doc)
public static InputStream getFileAsStream(String fileName) throws FileNotFoundException(Code)(Java Doc)
public static File getFileObject(String fileName) throws FileNotFoundException(Code)(Java Doc)
final protected Log getLog()(Code)(Java Doc)
final protected static MockWebConnection getMockConnection(HtmlPage page)(Code)(Java Doc)
final protected static HtmlPage loadPage(String html) throws Exception(Code)(Java Doc)
final protected static HtmlPage loadPage(BrowserVersion browserVersion, String html, List collectedAlerts) throws Exception(Code)(Java Doc)
final protected static HtmlPage loadPage(String html, List collectedAlerts) throws Exception(Code)(Java Doc)
final protected static HtmlPage loadPage(String html, List collectedAlerts, URL url) throws Exception(Code)(Java Doc)
final protected static HtmlPage loadPage(BrowserVersion browserVersion, String html, List collectedAlerts, URL url) throws Exception(Code)(Java Doc)
final protected static HtmlPage loadUrl(String url) throws Exception(Code)(Java Doc)
protected boolean notYetImplemented()(Code)(Java Doc)
protected void testHTMLFile(String fileName) throws Exception(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.