Package org.apache.tapestry.web

Examples of org.apache.tapestry.web.WebContext


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

        replayControls();

        WebContext wc = new PortletWebContext(context);

        List l = wc.getInitParameterNames();

        checkList(l);

        verifyControls();
    }
View Full Code Here


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

        replayControls();

        WebContext wc = new PortletWebContext(context);

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

        verifyControls();
    }
View Full Code Here

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

        replayControls();

        WebContext wc = new PortletWebContext(context);

        List l = wc.getAttributeNames();

        checkList(l);

        verifyControls();
    }
View Full Code Here

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

        replayControls();

        WebContext wc = new PortletWebContext(context);

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

        verifyControls();
    }
View Full Code Here

        context.setAttribute("name", attribute);

        replayControls();

        WebContext wc = new PortletWebContext(context);

        wc.setAttribute("name", attribute);

        verifyControls();
    }
View Full Code Here

        context.removeAttribute("tonull");

        replayControls();

        WebContext wc = new PortletWebContext(context);

        wc.setAttribute("tonull", null);

        verifyControls();
    }
View Full Code Here

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

        replayControls();

        WebContext wc = new PortletWebContext(context);

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

        verifyControls();
    }
View Full Code Here

        replayControls();

        interceptLogging(PortletWebContext.class.getName());

        WebContext wc = new PortletWebContext(context);

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

        verifyControls();

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

    public void testFoundInSubdir() throws Exception
    {
        PortletConfig config = newConfig("myportlet");

        MockControl contextc = newControl(WebContext.class);
        WebContext context = (WebContext) contextc.getMock();

        IApplicationSpecification specification = newSpecification();

        // Any arbitrary file will work here.

        URL fakeURL = getClass().getResource("hivemodule.xml");

        context.getResource("/WEB-INF/myportlet/myportlet.application");
        contextc.setReturnValue(fakeURL);

        Resource expectedResource = new WebContextResource(context,
                "/WEB-INF/myportlet/myportlet.application");
View Full Code Here

    public void testFoundInRootDir() throws Exception
    {
        PortletConfig config = newConfig("myportlet");

        MockControl contextc = newControl(WebContext.class);
        WebContext context = (WebContext) contextc.getMock();

        IApplicationSpecification specification = newSpecification();

        // Any arbitrary file will work here.

        URL fakeURL = getClass().getResource("hivemodule.xml");

        context.getResource("/WEB-INF/myportlet/myportlet.application");
        contextc.setReturnValue(null);

        context.getResource("/WEB-INF/myportlet.application");
        contextc.setReturnValue(fakeURL);

        Resource expectedResource = new WebContextResource(context,
                "/WEB-INF/myportlet.application");
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.