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

Method testHashCodeandEqualsEndNull

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

Source from the content-addressed store, hash-verified

216 }
217
218 @Test
219 public void testHashCodeandEqualsEndNull() {
220 TSQuery sub1 = getMetricForValidate();
221
222 final int hash_a = sub1.hashCode();
223 sub1.setEnd(null);
224 final int hash_b = sub1.hashCode();
225 assertTrue(hash_a != hash_b);
226 // this is ok since we assume "now" if end is missing
227 sub1.validateAndSetQuery();
228 assertEquals(hash_b, sub1.hashCode());
229
230 TSQuery sub2 = getMetricForValidate();
231 sub2.setEnd(null);
232
233 assertEquals(hash_b, sub2.hashCode());
234 assertEquals(sub1, sub2);
235 assertFalse(sub1 == sub2);
236 }
237
238 @Test (expected = IllegalArgumentException.class)
239 public void testHashCodeandEqualsEndInvalid() {

Callers

nothing calls this directly

Calls 4

getMetricForValidateMethod · 0.95
hashCodeMethod · 0.95
setEndMethod · 0.95
validateAndSetQueryMethod · 0.95

Tested by

no test coverage detected