@Test public void keepAliveDefaulted() { final long keepAlive = subject.getKeepAliveDuration(httpResponse, httpContext); MatcherAssert.assertThat(keepAlive, Matchers.is(5000l)); }
public long getKeepAliveDuration(final HttpResponse response, final HttpContext context) { final long result = super.getKeepAliveDuration(response, context); if (result < 0) { return maxKeepAliveDuration; } else { return Math.min(result, maxKeepAliveDuration); } }
NexusConnectionKeepAliveStrategy extends DefaultConnectionKeepAliveStrategy { public long getKeepAliveDuration(final HttpResponse response, final HttpContext context) { final long result = super.getKeepAliveDuration(response, context); if (result < 0) { return maxKeepAliveDuration; } else { return Math.min(result, maxKeepAliveDuration); } } }
NexusConnectionKeepAliveStrategy extends DefaultConnectionKeepAliveStrategy { public long getKeepAliveDuration(final HttpResponse response, final HttpContext context) { final long result = super.getKeepAliveDuration(response, context); if (result < 0) { return maxKeepAliveDuration; } else { return Math.min(result, maxKeepAliveDuration); } } NexusConnectionKeepAliveStrategy(final long maxKeepAliveDuration); }
NexusConnectionKeepAliveStrategy extends DefaultConnectionKeepAliveStrategy { public long getKeepAliveDuration(final HttpResponse response, final HttpContext context) { final long result = super.getKeepAliveDuration(response, context); if (result < 0) { return maxKeepAliveDuration; } else { return Math.min(result, maxKeepAliveDuration); } } NexusConnectionKeepAliveStrategy(final long maxKeepAliveDuration); long getKeepAliveDuration(final HttpResponse response, final HttpContext context); }
NexusConnectionKeepAliveStrategy extends DefaultConnectionKeepAliveStrategy { public long getKeepAliveDuration(final HttpResponse response, final HttpContext context) { final long result = super.getKeepAliveDuration(response, context); if (result < 0) { return maxKeepAliveDuration; } else { return Math.min(result, maxKeepAliveDuration); } } NexusConnectionKeepAliveStrategy(final long maxKeepAliveDuration); long getKeepAliveDuration(final HttpResponse response, final HttpContext context);  }