Search in sources :

Example 96 with HttpUriRequest

use of org.apache.http.client.methods.HttpUriRequest in project iosched by google.

the class HttpClientStackTest method testCreateHeadRequest.

public void testCreateHeadRequest() throws Exception {
    TestRequest.Head request = new TestRequest.Head();
    assertEquals(request.getMethod(), Method.HEAD);
    HttpUriRequest httpRequest = HttpClientStack.createHttpRequest(request, null);
    assertTrue(httpRequest instanceof HttpHead);
}
Also used : HttpUriRequest(org.apache.http.client.methods.HttpUriRequest) HttpHead(org.apache.http.client.methods.HttpHead) HttpHead(org.apache.http.client.methods.HttpHead) TestRequest(com.android.volley.mock.TestRequest)

Example 97 with HttpUriRequest

use of org.apache.http.client.methods.HttpUriRequest in project iosched by google.

the class HttpClientStackTest method testCreateDeprecatedGetRequest.

public void testCreateDeprecatedGetRequest() throws Exception {
    TestRequest.DeprecatedGet request = new TestRequest.DeprecatedGet();
    assertEquals(request.getMethod(), Method.DEPRECATED_GET_OR_POST);
    HttpUriRequest httpRequest = HttpClientStack.createHttpRequest(request, null);
    assertTrue(httpRequest instanceof HttpGet);
}
Also used : HttpUriRequest(org.apache.http.client.methods.HttpUriRequest) HttpGet(org.apache.http.client.methods.HttpGet) TestRequest(com.android.volley.mock.TestRequest)

Example 98 with HttpUriRequest

use of org.apache.http.client.methods.HttpUriRequest in project iosched by google.

the class HttpClientStackTest method testCreatePatchRequest.

public void testCreatePatchRequest() throws Exception {
    TestRequest.Patch request = new TestRequest.Patch();
    assertEquals(request.getMethod(), Method.PATCH);
    HttpUriRequest httpRequest = HttpClientStack.createHttpRequest(request, null);
    assertTrue(httpRequest instanceof HttpPatch);
}
Also used : HttpUriRequest(org.apache.http.client.methods.HttpUriRequest) HttpPatch(com.android.volley.toolbox.HttpClientStack.HttpPatch) HttpPatch(com.android.volley.toolbox.HttpClientStack.HttpPatch) TestRequest(com.android.volley.mock.TestRequest)

Example 99 with HttpUriRequest

use of org.apache.http.client.methods.HttpUriRequest in project iosched by google.

the class HttpClientStackTest method testCreateDeleteRequest.

public void testCreateDeleteRequest() throws Exception {
    TestRequest.Delete request = new TestRequest.Delete();
    assertEquals(request.getMethod(), Method.DELETE);
    HttpUriRequest httpRequest = HttpClientStack.createHttpRequest(request, null);
    assertTrue(httpRequest instanceof HttpDelete);
}
Also used : HttpDelete(org.apache.http.client.methods.HttpDelete) HttpUriRequest(org.apache.http.client.methods.HttpUriRequest) HttpDelete(org.apache.http.client.methods.HttpDelete) TestRequest(com.android.volley.mock.TestRequest)

Example 100 with HttpUriRequest

use of org.apache.http.client.methods.HttpUriRequest in project iosched by google.

the class HttpClientStackTest method testCreatePutRequest.

public void testCreatePutRequest() throws Exception {
    TestRequest.Put request = new TestRequest.Put();
    assertEquals(request.getMethod(), Method.PUT);
    HttpUriRequest httpRequest = HttpClientStack.createHttpRequest(request, null);
    assertTrue(httpRequest instanceof HttpPut);
}
Also used : HttpUriRequest(org.apache.http.client.methods.HttpUriRequest) HttpPut(org.apache.http.client.methods.HttpPut) HttpPut(org.apache.http.client.methods.HttpPut) TestRequest(com.android.volley.mock.TestRequest)

Aggregations

HttpUriRequest (org.apache.http.client.methods.HttpUriRequest)183 Test (org.junit.Test)62 TestRequest (com.android.volley.mock.TestRequest)52 HttpGet (org.apache.http.client.methods.HttpGet)44 URI (java.net.URI)41 HttpResponse (org.apache.http.HttpResponse)41 HttpEntity (org.apache.http.HttpEntity)38 CloseableHttpResponse (org.apache.http.client.methods.CloseableHttpResponse)36 HttpPost (org.apache.http.client.methods.HttpPost)21 IOException (java.io.IOException)19 Header (org.apache.http.Header)18 JSONObject (org.json.JSONObject)18 BufferedReader (java.io.BufferedReader)17 InputStreamReader (java.io.InputStreamReader)17 PrintWriter (java.io.PrintWriter)17 StringWriter (java.io.StringWriter)17 HttpHost (org.apache.http.HttpHost)13 HttpPut (org.apache.http.client.methods.HttpPut)12 HttpEntityEnclosingRequest (org.apache.http.HttpEntityEnclosingRequest)11 HttpParams (org.apache.http.params.HttpParams)10