Examples of ProtocolVersion


Examples of org.apache.http.ProtocolVersion

    HttpDelete httpdelete = new HttpDelete("http://localhost:" + PORT + "/delete");
    HttpResponse response = httpclient.execute(httpdelete);

    assertNotNull(response);
    assertEquals(200, response.getStatusLine().getStatusCode());
    assertEquals(new ProtocolVersion("HTTP", 1, 1), response.getStatusLine().getProtocolVersion());
    assertEquals("OK", response.getStatusLine().getReasonPhrase());
    String payLoad = convertStreamToString(response.getEntity().getContent()).trim();
    assertEquals("delete", payLoad);
  }
View Full Code Here

Examples of org.apache.http.ProtocolVersion

    HttpPost httppost = new HttpPost("http://localhost:" + PORT + "/post");
    HttpResponse response = httpclient.execute(httppost);

    assertNotNull(response);
    assertEquals(200, response.getStatusLine().getStatusCode());
    assertEquals(new ProtocolVersion("HTTP", 1, 1), response.getStatusLine().getProtocolVersion());
    assertEquals("OK", response.getStatusLine().getReasonPhrase());
    String payLoad = convertStreamToString(response.getEntity().getContent()).trim();
    assertEquals("post", payLoad);
  }
View Full Code Here

Examples of org.apache.http.ProtocolVersion

    HttpPut httpput = new HttpPut("http://localhost:" + PORT + "/put");
    HttpResponse response = httpclient.execute(httpput);

    assertNotNull(response);
    assertEquals(200, response.getStatusLine().getStatusCode());
    assertEquals(new ProtocolVersion("HTTP", 1, 1), response.getStatusLine().getProtocolVersion());
    assertEquals("OK", response.getStatusLine().getReasonPhrase());
    String payLoad = convertStreamToString(response.getEntity().getContent()).trim();
    assertEquals("put", payLoad);
  }
View Full Code Here

Examples of org.apache.http.ProtocolVersion

    HttpGet httpget = new HttpGet("http://localhost:" + PORT + "/capturing/1911");
    HttpResponse response = httpclient.execute(httpget);

    assertNotNull(response);
    assertEquals(200, response.getStatusLine().getStatusCode());
    assertEquals(new ProtocolVersion("HTTP", 1, 1), response.getStatusLine().getProtocolVersion());
    assertEquals("OK", response.getStatusLine().getReasonPhrase());
    String payLoad = convertStreamToString(response.getEntity().getContent()).trim();
    assertEquals("/capturing/1911", payLoad);
  }
View Full Code Here

Examples of org.apache.http.ProtocolVersion

    HttpGet httpget = new HttpGet("http://localhost:" + PORT + "/capturing/r1911");
    HttpResponse response = httpclient.execute(httpget);

    assertNotNull(response);
    assertEquals(404, response.getStatusLine().getStatusCode());
    assertEquals(new ProtocolVersion("HTTP", 1, 1), response.getStatusLine().getProtocolVersion());
    assertEquals("Not Found", response.getStatusLine().getReasonPhrase());
    String payLoad = convertStreamToString(response.getEntity().getContent()).trim();
    assertEquals("Requested URL: /capturing/r1911 was not found", payLoad);
  }
View Full Code Here

Examples of org.apache.http.ProtocolVersion

    HttpGet httpget = new HttpGet("http://localhost:" + PORT + "/");
    HttpResponse response = httpclient.execute(httpget);

    assertNotNull(response);
    assertEquals(200, response.getStatusLine().getStatusCode());
    assertEquals(new ProtocolVersion("HTTP", 1, 1), response.getStatusLine().getProtocolVersion());
    assertEquals("OK", response.getStatusLine().getReasonPhrase());
    assertEquals(5, response.getAllHeaders().length);
    String payLoad = convertStreamToString(response.getEntity().getContent()).trim();
    assertEquals(expectedPayload, payLoad);
  }
View Full Code Here

Examples of org.apache.http.ProtocolVersion

  }

  @Test
  public void HTTP_1_0_noConnectionHeaderTest() throws ClientProtocolException, IOException {
    HttpParams params = new BasicHttpParams();
    HttpProtocolParams.setVersion(params, new ProtocolVersion("HTTP", 1, 0));
    DefaultHttpClient httpclient = new DefaultHttpClient();
    HttpGet httpget = new HttpGet("http://localhost:" + PORT + "/");
    HttpResponse response = httpclient.execute(httpget);

    assertNotNull(response);
    assertEquals(200, response.getStatusLine().getStatusCode());
    assertEquals(new ProtocolVersion("HTTP", 1, 1), response.getStatusLine().getProtocolVersion());
    assertEquals("OK", response.getStatusLine().getReasonPhrase());
    assertEquals(5, response.getAllHeaders().length);
    String payLoad = convertStreamToString(response.getEntity().getContent()).trim();
    assertEquals(expectedPayload, payLoad);
  }
View Full Code Here

Examples of org.apache.http.ProtocolVersion

    HttpGet httpget = new HttpGet("http://localhost:" + PORT + "/throw");
    HttpResponse response = httpclient.execute(httpget);

    assertNotNull(response);
    assertEquals(500, response.getStatusLine().getStatusCode());
    assertEquals(new ProtocolVersion("HTTP", 1, 1), response.getStatusLine().getProtocolVersion());
    assertEquals("Internal Server Error", response.getStatusLine().getReasonPhrase());
    assertEquals(5, response.getAllHeaders().length);
    String payLoad = convertStreamToString(response.getEntity().getContent()).trim();
    assertEquals("exception message", payLoad);
  }
View Full Code Here

Examples of org.apache.http.ProtocolVersion

    HttpGet httpget = new HttpGet("http://localhost:" + PORT + "/async_throw");
    HttpResponse response = httpclient.execute(httpget);

    assertNotNull(response);
    assertEquals(500, response.getStatusLine().getStatusCode());
    assertEquals(new ProtocolVersion("HTTP", 1, 1), response.getStatusLine().getProtocolVersion());
    assertEquals("Internal Server Error", response.getStatusLine().getReasonPhrase());
    assertEquals(5, response.getAllHeaders().length);
    String payLoad = convertStreamToString(response.getEntity().getContent()).trim();
    assertEquals("exception message", payLoad);
  }
View Full Code Here

Examples of org.apache.http.ProtocolVersion

    HttpGet httpget = new HttpGet("http://localhost:" + PORT + "/src/test/resources/test.txt");
    HttpResponse response = httpclient.execute(httpget);

    assertNotNull(response);
    assertEquals(200, response.getStatusLine().getStatusCode());
    assertEquals(new ProtocolVersion("HTTP", 1, 1), response.getStatusLine().getProtocolVersion());
    assertEquals("OK", response.getStatusLine().getReasonPhrase());
    assertEquals(7, response.getAllHeaders().length);
    String payLoad = convertStreamToString(response.getEntity().getContent()).trim();
    assertEquals("test.txt", payLoad);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.