Examples of RawEndpoint


Examples of com.twitter.hbc.core.endpoint.RawEndpoint

      return this;
  }

  public ClientBuilder endpoint(String uri, String httpMethod) {
    Preconditions.checkNotNull(uri);
    this.endpoint = new RawEndpoint(uri, httpMethod);
    return this;
  }
View Full Code Here

Examples of com.twitter.hbc.core.endpoint.RawEndpoint

  }

  @Test
  public void testProperlyHandleSuccessfulConnection() {
    ClientBase clientBase = new ClientBase("name",
            mock, new HttpHosts("http://hi"), new RawEndpoint("/endpoint", HttpConstants.HTTP_GET), mockAuth,
            mockProcessor, mockReconnectionManager, mockRateTracker
    );

    mockStatusLine = mock(StatusLine.class);
    when(mockStatusLine.getStatusCode())
View Full Code Here

Examples of com.twitter.hbc.core.endpoint.RawEndpoint

  }

  @Test
  public void testHandleIOExceptionOnConnection() throws IOException {
    ClientBase clientBase = new ClientBase("name",
            mock, new HttpHosts("http://hi"), new RawEndpoint("/endpoint", HttpConstants.HTTP_GET), mockAuth,
            mockProcessor, mockReconnectionManager, mockRateTracker
    );
    when(mockConnection.connect(any(HttpUriRequest.class)))
            .thenThrow(new IOException());
View Full Code Here

Examples of com.twitter.hbc.core.endpoint.RawEndpoint

  }

  @Test
  public void testRetryTransientAuthFailures() {
    ClientBase clientBase = new ClientBase("name",
            mock, new HttpHosts("http://hi"), new RawEndpoint("/endpoint", HttpConstants.HTTP_GET), mockAuth,
            mockProcessor, mockReconnectionManager, mockRateTracker
    );

    when(mockStatusLine.getStatusCode())
            .thenReturn(401);
View Full Code Here

Examples of com.twitter.hbc.core.endpoint.RawEndpoint

  }

  @Test
  public void testUnknownEndpointFails() {
    ClientBase clientBase = new ClientBase("name",
            mock, new HttpHosts("http://hi"), new RawEndpoint("/endpoint", HttpConstants.HTTP_GET), mockAuth,
            mockProcessor, mockReconnectionManager, mockRateTracker
    );
    when(mockStatusLine.getStatusCode())
            .thenReturn(404);
    when(mockStatusLine.getReasonPhrase())
View Full Code Here

Examples of com.twitter.hbc.core.endpoint.RawEndpoint

  }

  @Test
  public void testServiceUnavailable() {
    ClientBase clientBase = new ClientBase("name",
            mock, new HttpHosts("http://hi"), new RawEndpoint("/endpoint", HttpConstants.HTTP_GET), mockAuth,
            mockProcessor, mockReconnectionManager, mockRateTracker
    );
    when(mockStatusLine.getStatusCode())
            .thenReturn(503);
View Full Code Here

Examples of com.twitter.hbc.core.endpoint.RawEndpoint

  // the overall flow. Worth it?

  @Test
  public void testIOExceptionDuringProcessing() throws Exception {
    ClientBase clientBase = new ClientBase("name",
            mockClient, new HttpHosts("http://hi"), new RawEndpoint("/endpoint", HttpConstants.HTTP_GET), mockAuth,
            mockProcessor, mockReconnectionManager, mockRateTracker
    );
    BasicClient client = new BasicClient(clientBase, executorService);
    final CountDownLatch latch = new CountDownLatch(1);
    when(mockStatusLine.getStatusCode())
View Full Code Here

Examples of com.twitter.hbc.core.endpoint.RawEndpoint

  }

  @Test
  public void testInterruptedExceptionDuringProcessing() throws Exception {
    ClientBase clientBase = new ClientBase("name",
            mockClient, new HttpHosts("http://hi"), new RawEndpoint("/endpoint", HttpConstants.HTTP_GET), mockAuth,
            mockProcessor, mockReconnectionManager, mockRateTracker
    );

    when(mockStatusLine.getStatusCode())
            .thenReturn(200);
View Full Code Here

Examples of com.twitter.hbc.core.endpoint.RawEndpoint

  @Test
  public void testConnectionRetries() throws Exception {
    HttpHosts mockHttpHosts = mock(HttpHosts.class);
    ClientBase clientBase = new ClientBase("name",
            mockClient, mockHttpHosts, new RawEndpoint("/endpoint", HttpConstants.HTTP_GET), mockAuth,
            mockProcessor, mockReconnectionManager, mockRateTracker
    );

    BasicClient client = new BasicClient(clientBase, executorService);
    final CountDownLatch latch = new CountDownLatch(1);
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.