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

Method gexpBadExpression

test/tsd/TestQueryRpc.java:667–681  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

665 }
666
667 @Test
668 public void gexpBadExpression() throws Exception {
669 final DataPoints[] datapoints = new DataPoints[1];
670 datapoints[0] = new MockDataPoints().getMock();
671 when(query_result.runAsync()).thenReturn(
672 Deferred.fromResult(datapoints));
673
674 final HttpQuery query = NettyMocks.getQuery(tsdb,
675 "/api/query/gexp?start=1h-ago&exp=scale(sum:sys.cpu.user,notanumber)");
676 rpc.execute(tsdb, query);
677 assertEquals(query.response().getStatus(), HttpResponseStatus.BAD_REQUEST);
678 final String json =
679 query.response().getContent().toString(Charset.forName("UTF-8"));
680 assertTrue(json.contains("factor"));
681 }
682
683 @Test
684 public void testParsePercentile() {

Callers

nothing calls this directly

Calls 9

getQueryMethod · 0.95
getMockMethod · 0.80
responseMethod · 0.80
containsMethod · 0.80
runAsyncMethod · 0.65
executeMethod · 0.65
getStatusMethod · 0.65
toStringMethod · 0.45
getContentMethod · 0.45

Tested by

no test coverage detected