org.apache.log4j.rolling
Class TimeBasedRollingTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.log4j.rolling.TimeBasedRollingTest
All Implemented Interfaces:
junit.framework.Test

public class TimeBasedRollingTest
extends junit.framework.TestCase

A rather exhaustive set of tests. Tests include leaving the ActiveFileName argument blank, or setting it, with and without compression, and tests with or without stopping/restarting the RollingFileAppender. The regression tests log a few times using a RollingFileAppender. Then, they predict the names of the files which sould be generated and compare them with witness files.

         Compression    ActiveFileName  Stop/Restart 
 Test1      NO              BLANK          NO
 Test2      NO              BLANK          YES
 Test3      YES             BLANK          NO
 Test4      NO                SET          YES 
 Test5      NO                SET          NO
 Test6      YES               SET          NO
 

Author:
Ceki Gülcü

Constructor Summary
TimeBasedRollingTest(java.lang.String name)
           
 
Method Summary
 void setUp()
           
 void tearDown()
           
 void test1()
          Test rolling without compression, activeFileName left blank, no stop/start
 void test2()
          No compression, with stop/restart, activeFileName left blank
 void test3()
          With compression, activeFileName left blank, no stop/restart
 void test4()
          Without compression, activeFileName set, with stop/restart
 void test5()
          No compression, activeFileName set, without stop/restart
 void test6()
          With compression, activeFileName set, no stop/restart,
 void testWithJoran1()
           
 void XXXtestWithJoran10()
           
 
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
 

Constructor Detail

TimeBasedRollingTest

public TimeBasedRollingTest(java.lang.String name)
Method Detail

setUp

public void setUp()
Overrides:
setUp in class junit.framework.TestCase

tearDown

public void tearDown()
Overrides:
tearDown in class junit.framework.TestCase

test1

public void test1()
           throws java.lang.Exception
Test rolling without compression, activeFileName left blank, no stop/start

Throws:
java.lang.Exception

test2

public void test2()
           throws java.lang.Exception
No compression, with stop/restart, activeFileName left blank

Throws:
java.lang.Exception

test3

public void test3()
           throws java.lang.Exception
With compression, activeFileName left blank, no stop/restart

Throws:
java.lang.Exception

test4

public void test4()
           throws java.lang.Exception
Without compression, activeFileName set, with stop/restart

Throws:
java.lang.Exception

test5

public void test5()
           throws java.lang.Exception
No compression, activeFileName set, without stop/restart

Throws:
java.lang.Exception

test6

public void test6()
           throws java.lang.Exception
With compression, activeFileName set, no stop/restart,

Throws:
java.lang.Exception

testWithJoran1

public void testWithJoran1()
                    throws java.lang.Exception
Throws:
java.lang.Exception

XXXtestWithJoran10

public void XXXtestWithJoran10()
                        throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2010 The Apache Software Foundation. Licensed under the Apache License, Version 2.0

Apache Extras Companion for Apache log4j, Apache log4j and Apache are trademarks of the Apache Software Foundation.