Examples of DefaultErrorHandler


Examples of org.apache.hivemind.impl.DefaultErrorHandler

     */
    public void _testLinePreciseErrorReporting() throws Exception
    {
        Resource resource = getResource("missingModuleId.groovy");

        ErrorHandler handler = new DefaultErrorHandler();
        DescriptorParser parser = new DescriptorParser(handler);

        parser.initialize(resource, getClassResolver());

        GroovyCodeSource source = new GroovyCodeSource(resource.getResourceURL());
View Full Code Here

Examples of org.apache.hivemind.impl.DefaultErrorHandler

public class TestXmlResourceProcessor extends FrameworkTestCase
{
    public void testMissingURLResource() throws Exception
    {
        XmlResourceProcessor processor = new XmlResourceProcessor(getClassResolver(),
                new DefaultErrorHandler());

        Resource[] missingResources = new Resource[]
        { new FileResource("foo"), new URLResource(new URL("file://MissingFile")) };
        Class[] exceptionTypes = new Class[]
        { NullPointerException.class, UnknownHostException.class };
View Full Code Here

Examples of org.apache.hivemind.impl.DefaultErrorHandler

    private ModuleDescriptor _md;

    public RegistrySerializer()
    {
        _handler = new DefaultErrorHandler();
    }
View Full Code Here

Examples of org.apache.hivemind.impl.DefaultErrorHandler

    private ObjectNameBuilder objectNameBuilder;

    public void setUp()
    {
        errorHandler = new DefaultErrorHandler();
        logControl = (MockControl) newControl(Log.class);
        log = LogFactory.getLog(MBeanRegistry.class);
        serverControl = newControl(MBeanServer.class);
        server = (MBeanServer) serverControl.getMock();
        objectNameBuilder = new ObjectNameBuilderImpl();
View Full Code Here

Examples of org.apache.hivemind.impl.DefaultErrorHandler

        verifyControls();
    }

    public void testDupe() throws Exception
    {
        Orderer o = new Orderer(new DefaultErrorHandler(), "cartoon character");

        o.add("FRED", "flintstone", null, null);
        o.add("BARNEY", "rubble", null, null);

        interceptLogging();
View Full Code Here

Examples of org.apache.hivemind.impl.DefaultErrorHandler

        verifyControls();
    }

    public void testPreStartDupe() throws Exception
    {
        Orderer o = new Orderer(new DefaultErrorHandler(), "cartoon character");

        o.add("FRED", "fred", "*", null);
        o.add("BARNEY", "barney", "*", null);
        o.add("WILMA", "wilma", "betty", null);
        o.add("BETTY", "betty", null, null);
View Full Code Here

Examples of org.apache.hivemind.impl.DefaultErrorHandler

        verifyControls();
    }

    public void testPostStarDupe() throws Exception
    {
        Orderer o = new Orderer(new DefaultErrorHandler(), "cartoon character");

        o.add("FRED", "fred", null, "wilma");
        o.add("BARNEY", "barney", null, "*");
        o.add("WILMA", "wilma", null, "*");
        o.add("BETTY", "betty", null, null);
View Full Code Here

Examples of org.apache.hivemind.impl.DefaultErrorHandler

                + "first, conflicting with 'barney' (at unknown location).");
    }

    public void testNoObjects() throws Exception
    {
        Orderer o = new Orderer(new DefaultErrorHandler(), "cartoon character");

        List l = o.getOrderedObjects();

        assertEquals(0, l.size());
    }
View Full Code Here

Examples of org.apache.hivemind.impl.DefaultErrorHandler

    }

    protected ModuleDescriptor parse(String file) throws Exception
    {
        Resource location = getResource(file);
        DefaultErrorHandler eh = new DefaultErrorHandler();

        RegistryAssemblyImpl assembly = new RegistryAssemblyImpl(eh);

        DescriptorParser p = new DescriptorParser(eh, assembly);
View Full Code Here

Examples of org.apache.log.util.DefaultErrorHandler

        formatter.setFormat("%7.7{priority} %{time}   [%8.8{category}] " +
                            "(%{uri}) %{thread}/%{class:short}: %{message}\\n%{throwable}");
        final ServletOutputLogTarget servTarget = new ServletOutputLogTarget(this.servletContext, formatter);

        final Hierarchy defaultHierarchy = Hierarchy.getDefaultHierarchy();
        final ErrorHandler errorHandler = new DefaultErrorHandler();
        defaultHierarchy.setErrorHandler(errorHandler);
        defaultHierarchy.setDefaultLogTarget(servTarget);
        defaultHierarchy.setDefaultPriority(logPriority);
        final Logger logger = new LogKitLogger(Hierarchy.getDefaultHierarchy().getLoggerFor(""));
        final String loggerManagerClass =
            this.getInitParameter("logger-class", LogKitLoggerManager.class.getName());

        // the log4j support requires currently that the log4j system is already configured elsewhere

        final LoggerManager loggerManager =
                newLoggerManager(loggerManagerClass, defaultHierarchy);
        ContainerUtil.enableLogging(loggerManager, logger);

        final DefaultContext subcontext = new DefaultContext(this.appContext);
        subcontext.put("servlet-context", this.servletContext);
        subcontext.put("context-work", this.workDir);
        if (this.servletContextPath == null) {
            File logSCDir = new File(this.workDir, "log");
            logSCDir.mkdirs();
            if (logger.isWarnEnabled()) {
                logger.warn("Setting context-root for LogKit to " + logSCDir);
            }
            subcontext.put("context-root", logSCDir.toString());
        } else {
            subcontext.put("context-root", this.servletContextPath);
        }

        try {
            ContainerUtil.contextualize(loggerManager, subcontext);
            this.loggerManager = loggerManager;

            if (loggerManager instanceof Configurable) {
                //Configure the logkit management
                String logkitConfig = getInitParameter("logkit-config", "/WEB-INF/logkit.xconf");

                // test if this is a qualified url
                InputStream is = null;
                if (logkitConfig.indexOf(':') == -1) {
                    is = this.servletContext.getResourceAsStream(logkitConfig);
                    if (is == null) is = new FileInputStream(logkitConfig);
                } else {
                    URL logkitURL = new URL(logkitConfig);
                    is = logkitURL.openStream();
                }
                final DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
                final Configuration conf = builder.build(is);
                ContainerUtil.configure(loggerManager, conf);
            }

            // let's configure log4j
            final String log4jConfig = getInitParameter("log4j-config", null);
            if ( log4jConfig != null ) {
                final Log4JConfigurator configurator = new Log4JConfigurator(subcontext);

                // test if this is a qualified url
                InputStream is = null;
                if ( log4jConfig.indexOf(':') == -1) {
                    is = this.servletContext.getResourceAsStream(log4jConfig);
                    if (is == null) is = new FileInputStream(log4jConfig);
                } else {
                    final URL log4jURL = new URL(log4jConfig);
                    is = log4jURL.openStream();
                }
                configurator.doConfigure(is, LogManager.getLoggerRepository());
            }

            ContainerUtil.initialize(loggerManager);
        } catch (Exception e) {
            errorHandler.error("Could not set up Cocoon Logger, will use screen instead", e, null);
        }

        this.log = this.loggerManager.getLoggerForCategory(accesslogger);
       
        final String deprecationLevel = getInitParameter("forbidden-deprecation-level", "ERROR");
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.