org.apache.anteater.test.log
Class TextLogger
java.lang.Object
|
+--org.apache.tools.ant.ProjectComponent
|
+--org.apache.tools.ant.types.DataType
|
+--org.apache.anteater.test.BaseDataType
|
+--org.apache.anteater.test.log.BaseLogger
|
+--org.apache.anteater.test.log.TextLogger
- All Implemented Interfaces:
- Groupable, Logger
- Direct Known Subclasses:
- MinimalLogger
- public class TextLogger
- extends BaseLogger
- implements Logger
Logger that writes Text log files.
- Version:
- $Revision: 1.3 $ $Date: 2002/08/11 13:20:52 $
- Author:
- Jeff Turner
Fields inherited from class org.apache.anteater.test.log.BaseLogger |
_destDir, _dt, _errors, _extension, _failures, _filenameFormat, _overwrite, _t0, _tasks, _testLog, _useFile, DEFAULT_LOGDIR |
Fields inherited from class org.apache.tools.ant.types.DataType |
checked, description, ref |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
project |
Methods inherited from class org.apache.anteater.test.BaseDataType |
debug, getDataTypeName, getDebug, getGroup, getRef, print, println, setDebug, setGroup, setGroup, setRefid |
Methods inherited from class org.apache.tools.ant.types.DataType |
circularReference, dieOnCircularReference, getCheckedRef, getDescription, isReference, noChildrenAllowed, setDescription, tooManyAttributes |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
getProject, log, log, setProject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TextLogger
public TextLogger()
startActionTask
public void startActionTask(ActionTask task)
- Description copied from interface:
Logger
- Indicates that an ActionTask (aka HTTP operation) has started. At this
point the underlying implementation should start a timer.
We can also conceptually start writing a new testsuite file, and fill in a
blank header:
- Specified by:
startActionTask
in interface Logger
- Overrides:
startActionTask
in class BaseLogger
actionTaskError
public void actionTaskError(String msg,
Exception e)
- Description copied from interface:
Logger
- Indicates that an error occurred before any of the tests were attempted.
Eg, if the HTTP request times out, or the DNS lookup fails.
If this event occurs, no further tests are expected to be logged.
- Specified by:
actionTaskError
in interface Logger
startTest
public void startTest(MatcherTest test)
- Description copied from interface:
Logger
- Indicates the start of a test against the retrieved Response.
An internal test timer should start.
Can start writing:
The 'tests' field of the actiontask will be incremented
- Specified by:
startTest
in interface Logger
- Overrides:
startTest
in class BaseLogger
testLog
public void testLog(String msg)
- Description copied from interface:
Logger
- ActionTasks may log anything they think relevant to the user here.
- Specified by:
testLog
in interface Logger
- Overrides:
testLog
in class BaseLogger
testError
public void testError(String msg,
Exception e)
- Description copied from interface:
Logger
- ActionTasks may fail unexpectedly, and these are classed as Errors and
should be reported here.
This will add an child to the current .
The 'errors' field of the actiontask will be incremented.
- Specified by:
testError
in interface Logger
- Overrides:
testError
in class BaseLogger
testFailure
public void testFailure(String msg,
Exception e)
- Description copied from interface:
Logger
- If the ActionTask fails to validate the service, then a failure should be
recorded via this method.
This will add a child to the current .
The 'failures' field of the actiontask will be incremented.
- Specified by:
testFailure
in interface Logger
- Overrides:
testFailure
in class BaseLogger
endTest
public void endTest(MatcherTest test)
- Description copied from interface:
Logger
- Indicates that a test against the retrieved response has completed.
An internal test timer should end.
If the request succeeded, an entry like:
is written. If the request failed or generated an error, the @testError or
- Specified by:
endTest
in interface Logger
- Overrides:
endTest
in class BaseLogger
endActionTask
public void endActionTask(ActionTask task)
- Description copied from interface:
Logger
- Indicates that an ActionTask has ended.
The actiontask timer should be stopped
Here we can also write the assembled actiontask to a file.
- Specified by:
endActionTask
in interface Logger
- Overrides:
endActionTask
in class BaseLogger
Ant Functional Tester -- see Project home page for details