Examples of useSystemLoader()


Examples of org.apache.commons.logging.PathableClassLoader.useSystemLoader()

        // Determine the URL to this .class file, so that we can then
        // append the priority dirs to it. For tidiness, load this
        // class through a dummy loader though this is not absolutely
        // necessary...
        PathableClassLoader dummy = new PathableClassLoader(null);
        dummy.useSystemLoader("junit.");
        dummy.addLogicalLib("testclasses");
        dummy.addLogicalLib("commons-logging");
       
        String thisClassPath = thisClass.getName().replace('.', '/') + ".class";
        URL baseUrl = dummy.findResource(thisClassPath);
View Full Code Here

Examples of org.apache.commons.logging.PathableClassLoader.useSystemLoader()

        // LogFactory class. Therefore if that class can be found, then the
        // TCCL must have been used to load it.
        PathableClassLoader emptyLoader = new PathableClassLoader(null);
       
        PathableClassLoader parentLoader = new PathableClassLoader(null);
        parentLoader.useSystemLoader("junit.");
        parentLoader.addLogicalLib("commons-logging");
        parentLoader.addLogicalLib("testclasses");
        // hack to ensure that the testcase classloader can't see
        // the cust MyLogFactoryImpl
        parentLoader.useExplicitLoader(
View Full Code Here

Examples of org.apache.commons.logging.PathableClassLoader.useSystemLoader()

        // Determine the URL to this .class file, so that we can then
        // append the priority dirs to it. For tidiness, load this
        // class through a dummy loader though this is not absolutely
        // necessary...
        PathableClassLoader dummy = new PathableClassLoader(null);
        dummy.useSystemLoader("junit.");
        dummy.addLogicalLib("testclasses");
        dummy.addLogicalLib("commons-logging");
       
        String thisClassPath = thisClass.getName().replace('.', '/') + ".class";
        URL baseUrl = dummy.findResource(thisClassPath);
View Full Code Here

Examples of org.apache.commons.logging.PathableClassLoader.useSystemLoader()

        // Log class. Therefore if that class can be found, then the
        // TCCL must have been used to load it.
        PathableClassLoader emptyLoader = new PathableClassLoader(null);
       
        PathableClassLoader parentLoader = new PathableClassLoader(null);
        parentLoader.useSystemLoader("junit.");
        parentLoader.addLogicalLib("commons-logging");
        parentLoader.addLogicalLib("testclasses");
        // hack to ensure that the testcase classloader can't see
        // the custom MyLogFactoryImpl
        parentLoader.useExplicitLoader(MY_LOG_PKG + ".", emptyLoader);
View Full Code Here

Examples of org.apache.commons.logging.PathableClassLoader.useSystemLoader()

     */
    public static Test suite() throws Exception {
        Class thisClass = StandardTestCase.class;

        PathableClassLoader loader = new PathableClassLoader(null);
        loader.useSystemLoader("junit.");
        loader.addLogicalLib("testclasses");
        loader.addLogicalLib("commons-logging");
        loader.addLogicalLib("logkit");

        Class testClass = loader.loadClass(thisClass.getName());
View Full Code Here

Examples of org.apache.commons.logging.PathableClassLoader.useSystemLoader()

        // Having the test loaded via a loader above the tccl emulates the situation
        // where a web.xml file specifies ServletContextCleaner as a listener, and
        // that class is deployed via a shared classloader.

        PathableClassLoader parent = new PathableClassLoader(null);
        parent.useSystemLoader("junit.");
        parent.addLogicalLib("commons-logging");
        parent.addLogicalLib("servletapi");

        PathableClassLoader child = new PathableClassLoader(parent);
        child.setParentFirst(false);
View Full Code Here

Examples of org.apache.commons.logging.PathableClassLoader.useSystemLoader()

    /**
     * Return the tests included in this test suite.
     */
    public static Test suite() throws Exception {
        PathableClassLoader parent = new PathableClassLoader(null);
        parent.useSystemLoader("junit.");
        // the TestHandler class must be accessable from the System classloader
        // in order for java.util.logging.LogManager.readConfiguration to
        // be able to instantiate it. And this test case must see the same
        // class in order to be able to access its data. Yes this is ugly
        // but the whole jdk14 API is a ******* mess anyway.
View Full Code Here

Examples of org.apache.commons.logging.PathableClassLoader.useSystemLoader()

        // the TestHandler class must be accessable from the System classloader
        // in order for java.util.logging.LogManager.readConfiguration to
        // be able to instantiate it. And this test case must see the same
        // class in order to be able to access its data. Yes this is ugly
        // but the whole jdk14 API is a ******* mess anyway.
        parent.useSystemLoader("org.apache.commons.logging.jdk14.TestHandler");
        parent.addLogicalLib("commons-logging-api");

        PathableClassLoader child = new PathableClassLoader(parent);
        child.addLogicalLib("testclasses");
        child.addLogicalLib("commons-logging");
View Full Code Here

Examples of org.apache.commons.logging.PathableClassLoader.useSystemLoader()

        // Determine the URL to this .class file, so that we can then
        // append the priority dirs to it. For tidiness, load this
        // class through a dummy loader though this is not absolutely
        // necessary...
        PathableClassLoader dummy = new PathableClassLoader(null);
        dummy.useSystemLoader("junit.");
        dummy.addLogicalLib("testclasses");
        dummy.addLogicalLib("commons-logging");
       
        String thisClassPath = thisClass.getName().replace('.', '/') + ".class";
        URL baseUrl = dummy.findResource(thisClassPath);
View Full Code Here

Examples of org.apache.commons.logging.PathableClassLoader.useSystemLoader()

        //
        // A second properties file with priority=20 is also added,
        // so we can check that the first one in the classpath is
        // used.
        PathableClassLoader containerLoader = new PathableClassLoader(null);
        containerLoader.useSystemLoader("junit.");
        containerLoader.addLogicalLib("commons-logging");
       
        PathableClassLoader webappLoader = new PathableClassLoader(containerLoader);
        webappLoader.addLogicalLib("testclasses");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.