Package net.sourceforge.cruisecontrol.mock

Examples of net.sourceforge.cruisecontrol.mock.MockPageContext


        super(name);
    }

    public void testCreateLink() throws JspException {
        LinkTag tag = new LinkTag();
        MockPageContext pageContext = new MockPageContext();
        pageContext.setHttpServletRequest(new MockServletRequest("context", "servlet"));
        tag.setPageContext(pageContext);
        tag.setId("link");
        assertEquals(Tag.SKIP_BODY, tag.doStartTag());
        assertEquals(Tag.EVAL_PAGE, tag.doEndTag());

        assertEquals("/context/servlet", pageContext.getAttribute("link"));
    }
View Full Code Here


        assertEquals("/context/servlet", pageContext.getAttribute("link"));
    }

    public void testCreateLinkExcludeLog() throws JspException {
        LinkTag tag = new LinkTag();
        MockPageContext pageContext = new MockPageContext();
        final MockServletRequest mockRequest = new MockServletRequest("context", "servlet");
        pageContext.setHttpServletRequest(mockRequest);
        mockRequest.addParameter("log", "logFile");
        mockRequest.addParameter("other", "value");
        tag.setPageContext(pageContext);
        tag.setId("link");
        assertEquals(Tag.SKIP_BODY, tag.doStartTag());
        assertEquals(Tag.EVAL_PAGE, tag.doEndTag());

        assertEquals("/context/servlet?other=value", pageContext.getAttribute("link"));

    }
View Full Code Here

    private File log2;
    private File log3;

    public void setUp() {
        tag = new CruiseControlTagSupport();
        MockPageContext pageContext = new MockPageContext();
        tag.setPageContext(pageContext);
        request = new MockServletRequest("context", "servlet");
        pageContext.setHttpServletRequest(request);

        logDir = new File("testresults/");
        if (!logDir.exists()) {
            assertTrue("Failed to create test result dir", logDir.mkdir());
        }
View Full Code Here

    public void setUp() {
        tabTag = new TabTag();
        tabTag.setName("tab1");
        tabTag.setLabel("Tab 1");

        final MockPageContext pageContext = new MockPageContext();
        tabTag.setPageContext(pageContext);
        request = new MockServletRequest();
        pageContext.setHttpServletRequest(request);
    }
View Full Code Here

    protected void setUp() {
        tabSheet = new TabSheetTag();
        content = new MockBodyContent();
        tabSheet.setBodyContent(content);
        pageContext = new MockPageContext();
        request = new MockServletRequest("context", "servlet");
        pageContext.setHttpServletRequest(request);
        tabSheet.setPageContext(pageContext);
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.cruisecontrol.mock.MockPageContext

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.