Package com.linkedin.r2.transport.http.client

Examples of com.linkedin.r2.transport.http.client.HttpClientFactory.shutdown()


    Assert.assertEquals(greetingResponse.getEntity().getMessage(), NEW_MESSAGE);

    // shut down client
    FutureCallback<None> futureCallback = new FutureCallback<None>();
    r2Client.shutdown(futureCallback);
    futureCallback.get();
  }

  @Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestOptionsDataProvider")
  public void testOldCookbookInBatch(RestliRequestOptions requestOptions) throws Exception
View Full Code Here


    FutureCallback<None> factoryShutdown = new FutureCallback<None>();
    factory.shutdown(factoryShutdown);

    FutureCallback<None> clientShutdown = new FutureCallback<None>();
    client.shutdown(clientShutdown);

    // Client and factory shutdowns are now pending.  When we release the latch, the response will
    // be returned, which causes the shutdowns to complete on the Netty IO thread that received the
    // response.
    _testServer.releaseResponseLatch();
View Full Code Here

    @SuppressWarnings("unchecked")
    Callback<None> callback = EasyMock.createMock(Callback.class);
    Capture<Callback<None>> callbackCapture = new Capture<Callback<None>>();

    // Underlying client's shutdown should be invoked with correct callback
    client.shutdown(EasyMock.capture(callbackCapture));
    EasyMock.replay(client);

    // No methods should be invoked on the callback
    EasyMock.replay(callback);
View Full Code Here

    }

    assertEquals(response.getStatus(), 200);

    final FutureCallback<None> callback = new FutureCallback<None>();
    client.shutdown(callback);
    callback.get();
  }

  @Test
  public void testRequestContextReuse() throws Exception
View Full Code Here

    latch.await(REQUEST_TIMEOUT, TimeUnit.MILLISECONDS);

    Assert.assertTrue(context.getLocalAttrs().isEmpty());

    final FutureCallback<None> callback = new FutureCallback<None>();
    client.shutdown(callback);
    callback.get();
  }

  // Disabled this test for now because due to VMWare/Solaris x86 bugs, ScheduledExecutor
  // does not work correctly on the hudson builds.  Reenable it when we move our Hudson jobs
View Full Code Here

    String requestString = _testServer.getLastRequest();
    assertTrue(requestString.startsWith("GET / HTTP"), "Request '" + requestString +
            "' should have started with 'GET / HTTP'");

    final FutureCallback<None> callback = new FutureCallback<None>();
    client.shutdown(callback);
    callback.get();
  }
}
View Full Code Here

  {
    TransportClient client = new HttpClientFactory().getClient(
            Collections.<String, String>emptyMap());

    FutureCallback<None> shutdownCallback = new FutureCallback<None>();
    client.shutdown(shutdownCallback);
    shutdownCallback.get(30, TimeUnit.SECONDS);

    // Now verify a new request will also fail
    RestRequest r = new RestRequestBuilder(URI.create("http://no.such.host.linkedin.com")).build();
    FutureCallback<RestResponse> callback = new FutureCallback<RestResponse>();
View Full Code Here

    Assert.assertEquals(greetingResponse.getEntity().getMessage(), NEW_MESSAGE);

    // shut down client
    FutureCallback<None> futureCallback = new FutureCallback<None>();
    r2Client.shutdown(futureCallback);
    futureCallback.get();
  }

  @Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestOptionsDataProvider")
  public void testOldCookbookInBatch(RestliRequestOptions requestOptions) throws Exception
View Full Code Here

    FutureCallback<None> factoryShutdown = new FutureCallback<None>();
    factory.shutdown(factoryShutdown);

    FutureCallback<None> clientShutdown = new FutureCallback<None>();
    client.shutdown(clientShutdown);

    // Client and factory shutdowns are now pending.  When we release the latch, the response will
    // be returned, which causes the shutdowns to complete on the Netty IO thread that received the
    // response.
    _testServer.releaseResponseLatch();
View Full Code Here

    }

    assertEquals(response.getStatus(), 200);

    final FutureCallback<None> callback = new FutureCallback<None>();
    client.shutdown(callback);
    callback.get();
  }

  @Test
  public void testRequestContextReuse() throws Exception
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.