|
|||||||||||
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.ActionTask | +--org.apache.anteater.test.Listener
Starts listening for an incoming HTTP request.
If no port is specified, the default port is the first port
declared using the servletContainer
element. The local
path to which the listening occurs is specified using the
path
attribute.
The execution of the Ant script will stop until a request
is received at the given local path. When the request is received,
the listener
element start the matching process using
the matcher set described by the enclosed match
elements.
You can specify a timeout for which a request is expected. If
there's no request received, or if the request is received, but no
matchers succeed, the listener
element fails.
See here for a description of
how this interacts with other classes.
Field Summary |
Fields inherited from class org.apache.anteater.test.ActionTask |
haltonerror, logger, matcherSet, reqFeatures, result, session, successProp, successVal |
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 |
Constructor Summary | |
Listener()
|
|
Listener(int port,
String path)
|
Method Summary | |
Object |
createMatchObject()
This lifecycle method is called during execute() , and should be
used to create the object on which Matchers should match on. |
boolean |
equals(Object another)
|
void |
execute()
Main lifecycle method. |
String |
getId()
Return a String identification of this HTTP action suitable for reporting. |
String |
getPath()
|
int |
getPort()
|
String |
getURL()
Return the URL associated with this task (that it implements or tests). |
int |
hashCode()
|
void |
setHttpMessageRequest(HttpMessage request)
Called by ListenerProxyServlet. |
void |
setHttpServletResponse(javax.servlet.http.HttpServletResponse servletResponse)
Called by ListenerProxyServlet. |
void |
setPath(String path)
|
void |
setPort(int port)
|
void |
setResponseWriter(PipedWriter writer)
Called by ListenerProxyServlet. |
void |
setTimeout(int timeout)
|
void |
setUseTidy(Boolean yn)
|
String |
toString()
|
Methods inherited from class org.apache.anteater.test.ActionTask |
addConfiguredLogger, addConfiguredSession, addConfiguredUses, addMatch, addNamespace, getObjectModel, getProperties, getProperty, getPropertyAsInt, getResult, setAssign, setDebug, setHaltonerror, setValue |
Methods inherited from class org.apache.anteater.test.BaseTask |
debug, getDebug, getGroup, print, println, resolveContentURL, 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, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Listener()
public Listener(int port, String path)
Method Detail |
public boolean equals(Object another)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public String getId()
ActionTask
getId
in class ActionTask
public String getURL()
ActionTask
getURL
in class ActionTask
public void setPort(int port)
public void setPath(String path)
public void setTimeout(int timeout)
public void setUseTidy(Boolean yn)
public int getPort()
public String getPath()
public void setHttpMessageRequest(HttpMessage request)
public void setHttpServletResponse(javax.servlet.http.HttpServletResponse servletResponse)
public void setResponseWriter(PipedWriter writer)
public Object createMatchObject() throws Exception
ActionTask
ActionTask.execute()
, and should be
used to create the object on which Matchers should match on. Typically,
this will be a HttpMessage
of some sort.
As this method is called from execute(), it can rely on the
setXxx
methods having been called.
createMatchObject
in class ActionTask
Exception
public void execute()
ActionTask
Usually, subclasses can get away with not touching this method, but
instead overriding the ActionTask.createMatchObject()
method, which is called
from this method.
execute
in class ActionTask
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |