|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--org.apache.anteater.test.log.CompositeLogger
A Logger that implements the Composite (GoF) pattern, by delegating method calls to a group of Loggers. With this, ActionTasks and Tests that use logging don't need to care how many or what type of Logger they're actually using.
ActionTask| Constructor Summary | |
CompositeLogger()
|
|
| Method Summary | |
void |
actionTaskError(String msg,
Exception e)
Indicates that an error occurred before any of the tests were attempted. |
void |
addLogger(Logger logger)
|
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 |
setGroup(Group group)
|
void |
setGroup(String name)
|
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). |
int |
size()
|
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 class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CompositeLogger()
| Method Detail |
public void addLogger(Logger logger)
public void setGroup(String name)
setGroup in interface Groupablepublic void setGroup(Group group)
setGroup in interface Groupablepublic void startActionTask(ActionTask task)
Logger
startActionTask in interface Logger
public void actionTaskError(String msg,
Exception e)
LoggerIf this event occurs, no further tests are expected to be logged.
actionTaskError in interface Loggerpublic void startTest(MatcherTest test)
Logger
startTest in interface Loggerpublic void testLog(String msg)
Logger
testLog in interface Logger
public void testError(String msg,
Exception e)
Logger
testError in interface Logger
public void testFailure(String msg,
Exception e)
Logger
testFailure in interface Loggerpublic void endTest(MatcherTest test)
Logger
endTest in interface Loggerpublic void endActionTask(ActionTask task)
Logger
endActionTask in interface Loggerpublic void setTodir(File destDir)
Logger
setTodir in interface Loggerpublic void setUseFile(boolean useFile)
Logger
setUseFile in interface Loggerpublic void setFilenameFormat(String filenameFormat)
Logger
setFilenameFormat in interface Loggerpublic void setOverwrite(boolean overwrite)
Logger
setOverwrite in interface Loggerpublic void setExtension(String ext)
Logger
setExtension in interface Loggerpublic int size()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||