|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tools.ant.ProjectComponent | +--org.apache.tools.ant.Task | +--org.apache.anteater.test.BaseTask | +--org.apache.anteater.test.Matcher
A Matcher
corresponds to a <match> element, and
describes a set of tests that need to be applied on an object. Multiple
Matcher
s can be applied on an object, by grouping them into a
MatcherSet
; see the description of this class to understand how this
works.
A Matcher
contains multiple tests which are to be verified
on an object. These tests are described by MatcherTest
instances. All of the tests have to succeed for a matcher to succeed.
Represents a set of <matcher> elements, and takes each
Matcher through it's lifecycle.
,
A test element inside a <matcher>, eg
<responseCode>, <regexp> etc.
Field Summary | |
protected boolean |
error
If the test failed, was it an error? |
protected Logger |
logger
|
protected MatcherSet |
matcherSet
|
protected ArrayList |
matcherTests
|
protected Object |
matchOn
|
protected boolean |
result
Did the test pass? |
protected String |
successProp
Property to set if this match element's tests all succeed. |
protected String |
successVal
Value to set successProp to if this match element's tests all succeed. |
Fields inherited from class org.apache.anteater.test.BaseTask |
debug, debugWasSet |
Fields inherited from class org.apache.tools.ant.Task |
description, location, target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
project |
Fields inherited from interface org.apache.anteater.test.ObjectModel |
NAMESPACES_KEY, PROPERTIES_KEY |
Constructor Summary | |
Matcher()
|
Method Summary | |
void |
addTask(org.apache.tools.ant.Task task)
|
void |
execute()
Run all the MatcherTest children of this
instance. |
boolean |
getErrorFlag()
Returns whether this matcher exited with an error, as opposed to a failure. |
Object |
getMatchOn()
|
boolean |
getResult()
Retusn whether this matcher succeeded. |
void |
setAssign(String propName)
Set the name of a property which will be set in the project if this matcher succeeds. |
void |
setLogger(Logger logger)
Set the logger. |
void |
setMatcherSet(MatcherSet matcherSet)
|
void |
setMatchOn(Object matchOn)
|
void |
setObjectModel(Map objectModel)
Set the context in the receiving object. |
void |
setValue(String propVal)
Set the value to which the setAssign(java.lang.String) property will be set if this
matcher succeeds. |
Methods inherited from class org.apache.anteater.test.BaseTask |
debug, getDebug, getGroup, print, println, resolveContentURL, setDebug, setGroup, setGroup |
Methods inherited from class org.apache.tools.ant.Task |
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorOutput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
getProject, setProject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected String successProp
protected String successVal
successProp
to if this match element's tests all succeed.
protected Logger logger
protected Object matchOn
protected MatcherSet matcherSet
protected boolean result
protected boolean error
protected ArrayList matcherTests
Constructor Detail |
public Matcher()
Method Detail |
public void setObjectModel(Map objectModel)
ObjectModel
setObjectModel
in interface ObjectModel
objectModel
- a HashMap
valuepublic void setLogger(Logger logger)
Logger.startTest(org.apache.anteater.test.MatcherTest)
, Logger.endTest(org.apache.anteater.test.MatcherTest)
,
and Logger.testLog(java.lang.String)
, Logger.testError(java.lang.String, java.lang.Exception)
, Logger.testFailure(java.lang.String, java.lang.Exception)
.
public void setAssign(String propName)
public void setValue(String propVal)
setAssign(java.lang.String)
property will be set if this
matcher succeeds.
public void setMatchOn(Object matchOn)
public Object getMatchOn()
public void setMatcherSet(MatcherSet matcherSet)
public void addTask(org.apache.tools.ant.Task task)
addTask
in interface org.apache.tools.ant.TaskContainer
public boolean getResult()
false
implies an error or failure occurred.
public boolean getErrorFlag()
getResult()
returns false.
public void execute() throws org.apache.tools.ant.BuildException
MatcherTest
children of this
instance. If one of them fails, the whole matcher fails. Any
child which is not a MatcherTest
instance, is simply
execute
d.
execute
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
- if a logger isn't set, something goes drastically
wrong, or a non-Anteater nested task fails.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |