@Test public void testSetsConnectionTimeoutWhenServerDisconnects() throws Exception { if (server != null) server.shutdown(); server = BetterMockWebServer.newInstanceLocalhost(); for (int i = 0; i < 100; i++) { server.enqueue(new MockResponse().setSocketPolicy(SocketPolicy.DISCONNECT_AT_START)); } server.play(); baseUrl = server.getUrl("/"); feed = HttpFeed.builder() .entity(entity) .baseUrl(baseUrl) .poll(new HttpPollConfig<Integer>(SENSOR_INT) .period(100) .connectionTimeout(Duration.TEN_SECONDS) .socketTimeout(Duration.TEN_SECONDS) .onSuccess(HttpValueFunctions.responseCode()) .onException(Functions.constant(-1))) .build(); assertSensorEventually(SENSOR_INT, -1, TIMEOUT_MS); }
public static Builder builder() { return new Builder(); }
HttpFeed extends AbstractFeed { public static Builder builder() { return new Builder(); } }
HttpFeed extends AbstractFeed { public static Builder builder() { return new Builder(); } HttpFeed(); protected  HttpFeed(Builder builder); }
HttpFeed extends AbstractFeed { public static Builder builder() { return new Builder(); } HttpFeed(); protected  HttpFeed(Builder builder); static Builder builder(); }
HttpFeed extends AbstractFeed { public static Builder builder() { return new Builder(); } HttpFeed(); protected  HttpFeed(Builder builder); static Builder builder(); static final Logger log; @SuppressWarnings("serial")
    static final ConfigKey<SetMultimap<HttpPollIdentifier, HttpPollConfig<?>>> POLLS; }