|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.apache.shale.usecases.systest.AbstractTestCase
public abstract class AbstractTestCase
Abstract base class for system integration tests based on HtmlUnit.
Field Summary | |
---|---|
protected com.gargoylesoftware.htmlunit.html.HtmlPage |
page
The most recently retrieved page from the server. |
protected URL |
url
The calculated URL for the installed "systest" web application. |
protected com.gargoylesoftware.htmlunit.WebClient |
webClient
The web client for this test case. |
Constructor Summary | |
---|---|
AbstractTestCase(String name)
Construct a new instance of this test case. |
Method Summary | |
---|---|
protected com.gargoylesoftware.htmlunit.html.HtmlBody |
body()
Return the body element for the most recently retrieved page. |
protected com.gargoylesoftware.htmlunit.html.HtmlElement |
element(String id)
Return the HTML element with the specified id from the
most recently retrieved page. |
protected com.gargoylesoftware.htmlunit.html.HtmlForm |
form(String id)
Return the form with the specified id from the most
recently retrieved page. |
protected com.gargoylesoftware.htmlunit.html.HtmlHead |
head()
Return the head element for the most recently retrieved page. |
protected com.gargoylesoftware.htmlunit.html.HtmlPage |
link(com.gargoylesoftware.htmlunit.html.HtmlAnchor anchor)
Click the specified hyperlink, and retrieve the subsequent page, saving a reference so that other utility methods may be used to retrieve information from it. |
protected com.gargoylesoftware.htmlunit.html.HtmlPage |
page(String path)
Retrieve and return the page at the specified context relative path. |
protected void |
setUp()
Set up the instance variables required for this test case. |
protected com.gargoylesoftware.htmlunit.html.HtmlPage |
submit(com.gargoylesoftware.htmlunit.html.HtmlSubmitInput submit)
Submit the current page, using the specified component, and retrieve the subsequent page, saving a reference so that other utility methods may be used to retrieve information from it. |
static junit.framework.Test |
suite()
Return the set of tests included in this test suite. |
protected void |
tearDown()
Tear down instance variables required by this test case. |
protected String |
title()
Return the page title from the most recently retrieved page. |
protected URL |
url(String path)
Calculate and return an absolute URL for the specified context relative path, which must begin with a '/' character. |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString |
Methods inherited from class junit.framework.Assert |
---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected com.gargoylesoftware.htmlunit.html.HtmlPage page
The most recently retrieved page from the server.
protected URL url
The calculated URL for the installed "systest" web application.
This value is based on a system property named url
,
which must be defined as part of the command line that executes
each test case.
protected com.gargoylesoftware.htmlunit.WebClient webClient
The web client for this test case.
Constructor Detail |
---|
public AbstractTestCase(String name)
Construct a new instance of this test case.
name
- Name of the new test caseMethod Detail |
---|
protected void setUp() throws Exception
Set up the instance variables required for this test case.
setUp
in class junit.framework.TestCase
Exception
public static junit.framework.Test suite()
Return the set of tests included in this test suite.
protected void tearDown() throws Exception
Tear down instance variables required by this test case.
tearDown
in class junit.framework.TestCase
Exception
protected com.gargoylesoftware.htmlunit.html.HtmlBody body() throws Exception
Return the body element for the most recently retrieved page.
If there is no such element, return null
.
Exception
protected com.gargoylesoftware.htmlunit.html.HtmlElement element(String id) throws Exception
Return the HTML element with the specified id
from the
most recently retrieved page. If there is no such element, return
null
.
id
- Identifier of the requested element.
Exception
protected com.gargoylesoftware.htmlunit.html.HtmlForm form(String id) throws Exception
Return the form with the specified id
from the most
recently retrieved page. If there is no such form, return
null
.
id
- Identifier of the requested form.
Exception
protected com.gargoylesoftware.htmlunit.html.HtmlHead head() throws Exception
Return the head element for the most recently retrieved page.
If there is no such element, return null
.
Exception
protected com.gargoylesoftware.htmlunit.html.HtmlPage link(com.gargoylesoftware.htmlunit.html.HtmlAnchor anchor) throws IOException
Click the specified hyperlink, and retrieve the subsequent page, saving a reference so that other utility methods may be used to retrieve information from it.
anchor
- Anchor component to click
IOException
- if an input/output error occursprotected com.gargoylesoftware.htmlunit.html.HtmlPage page(String path) throws Exception
Retrieve and return the page at the specified context relative path. Save a reference to this page so that other utility methods may be used to retrieve information from it.
path
- Context relative path
IllegalArgumentException
- if the context relative path
does not begin with a '/' character
Exception
protected com.gargoylesoftware.htmlunit.html.HtmlPage submit(com.gargoylesoftware.htmlunit.html.HtmlSubmitInput submit) throws IOException
Submit the current page, using the specified component, and retrieve the subsequent page, saving a reference so that other utility methods may be used to retrieve information from it.
submit
- Submit button component to click
IOException
- if an input/output error occursprotected String title() throws Exception
Return the page title from the most recently retrieved page. Any leading and trailing whitespace will be trimmed.
Exception
protected URL url(String path) throws Exception
Calculate and return an absolute URL for the specified context relative path, which must begin with a '/' character.
path
- Context relative path
IllegalArgumentException
- if the context relative path
does not begin with a '/' character
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |