org.mod4j.runtime.test
Class AbstractLoggingTest

java.lang.Object
  extended by org.mod4j.runtime.test.AbstractLoggingTest
Direct Known Subclasses:
LoggingAspectTest, TimingAspectTest

public abstract class AbstractLoggingTest
extends java.lang.Object

Base for Tests that need to verify that loglines are properly written.


Field Summary
protected  java.util.logging.Logger logger
          Can be used to set the Level.
protected  java.util.logging.Handler mockHandler
          Can be used to 'listen in' on the messages written to the log.
 
Constructor Summary
AbstractLoggingTest()
           
 
Method Summary
protected abstract  org.apache.commons.logging.Log getLog()
          The Log we'll work with.
 void setUp()
          Setup environment before tests.
 void tearDown()
          Cleanup after tests.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected java.util.logging.Logger logger
Can be used to set the Level. Is set to Level.ALL in the Before and the old Level will be reset in the After.


mockHandler

protected java.util.logging.Handler mockHandler
Can be used to 'listen in' on the messages written to the log. Subclass has to do the replay/verify.

Constructor Detail

AbstractLoggingTest

public AbstractLoggingTest()
Method Detail

setUp

public void setUp()
Setup environment before tests. If subclasses override this method, don't forget to call super!


getLog

protected abstract org.apache.commons.logging.Log getLog()
The Log we'll work with. Has to be implemented by the subclass.

Returns:
The Log we'll work with.

tearDown

public void tearDown()
Cleanup after tests. If subclasses override this method, don't forget to call super!



Copyright © 2010 Mod4j. All Rights Reserved.