Package org.apache.tapestry.services

Examples of org.apache.tapestry.services.Infrastructure


    {
        IRequestCycle cycle = newCycle();

        ClassResolver cr = newMock(ClassResolver.class);
       
        Infrastructure infra = newMock(Infrastructure.class);

        PageRenderSupport prs = newMock(PageRenderSupport.class);

        expect(cycle.getInfrastructure()).andReturn(infra);

        expect(infra.getClassResolver()).andReturn(cr);

        trainGetAttribute(cycle, TapestryUtils.PAGE_RENDER_SUPPORT_ATTRIBUTE, prs);

        return cycle;
    }
View Full Code Here


    }

    public void testSuccessfulInfrastructureLookup()
    {
        MockControl ifrControl = newControl(Infrastructure.class);
        Infrastructure ifr = (Infrastructure) ifrControl.getMock();

        ResetEventHub coord = (ResetEventHub) newMock(ResetEventHub.class);

        ifr.getResetEventHub();
        ifrControl.setReturnValue(coord);

        replayControls();

        InfrastructureObjectProvider p = new InfrastructureObjectProvider();
View Full Code Here

    private void trainForConstructor(IPage page, IComponent component, ClassResolver resolver,
            ClassFinder classFinder)
    {
        IRequestCycle cycle = newCycle();
        Infrastructure infrastructure = (Infrastructure) newMock(Infrastructure.class);
        INamespace namespace = (INamespace) newMock(INamespace.class);

        trainGetPage(component, page);

        page.getRequestCycle();
        setReturnValue(page, cycle);

        cycle.getInfrastructure();
        setReturnValue(cycle, infrastructure);

        infrastructure.getClassResolver();
        setReturnValue(infrastructure, resolver);

        component.getNamespace();
        setReturnValue(component, namespace);

        namespace.getPropertyValue("org.apache.tapestry.bean-class-packages");
        setReturnValue(namespace, "mypackage");

        infrastructure.getClassFinder();
        setReturnValue(infrastructure, classFinder);
    }
View Full Code Here

    }

    private Infrastructure newInfrastructure(PageSource source)
    {
        MockControl control = newControl(Infrastructure.class);
        Infrastructure infrastructure = (Infrastructure) control.getMock();

        infrastructure.getPageSource();
        control.setReturnValue(source);

        return infrastructure;
    }
View Full Code Here

        IEngineService service = newService();
        ServiceMap map = newServiceMap("fred", service);

        MockControl control = newControl(Infrastructure.class);
        Infrastructure infrastructure = (Infrastructure) control.getMock();

        infrastructure.getPageSource();
        control.setReturnValue(newPageSource());

        infrastructure.getServiceMap();
        control.setReturnValue(map);

        RequestCycleEnvironment env = new RequestCycleEnvironment(newErrorHandler(),
                infrastructure, context, newStrategySource(), newBuilder());
        IEngine engine = newEngine();
View Full Code Here

    }

    public void testForgetPage()
    {
        RequestContext context = new RequestContext(null, null);
        Infrastructure infrastructure = newInfrastructure();
        PropertyPersistenceStrategySource source = newStrategySource();
        RequestCycleEnvironment env = new RequestCycleEnvironment(newErrorHandler(),
                infrastructure, context, source, newBuilder());
        IEngine engine = newEngine();
        IMonitor monitor = newMonitor();
View Full Code Here

TOP

Related Classes of org.apache.tapestry.services.Infrastructure

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.