Package org.apache.hivemind

Examples of org.apache.hivemind.ErrorHandler


    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


    }

    public void testTerminatorConflict()
    {
        MockControl c = newControl(ErrorHandler.class);
        ErrorHandler eh = (ErrorHandler) c.getMock();

        Log log = getLog();

        eh.error(
            log,
            "Terminator ss2 for pipeline service foo.bar conflicts with "
                + "previous terminator (ss1, at unknown location) and has been ignored.",
            null,
            null);
View Full Code Here

        verifyControls();
    }

    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 "
                + "use as part of the pipeline for service foo.bar.",
            null,
View Full Code Here

        verifyControls();
    }

    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 "
                + "use as part of the pipeline for service foo.bar.",
            null,
View Full Code Here

        moduleControl.setReturnValue("foo.bar");

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

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

        replayControls();

        PipelineAssembler pa =
View Full Code Here

        catch (Exception ex)
        {
            // Have to decide if we need to display the location of the rule
            // or the element.

            ErrorHandler errorHandler = processor.getContributingModule().getErrorHandler();
            errorHandler.error(LOG, RulesMessages.unableToSetElementProperty(
                    propertyName,
                    target,
                    processor,
                    element,
                    ex), element.getLocation(), ex);
View Full Code Here

            PropertyUtils.write(target, _propertyName, finalValue);

        }
        catch (Exception ex)
        {
            ErrorHandler eh = processor.getContributingModule().getErrorHandler();

            eh.error(LOG, RulesMessages
                    .readAttributeFailure(_attributeName, element, processor, ex), element
                    .getLocation(), ex);
        }

    }
View Full Code Here

        attempt("SYMBOL Ends with ${partial", "${symbol} Ends with ${partial");
    }

    public void testMissingSymbol()
    {
        ErrorHandler eh = (ErrorHandler) newMock(ErrorHandler.class);
        Location l = newLocation();

        MockControl control = newControl(SymbolSource.class);
        SymbolSource source = (SymbolSource) control.getMock();

        // Training

        source.valueForSymbol("symbol");
        control.setReturnValue(null);

        eh.error(
            LogFactory.getLog(SymbolExpanderImpl.class),
            XmlImplMessages.noSuchSymbol("symbol"),
            l,
            null);
View Full Code Here

        log.error("Error at classpath:/foo/bar/Baz.module, line 13: Bad frob value.", ex);

        replayControls();

        ErrorHandler eh = new DefaultErrorHandler();

        eh.error(log, "Bad frob value.", l, ex);

        verifyControls();
    }
View Full Code Here

        log.error("Error: Bad frob value.", ex);

        replayControls();

        ErrorHandler eh = new DefaultErrorHandler();

        eh.error(log, "Bad frob value.", null, ex);

        verifyControls();
    }
View Full Code Here

TOP

Related Classes of org.apache.hivemind.ErrorHandler

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.