org.opennms.test.mock
Class MockLogAppender

java.lang.Object
  extended by org.apache.log4j.AppenderSkeleton
      extended by org.opennms.test.mock.MockLogAppender
All Implemented Interfaces:
Appender, OptionHandler

public class MockLogAppender
extends AppenderSkeleton

Author:
brozow

Field Summary
 
Fields inherited from class org.apache.log4j.AppenderSkeleton
closed, errorHandler, headFilter, layout, name, tailFilter, threshold
 
Constructor Summary
MockLogAppender()
           
 
Method Summary
protected  void append(LoggingEvent event)
           
static void assertNotGreaterOrEqual(Level level)
           
static void assertNoWarningsOrGreater()
           
 void close()
           
 void doAppend(LoggingEvent event)
           
static LoggingEvent[] getEvents()
           
static LoggingEvent[] getEventsGreaterOrEqual(Level level)
           
static boolean isLoggingSetup()
           
static boolean noWarningsOrHigherLogged()
           
static void receivedLogLevel(Level level)
           
 boolean requiresLayout()
           
static void resetEvents()
           
static void resetLogLevel()
           
static void setupLogging()
           
static void setupLogging(boolean toConsole)
           
static void setupLogging(boolean toConsole, String level)
           
 
Methods inherited from class org.apache.log4j.AppenderSkeleton
activateOptions, 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
 

Constructor Detail

MockLogAppender

public MockLogAppender()
Method Detail

doAppend

public void doAppend(LoggingEvent event)
Specified by:
doAppend in interface Appender
Overrides:
doAppend in class AppenderSkeleton

append

protected void append(LoggingEvent event)
Specified by:
append in class AppenderSkeleton

close

public void close()

requiresLayout

public boolean requiresLayout()

resetEvents

public static void resetEvents()

getEvents

public static LoggingEvent[] getEvents()

getEventsGreaterOrEqual

public static LoggingEvent[] getEventsGreaterOrEqual(Level level)

setupLogging

public static void setupLogging()

setupLogging

public static void setupLogging(boolean toConsole)

setupLogging

public static void setupLogging(boolean toConsole,
                                String level)

isLoggingSetup

public static boolean isLoggingSetup()

receivedLogLevel

public static void receivedLogLevel(Level level)

resetLogLevel

public static void resetLogLevel()

noWarningsOrHigherLogged

public static boolean noWarningsOrHigherLogged()

assertNotGreaterOrEqual

public static void assertNotGreaterOrEqual(Level level)
                                    throws junit.framework.AssertionFailedError
Throws:
junit.framework.AssertionFailedError

assertNoWarningsOrGreater

public static void assertNoWarningsOrGreater()
                                      throws junit.framework.AssertionFailedError
Throws:
junit.framework.AssertionFailedError


Copyright © 2008. All Rights Reserved.