Package org.apache.tapestry.web

Examples of org.apache.tapestry.web.WebContext


        verifyControls();
    }

    public void testGetRelativeResource()
    {
        WebContext context = newContext();

        replayControls();

        Resource r1 = new WebContextResource(context, "/foo/bar/baz.html");
        Resource r2 = r1.getRelativeResource("baz.gif");
View Full Code Here


        context.getInitParameterNames();
        control.setReturnValue(newEnumeration());

        replayControls();

        WebContext wc = new ServletWebContext(context);

        List l = wc.getInitParameterNames();

        checkList(l);

        verifyControls();
    }
View Full Code Here

        context.getInitParameter("artist");
        control.setReturnValue(value);

        replayControls();

        WebContext wc = new ServletWebContext(context);

        assertSame(value, wc.getInitParameterValue("artist"));

        verifyControls();
    }
View Full Code Here

        context.getAttributeNames();
        control.setReturnValue(newEnumeration());

        replayControls();

        WebContext wc = new ServletWebContext(context);

        List l = wc.getAttributeNames();

        checkList(l);

        verifyControls();
    }
View Full Code Here

        context.getAttribute("attr");
        control.setReturnValue(attribute);

        replayControls();

        WebContext wc = new ServletWebContext(context);

        assertSame(attribute, wc.getAttribute("attr"));

        verifyControls();
    }
View Full Code Here

        context.setAttribute("name", attribute);

        replayControls();

        WebContext wc = new ServletWebContext(context);

        wc.setAttribute("name", attribute);

        verifyControls();
    }
View Full Code Here

        context.removeAttribute("tonull");

        replayControls();

        WebContext wc = new ServletWebContext(context);

        wc.setAttribute("tonull", null);

        verifyControls();
    }
View Full Code Here

        context.getResource("/tapestry");
        control.setReturnValue(url);

        replayControls();

        WebContext wc = new ServletWebContext(context);

        assertSame(url, wc.getResource("/tapestry"));

        verifyControls();
    }
View Full Code Here

        replayControls();

        interceptLogging(ServletWebContext.class.getName());

        WebContext wc = new ServletWebContext(context);

        assertNull(wc.getResource("/tapestry"));

        verifyControls();

        assertLoggedMessage("Error getting context resource '/tapestry': Like this ever happens.");
    }
View Full Code Here

    public void test_Context_Spec_Resource()
    {
        IComponent comp = newMock(IComponent.class);
        checkOrder(comp, false);
        WebContext context = newMock(WebContext.class);
        IRequestCycle cycle = newMock(IRequestCycle.class);

        IComponentSpecification spec = new ComponentSpecification();
        WebContextResource base = new WebContextResource(context, "/WEB-INF/MyComponent.jwc");
        spec.setSpecificationLocation(base);
       
        ComponentResourceResolverImpl resolver = new ComponentResourceResolverImpl();

        expect(comp.getSpecification()).andReturn(spec).anyTimes();
        expect(context.getResource("/WEB-INF/MyComponent.html")).andReturn(newURL());

        replay();

        Resource resolved = resolver.findComponentResource(comp, cycle, null, ".html", null);
        assert resolved != null;
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.