Package org.apache.hivemind

Examples of org.apache.hivemind.ErrorLog


     * validator.
     */

    public void testIncomplete()
    {
        ErrorLog log = (ErrorLog) newMock(ErrorLog.class);
        Location l = fabricateLocation(11);

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

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

        log
                .error(
                        "Method 'public abstract void org.apache.tapestry.enhance.TestEnhancedClassValidator$AbstractBase.foo()' (declared in class org.apache.tapestry.enhance.TestEnhancedClassValidator$AbstractBase) has no implementation in class org.apache.tapestry.enhance.TestEnhancedClassValidator$AbstractBase (or enhanced subclass org.apache.tapestry.enhance.TestEnhancedClassValidator$Incomplete).",
                        l,
                        null);

View Full Code Here


        Location l = fabricateLocation(11);

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

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

        Throwable ex = new ApplicationRuntimeException(EnhanceMessages
                .claimedProperty("specification"));

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

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

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

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

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

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

        InjectAssetWorker w = new InjectAssetWorker();
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 testGetChanges()
    {
        IRequestCycle cycle = newCycle();
        ErrorLog log = newLog();

        MockControl sourcec = newControl(PropertyPersistenceStrategySource.class);
        PropertyPersistenceStrategySource source = (PropertyPersistenceStrategySource) sourcec
                .getMock();
View Full Code Here

    }

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

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

        IComponentSpecification spec = newSpec("foobar", "session");
View Full Code Here

    public void testUnknownStategy()
    {
        Location l = fabricateLocation(12);
        Throwable inner = new ApplicationRuntimeException("Simulated error.");
        ErrorLog log = newLog();

        IRequestCycle cycle = newCycle();

        MockControl sourcec = newControl(PropertyPersistenceStrategySource.class);
        PropertyPersistenceStrategySource source = (PropertyPersistenceStrategySource) sourcec
                .getMock();

        MockControl componentc = newControl(IComponent.class);
        IComponent component = (IComponent) componentc.getMock();

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

        MockControl psc = newControl(IPropertySpecification.class);
        IPropertySpecification ps = (IPropertySpecification) psc.getMock();

        component.getSpecification();
        componentc.setReturnValue(spec);

        spec.getPropertySpecification("zip");
        specc.setReturnValue(ps);

        ps.getPersistence();
        psc.setReturnValue("unknown");

        source.getStrategy("unknown");
        sourcec.setThrowable(inner);

        ps.getLocation();
        psc.setReturnValue(l);

        log.error("Simulated error.", l, inner);

        replayControls();

        PageRecorderImpl pr = new PageRecorderImpl("SomePage", cycle, source, log);
View Full Code Here

    }

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

        Creator creator = new Creator();

        PageFixture page = (PageFixture) creator.newInstance(PageFixture.class);
View Full Code Here

    }

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

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

        IComponent component = (IComponent) newMock(IComponent.class);
View Full Code Here

    }

    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

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.