Package net.sourceforge.cruisecontrol.mock

Examples of net.sourceforge.cruisecontrol.mock.MockServletRequest


    /*
     * Test for void service(HttpServletRequest, HttpServletResponse)
     */
    public void testService() throws ServletException, IOException {
        MockServletRequest request = new MockServletRequest();
        MockServletResponse response = new MockServletResponse();
        File file = File.createTempFile("tmp", ".html");
        file.deleteOnExit();
        final File dir = file.getParentFile();
        request.setPathInfo(file.getName());
        servlet = new FileServlet() {
            File getRootDir(ServletConfig servletconfig) {
                return dir;
            }
        };
View Full Code Here


    private File logDir;

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

        tag.setPageContext(pageContext);
        tag.setBodyContent(new MockBodyContent());
View Full Code Here

    protected void setUp() throws Exception {
        tag = new ArtifactsLinkTag();

        pageContext = new MockPageContext();
        request = new MockServletRequest("context", "servlet");
        pageContext.setHttpServletRequest(request);

        tag.setPageContext(pageContext);

        logDir = new File("testresults/ArtifactsLinkTagTest");
View Full Code Here

    }

    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());
View Full Code Here

    }

    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());
View Full Code Here

    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

        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.MockServletRequest

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.