Package org.apache.hivemind

Examples of org.apache.hivemind.ErrorHandler


        TranslatorContribution tc = new TranslatorContribution();
        tc.setName("invalid");

        Registry r = createRegistryForContribution(tc);

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

        eh.error(
            TranslatorManager.LOG,
            "Translator contribution 'invalid' must specify either the service-id or class attribute.",
            null,
            null);
View Full Code Here


        ServicePoint point = (ServicePoint) pointControl.getMock();

        InvokeFactoryServiceConstructor c = new InvokeFactoryServiceConstructor();

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

        // Training !

        point.getServiceLog();
        pointControl.setReturnValue(LOG);

        module.getServicePoint("foo.bar.Baz");
        moduleControl.setReturnValue(factoryPoint);

        factoryPoint.getParametersCount();
        factoryPointControl.setReturnValue(Occurances.REQUIRED);

        factoryPoint.getService(ServiceImplementationFactory.class);
        factoryPointControl.setReturnValue(factory);

        factoryPoint.getParametersSchema();
        factoryPointControl.setReturnValue(null);

        module.getErrorHandler();
        moduleControl.setReturnValue(eh);

        String message =
            ImplMessages.wrongNumberOfParameters("foo.bar.Baz", 0, Occurances.REQUIRED);

        eh.error(LOG, message, null, null);

        point.getExtensionPointId();
        pointControl.setReturnValue("bleep.Bloop");

        point.getServiceInterface();
View Full Code Here

        l.add(c2);

        ObjectTranslator ot = new ObjectTranslator();

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

        ot.setLog(log);
        ot.setErrorHandler(eh);
        ot.setContributions(l);

        eh.error(
            log,
            "Object provider prefix 'dupe' duplicates a previous prefix at " + l1 + ".",
            l2,
            null);
View Full Code Here

        ObjectTranslator ot = new ObjectTranslator();

        Module module = (Module) newMock(Module.class);

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

        ot.setLog(log);
        ot.setErrorHandler(eh);
        ot.setContributions(Collections.EMPTY_LIST);

        ot.initializeService();

        eh.error(
            log,
            "Object provider selector 'badprefix' is not properly formatted.",
            null,
            null);
View Full Code Here

        ObjectTranslator ot = new ObjectTranslator();

        Module module = (Module) newMock(Module.class);

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

        ot.setLog(log);
        ot.setErrorHandler(eh);
        ot.setContributions(Collections.EMPTY_LIST);

        ot.initializeService();

        eh.error(log, "No object provider exists for prefix 'zap'.", null, null);

        replayControls();

        Object result = ot.translate(module, Object.class, "zap:foo", null);
View Full Code Here

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

        ErrorHandler eh = new DefaultErrorHandler();

        m.getErrorHandler();
        c.setReturnValue(eh);

        replayControls();
View Full Code Here

        p.addProperty(new BuilderServiceIdFacet());

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

        ErrorHandler eh = new DefaultErrorHandler();
        ClassResolver cr = new DefaultClassResolver();

        MockControl messagesControl = newControl(Messages.class);
        Messages messages = (Messages) messagesControl.getMock();
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);

        BuilderParameter parameter = new BuilderParameter();

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

        module.getService(StringHolder.class);
        mc.setThrowable(new ApplicationRuntimeException("Simulated failure."));

        module.getErrorHandler();
        mc.setReturnValue(eh);

        eh.error(
            log,
            "Unable to autowire property stringHolder of service foo.bar: Simulated failure.",
            null,
            new ApplicationRuntimeException(""));
        ehc.setMatcher(new ExceptionAwareArgumentsMatcher());
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

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.