Examples of MockServletContext


Examples of com.mockobjects.servlet.MockServletContext

        parameters.setProperty("key2", "value2");
        parameters.setProperty("list", "value1, value2");
        parameters.setProperty("listesc", "value1\\,value2");

        // create a servlet context
        ServletContext context = new MockServletContext()
        {
            public String getInitParameter(String key)
            {
                return parameters.getProperty(key);
            }
View Full Code Here

Examples of com.mockrunner.mock.web.MockServletContext

       
        try {
            mockFactory = new WebMockObjectFactory();
           
            // create mock RollerContext
            MockServletContext ctx = mockFactory.getMockServletContext();
            ctx.setRealPath("/", ".");
            rollerContext = new MockRollerContext();
            rollerContext.init(ctx);
           
            mockRequest = mockFactory.getMockRequest();
            mockRequest.setContextPath("/roller");
View Full Code Here

Examples of com.sun.facelets.mock.MockServletContext

    protected void setUp() throws Exception {
        super.setUp();
        URI context = this.getContext();

        this.servletContext = new MockServletContext(context);
        this.servletRequest = new MockHttpServletRequest(this.servletContext,
                context);
        this.servletResponse = new MockHttpServletResponse();

        // initialize Faces
View Full Code Here

Examples of com.sun.faces.mock.MockServletContext

    // Set up instance variables required by this test case.
    public void setUp() {
       
        // Set up Servlet API Objects
        servletContext = new MockServletContext();
        servletContext.addInitParameter("appParamName", "appParamValue");
        servletContext.setAttribute("appScopeName", "appScopeValue");
        config = new MockServletConfig(servletContext);
        session = new MockHttpSession();
        session.setAttribute("sesScopeName", "sesScopeValue");
View Full Code Here

Examples of gobo.slim3.tester.MockServletContext

  public MockHttpServletResponse response;
  public MockHttpServletRequest request;

  public ControllerTester() {
    this.request = new MockHttpServletRequest(new MockServletContext());
    this.response = new MockHttpServletResponse();
  }
View Full Code Here

Examples of net.sf.jsptest.compiler.jsp20.mock.MockServletContext

    this.servletClass = servletClass;
  }

  public JspExecution request(String httpMethod, Map requestAttributes,
      Map sessionAttributes, Map requestParameters) {
    ServletContext servletContext = new MockServletContext();
    ServletConfig servletConfig = new MockServletConfig(servletContext);
    MockHttpSession session = configureHttpSession(sessionAttributes);
    MockHttpServletRequest request = configureHttpServletRequest(
        httpMethod, requestAttributes, requestParameters, session);
    MockHttpServletResponse response = new MockHttpServletResponse();
View Full Code Here

Examples of net.sourceforge.cruisecontrol.mock.MockServletContext

        servlet = null;
    }

    public void testGetRootDir() {
        MockServletConfig config = new MockServletConfig();
        MockServletContext context = new MockServletContext();
        config.setServletContext(context);
       
        try {
            servlet.getRootDir(config);
            fail("should have exception when required attributes not set");
        } catch (ServletException e) {
        }

        config.setInitParameter("rootDir", ".");
        try {
            servlet.getRootDir(config);
        } catch (ServletException e) {
            fail("shouldn't throw exception when valid rootDir parameter set");
        }
       
        context.setInitParameter("logDir", "this directory does not exist");
        try {
            servlet.getRootDir(config);
        } catch (ServletException e) {
            fail("good rootDir but bad logDir should work");
        }
       
        config = new MockServletConfig();
        context = new MockServletContext();
        config.setServletContext(context);

        context.setInitParameter("logDir", ".");
        try {
            servlet.getRootDir(config);
        } catch (ServletException e) {
            fail("shouldn't throw exception when valid logDir parameter set");
        }
View Full Code Here

Examples of net.sourceforge.stripes.mock.MockServletContext

    }

    public TestEngine( Properties props )
        throws WikiException
    {
        super( new MockServletContext( "test" ), "test", cleanTestProps( props ) );
       
        // Stash the WikiEngine in the servlet context
        ServletContext servletContext = this.getServletContext();
        servletContext.setAttribute("com.ecyrd.jspwiki.WikiEngine", this);
    }
View Full Code Here

Examples of org.apache.click.servlet.MockServletContext

     * simulate a complete servlet environment.
     */
    void configure() {
        try {
            if (getServletContext() == null) {
                setServletContext(new MockServletContext());
            }

            getServletContext().setWebappPath(webappPath);

            if (getServletConfig() == null) {
View Full Code Here

Examples of org.apache.myfaces.test.mock.MockServletContext

        }
    }

    protected void initServletObjects()
    {
        this.servletContext = new MockServletContext();
        this.servletConfig = new MockServletConfig(this.servletContext);
        applyContainerConfig();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.