Spelling
This commit is contained in:
@@ -19,7 +19,7 @@ package org.apache.commons.logging;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
/**
|
||||
* testcase to emulate container and application isolated from container
|
||||
* test to emulate container and application isolated from container
|
||||
*/
|
||||
public class LoadTestCase extends TestCase{
|
||||
//TODO: need some way to add service provider packages
|
||||
|
||||
@@ -57,8 +57,8 @@ public class PathableClassLoader extends URLClassLoader {
|
||||
* <p>
|
||||
* This is necessary in order for the rest of the world to communicate
|
||||
* with classes loaded via a custom classloader. As an example, junit
|
||||
* testcases which are loaded via a custom classloader needs to see
|
||||
* the same junit classes as the code invoking the testcase, otherwise
|
||||
* tests which are loaded via a custom classloader needs to see
|
||||
* the same junit classes as the code invoking the test, otherwise
|
||||
* they can't pass result objects back.
|
||||
* <p>
|
||||
* Normally, only a classloader created with a null parent needs to
|
||||
@@ -79,7 +79,7 @@ public class PathableClassLoader extends URLClassLoader {
|
||||
* totally clean; nothing but the standard java library will be
|
||||
* present.
|
||||
* <p>
|
||||
* When using a null parent classloader with a junit testcase, it *is*
|
||||
* When using a null parent classloader with a junit test, it *is*
|
||||
* necessary for the junit library to also be visible. In this case, it
|
||||
* is recommended that the following code be used:
|
||||
* <pre>
|
||||
|
||||
@@ -63,7 +63,7 @@ public class FirstPriorityConfigTestCase extends TestCase {
|
||||
final URL baseUrl = dummy.findResource(thisClassPath);
|
||||
|
||||
// Now set up the desired classloader hierarchy. We'll put JCL
|
||||
// in the container path, the testcase in a webapp path, and
|
||||
// in the container path, the test in a webapp path, and
|
||||
// both config files into the webapp path too.
|
||||
final PathableClassLoader containerLoader = new PathableClassLoader(null);
|
||||
containerLoader.useExplicitLoader("junit.", Test.class.getClassLoader());
|
||||
|
||||
@@ -131,8 +131,8 @@ public class MockSecurityManager extends SecurityManager {
|
||||
// this is the unit test code; treat this like an untrusted client
|
||||
// app that is using JCL
|
||||
++untrustedCodeCount;
|
||||
System.out.println("Untrusted code [testcase] found");
|
||||
throw new SecurityException("Untrusted code [testcase] found");
|
||||
System.out.println("Untrusted code [test] found");
|
||||
throw new SecurityException("Untrusted code [test] found");
|
||||
} else if (cname.startsWith("org.apache.commons.logging.")) {
|
||||
if (!permissions.implies(p)) {
|
||||
System.out.println("Permission refused:" + p.getClass() + ":" + p);
|
||||
|
||||
@@ -39,7 +39,7 @@ import org.apache.commons.logging.PathableTestSuite;
|
||||
* 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.
|
||||
* classloader, and use a separate test class for each test.
|
||||
*/
|
||||
public class SecurityAllowedTestCase extends TestCase
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@ import org.apache.commons.logging.PathableTestSuite;
|
||||
* 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.
|
||||
* classloader, and use a separate test class for each test.
|
||||
*/
|
||||
public class SecurityForbiddenTestCase extends TestCase
|
||||
{
|
||||
|
||||
@@ -74,7 +74,7 @@ public class TcclDisabledTestCase extends TestCase {
|
||||
parentLoader.useExplicitLoader("junit.", Test.class.getClassLoader());
|
||||
parentLoader.addLogicalLib("commons-logging");
|
||||
parentLoader.addLogicalLib("testclasses");
|
||||
// hack to ensure that the testcase classloader can't see
|
||||
// hack to ensure that the test classloader can't see
|
||||
// the custom MyLog
|
||||
parentLoader.useExplicitLoader(MY_LOG_PKG + ".", emptyLoader);
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ public class TcclEnabledTestCase extends TestCase {
|
||||
parentLoader.useExplicitLoader("junit.", Test.class.getClassLoader());
|
||||
parentLoader.addLogicalLib("commons-logging");
|
||||
parentLoader.addLogicalLib("testclasses");
|
||||
// hack to ensure that the testcase classloader can't see
|
||||
// hack to ensure that the test classloader can't see
|
||||
// the custom MyLogFactoryImpl
|
||||
parentLoader.useExplicitLoader(MY_LOG_PKG + ".", emptyLoader);
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ public class TcclDisabledTestCase extends TestCase {
|
||||
parentLoader.useExplicitLoader("junit.", Test.class.getClassLoader());
|
||||
parentLoader.addLogicalLib("commons-logging");
|
||||
parentLoader.addLogicalLib("testclasses");
|
||||
// hack to ensure that the testcase classloader can't see
|
||||
// hack to ensure that the test classloader can't see
|
||||
// the custom MyLogFactoryImpl
|
||||
parentLoader.useExplicitLoader(
|
||||
MY_LOG_FACTORY_PKG + ".", emptyLoader);
|
||||
|
||||
@@ -69,7 +69,7 @@ public class TcclEnabledTestCase extends TestCase {
|
||||
parentLoader.useExplicitLoader("junit.", Test.class.getClassLoader());
|
||||
parentLoader.addLogicalLib("commons-logging");
|
||||
parentLoader.addLogicalLib("testclasses");
|
||||
// hack to ensure that the testcase classloader can't see
|
||||
// hack to ensure that the test classloader can't see
|
||||
// the cust MyLogFactoryImpl
|
||||
parentLoader.useExplicitLoader(
|
||||
"org.apache.commons.logging.tccl.custom.", emptyLoader);
|
||||
|
||||
Reference in New Issue
Block a user