Package org.apache.hivemind

Examples of org.apache.hivemind.ErrorLog


        ClassFactory cf = new ClassFactoryImpl();
        DefaultImplementationBuilderImpl dib = new DefaultImplementationBuilderImpl();

        dib.setClassFactory(cf);

        ErrorLog log = newErrorLog();

        replayControls();

        PipelineAssembler pa = new PipelineAssembler(log, "foo.bar", StandardService.class,
                StandardFilter.class, new ClassFactoryImpl(), dib);
View Full Code Here


        ClassFactory cf = new ClassFactoryImpl();
        DefaultImplementationBuilderImpl dib = new DefaultImplementationBuilderImpl();

        dib.setClassFactory(cf);

        ErrorLog log = newErrorLog();

        PipelineAssembler pa = new PipelineAssembler(log, "foo.bar", StandardService.class,
                StandardFilter.class, new ClassFactoryImpl(), dib);

        replayControls();
View Full Code Here

        MockControl fpc = newControl(ServiceImplementationFactoryParameters.class);
        ServiceImplementationFactoryParameters fp = (ServiceImplementationFactoryParameters) fpc
                .getMock();

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

        fp.getServiceInterface();
        fpc.setReturnValue(Runnable.class);

        StrategyParameter p = buildParameter(Number.class, adapter, l, null);

        fp.getFirstParameter();
        fpc.setReturnValue(p);

        fp.getErrorLog();
        fpc.setReturnValue(log);

        log.error(
                StrategyMessages.strategyWrongInterface(adapter, Number.class, Runnable.class),
                l,
                new ClassCastException());
        logc.setMatcher(new AggregateArgumentsMatcher(new ArgumentMatcher[]
        { null, null, new TypeMatcher() }));
View Full Code Here

        MockControl fpc = newControl(ServiceImplementationFactoryParameters.class);
        ServiceImplementationFactoryParameters fp = (ServiceImplementationFactoryParameters) fpc
                .getMock();

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

        fp.getServiceInterface();
        fpc.setReturnValue(Runnable.class);

        factory.newClass("NewClass", Object.class);
        factoryControl.setReturnValue(cf);

        cf.addInterface(Runnable.class);
        cf.addField("_registry", StrategyRegistry.class);

        cf.addConstructor(new Class[]
        { StrategyRegistry.class }, null, "_registry = $1;");
        cfc.setMatcher(new AggregateArgumentsMatcher(new ArrayMatcher()));

        cf.addMethod(
                Modifier.PRIVATE,
                new MethodSignature(Runnable.class, "_getStrategy", new Class[]
                { Object.class }, null),
                "return (java.lang.Runnable) _registry.getStrategy($1.getClass());");
        cfc.setReturnValue(mf);

        MethodSignature sig = new MethodSignature(void.class, "run", null, null);

        cf.addMethod(Modifier.PUBLIC, sig, "{  }");
        cfc.setReturnValue(mf);

        fp.getErrorLog();
        fpc.setReturnValue(log);

        fp.getFirstParameter();
        // Slight fudge: we return the location itself when we should return
        // an object with this location.
        fpc.setReturnValue(l);

        log.error(StrategyMessages.improperServiceMethod(sig), l, null);

        fp.getServiceId();
        fpc.setReturnValue("foo.Bar");

        ClassFabUtils.addToStringMethod(cf, StrategyMessages.toString("foo.Bar", Runnable.class));
View Full Code Here

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

        ErrorLog el = (ErrorLog) newMock(ErrorLog.class);

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

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

        ErrorLog el = (ErrorLog) newMock(ErrorLog.class);

        el.error("EventProducer does not implement an event set named 'fred'.", location, null);

        replayControls();

        EventLinker l = new EventLinkerImpl(el);
View Full Code Here

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

        ErrorLog el = (ErrorLog) newMock(ErrorLog.class);

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

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

        ErrorLog el = (ErrorLog) newMock(ErrorLog.class);

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

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

        MockControl errorLogc = newControl(ErrorLog.class);
        ErrorLog errorLog = (ErrorLog) errorLogc.getMock();

        fp.getLog();
        fpc.setReturnValue(log);

        fp.getServiceId();
        fpc.setReturnValue("foo.Bar");

        fp.getInvokingModule();
        fpc.setReturnValue(module);

        module.resolveType("org.apache.hivemind.service.impl.InitializerErrorRunnable");
        mc.setReturnValue(InitializerErrorRunnable.class);

        fp.getErrorLog();
        fpc.setReturnValue(errorLog);

        Throwable cause = new ApplicationRuntimeException("Failure in initializeService().");

        String message = ServiceMessages.unableToInitializeService(
                "foo.Bar",
                "initializeService",
                InitializerErrorRunnable.class,
                cause);

        errorLog.error(message, l, new ApplicationRuntimeException(""));
        errorLogc.setMatcher(new AggregateArgumentsMatcher(new ArgumentMatcher[]
        { null, null, new TypeMatcher() }));

        BuilderParameter p = new BuilderParameter();
        p.setClassName(InitializerErrorRunnable.class.getName());
View Full Code Here

        Log log = (Log) logc.getMock();

        MockControl messagesControl = newControl(Messages.class);
        Messages messages = (Messages) messagesControl.getMock();

        ErrorLog errorLog = (ErrorLog) newMock(ErrorLog.class);

        // Normally I try and get all the invocations into chronological
        // order ... but with this refactoring, that's painful; these
        // are in an order that appeases junit.
View Full Code Here

TOP

Related Classes of org.apache.hivemind.ErrorLog

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.