org.apache.anteater.test.matchers
Class Header
java.lang.Object
|
+--org.apache.tools.ant.ProjectComponent
|
+--org.apache.tools.ant.Task
|
+--org.apache.anteater.test.BaseTask
|
+--org.apache.anteater.test.ContentHandlerTask
|
+--org.apache.anteater.test.MatcherTest
|
+--org.apache.anteater.test.matchers.Header
- All Implemented Interfaces:
- Groupable, ObjectModel, org.apache.tools.ant.TaskContainer
- public class Header
- extends MatcherTest
Maintains an HTTP header.
- Version:
- $Revision: 1.13 $ $Date: 2003/01/18 04:09:47 $
- Author:
- Costin Manolache, Ovidiu Predescu, Jeff Turner
Field Summary |
protected String |
name
The name of the header. |
protected String |
pattern
Regexp pattern that the header should match. |
protected String |
value
The value of the header. |
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 |
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 |
name
protected String name
- The name of the header.
value
protected String value
- The value of the header.
pattern
protected String pattern
- Regexp pattern that the header should match.
Header
public Header()
Header
public Header(String name,
String value)
- Constructor. Note: Headers created with this will have a null 'project',
and so cannot be executed. Use
create(org.apache.tools.ant.Project, java.lang.String, java.lang.String)
to create a Header owned by
a project.
create
public static Header create(org.apache.tools.ant.Project proj,
String name,
String value)
- A factory for creating Headers which have their 'project' field properly
set.
getName
public String getName()
setName
public void setName(String v)
getValue
public String getValue()
- Get expected value.
setValue
public void setValue(String v)
addText
public void addText(String body)
- Description copied from class:
MatcherTest
- Sets the body text.
- Overrides:
addText
in class MatcherTest
setPattern
public void setPattern(String v)
- Sets a regexp pattern that the header should match.
equals
public boolean equals(Object another)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
parseHeadersAsString
public static void parseHeadersAsString(String s,
HashMap headers)
parseHeaderLine
public static Header parseHeaderLine(String line)
toString
public static String toString(HashMap headers)
validate
public boolean validate()
throws org.apache.tools.ant.BuildException
- Description copied from class:
MatcherTest
- Return true if this instance matches against the
matchOn
object of the matcher
.
- Specified by:
validate
in class MatcherTest
- Returns:
- a
boolean
value
org.apache.tools.ant.BuildException
Ant Functional Tester -- see Project home page for details