Ejemplo n.º 1
0
  public void testExample1() {
    String servlet = "/Example1";
    String descriptionOpen = contextPathOpen + servlet;
    String descriptionDeny = contextPathDeny + servlet;

    StringBuffer output = new StringBuffer();
    boolean success = doIndividualTest(servlet, null, 302, username, contextPathOpen, output);
    int index = output.indexOf("https://");
    if (success && (index != -1)) {
      stat.addStatus(descriptionOpen, stat.PASS);
    } else stat.addStatus(descriptionOpen, stat.FAIL);

    output = new StringBuffer();
    success = doIndividualTest(servlet, null, 302, username, contextPathDeny, output);
    if (success) stat.addStatus(descriptionDeny, stat.PASS);
    else stat.addStatus(descriptionDeny, stat.FAIL);
  }
Ejemplo n.º 2
0
  public void testCovered3bPut() {
    String servlet = "/Covered3b";
    String method = "PUT";
    String descriptionOpen = contextPathOpen + servlet + "-" + method;
    String descriptionDeny = contextPathDeny + servlet + "-" + method;

    StringBuffer output = new StringBuffer();
    boolean success = doIndividualTest(servlet, method, 302, username, contextPathOpen, output);
    int index = output.indexOf("https://");
    if (success && (index != -1)) {
      stat.addStatus(descriptionOpen, stat.PASS);
    } else stat.addStatus(descriptionOpen, stat.FAIL);

    output = new StringBuffer();
    success = doIndividualTest(servlet, method, 302, username, contextPathDeny, output);
    if (success) stat.addStatus(descriptionDeny, stat.PASS);
    else stat.addStatus(descriptionDeny, stat.FAIL);
  }