Package org.apache.hivemind

Examples of org.apache.hivemind.ErrorHandler


        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 = newLocation();

        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

        verifyControls();
    }

    public void testUnknownPrereq() throws Exception
    {
        ErrorHandler eh = (ErrorHandler) newMock(ErrorHandler.class);

        eh.error(LOG, "Unknown cartoon character dependency 'charlie' (for 'fred').", null, null);

        replayControls();

        Orderer o = new Orderer(LOG, eh, "cartoon character");
View Full Code Here

        verifyControls();
    }

    public void testUnknownPostreq() throws Exception
    {
        ErrorHandler eh = (ErrorHandler) newMock(ErrorHandler.class);

        eh.error(LOG, "Unknown cartoon character dependency 'dino' (for 'betty').", null, null);

        replayControls();

        Orderer o = new Orderer(LOG, eh, "cartoon character");
View Full Code Here

    }

    public void testCyclePre() throws Exception
    {
        MockControl c = newControl(ErrorHandler.class);
        ErrorHandler eh = (ErrorHandler) c.getMock();

        eh.error(
                LOG,
                "Unable to order cartoon character 'wilma' due to dependency cycle:"
                        + " A cycle has been detected from the initial object [wilma]",
                null,
                new ApplicationRuntimeException(""));
View Full Code Here

    }

    public void testCyclePost() throws Exception
    {
        MockControl c = newControl(ErrorHandler.class);
        ErrorHandler eh = (ErrorHandler) c.getMock();

        eh
                .error(
                        LOG,
                        "Unable to order cartoon character 'betty' due to dependency cycle: A cycle has been detected from the initial object [fred]",
                        null,
                        new ApplicationRuntimeException(""));
View Full Code Here

     * defined as private in another module.
     */
    public void testSchemaNotVisible()
    {
        MockControl ehControl = newControl(ErrorHandler.class);
        ErrorHandler errorHandler = (ErrorHandler) ehControl.getMock();

        Log log = LogFactory.getLog(XmlExtensionResolver.class);

        SchemaImpl schema = new SchemaImpl("foo.bar");
        schema.setId("Baz");
        schema.setVisibility(Visibility.PRIVATE);

        RegistryDefinition definition = new RegistryDefinitionImpl();

        Location l = newLocation();

        errorHandler.error(
                log,
                XmlImplMessages.schemaNotVisible("foo.bar.Baz", "zip.zoop"),
                l,
                null);

View Full Code Here

        verifyControls();
    }

    public void testSchemaNotFound()
    {
        ErrorHandler errorHandler = new DefaultErrorHandler();

        Log log = LogFactory.getLog(XmlModuleDescriptorProcessor.class);

        RegistryDefinition definition = new RegistryDefinitionImpl();

        Location l = newLocation();

        errorHandler.error(log, XmlImplMessages.unableToResolveSchema("foo.bar.Baz"), l, null);

        replayControls();

        ModuleDescriptor zipZoop = new ModuleDescriptor(null, errorHandler);
        zipZoop.setModuleId("zip.zoop");
View Full Code Here

        return e;
    }

    public void testContributionConditionalExpressionTrue()
    {
        ErrorHandler errorHandler = new DefaultErrorHandler();

        RegistryDefinition definition = new RegistryDefinitionImpl();

        replayControls();
View Full Code Here

        verifyControls();
    }

    public void testConditionalExpressionFalse()
    {
        ErrorHandler errorHandler = new DefaultErrorHandler();

        RegistryDefinition definition = new RegistryDefinitionImpl();

        replayControls();
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.