FileDocCategorySizeDatePackage
CustomLevelTestCase.javaAPI DocApache log4j 1.2.152683Sat Aug 25 00:09:34 BST 2007org.apache.log4j.xml

CustomLevelTestCase

public class CustomLevelTestCase extends TestCase

Fields Summary
static String
TEMP
Logger
root
Logger
logger
Constructors Summary
public CustomLevelTestCase(String name)


     
    super(name);
  
Methods Summary
voidcommon()

    int i = 0;
    logger.debug("Message " + ++i);
    logger.info ("Message " + ++i);
    logger.warn ("Message " + ++i);
    logger.error("Message " + ++i);
    logger.log(XLevel.TRACE, "Message " + ++i);
  
public voidsetUp()

    root = Logger.getRootLogger();
    logger = Logger.getLogger(CustomLevelTestCase.class);
  
public static junit.framework.Testsuite()

    TestSuite suite = new TestSuite();
    suite.addTest(new CustomLevelTestCase("test1"));
    suite.addTest(new CustomLevelTestCase("test2"));
    suite.addTest(new CustomLevelTestCase("test3"));
    suite.addTest(new CustomLevelTestCase("test4"));
    return suite;
  
public voidtearDown()

  
    root.getLoggerRepository().resetConfiguration();
  
public voidtest1()

    DOMConfigurator.configure("input/xml/customLevel1.xml");
    common();
    assertTrue(Compare.compare(TEMP, "witness/customLevel.1"));
  
public voidtest2()

    DOMConfigurator.configure("input/xml/customLevel2.xml");
    common();
    assertTrue(Compare.compare(TEMP, "witness/customLevel.2"));
  
public voidtest3()

    DOMConfigurator.configure("input/xml/customLevel3.xml");
    common();
    assertTrue(Compare.compare(TEMP, "witness/customLevel.3"));
  
public voidtest4()

    DOMConfigurator.configure("input/xml/customLevel4.xml");
    common();
    assertTrue(Compare.compare(TEMP, "witness/customLevel.4"));