()
| 105 | } |
| 106 | |
| 107 | @Test |
| 108 | public void ctorDuplicate() throws Exception { |
| 109 | QueryStats.setEnableDuplicates(false); |
| 110 | final TSQuery query = new TSQuery(); |
| 111 | query.setStart("1h-ago"); |
| 112 | final QueryStats stats = new QueryStats(remote, query, headers); |
| 113 | assertNotNull(stats); |
| 114 | final Map<String, Object> map = QueryStats.getRunningAndCompleteStats(); |
| 115 | assertNotNull(map); |
| 116 | assertEquals(1, ((List<Object>)map.get("running")).size()); |
| 117 | assertEquals(0, ((Collection<QueryStats>)map.get("completed")).size()); |
| 118 | try { |
| 119 | new QueryStats(remote, query, headers); |
| 120 | fail("Expected a QueryException"); |
| 121 | } catch (QueryException e) { } |
| 122 | QueryStats.setEnableDuplicates(true); |
| 123 | } |
| 124 | |
| 125 | @Test (expected = IllegalArgumentException.class) |
| 126 | public void ctorNullRemote() throws Exception { |
nothing calls this directly
no test coverage detected