()
| 225 | } |
| 226 | |
| 227 | @Test |
| 228 | public void markCompleteTimeout() throws Exception { |
| 229 | final TSQuery query = new TSQuery(); |
| 230 | query.setStart("1h-ago"); |
| 231 | final QueryStats stats = new QueryStats(remote, query, headers); |
| 232 | final RuntimeException timeout = new RuntimeException("Timeout!"); |
| 233 | stats.markSerialized(HttpResponseStatus.REQUEST_TIMEOUT, timeout); |
| 234 | final Map<String, Object> map = QueryStats.getRunningAndCompleteStats(); |
| 235 | assertNotNull(map); |
| 236 | assertEquals(0, ((List<Object>)map.get("running")).size()); |
| 237 | assertEquals(1, ((Collection<QueryStats>)map.get("completed")).size()); |
| 238 | final QueryStats completed = ((Collection<QueryStats>)map.get("completed")) |
| 239 | .iterator().next(); |
| 240 | assertEquals(408, completed.getHttpResponse().getCode()); |
| 241 | assertTrue(completed.getException().startsWith("Timeout!\n")); |
| 242 | } |
| 243 | |
| 244 | @Test |
| 245 | public void executed() throws Exception { |
nothing calls this directly
no test coverage detected