Package net.sf.jsptest.compiler.jsp20.mock

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


        }
    }

    protected void invokeServlet(String httpMethod, Class jspClass) throws InstantiationException,
            IllegalAccessException, ServletException, IOException {
        ServletContext servletContext = new MockServletContext();
        ServletConfig servletConfig = new MockServletConfig(servletContext);
        MockHttpSession httpSession = new MockHttpSession();
        httpSession.setAttributes(sessionAttributes);
        MockHttpServletRequest request = new MockHttpServletRequest();
        request.setSession(httpSession);
View Full Code Here

        new File(info.getJavaSource()).getParentFile().mkdirs();
    }

    private JspServletWrapper makeWrapper(ServletContext servletContext, Options options,
            JspRuntimeContext jspRuntimeContext) throws MalformedURLException, JasperException {
        TagInfo tagInfo = new MockTagInfo();
        String tagFilePath = "/";
        URL tagFileJarUrl = new File(".").toURL();
        JspServletWrapper wrapper = new JspServletWrapper(servletContext, options, tagFilePath,
                tagInfo, jspRuntimeContext, tagFileJarUrl);
        return wrapper;
View Full Code Here

        return options.getCompilerSourceVM();
    }

    public TldLocationsCache getTldLocationsCache() {
        TldLocationsCache realCache = options.getTldLocationsCache();
        return new MockTldLocationsCache(realCache, servletContext);
    }
View Full Code Here

               HttpSessionManager sessionManager = Utils.getBeanReference(manager, HttpSessionManager.class);

               HttpSession session = sessionStore.get(id.getId());
               if(session == null)
               {
                  session = new MockHttpSession(id.getId(), new MockServletContext("/"));
               }
               sessionManager.setSession(session);
               sessionStore.put(id.getId(), session);
            }
         }
View Full Code Here

TOP

Related Classes of net.sf.jsptest.compiler.jsp20.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.