Package org.apache.shale.test.mock

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


    /** {@inheritDoc} */
    @Override
    protected void setUp() throws Exception {
        super.setUp();
        MockServletContext servletContext = new MockServletContext();
        servletContext
                .addInitParameter("initParameter1", "initParameterValue1");
        MockHttpSession session = new MockHttpSession(servletContext);
        MockHttpServletRequest request = new MockHttpServletRequest(session);
        MockHttpServletResponse response = new MockHttpServletResponse();
        request.addHeader("Content-Type", "text/html");
View Full Code Here


    RuntimeConfiguredContext context;
   
    /** {@inheritDoc} */
    @Override
    protected void setUp() throws Exception {
        MockServletContext rootContext = new MockServletContext();
        rootContext.addInitParameter("initParameter1", "parameterValue1");
        rootContext.addInitParameter("initParameter2", "parameterValue2");
        context = new RuntimeConfiguredContext(rootContext);
        context.setInitParameter("initParameter1", "newParameterValue1");
        context.setInitParameter("newInitParameter", "newParameterValue2");
    }
View Full Code Here

    /** {@inheritDoc} */
    @Override
    protected void setUp() throws Exception {
        super.setUp();
        servletContext = new MockServletContext();
        applicationContext = EasyMock.createMock(TilesApplicationContext.class);
        Map<String, Object> applicationScope = new HashMap<String, Object>();
        applicationScope.put("applicationAttribute1", "applicationValue1");
        applicationScope.put("applicationAttribute2", "applicationValue2");
        EasyMock.expect(applicationContext.getApplicationScope()).andReturn(
View Full Code Here

        threadContextClassLoader = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(new URLClassLoader(new URL[0],
                this.getClass().getClassLoader()));

        // Set up Servlet API Objects
        servletContext = new MockServletContext();
        config = new MockServletConfig(servletContext);
        session = new MockHttpSession();
        session.setServletContext(servletContext);
        request = new MockHttpServletRequest(session);
        request.setServletContext(servletContext);
View Full Code Here

        threadContextClassLoader = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(new URLClassLoader(new URL[0],
                this.getClass().getClassLoader()));
       
        // Set up Servlet API Objects
        servletContext = new MockServletContext();
        config = new MockServletConfig(servletContext);
        session = new MockHttpSession();
        session.setServletContext(servletContext);
        request = new MockHttpServletRequest(session);
        request.setServletContext(servletContext);
View Full Code Here

TOP

Related Classes of org.apache.shale.test.mock.MockServletContext

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.