public abstract class HTMLOutputModule extends WebTestModule
getOutput(). The HTML code is provided
in different formats, e.g. as parsed XML
documents.| Constructor and Description |
|---|
HTMLOutputModule(WebMockObjectFactory mockFactory) |
| Modifier and Type | Method and Description |
|---|---|
abstract String |
getOutput()
Returns the output as a string.
|
BufferedReader |
getOutputAsBufferedReader()
Returns the output as a
BufferedReader. |
org.jdom.Document |
getOutputAsJDOMDocument()
Parses the output with the NekoHTML parser and returns it
as a JDOM XML document.
|
Document |
getOutputAsW3CDocument()
Parses the output with the NekoHTML parser and returns it
as a W3C XML document.
|
String |
getOutputAsWellformedXML()
Parses the output with the NekoHTML parser and returns it
as fixed, wellformed XML.
|
void |
setCaseSensitive(boolean caseSensitive)
|
void |
verifyOutput(String expectedOutput)
Verifies the tag output.
|
void |
verifyOutputContains(String expectedOutput)
Verifies if the output contains the specified data.
|
void |
verifyOutputRegularExpression(String expression)
Verifies if the output matches the specified regular expression.
|
addRequestParameter, addRequestParameter, addRequestParameter, getRequestAttribute, getRequestParameter, getSessionAttribute, setRequestAttribute, setSessionAttributepublic HTMLOutputModule(WebMockObjectFactory mockFactory)
public abstract String getOutput()
public BufferedReader getOutputAsBufferedReader()
BufferedReader.public Document getOutputAsW3CDocument()
NestedApplicationException
if the output is not parsable. NekoHTML is quite good in fixing sloppy
HTML code. If you want to use a different parser configuration,
you can use the method XmlUtil.parse(org.apache.xerces.parsers.DOMParser, java.lang.String)
to parse the string output yourself. Please note that
HTML parsing is not very fast and may slow down
your test suite.org.w3c.dom.DocumentRuntimeException - if a parsing error occurspublic org.jdom.Document getOutputAsJDOMDocument()
NestedApplicationException
if the output is not parsable. NekoHTML is quite good in fixing sloppy
HTML code. If you want to use a different parser configuration,
you can use the method XmlUtil.parse(org.apache.xerces.parsers.DOMParser, java.lang.String)
to parse the string output yourself. Please note that
HTML parsing is not very fast and may slow down
your test suite.org.jdom.DocumentRuntimeException - if a parsing error occurspublic String getOutputAsWellformedXML()
NestedApplicationException
if the output is not parsable. NekoHTML is quite good in fixing sloppy
HTML code. If you want to use a different parser configuration,
you can use the method XmlUtil.parse(org.apache.xerces.parsers.DOMParser, java.lang.String)
to parse the string output yourself. Please note that
HTML parsing is not very fast and may slow down
your test suite.RuntimeException - if a parsing error occurspublic void setCaseSensitive(boolean caseSensitive)
verifyOutput(java.lang.String), verifyOutputContains(java.lang.String)
and verifyOutputRegularExpression(java.lang.String).
should compare case sensitive. Default is true.caseSensitive - enable or disable case sensitivitypublic void verifyOutput(String expectedOutput)
expectedOutput - the expected output.VerifyFailedException - if verification failspublic void verifyOutputContains(String expectedOutput)
expectedOutput - the dataVerifyFailedException - if verification failspublic void verifyOutputRegularExpression(String expression)
expression - the dataVerifyFailedException - if verification failsCopyright © 2003-2015. All Rights Reserved.