()
| 149 | } |
| 150 | |
| 151 | @Test |
| 152 | public void testHashCodeandEquals() throws Exception { |
| 153 | final TSQuery query = new TSQuery(); |
| 154 | query.setStart("1h-ago"); |
| 155 | final QueryStats stats = new QueryStats(remote, query, headers); |
| 156 | assertNotNull(stats); |
| 157 | final int hash_a = stats.hashCode(); |
| 158 | |
| 159 | // have to mark the old one as complete before we can test equality |
| 160 | stats.markSerializationSuccessful(); |
| 161 | |
| 162 | final TSQuery query2 = new TSQuery(); |
| 163 | query2.setStart("1h-ago"); |
| 164 | final QueryStats stats2 = new QueryStats(remote, query2, headers); |
| 165 | assertNotNull(stats); |
| 166 | assertEquals(hash_a, stats2.hashCode()); |
| 167 | assertEquals(stats, stats2); |
| 168 | assertFalse(stats == stats2); |
| 169 | } |
| 170 | |
| 171 | @Test |
| 172 | public void testHashCodeandNotEquals() throws Exception { |
nothing calls this directly
no test coverage detected