Package org.apache.click.pages

Examples of org.apache.click.pages.RedirectToHtm


        MockContainer container = new MockContainer("web");
        container.start();
        String contextPath = container.getRequest().getContextPath();
        container.getRequest().setMethod("GET");

        RedirectToHtm page = (RedirectToHtm) container.testPage(RedirectToHtm.class);

        // assert that the Page successfully redirected to test.htm
        String expected = contextPath + "/test.htm";
        assertEquals(expected, container.getRedirect());
        container.stop();
View Full Code Here


     * CLK-456
     */
    public void testRedirectDuplicateContextPath() {
        MockContext context = MockContext.initContext();
        String contextPath = context.getRequest().getContextPath();
        RedirectToHtm page = new RedirectToHtm();
        String redirect = "/test.htm";

        // assert that the Page redirect to /contextPath/test.htm
        String expected = contextPath + redirect;
        page.setRedirect(redirect);
        assertEquals(expected, page.getRedirect());

        // assert that setting redirect to a path already prefixed with contextPath
        // won't add a second contextPath
        page.setRedirect(contextPath + "/test.htm");
        assertEquals(expected, page.getRedirect());
    }
View Full Code Here

        MockContainer container = new MockContainer("web");
        container.start();
        String contextPath = container.getRequest().getContextPath();
        container.getRequest().setMethod("GET");

        RedirectToHtm page = (RedirectToHtm) container.testPage(RedirectToHtm.class);

        // assert that the Page successfully redirected to test.htm
        String expected = contextPath + "/test.htm";
        assertEquals(expected, container.getRedirect());
        container.stop();
View Full Code Here

     * CLK-456
     */
    public void testRedirectDuplicateContextPath() {
        MockContext context = MockContext.initContext();
        String contextPath = context.getRequest().getContextPath();
        RedirectToHtm page = new RedirectToHtm();
        String redirect = "/test.htm";

        // assert that the Page redirect to /contextPath/test.htm
        String expected = contextPath + redirect;
        page.setRedirect(redirect);
        assertEquals(expected, page.getRedirect());

        // assert that setting redirect to a path already prefixed with contextPath
        // won't add a second contextPath
        page.setRedirect(contextPath + "/test.htm");
        assertEquals(expected, page.getRedirect());
    }
View Full Code Here

     * CLK-456
     */
    public void testRedirectDuplicateContextPath() {
        MockContext context = MockContext.initContext();
        String contextPath = context.getRequest().getContextPath();
        RedirectToHtm page = new RedirectToHtm();
        String redirect = "/test.htm";

        // assert that the Page redirect to /contextPath/test.htm
        String expected = contextPath + redirect;
        page.setRedirect(redirect);
        assertEquals(expected, page.getRedirect());

        // assert that setting redirect to a path already prefixed with contextPath
        // won't add a second contextPath
        page.setRedirect(contextPath + "/test.htm");
        assertEquals(expected, page.getRedirect());
    }
View Full Code Here

TOP

Related Classes of org.apache.click.pages.RedirectToHtm

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.