Package org.apache.hivemind

Examples of org.apache.hivemind.ErrorHandler


            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


            PropertyUtils.write(target, _propertyName, finalValue);
        }
        catch (Exception ex)
        {
            ErrorHandler eh = processor.getContributingModule().getErrorHandler();

            String message = RulesMessages.unableToSetProperty(_propertyName, target, ex);

            eh.error(LOG, message, element.getLocation(), ex);
        }

    }
View Full Code Here

            PropertyUtils.write(target, _propertyName, finalValue);
        }
        catch (Exception ex)
        {
            ErrorHandler eh = processor.getContributingModule().getErrorHandler();

            eh.error(
                LOG,
                RulesMessages.readContentFailure(processor, element, ex),
                element.getLocation(),
                ex);
        }
View Full Code Here

     */

    public void testContributionToNonVisibleConfigurationPoint() throws Exception
    {
        MockControl ehc = newControl(ErrorHandler.class);
        ErrorHandler errorHandler = (ErrorHandler) ehc.getMock();

        RegistryAssemblyImpl assembly = new RegistryAssemblyImpl();

        XmlResourceProcessor parser = new XmlResourceProcessor(getClassResolver(), errorHandler);

        RegistryInfrastructureConstructor cons = new RegistryInfrastructureConstructor(
                errorHandler, LOG, assembly);

        ModuleDescriptor md = parser.processResource(getResource("Privates.xml"));

        cons.addModuleDescriptor(md);

        md = parser.processResource(getResource("ContributePrivate.xml"));

        ContributionDescriptor cd = (ContributionDescriptor) md.getContributions().get(0);

        ImplementationDescriptor id = (ImplementationDescriptor) md.getImplementations().get(0);

        InterceptorDescriptor itd = (InterceptorDescriptor) id.getInterceptors().get(0);

        cons.addModuleDescriptor(md);

        assembly.performPostProcessing();

        // Training

        errorHandler
                .error(
                        LOG,
                        "Service point hivemind.test.privates.PrivateService is not visible to module hivemind.test.contribprivates.",
                        id.getInstanceBuilder().getLocation(),
                        null);

        errorHandler
                .error(
                        LOG,
                        "Service point hivemind.test.privates.PrivateService is not visible to module hivemind.test.contribprivates.",
                        itd.getLocation(),
                        null);

        errorHandler
                .error(
                        LOG,
                        "Configuration point hivemind.test.privates.PrivateConfig is not visible to module hivemind.test.contribprivates.",
                        cd.getLocation(),
                        null);

        errorHandler
                .error(
                        LOG,
                        "No module has contributed a service constructor for service point hivemind.test.privates.PrivateService.",
                        null,
                        null);
View Full Code Here

    public void testBuilderErrorHandlerFacet()
    {
        MockControl c = newControl(Module.class);
        Module m = (Module) c.getMock();

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

        MockControl pc = newControl(ServiceImplementationFactoryParameters.class);
        ServiceImplementationFactoryParameters p = (ServiceImplementationFactoryParameters) pc
                .getMock();
View Full Code Here

                .getMock();

        MockControl c = newControl(Module.class);
        Module module = (Module) c.getMock();

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

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

        MockControl messagesControl = newControl(Messages.class);
View Full Code Here

        MockControl mc = newControl(Module.class);
        Module module = (Module) mc.getMock();

        MockControl ehc = newControl(ErrorHandler.class);
        ErrorHandler eh = (ErrorHandler) ehc.getMock();

        Log log = (Log) newMock(Log.class);

        fp.getLog();
        fpc.setReturnValue(log);
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(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

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.