MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / testHashCodeandEquals

Method testHashCodeandEquals

test/stats/TestQueryStats.java:151–169  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 3

setStartMethod · 0.95
hashCodeMethod · 0.95

Tested by

no test coverage detected