コード例 #1
0
  protected void initServlet(String webXml) throws Exception {
    ServletRunner runner = new ServletRunner(new File(srcdir, webXml), "");
    client = runner.newClient();
    ic = client.newInvocation("http://localhost:8080/app1");

    originalServletContext = ic.getServlet().getServletConfig().getServletContext();
    servletContext = createServletContextWrapper(true);
    request = ic.getRequest();
    response = ic.getResponse();
  }
コード例 #2
0
 protected String doTest() throws IOException, SAXException {
   ServletUnitClient sc = sr.newClient();
   WebRequest request = new GetMethodWebRequest("http://incongru.net/empty");
   WebResponse response = sc.getResponse(request);
   return response.getText();
 }
コード例 #3
0
 protected void initTest(String ctxScope, String sesScope, String reqScope, FilterDef[] filters)
     throws IOException, SAXException {
   InputStream webXml = getWebXml(filters, ctxScope, sesScope, reqScope);
   sr = new ServletRunner(webXml);
   sr.registerServlet("empty", EmptyServlet.class.getName());
 }