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

Method testHashCodeandEqualsTimezone

test/core/TestTSQuery.java:248–265  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

246 }
247
248 @Test
249 public void testHashCodeandEqualsTimezone() {
250 TSQuery sub1 = getMetricForValidate();
251
252 final int hash_a = sub1.hashCode();
253 sub1.setTimezone("America/New_York");
254 final int hash_b = sub1.hashCode();
255 assertTrue(hash_a != hash_b);
256 sub1.validateAndSetQuery();
257 assertEquals(hash_b, sub1.hashCode());
258
259 TSQuery sub2 = getMetricForValidate();
260 sub2.setTimezone("America/New_York");
261
262 assertEquals(hash_b, sub2.hashCode());
263 assertEquals(sub1, sub2);
264 assertFalse(sub1 == sub2);
265 }
266
267 @Test (expected = IllegalArgumentException.class)
268 public void testHashCodeandEqualsTimezoneInvalid() throws Exception {

Callers

nothing calls this directly

Calls 4

getMetricForValidateMethod · 0.95
hashCodeMethod · 0.95
setTimezoneMethod · 0.95
validateAndSetQueryMethod · 0.95

Tested by

no test coverage detected