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

Method testHashCodeandEqualsMetric

test/core/TestTSSubQuery.java:277–293  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

275 }
276
277 @Test
278 public void testHashCodeandEqualsMetric() {
279 final TSSubQuery sub1 = getBaseQuery();
280 final int hash_a = sub1.hashCode();
281
282 sub1.setMetric("foo");
283 assertEquals(hash_a, sub1.hashCode());
284 sub1.validateAndSetQuery();
285 assertEquals(hash_a, sub1.hashCode());
286
287 TSSubQuery sub2 = getBaseQuery();
288 sub2.setMetric("foo");
289
290 assertEquals(hash_a, sub2.hashCode());
291 assertEquals(sub1, sub2);
292 assertFalse(sub1 == sub2);
293 }
294
295 @Test (expected = IllegalArgumentException.class)
296 public void testHashCodeandEqualsMetricNull() {

Callers

nothing calls this directly

Calls 4

getBaseQueryMethod · 0.95
hashCodeMethod · 0.95
setMetricMethod · 0.95
validateAndSetQueryMethod · 0.95

Tested by

no test coverage detected