Package fitnesse.http

Examples of fitnesse.http.ResponseParser


  private Thread makeParsingThread() {
    Thread parseResponseThread = new Thread(new Runnable() {
      public void run() {
        try {
          response = new ResponseParser(clientInput);
        }
        catch (Exception e) {
          e.printStackTrace();
        }
      }
View Full Code Here


  @Test
  public void testBadServer() throws Exception {
    try {
      shutdown.hostname = "http://google.com";
      ResponseParser response = shutdown.buildAndSendRequest();
      String status = shutdown.checkResponse(response);
      assertEquals("Not a FitNesse server", status);
    }
    catch (Exception e) {
    }
View Full Code Here

  private void run(String[] args) throws Exception {
    if (!parseArgs(args))
      usage();

    ResponseParser response = buildAndSendRequest();

    String status = checkResponse(response);
    if (!"OK".equals(status)) {
      LOG.warning("Failed to shutdown. Status = " + status);
      System.exit(response.getStatus());
    }
  }
View Full Code Here

    }
  }

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

    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.");
    if (parser.getStatus() == 401)
      throw new AuthenticationRequiredException(remoteUrl());

    String body = parser.getBody();
    return XmlUtil.newDocument(body);
  }
View Full Code Here

TOP

Related Classes of fitnesse.http.ResponseParser

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.