org.apache.commons.logging.security
Class SecurityAllowedTestCase

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

public class SecurityAllowedTestCase
extends junit.framework.TestCase

Tests for logging with a security policy that allows JCL access to everything.

This class has only one unit test, as we are (in part) checking behaviour in the static block of the LogFactory class. As that class cannot be unloaded after being loaded into a classloader, the only workaround is to use the PathableClassLoader approach to ensure each test is run in its own classloader, and use a separate testcase class for each test.


Nested Class Summary
static class SecurityAllowedTestCase.CustomHashtable
           
 
Constructor Summary
SecurityAllowedTestCase()
           
 
Method Summary
 void setUp()
           
static junit.framework.Test suite()
          Return the tests included in this test suite.
 void tearDown()
           
 void testAllAllowed()
          Test what happens when JCL is run with all permissions enabled.
 
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

SecurityAllowedTestCase

public SecurityAllowedTestCase()
Method Detail

suite

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

Throws:
Exception

setUp

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

tearDown

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

testAllAllowed

public void testAllAllowed()
Test what happens when JCL is run with all permissions enabled. Custom overrides should take effect.



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