Package org.apache.tapestry.services

Examples of org.apache.tapestry.services.Infrastructure


        return map;
    }

    public void testForgetPage()
    {
        Infrastructure infrastructure = newMock(Infrastructure.class);
        PageSource pageSource = new PageSource();
       
        expect(infrastructure.getPageSource()).andReturn(pageSource);
       
        PropertyPersistenceStrategySource source = newStrategySource();
        RequestCycleEnvironment env = new RequestCycleEnvironment(newErrorHandler(),
                infrastructure, source, newBuilder());
        IEngine engine = newEngine();
View Full Code Here


        return newMock(ClassResolver.class);
    }

    private Infrastructure newInfrastructure(ClassResolver resolver)
    {
        Infrastructure inf = newMock(Infrastructure.class);

        expect(inf.getClassResolver()).andReturn(resolver);

        return inf;
    }
View Full Code Here

        IFormComponent field = newField(form);
        ClassResolver resolver = newResolver();

        IRequestCycle cycle = newCycle();

        Infrastructure inf = newInfrastructure(resolver);

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

        PageRenderSupport prs = newSupport();
View Full Code Here

        IForm form = newForm("myform");
        IFormComponent field = newField(form);
        ClassResolver resolver = newResolver();
       
        IRequestCycle cycle = newCycle();
        Infrastructure inf = newInfrastructure(resolver);

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

        PageRenderSupport prs = newSupport();
View Full Code Here

        return (AbsoluteURLBuilder) newMock(AbsoluteURLBuilder.class);
    }

    private Infrastructure newInfrastructure(PageSource source)
    {
        Infrastructure infrastructure = (Infrastructure) newMock(Infrastructure.class);

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

        return infrastructure;
    }
View Full Code Here

        RequestContext context = new RequestContext(null, null);

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

        Infrastructure infrastructure = newInfrastructure(newPageSource());

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

        RequestCycleEnvironment env = new RequestCycleEnvironment(newErrorHandler(),
                infrastructure, 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, source, newBuilder());
        IEngine engine = newEngine();
        IMonitor monitor = newMonitor();
View Full Code Here

        verify();
    }

    public void testSuccessfulInfrastructureLookup()
    {
        Infrastructure ifr = newMock(Infrastructure.class);

        ResetEventHub coord = newMock(ResetEventHub.class);

        expect(ifr.getResetEventHub()).andReturn(coord);

        replay();

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

        IComponent comp1 = newMock(IComponent.class);
        IRequestCycle cycle = newMock(IRequestCycle.class);
        IMarkupWriter writer = newMock(IMarkupWriter.class);
        NestedMarkupWriter nested = newMock(NestedMarkupWriter.class);

        Infrastructure infra = newMock(Infrastructure.class);

        List parts = new ArrayList();
        parts.add("id1");

        DojoAjaxResponseBuilder builder = new DojoAjaxResponseBuilder(cycle, writer, parts);

        render.render(NullWriter.getSharedInstance(), cycle);

        expect(comp1.getClientId()).andReturn("id1").anyTimes();
        expect(comp1.peekClientId()).andReturn("id1").anyTimes();
        expect(cycle.getInfrastructure()).andReturn(infra);
        expect(infra.getOutputEncoding()).andReturn("UTF-8");

        writer.printRaw("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
        writer.printRaw("<!DOCTYPE html "
                        + "PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" "
                        + "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\" [" + NEWLINE
View Full Code Here

    {
        IPage page = newMock(IPage.class);
        checkOrder(page, false);
       
        IRequestCycle cycle = newMock(IRequestCycle.class);
        Infrastructure infra = newMock(Infrastructure.class);
        IMarkupWriter writer = newBufferWriter();

        Location l = newLocation();

        RequestLocaleManager rlm = newMock(RequestLocaleManager.class);
        MarkupWriterSource mrs = newMock(MarkupWriterSource.class);
        WebResponse resp = newMock(WebResponse.class);
        AssetFactory assetFactory = newMock(AssetFactory.class);
        IEngineService pageService = newEngineService();

        List errorPages = new ArrayList();

        List parts = new ArrayList();
        parts.add("id1");

        PrintWriter pw = newPrintWriter();
       
        rlm.persistLocale();
        expect(cycle.getInfrastructure()).andReturn(infra).anyTimes();
        expect(infra.getOutputEncoding()).andReturn(("UTF-8")).anyTimes();
        expect(cycle.getParameters("updateParts")).andReturn((String[])parts.toArray(new String[parts.size()]));
        expect(resp.getPrintWriter(isA(ContentType.class))).andReturn(pw);
        expect(mrs.newMarkupWriter(eq(pw), isA(ContentType.class))).andReturn(writer);

        expect(cycle.getAttribute(TapestryUtils.PAGE_RENDER_SUPPORT_ATTRIBUTE)).andReturn(null);
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.