Package org.apache.hivemind

Examples of org.apache.hivemind.ErrorHandler


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

        MockControl errorHandlerControl = newControl(ErrorHandler.class);
        ErrorHandler errorHandler = (ErrorHandler) errorHandlerControl.getMock();

        log.info("Executing task Failure.");

        errorHandler.error(
            log,
            "Exception while executing task Failure: Failure!",
            null,
            new ApplicationRuntimeException(""));
        errorHandlerControl.setMatcher(new ExceptionAwareArgumentsMatcher());
View Full Code Here


    {
        Location location = createLocation();
        EventProducer p = new EventProducer();
        Object c = "NeverwinterNights";

        ErrorHandler eh = (ErrorHandler) newMock(ErrorHandler.class);

        eh.error(
            null,
            "NeverwinterNights does not implement any listener interfaces compatible with EventProducer.",
            location,
            null);
View Full Code Here

    {
        Location location = createLocation();
        EventProducer p = new EventProducer();
        Object c = "SoulCailiburII";

        ErrorHandler eh = (ErrorHandler) newMock(ErrorHandler.class);

        eh.error(
            null,
            "EventProducer does not implement an event set named 'fred'.",
            location,
            null);
View Full Code Here

    {
        Location location = createLocation();
        EventProducer p = new EventProducer();
        Object c = "SplinterCell";

        ErrorHandler eh = (ErrorHandler) newMock(ErrorHandler.class);

        eh.error(
            null,
            "SplinterCell does not implement the java.beans.PropertyChangeListener listener interface (for event set 'propertyChange' of EventProducer).",
            location,
            null);
View Full Code Here

    {
        Location location = createLocation();
        Object p = "DanceDanceRevolution";
        Object c = "SplinterCell";

        ErrorHandler eh = (ErrorHandler) newMock(ErrorHandler.class);

        eh.error(
            null,
            "SplinterCell does not implement any listener interfaces compatible with DanceDanceRevolution.",
            location,
            null);
View Full Code Here

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

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

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

        // Training

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

        eh.error(
            LogFactory.getLog(SymbolExpander.class),
            ImplMessages.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

        verifyControls();
    }

    public void testStrictErrorHandler()
    {
        ErrorHandler eh = new StrictErrorHandler();
        Throwable cause = new NullPointerException();

        try
        {
            eh.error(null, "An error message.", null, cause);
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertEquals("Error: An error message.", ex.getMessage());
View Full Code Here

        }
    }

    public void testStrictErrorHandlerWithLocation()
    {
        ErrorHandler eh = new StrictErrorHandler();
        Throwable cause = new NullPointerException();
        Location l = fabricateLocation(21);

        try
        {
            eh.error(null, "An error message.", l, cause);
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertEquals("Error at " + l + ": An error message.", ex.getMessage());
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.