Package org.apache.tapestry.web

Examples of org.apache.tapestry.web.WebContext


    {
        String requestedResource = "/org/apache/tapestry/asset/tapestry-in-action-missing.png";
        WebRequest request = newMock(WebRequest.class);
        checkOrder(request, false);
        WebResponse response = newMock(WebResponse.class);
        WebContext context = newMock(WebContext.class);
        IRequestCycle cycle = newMock(IRequestCycle.class);
        ResourceMatcher matcher = newMock(ResourceMatcher.class);
        ResourceDigestSource digestSource = newMock(ResourceDigestSource.class);
        RequestExceptionReporter exceptionReporter = newMock(RequestExceptionReporter.class);
View Full Code Here


    {
        Resource base = newResource();
        Resource relative = newResource();
        Location l = newLocation();
        IComponentSpecification spec = newMock(IComponentSpecification.class);
        WebContext context = newMock(WebContext.class);

        trainGetRelativeResource(base, "/", base);
        trainGetRelativeResource(base, "asset.png", relative);
        trainGetLocalization(relative, Locale.FRENCH, null);

        trainGetRelativeResource(base, "asset.png", relative);
        trainGetLocalization(relative, Locale.FRENCH, null);
        expect(spec.getLocation()).andReturn(l);
        expect(l.getResource()).andReturn(null);

        expect(context.getResource("/asset_fr.png")).andReturn(null);
        expect(context.getResource("/asset.png")).andReturn(null);

        replay();

        ContextAssetFactory factory = new ContextAssetFactory();
        factory.setLocalizer(new DefaultResourceLocalizer());
View Full Code Here

   
    public void test_Create_Absolute_Asset()
    {
        Location l = newLocation();
        URL url = newURL();
        WebContext context = newMock(WebContext.class);
        trainGetResource(context, "/asset_fr.png", url);

        replay();

        ContextAssetFactory factory = new ContextAssetFactory();
View Full Code Here

    }

    public void test_Create_Absolute_Asset_Missing()
    {
        Location l = newLocation();
        WebContext context = newMock(WebContext.class);

        trainGetResource(context, "/asset_fr.png", null);
        trainGetResource(context, "/asset.png", null);

        replay();
View Full Code Here

   
    public void test_Create_Asset_Encode_URL()
    {
        Location l = newLocation();
        URL url = newURL();
        WebContext context = newMock(WebContext.class);
        IRequestCycle rc = newMock(IRequestCycle.class);

        trainGetResource(context, "/asset_fr.png", url);
       
        replay();
View Full Code Here

        ClassResolver resolver = new DefaultClassResolver();

        builder.addModuleDescriptorProvider(new XmlModuleDescriptorProvider(resolver));

        String name = config.getPortletName();
        WebContext context = new PortletWebContext(config.getPortletContext());

        addModuleIfExists(builder, resolver, context, "/WEB-INF/" + name + "/hivemodule.xml");
        addModuleIfExists(builder, resolver, context, "/WEB-INF/hivemodule.xml");

        return builder.constructRegistry(Locale.getDefault());
View Full Code Here

        return getRequest().getContextPath();
    }

    public Resource getContextRoot()
    {
        WebContext context = (WebContext) getProperty("context");

        return new WebContextResource(context, "/");
    }
View Full Code Here

    private ApplicationGlobals _globals;

    public void initialize(HttpServlet servlet)
    {
        ServletContext servletContext = servlet.getServletContext();
        WebContext context = new ServletWebContext(servletContext);

        _globals.storeServletContext(servletContext);
        _globals.storeWebContext(context);
    }
View Full Code Here

    public void testCreateAbsoluteAsset()
    {
        Location l = newLocation();
        URL url = newURL();
        WebContext context = (WebContext) newMock(WebContext.class);

        trainGetResource(context, "/asset_fr.png", url);

        replayControls();
View Full Code Here

    }

    public void testCreateAbsoluteAssetMissing()
    {
        Location l = newLocation();
        WebContext context = (WebContext) newMock(WebContext.class);

        trainGetResource(context, "/asset_fr.png", null);
        trainGetResource(context, "/asset.png", null);

        replayControls();
View Full Code Here

TOP

Related Classes of org.apache.tapestry.web.WebContext

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.