org.apache.anteater.test.log
Interface Logger

All Superinterfaces:
Groupable
All Known Implementing Classes:
BaseLogger, ColourLogger, CompositeLogger, DebugLogger, TextLogger, XMLLogger

public interface Logger
extends Groupable

Callback-style logger interface. There are methods for when an ActionTask or Matcher starts and stops, and when errors, failures and messages are logged within a test.

Loggers are owned (and it's methods invoked) by ActionTasks and MatcherTests. Loggers are created by LoggerFactories.

Since:
June 15, 2002
Version:
$Revision: 1.9 $ $Date: 2003/03/09 15:33:12 $
Author:
Jeff Turner
See Also:
ActionTask, MatcherTest, LoggerFactory

Method Summary
 void actionTaskError(String msg, Exception e)
          Indicates that an error occurred before any of the tests were attempted.
 void endActionTask(ActionTask task)
          Indicates that an ActionTask has ended.
 void endTest(MatcherTest test)
          Indicates that a test against the retrieved response has completed.
 void setExtension(String ext)
          Set the extension of the log file (if any).
 void setFilenameFormat(String filenameFormat)
          Sets a template with which the names of log files are determined.
 void setOverwrite(boolean overwrite)
          Set whether the logger should overwrite old log files from previous runs.
 void setTodir(File destDir)
          Set the destination directory for the log file (if any).
 void setUseFile(boolean useFile)
          Set whether the logger should log to a file (or stdout).
 void startActionTask(ActionTask task)
          Indicates that an ActionTask (aka HTTP operation) has started.
 void startTest(MatcherTest test)
          Indicates the start of a test against the retrieved Response.
 void testError(String msg, Exception e)
          ActionTasks may fail unexpectedly, and these are classed as Errors and should be reported here.
 void testFailure(String msg, Exception e)
          If the ActionTask fails to validate the service, then a failure should be recorded via this method.
 void testLog(String msg)
          ActionTasks may log anything they think relevant to the user here.
 
Methods inherited from interface org.apache.anteater.test.Groupable
setGroup, setGroup
 

Method Detail

startActionTask

public void startActionTask(ActionTask task)
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:


actionTaskError

public void actionTaskError(String msg,
                            Exception e)
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.


startTest

public void startTest(MatcherTest test)
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


testLog

public void testLog(String msg)
ActionTasks may log anything they think relevant to the user here.


testError

public void testError(String msg,
                      Exception e)
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.


testFailure

public void testFailure(String msg,
                        Exception e)
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.


endTest

public void endTest(MatcherTest test)
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


endActionTask

public void endActionTask(ActionTask task)
Indicates that an ActionTask has ended. The actiontask timer should be stopped Here we can also write the assembled actiontask to a file.


setTodir

public void setTodir(File destDir)
Set the destination directory for the log file (if any).


setUseFile

public void setUseFile(boolean useFile)
Set whether the logger should log to a file (or stdout).


setFilenameFormat

public void setFilenameFormat(String filenameFormat)
Sets a template with which the names of log files are determined.


setOverwrite

public void setOverwrite(boolean overwrite)
Set whether the logger should overwrite old log files from previous runs.


setExtension

public void setExtension(String ext)
Set the extension of the log file (if any).



Ant Functional Tester -- see Project home page for details