org.apache.commons.logging.simple
Class DateTimeCustomConfigTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.commons.logging.simple.DefaultConfigTestCase
              extended by org.apache.commons.logging.simple.CustomConfigTestCase
                  extended by org.apache.commons.logging.simple.DateTimeCustomConfigTestCase
All Implemented Interfaces:
junit.framework.Test

public class DateTimeCustomConfigTestCase
extends CustomConfigTestCase

Tests custom date time format configuration


Field Summary
 
Fields inherited from class org.apache.commons.logging.simple.CustomConfigTestCase
expected, testMessages
 
Fields inherited from class org.apache.commons.logging.simple.DefaultConfigTestCase
factory, log
 
Constructor Summary
DateTimeCustomConfigTestCase()
           
 
Method Summary
protected  void checkDecoratedDateTime()
          Checks that the date time format has been successfully set
protected  void checkShowDateTime()
          Hook for subclassses
 void setProperties()
          Set up system properties required by this unit test.
 void setUp()
          Set up instance variables required by this test case.
static junit.framework.Test suite()
          Return the tests included in this test suite.
 
Methods inherited from class org.apache.commons.logging.simple.CustomConfigTestCase
checkDecorated, checkExpected, checkStandard, logExceptionMessages, logPlainMessages, tearDown, testExceptionMessages, testPlainMessages, testSerializable
 
Methods inherited from class org.apache.commons.logging.simple.DefaultConfigTestCase
setUpDecorated, setUpFactory, setUpLog, testPristineDecorated, testPristineFactory, testPristineLog
 
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, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DateTimeCustomConfigTestCase

public DateTimeCustomConfigTestCase()
Method Detail

suite

public static junit.framework.Test suite()
                                  throws Exception
Return the tests included in this test suite.

We need to use a PathableClassLoader here because the SimpleLog class is a pile of junk and chock-full of static variables. Any other test (like simple.CustomConfigTestCase) that has used the SimpleLog class will already have caused it to do once-only initialisation that we can't reset, even by calling LogFactory.releaseAll, because of those ugly statics. The only clean solution is to load a clean copy of commons-logging including SimpleLog via a nice clean classloader. Or we could fix SimpleLog to be sane...

Throws:
Exception

setProperties

public void setProperties()
Set up system properties required by this unit test. Here, we set up the props defined in the parent class setProperties method, and add a few to configure the SimpleLog class date/time output.

Overrides:
setProperties in class CustomConfigTestCase

setUp

public void setUp()
           throws Exception
Set up instance variables required by this test case.

Overrides:
setUp in class CustomConfigTestCase
Throws:
Exception

checkDecoratedDateTime

protected void checkDecoratedDateTime()
Checks that the date time format has been successfully set

Overrides:
checkDecoratedDateTime in class CustomConfigTestCase

checkShowDateTime

protected void checkShowDateTime()
Hook for subclassses

Overrides:
checkShowDateTime in class CustomConfigTestCase


Copyright © 2001-2011 Apache Software Foundation. All Rights Reserved.