()
| 242 | } |
| 243 | |
| 244 | @Test |
| 245 | public void executed() throws Exception { |
| 246 | final TSQuery query = new TSQuery(); |
| 247 | query.setStart("1h-ago"); |
| 248 | final QueryStats stats = new QueryStats(remote, query, headers); |
| 249 | stats.markSerialized(HttpResponseStatus.REQUEST_TIMEOUT, null); |
| 250 | final Map<String, Object> map = QueryStats.getRunningAndCompleteStats(); |
| 251 | assertNotNull(map); |
| 252 | assertEquals(0, ((List<Object>)map.get("running")).size()); |
| 253 | assertEquals(1, ((Collection<QueryStats>)map.get("completed")).size()); |
| 254 | final QueryStats completed = ((Collection<QueryStats>)map.get("completed")) |
| 255 | .iterator().next(); |
| 256 | assertEquals(1, completed.getExecuted()); |
| 257 | } |
| 258 | |
| 259 | @Test |
| 260 | public void executedTwice() throws Exception { |
nothing calls this directly
no test coverage detected