Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

junit.log4j
Class LoggedTestCase  view LoggedTestCase download LoggedTestCase.java

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byjunit.log4j.LoggedTestCase
All Implemented Interfaces:
junit.framework.Test

public class LoggedTestCase
extends junit.framework.TestCase

Extension of TestCase integrating Log4J.

Created: Fri Nov 02 14:21:45 2001

Version:
$Revision: 1.1 $

Field Summary
protected  org.apache.log4j.Category category
           
protected  boolean isLog4jInClasspath
           
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
LoggedTestCase(java.lang.String name)
          Calls LoggedTestCase(name, log4j.properties) 55 .
LoggedTestCase(java.lang.String name, java.lang.String propertyFile)
          Creates a new LoggedTestCase instance.
 
Method Summary
 void debug(java.lang.Object message)
          Redirection to debug() 55 in the testcase category 55 .
 void debug(java.lang.Object message, java.lang.Throwable t)
          Redirection to debug() 55 in the testcase category 55 .
 void error(java.lang.Object message)
          Redirection to error() 55 in the testcase category 55 .
 void error(java.lang.Object message, java.lang.Throwable t)
          Redirection to error() 55 in the testcase category 55 .
 void fatal(java.lang.Object message)
          Redirection to fatal() 55 in the testcase category 55 .
 void fatal(java.lang.Object message, java.lang.Throwable t)
          Redirection to fatal() 55 in the testcase category 55 .
 void info(java.lang.Object message)
          Redirection to info() 55 in the testcase category 55 .
 void info(java.lang.Object message, java.lang.Throwable t)
          Redirection to info() 55 in the testcase category 55 .
 void setUp()
          Setup of the test case.
 void tearDown()
          Tear down of the test case.
 void warn(java.lang.Object message)
          Redirection to warn() 55 in the testcase category 55 .
 void warn(java.lang.Object message, java.lang.Throwable t)
          Redirection to warn() 55 in the testcase category 55 .
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

category

protected org.apache.log4j.Category category

isLog4jInClasspath

protected boolean isLog4jInClasspath
Constructor Detail

LoggedTestCase

public LoggedTestCase(java.lang.String name,
                      java.lang.String propertyFile)

Creates a new LoggedTestCase instance. The Log4J properties are read from the file name from the current directory. If the file does not exist, the default Log4J properties are used.

If Log4J is not in the classpath, all log messages will be written to stdout. This is to make it easy on user who do not want to have to download log4j and put it in their classpath !


LoggedTestCase

public LoggedTestCase(java.lang.String name)
Calls LoggedTestCase(name, log4j.properties) 55 .

Method Detail

setUp

public void setUp()
           throws java.lang.Exception
Setup of the test case. Simply writes "Set up started." to the logger with priority INFO 55 .


tearDown

public void tearDown()
              throws java.lang.Exception
Tear down of the test case. Simply writes "Tear down finished." to the logger with priority INFO 55 .


debug

public void debug(java.lang.Object message)
Redirection to debug() 55 in the testcase category 55 .


debug

public void debug(java.lang.Object message,
                  java.lang.Throwable t)
Redirection to debug() 55 in the testcase category 55 .


error

public void error(java.lang.Object message)
Redirection to error() 55 in the testcase category 55 .


error

public void error(java.lang.Object message,
                  java.lang.Throwable t)
Redirection to error() 55 in the testcase category 55 .


fatal

public void fatal(java.lang.Object message)
Redirection to fatal() 55 in the testcase category 55 .


fatal

public void fatal(java.lang.Object message,
                  java.lang.Throwable t)
Redirection to fatal() 55 in the testcase category 55 .


info

public void info(java.lang.Object message)
Redirection to info() 55 in the testcase category 55 .


info

public void info(java.lang.Object message,
                 java.lang.Throwable t)
Redirection to info() 55 in the testcase category 55 .


warn

public void warn(java.lang.Object message)
Redirection to warn() 55 in the testcase category 55 .


warn

public void warn(java.lang.Object message,
                 java.lang.Throwable t)
Redirection to warn() 55 in the testcase category 55 .