Package com.medallia.spider

Examples of com.medallia.spider.SpiderServlet$RequestHandler


    return "/" + Task.uriNameForTask(ct);
  }

  /** @return a ServletMock that forwards request to an instance of the given class */
  protected ServletMock makeServletMock(Class<? extends SpiderServlet> servletClass) throws Exception {
    final SpiderServlet servlet = servletClass.newInstance();
    servlet.init(new ServletConfig() {
      public String getServletName() { return null; }
      public String getInitParameter(String arg0) { return null; }
      public Enumeration getInitParameterNames() { return null; }
      public ServletContext getServletContext() {
        return new ServletContextAdapter() {
          @Override public String getRealPath(String relativePath) {
            return new File(JettyWebRunner.findWebRoot(), relativePath).getAbsolutePath();
          }
        };
      }
    });
    return new ServletMock() {
      public void service(HttpServletRequest req, HttpServletResponse res) throws Exception {
        servlet.service(req, res);
      }
      public void destroy() {
        servlet.destroy();
      }
    };
  }
View Full Code Here

TOP

Related Classes of com.medallia.spider.SpiderServlet$RequestHandler

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.