Package org.apache.commons.logging

Examples of org.apache.commons.logging.Log


    }

    public void testIncorrectTerminatorType()
    {
        ErrorHandler eh = getErrorHandler();
        Log log = getLog();

        eh.error(
            log,
            "-String- is not an instance of interface "
                + "org.apache.hivemind.lib.pipeline.StandardService suitable for "
View Full Code Here


    }

    public void testIncorrectFilterType()
    {
        ErrorHandler eh = getErrorHandler();
        Log log = getLog();

        eh.error(
            log,
            "-String- is not an instance of interface "
                + "org.apache.hivemind.lib.pipeline.StandardFilter suitable for "
View Full Code Here

        module.getClassResolver();
        moduleControl.setReturnValue(new DefaultClassResolver());

        ErrorHandler eh = getErrorHandler();
        Log log = getLog();

        replayControls();

        PipelineAssembler pa =
            new PipelineAssembler(
View Full Code Here

                instances = new HashMap();
                instancesByClassLoader.put(contextClassLoader, instances);
            }

            // get the log
            Log log = (Log) instances.get(name);
            if (log == null) {
                log = new GeronimoLog(name, logFactory.getInstance(name));
                instances.put(name, log);
            }
            return log;
View Full Code Here

     */
    public void testSetLogger()
    {
        AbstractConfiguration config = getEmptyConfiguration();
        assertNotNull("Default logger is null", config.getLogger());
        Log log = LogFactory.getLog(config.getClass());
        config.setLogger(log);
        assertSame("Logger was not set", log, config.getLogger());
    }
View Full Code Here

    {
        ClassFactory cf = new ClassFactoryImpl();

        Runnable r = (Runnable) newMock(Runnable.class);
        MockControl logControl = newControl(Log.class);
        Log log = (Log) logControl.getMock();

        LoggingInterceptorClassFactory f = new LoggingInterceptorClassFactory(cf);

        MockControl spControl = newControl(ServicePoint.class);
        ServicePoint sp = (ServicePoint) spControl.getMock();
       
        // Training

        sp.getServiceInterface();
        spControl.setReturnValue(Runnable.class);
               
        sp.getExtensionPointId();
        spControl.setReturnValue("foo.bar");
       
        replayControls();

        // Create interceptor
        InterceptorStackImpl is = new InterceptorStackImpl(log, sp, r);

        Class interceptorClass = f.constructInterceptorClass(is, Collections.EMPTY_LIST);
        Constructor c = interceptorClass.getConstructors()[0];

        Object interceptor =  c.newInstance(new Object[] { is.getServiceLog(), is.peek() });
        is.push(interceptor);

        Runnable ri = (Runnable) is.peek();

        verifyControls();

        // Training
       
        log.isDebugEnabled();
        logControl.setReturnValue(true);

        log.debug("BEGIN run()");
        log.debug("END run()");
       
        r.run();

        replayControls();
View Full Code Here

        factory.setBasePath("conf");
        factory.setAttributeSplittingDisabled(true);
        factory.setDelimiterParsingDisabled(true);
        factory.setListDelimiter('/');
        factory.setThrowExceptionOnMissing(true);
        Log log = LogFactory.getLog(getClass());
        factory.setLogger(log);
        factory.clearErrorListeners();
        factory.clearConfigurationListeners();
        ConfigurationListenerTestImpl l =
                new ConfigurationListenerTestImpl(factory);
View Full Code Here

    public void testMultiTenentConfiguration3() throws Exception
    {
        factory.setFile(MULTI_TENENT_FILE);
        StringWriter writer = new StringWriter();
        WriterAppender app = new WriterAppender(new SimpleLayout(), writer);
        Log log = LogFactory.getLog("TestLogger");
        Logger logger = ((Log4JLogger)log).getLogger();
        logger.addAppender(app);
        logger.setLevel(Level.DEBUG);
        logger.setAdditivity(false);
View Full Code Here

        factory.setBasePath("conf");
        factory.setAttributeSplittingDisabled(true);
        factory.setDelimiterParsingDisabled(true);
        factory.setListDelimiter('/');
        factory.setThrowExceptionOnMissing(true);
        Log log = LogFactory.getLog(getClass());
        factory.setLogger(log);
        factory.clearErrorListeners();
        factory.clearConfigurationListeners();
        ConfigurationListenerTestImpl l =
                new ConfigurationListenerTestImpl(factory);
View Full Code Here

    public void testMultiTenentConfiguration3() throws Exception
    {
        factory.setFile(MULTI_TENENT_FILE);
        StringWriter writer = new StringWriter();
        WriterAppender app = new WriterAppender(new SimpleLayout(), writer);
        Log log = LogFactory.getLog("TestLogger");
        Logger logger = ((Log4JLogger)log).getLogger();
        logger.addAppender(app);
        logger.setLevel(Level.DEBUG);
        logger.setAdditivity(false);
View Full Code Here

TOP

Related Classes of org.apache.commons.logging.Log

Copyright © 2018 www.massapicom. 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.