org.apache.commons.logging.pathable
Class GeneralTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.commons.logging.pathable.GeneralTestCase
All Implemented Interfaces:
junit.framework.Test

public class GeneralTestCase
extends junit.framework.TestCase

Tests for the PathableTestSuite class.


Constructor Summary
GeneralTestCase()
           
 
Method Summary
static junit.framework.Test suite()
          Set up a custom classloader hierarchy for this test case.
 void testResetContext1()
          Verify that when a test method modifies the context classloader it is reset before the next test is run.
 void testResetContext2()
          See testResetContext1.
 void testResetProps1()
          Verify that when a test method modifies the system properties they are reset before the next test is run.
 void testResetProps2()
          See testResetProps1.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, 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

GeneralTestCase

public GeneralTestCase()
Method Detail

suite

public static junit.framework.Test suite()
                                  throws Exception
Set up a custom classloader hierarchy for this test case.

Throws:
Exception

testResetProps1

public void testResetProps1()
Verify that when a test method modifies the system properties they are reset before the next test is run.

This method works in conjunction with testResetProps2. There is no way of knowing which test method junit will run first, but it doesn't matter; whichever one of them runs first will modify the system properties. If the PathableTestSuite isn't resetting the system properties then whichever of them runs second will fail. Of course if other methods are run in-between then those methods might also fail...


testResetProps2

public void testResetProps2()
See testResetProps1.


testResetContext1

public void testResetContext1()
Verify that when a test method modifies the context classloader it is reset before the next test is run.

This method works in conjunction with testResetContext2. There is no way of knowing which test method junit will run first, but it doesn't matter; whichever one of them runs first will modify the contextClassloader. If the PathableTestSuite isn't resetting the contextClassLoader then whichever of them runs second will fail. Of course if other methods are run in-between then those methods might also fail...


testResetContext2

public void testResetContext2()
See testResetContext1.



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