Package org.apache.hivemind

Examples of org.apache.hivemind.ErrorLog


    public void test_Class_Annotation_Failure()
    {
        ClassResolver resolver = new DefaultClassResolver();

        ErrorLog log = newErrorLog();
        EnhancementOperation op = newOp(DeprecatedBean.class);
        IComponentSpecification spec = newSpec();

        ClassAnnotationEnhancementWorker classWorker = newMock(ClassAnnotationEnhancementWorker.class);

        Throwable t = new RuntimeException("Simulated failure.");

        DescribedLocation location = newClassLocation(DeprecatedBean.class, Deprecated.class);

        classWorker.performEnhancement(op, spec, DeprecatedBean.class, location);
        expectLastCall().andThrow(t);

        log.error("An error occured processing annotation @java.lang.Deprecated() of "
                + "class org.apache.tapestry.annotations.DeprecatedBean: Simulated failure.",
                null,
                t);

        replay();
View Full Code Here


        List<SecondaryAnnotationWorker> secWorkers = new ArrayList<SecondaryAnnotationWorker>();
        secWorkers.add(secondary);
       
        EnhancementOperation op = newOp();
        IComponentSpecification spec = newSpec();
        ErrorLog log = newErrorLog();

        Method method = findMethod(AnnotatedPage.class, "getPropertyWithInitialValue");

        Resource classResource = newResource(AnnotatedPage.class);

        RuntimeException cause = new RuntimeException("Forced.");

        expect(secondary.canEnhance(method)).andThrow(cause);
       
        log.error(AnnotationMessages.failureEnhancingMethod(method, cause), null, cause);
       
        replay();
       
        AnnotationEnhancementWorker worker = new AnnotationEnhancementWorker();
        worker.setSecondaryAnnotationWorkers(secWorkers);
View Full Code Here

        IComponentSpecification spec = newSpecification(newInjects("fred", "barney", l));
        MockControl opc = newControl(EnhancementOperation.class);
        EnhancementOperation op = (EnhancementOperation) opc.getMock();

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

        ApplicationStateManager asm = newASM();

        op.addField("_$applicationStateManager", ApplicationStateManager.class, asm);

        op.getPropertyType("fred");
        opc.setReturnValue(Map.class);

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

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

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

        replayControls();

        InjectStateWorker w = new InjectStateWorker();
        w.setApplicationStateManager(asm);
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.claimProperty("barney");
        control.setThrowable(ex);

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

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

        replayControls();

        InjectBeanWorker w = new InjectBeanWorker();
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

        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

        MockControl pc = newControl(InjectedValueProvider.class);
        InjectedValueProvider p = (InjectedValueProvider) pc.getMock();

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

        op.getPropertyType("fred");
        opc.setReturnValue(null);

        op.claimProperty("fred");
View Full Code Here

        MockControl pc = newControl(InjectedValueProvider.class);
        InjectedValueProvider p = (InjectedValueProvider) pc.getMock();

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

        op.getPropertyType("fred");
        opc.setReturnValue(IEngineService.class);

        op.claimProperty("fred");
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

        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

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.