Package org.apache.hivemind

Examples of org.apache.hivemind.ErrorLog


    }

    public void testChangeWhileLocked()
    {
        IRequestCycle cycle = newCycle();
        ErrorLog log = newLog();

        MockControl pagec = newControl(IPage.class);
        IPage page = (IPage) pagec.getMock();

        PropertyPersistenceStrategySource source = (PropertyPersistenceStrategySource) newMock(PropertyPersistenceStrategySource.class);

        page.getExtendedId();
        pagec.setReturnValue("MyPage");

        log
                .error(
                        "Change to persistent property foobar of MyPage has been ignored."
                                + " Persistent properties may only be changed prior to the rendering of the response page.",
                        null,
                        null);
View Full Code Here


    public void testChangeToNonSpecifiedProperty()
    {
        Resource r = fabricateLocation(99).getResource();
        IRequestCycle cycle = newCycle();
        ErrorLog log = newLog();

        MockControl pagec = newControl(IPage.class);
        IPage page = (IPage) pagec.getMock();

        MockControl specc = newControl(IComponentSpecification.class);
        IComponentSpecification spec = (IComponentSpecification) specc.getMock();

        PropertyPersistenceStrategySource source = (PropertyPersistenceStrategySource) newMock(PropertyPersistenceStrategySource.class);

        page.getSpecification();
        pagec.setReturnValue(spec);

        spec.getPropertySpecification("foobar");
        specc.setReturnValue(null);

        page.getExtendedId();
        pagec.setReturnValue("TestPage");

        page.getSpecification();
        pagec.setReturnValue(spec);

        spec.getSpecificationLocation();
        specc.setReturnValue(r);

        log.error(
                "A property change event for property foobar of TestPage was observed, "
                        + "but no such property is identified in the specification (" + r + ").",
                null,
                null);
View Full Code Here

        MockControl control = newControl(EnhancementOperation.class);
        EnhancementOperation op = (EnhancementOperation) control.getMock();

        IComponentSpecification spec = newSpec("fred", "barney", l);

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

        op.getPropertyType("barney");
        control.setReturnValue(IComponent.class);

        op.claimProperty("barney");
        control.setThrowable(ex);

        op.getBaseClass();
        control.setReturnValue(BaseComponent.class);

        log.error(EnhanceMessages.errorAddingProperty("barney", BaseComponent.class, ex), l, ex);

        replayControls();

        InjectComponentWorker w = new InjectComponentWorker();
View Full Code Here

        List list = new ArrayList();
        list.add(firstc);
        list.add(secondc);

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

        first.service(cycle);

        log.error(ImplMessages.dupeService("duplicate", firstc), l, null);

        replayControls();

        ServiceMapImpl m = new ServiceMapImpl();
View Full Code Here

        assertSame(overrideFred, infra.getProperty("fred"));
    }

    public void testDuplicate()
    {
        ErrorLog log = (ErrorLog) newMock(ErrorLog.class);

        Location l1 = fabricateLocation(99);
        Location l2 = fabricateLocation(132);

        Object fredModal = new Object();
        Object duplicateFred = new Object();

        List l = new ArrayList();
        l.add(newContribution("fred", "bedrock", fredModal, l1));
        InfrastructureContribution conflict = newContribution("fred", "bedrock", duplicateFred, l2);
        l.add(conflict);

        log.error(ImplMessages.duplicateInfrastructureContribution(conflict, l1), l2, null);

        replayControls();

        InfrastructureImpl infra = new InfrastructureImpl();
        infra.setNormalContributions(l);
View Full Code Here

        MockControl specc = newControl(IComponentSpecification.class);
        IComponentSpecification spec = (IComponentSpecification) specc.getMock();

        Location l = fabricateLocation(21);

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

        op.findUnclaimedAbstractProperties();
        opc.setReturnValue(Collections.singletonList("fred"));

        Throwable ex = new ApplicationRuntimeException("Arbitrary error.");

        op.getPropertyType("fred");
        opc.setThrowable(ex);

        op.getBaseClass();
        opc.setReturnValue(BaseComponent.class);

        spec.getLocation();
        specc.setReturnValue(l);

        log.error(EnhanceMessages.errorAddingProperty("fred", BaseComponent.class, ex), l, ex);

        replayControls();

        AbstractPropertyWorker w = new AbstractPropertyWorker();
        w.setErrorLog(log);
View Full Code Here

        opc.setThrowable(ex);

        op.getBaseClass();
        opc.setReturnValue(BaseComponent.class);

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

        log
                .error(
                        "Error adding property 'wilma' to class org.apache.tapestry.BaseComponent: Simulated error.",
                        l,
                        ex);
View Full Code Here

    }

    public void testInitializeUnknownScope()
    {
        Location l = fabricateLocation(55);
        ErrorLog log = (ErrorLog) newMock(ErrorLog.class);

        StateObjectContribution c = new StateObjectContribution();
        c.setName("fred");
        c.setScope("wierd");
        c.setLocation(l);

        Map applicationContributions = new HashMap();
        applicationContributions.put("fred", c);

        log.error(StateMessages.unknownScope("fred", "wierd"), l, null);

        replayControls();

        SOMRegistryImpl r = new SOMRegistryImpl();
        r.setApplicationContributions(applicationContributions);
View Full Code Here

        control.setThrowable(ex);

        op.getBaseClass();
        control.setReturnValue(BaseComponent.class);

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

        log.error(
                EnhanceMessages.errorAddingProperty(w.MESSAGES_PROPERTY, BaseComponent.class, ex),
                null,
                ex);

        replayControls();
View Full Code Here

        opc.setThrowable(ex);

        op.getBaseClass();
        opc.setReturnValue(BaseComponent.class);

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

        log
                .error(
                        "Error adding property 'wilma' to class org.apache.tapestry.BaseComponent: Simulated error.",
                        l,
                        ex);
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.