Package fitnesse.http

Examples of fitnesse.http.RequestBuilder


  @Test
  public void testShutdownCalledFromServer() throws Exception {
    Thread thread = new Thread() {
      public void run() {
        try {
          RequestBuilder request = new RequestBuilder("/?responder=shutdown");
          ResponseParser.performHttpRequest("localhost", FitNesseUtil.PORT, request);
          doneShuttingDown = true;
        }
        catch (Exception e) {
          e.printStackTrace();
View Full Code Here


      System.exit(response.getStatus());
    }
  }

  public ResponseParser buildAndSendRequest() throws IOException {
    RequestBuilder request = buildRequest();
    ResponseParser response = ResponseParser.performHttpRequest(hostname, port, request);
    return response;
  }
View Full Code Here

    ResponseParser response = ResponseParser.performHttpRequest(hostname, port, request);
    return response;
  }

  public RequestBuilder buildRequest() {
    RequestBuilder request = new RequestBuilder("/?responder=shutdown");
    if (username != null)
      request.addCredentials(username, password);
    return request;
  }
View Full Code Here

    return getXmlDocument("pages");
  }

  private Document getXmlDocument(String documentType) throws IOException, SAXException {
    String remotePathName = PathParser.render(remotePath);
    RequestBuilder builder = new RequestBuilder("/" + remotePathName);
    builder.addInput("responder", "proxy");
    builder.addInput("type", documentType);
    builder.setHostAndPort(remoteHostname, remotePort);
    if (remoteUsername != null)
      builder.addCredentials(remoteUsername, remotePassword);

    ResponseParser parser = ResponseParser.performHttpRequest(remoteHostname, remotePort, builder);

    if (parser.getStatus() == 404)
      throw new IOException("The remote resource, " + remoteUrl() + ", was not found.");
View Full Code Here

TOP

Related Classes of fitnesse.http.RequestBuilder

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.