com.nexwerk.log4junit.log4j
Class MultipleVMJUnitAppender

java.lang.Object
  extended by org.apache.log4j.AppenderSkeleton
      extended by org.apache.log4j.varia.NullAppender
          extended by com.nexwerk.log4junit.log4j.MultipleVMJUnitAppender
All Implemented Interfaces:
JUnitAppender, org.apache.log4j.Appender, org.apache.log4j.spi.OptionHandler

public class MultipleVMJUnitAppender
extends org.apache.log4j.varia.NullAppender
implements JUnitAppender

Author:
Enrique Comba Riepenhausen Date: Nov 7, 2007 Time: 3:13:19 PM

Field Summary
 
Fields inherited from class org.apache.log4j.AppenderSkeleton
closed, errorHandler, headFilter, layout, name, tailFilter, threshold
 
Constructor Summary
MultipleVMJUnitAppender()
           
 
Method Summary
 void doAppend(org.apache.log4j.spi.LoggingEvent loggingEvent)
           
 java.lang.String getLogMessages()
          Returns the log messages collected so far.
 boolean logLevelReached()
          Checks if the threshold has been reached.
 void setLogLevelThreshold(org.apache.log4j.Level level)
          Sets the threshold level to check against to see if an error has occured.
 void startRecording()
          Start the log recording process.
 void stopRecording()
          Stop the recording process to be able to start asserting the log without the log being cluttered with more logging information.
 
Methods inherited from class org.apache.log4j.varia.NullAppender
activateOptions, append, close, getInstance, requiresLayout
 
Methods inherited from class org.apache.log4j.AppenderSkeleton
addFilter, clearFilters, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.log4j.Appender
addFilter, clearFilters, close, getErrorHandler, getFilter, getLayout, getName, requiresLayout, setErrorHandler, setLayout, setName
 

Constructor Detail

MultipleVMJUnitAppender

public MultipleVMJUnitAppender()
Method Detail

startRecording

public void startRecording()
Start the log recording process.

Specified by:
startRecording in interface JUnitAppender

stopRecording

public void stopRecording()
Stop the recording process to be able to start asserting the log without the log being cluttered with more logging information.

Specified by:
stopRecording in interface JUnitAppender

getLogMessages

public java.lang.String getLogMessages()
Returns the log messages collected so far.

Specified by:
getLogMessages in interface JUnitAppender
Returns:
The log messages.

setLogLevelThreshold

public void setLogLevelThreshold(org.apache.log4j.Level level)
Sets the threshold level to check against to see if an error has occured.

Specified by:
setLogLevelThreshold in interface JUnitAppender
Parameters:
level - The level threshold

logLevelReached

public boolean logLevelReached()
Checks if the threshold has been reached.

Specified by:
logLevelReached in interface JUnitAppender
Returns:
True if the threshold has been reached.

doAppend

public void doAppend(org.apache.log4j.spi.LoggingEvent loggingEvent)
Specified by:
doAppend in interface org.apache.log4j.Appender
Overrides:
doAppend in class org.apache.log4j.varia.NullAppender


Copyright © 2007 NexWerk. All Rights Reserved.