|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.jira.functest.framework.locator.AbstractLocator
public abstract class AbstractLocator
A base class to derive Locators from
| Nested Class Summary | |
|---|---|
protected static interface |
AbstractLocator.LocatorTextOperation
|
| Field Summary | |
|---|---|
protected Node[] |
nodes
|
protected com.meterware.httpunit.WebResponse |
originalWebResponse
|
protected net.sourceforge.jwebunit.WebTester |
tester
|
| Constructor Summary | |
|---|---|
protected |
AbstractLocator()
|
protected |
AbstractLocator(net.sourceforge.jwebunit.WebTester tester)
|
| Method Summary | |
|---|---|
Iterable<LocatorEntry> |
allMatches()
Get all matches of this locator as an iterable collection of locatore entries |
protected Node |
betterNode(Node node)
|
protected static boolean |
containsNode(Locator locator,
Node node)
|
boolean |
exists()
Return true at least one element will be matches by this locator. |
protected Document |
getDOM(net.sourceforge.jwebunit.WebTester tester)
Returns the DOM Document from the WebTester. |
String |
getHTML()
Returns the HTML that a called to Locator.getNodes() represent, including the top level nodes themselves. |
String |
getHTML(Node node)
Returns the HTML of the specified node. |
Node |
getNode()
This convenience methods is the the equivalent of getNodes()[0] except when the number of nodes found is zero, in which case it should return null. |
protected String |
getNodesTextImpl(Node[] nodes,
AbstractLocator.LocatorTextOperation textOperation)
Called to get all the text or HTML of a set of Node's. |
protected String |
getNodeTextImpl(Node node,
AbstractLocator.LocatorTextOperation textOperation)
Called to get the test or HTML of an Node |
String |
getRawText()
Returns the combined raw text of the Nodes that getNodes() would return or empty string. |
String |
getRawText(Node node)
Returns the raw text of the specified Node. |
String |
getText()
Returns the combined collapsed text of the Nodes that getNodes() would return or empty string. |
String |
getText(Node node)
Returns the collapsed text of the specified Node. |
protected com.meterware.httpunit.WebResponse |
getWebResponse(net.sourceforge.jwebunit.WebTester tester)
|
boolean |
hasNodes()
This will return true if the Locator found some Node's. |
Iterator<LocatorEntry> |
iterator()
This will return a Iterator that returns LocatorEntry objects |
protected String |
toStringImpl(String concreteImplementationName)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.atlassian.jira.functest.framework.locator.Locator |
|---|
getNodes, toString |
| Field Detail |
|---|
protected net.sourceforge.jwebunit.WebTester tester
protected com.meterware.httpunit.WebResponse originalWebResponse
protected Node[] nodes
| Constructor Detail |
|---|
protected AbstractLocator()
protected AbstractLocator(net.sourceforge.jwebunit.WebTester tester)
| Method Detail |
|---|
protected Node betterNode(Node node)
public boolean exists()
Locator
exists in interface Locatorpublic Node getNode()
Locator
getNode in interface Locatorpublic Iterator<LocatorEntry> iterator()
LocatorIterator that returns LocatorEntry objects
iterator in interface LocatorIterator that returns LocatorEntry objectspublic Iterable<LocatorEntry> allMatches()
Locator
allMatches in interface Locatorpublic boolean hasNodes()
LocatorNode's. This is really a convenience method
for getNodes().length > 0
hasNodes in interface Locatorprotected Document getDOM(net.sourceforge.jwebunit.WebTester tester)
tester - the WebTester in play
public String getText()
LocatorgetNodes() would return or empty string.
NOTE : This text is the "COLLAPSED" text of the nodes, that is all the child Text nodes
smooshed together to removed repeating whitespace.
getText in interface Locatorpublic String getText(Node node)
LocatorgetNodes()
would return.
NOTE : This text is the "COLLAPSED" text of the node, that is all the child Text nodes
smooshed together to removed repeating whitespace.
getText in interface Locatornode - the node that we previously returned by a call to getNodes()
public String getRawText()
LocatorgetNodes() would return or empty string.
NOTE : This text is the "RAW" text of the nodes, that is all the child Text nodes
appended together with not whitespace removal at all.
getRawText in interface Locatorpublic String getRawText(Node node)
LocatorgetNodes()
would return.
NOTE : This text is the "RAW" text of the node, that is all the child Text nodes
appended together with not whitespace removal at all.
getRawText in interface Locatornode - the node that we previously returned by a call to getNodes()
public String getHTML()
LocatorLocator.getNodes() represent, including the top level nodes themselves.
getHTML in interface Locatorpublic String getHTML(Node node)
LocatorgetNodes()
would return.
getHTML in interface Locatornode - the node that we previously returned by a call to getNodes()
protected String getNodeTextImpl(Node node,
AbstractLocator.LocatorTextOperation textOperation)
Node
node - the NodetextOperation - the type of text operation
protected String getNodesTextImpl(Node[] nodes,
AbstractLocator.LocatorTextOperation textOperation)
Node's. Makes a call
to AbstractLocator#getNodeHtmlImpl for each node and appends it.
nodes - the Nodes to get text fortextOperation - the type of text operation
protected static boolean containsNode(Locator locator,
Node node)
protected com.meterware.httpunit.WebResponse getWebResponse(net.sourceforge.jwebunit.WebTester tester)
protected String toStringImpl(String concreteImplementationName)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||