Search in sources :

Example 1 with HttpOneOnly

use of io.undertow.testutils.HttpOneOnly in project undertow by undertow-io.

the class AbstractLoadBalancingProxyTestCase method testOldBackend.

@Test
@HttpOneOnly
public void testOldBackend() throws IOException {
    TestHttpClient client = new TestHttpClient();
    try {
        for (int i = 0; i < 10; ++i) {
            HttpGet get = new HttpGet(DefaultServer.getDefaultServerURL() + "/old");
            HttpResponse result = client.execute(get);
            Assert.assertEquals(StatusCodes.OK, result.getStatusLine().getStatusCode());
            Assert.assertEquals(RESPONSE_BODY, HttpClientUtils.readResponse(result));
        }
    } finally {
        client.getConnectionManager().shutdown();
    }
}
Also used : HttpGet(org.apache.http.client.methods.HttpGet) HttpResponse(org.apache.http.HttpResponse) TestHttpClient(io.undertow.testutils.TestHttpClient) Test(org.junit.Test) HttpOneOnly(io.undertow.testutils.HttpOneOnly)

Aggregations

HttpOneOnly (io.undertow.testutils.HttpOneOnly)1 TestHttpClient (io.undertow.testutils.TestHttpClient)1 HttpResponse (org.apache.http.HttpResponse)1 HttpGet (org.apache.http.client.methods.HttpGet)1 Test (org.junit.Test)1