Examples of InjectedValueProvider


Examples of org.apache.tapestry.services.InjectedValueProvider

    {
        Object injectedValue = new Object();
        Location l = fabricateLocation(12);

        MockControl control = newControl(InjectedValueProvider.class);
        InjectedValueProvider provider = (InjectedValueProvider) control.getMock();

        provider.obtainValue("spring:bean", l);
        control.setReturnValue(injectedValue);

        ValueConverter converter = newValueConverter();

        replayControls();
View Full Code Here

Examples of org.apache.tapestry.services.InjectedValueProvider

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

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

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

        op.claimProperty("fred");

        p.obtainValue("service:barney", l);

        pc.setReturnValue(injectedValue);

        op.addInjectedField("_$fred", injectedValue);
        opc.setReturnValue("_$fred");
View Full Code Here

Examples of org.apache.tapestry.services.InjectedValueProvider

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

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

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

        op.claimProperty("wilma");

        p.obtainValue("service:betty", l);
        pc.setReturnValue(injectedValue);

        op.addInjectedField("_$wilma", injectedValue);
        opc.setReturnValue("_$wilma");
View Full Code Here

Examples of org.apache.tapestry.services.InjectedValueProvider

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

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

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

        op.claimProperty("fred");

        p.obtainValue("service:barney", l);
        pc.setReturnValue(null);

        replayControls();

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

Examples of org.apache.tapestry.services.InjectedValueProvider

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

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

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

        op.claimProperty("fred");

        p.obtainValue("service:barney", l);
        pc.setReturnValue("INJECTED-VALUE");

        replayControls();

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

Examples of org.apache.tapestry.services.InjectedValueProvider

        InjectSpecification spec = newSpec("fred", "service:barney", l);

        EnhancementOperation op = newMock(EnhancementOperation.class);

        InjectedValueProvider p = newMock(InjectedValueProvider.class);

        expect(op.getPropertyType("fred")).andReturn(null);

        op.claimReadonlyProperty("fred");

        expect(p.obtainValue("service:barney", l)).andReturn(injectedValue);

        // When the same bean is injected multiple times, the field name
        // returned won't match the field name suggested; make sure the code
        // generation used the correct field name.
View Full Code Here

Examples of org.apache.tapestry.services.InjectedValueProvider

        InjectSpecification spec = newSpec("wilma", "service:betty", l);

        EnhancementOperation op = newMock(EnhancementOperation.class);

        InjectedValueProvider p = newMock(InjectedValueProvider.class);

        expect(op.getPropertyType("wilma")).andReturn(IEngineService.class);

        op.claimReadonlyProperty("wilma");

        expect(p.obtainValue("service:betty", l)).andReturn(injectedValue);

        expect(op.addInjectedField("_$wilma", IEngineService.class, injectedValue)).andReturn("_$wilma");

        op.addMethod(Modifier.PUBLIC, new MethodSignature(IEngineService.class, "getWilma", null,
                null), "return _$wilma;", l);
View Full Code Here

Examples of org.apache.tapestry.services.InjectedValueProvider

        InjectSpecification spec = newSpec("fred", "service:barney", l);

        EnhancementOperation op = newMock(EnhancementOperation.class);

        InjectedValueProvider p = newMock(InjectedValueProvider.class);

        expect(op.getPropertyType("fred")).andReturn(null);

        op.claimReadonlyProperty("fred");

        expect(p.obtainValue("service:barney", l)).andReturn(null);

        replay();

        InjectObjectWorker w = new InjectObjectWorker();
        w.setProvider(p);
View Full Code Here

Examples of org.apache.tapestry.services.InjectedValueProvider

        InjectSpecification spec = newSpec("fred", "service:barney", l);

        EnhancementOperation op = newMock(EnhancementOperation.class);

        InjectedValueProvider p = newMock(InjectedValueProvider.class);

        expect(op.getPropertyType("fred")).andReturn(IEngineService.class);

        op.claimReadonlyProperty("fred");

        expect(p.obtainValue("service:barney", l)).andReturn("INJECTED-VALUE");

        replay();

        InjectObjectWorker w = new InjectObjectWorker();
        w.setProvider(p);
View Full Code Here

Examples of org.apache.tapestry.services.InjectedValueProvider

       
        InjectSpecification spec = newSpec("fred", "service:barney", l);
       
        EnhancementOperation op = newMock(EnhancementOperation.class);
       
        InjectedValueProvider p = newMock(InjectedValueProvider.class);
       
        expect(op.getPropertyType("fred")).andReturn(Map.class);
       
        op.claimReadonlyProperty("fred");
       
        expect(p.obtainValue("service:barney", l)).andReturn(new HashMap());
       
        expect(op.addInjectedField("_$fred", Map.class, injectedValue)).andReturn("_$fred");
       
        op.addMethod(Modifier.PUBLIC, new MethodSignature(Map.class, "getFred", null,
                null), "return _$fred;", l);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.