()
| 258 | // } |
| 259 | |
| 260 | @Test |
| 261 | public void oneExpressionNoFilter() throws Exception { |
| 262 | oneExtraSameE(); |
| 263 | final Metric metric1 = Metric.Builder().setMetric("A").setId("a") |
| 264 | .build(); |
| 265 | final Metric metric2 = Metric.Builder().setMetric("B").setId("b") |
| 266 | .build(); |
| 267 | metrics = Arrays.asList(metric1, metric2); |
| 268 | |
| 269 | final String json = JSON.serializeToString(getDefaultQueryBuilder().build()); |
| 270 | final QueryRpc rpc = new QueryRpc(); |
| 271 | final HttpQuery query = NettyMocks.postQuery(tsdb, |
| 272 | "/api/query/exp", json); |
| 273 | NettyMocks.mockChannelFuture(query); |
| 274 | |
| 275 | rpc.execute(tsdb, query); |
| 276 | final String response = |
| 277 | query.response().getContent().toString(Charset.forName("UTF-8")); |
| 278 | System.out.println(response); |
| 279 | assertTrue(response.contains("\"alias\":\"A plus B\"")); |
| 280 | assertTrue(response.contains("\"dps\":[[1431561600000,47.0]")); |
| 281 | assertTrue(response.contains("[1431561660000,52.0]")); |
| 282 | assertTrue(response.contains("[1431561720000,57.0]")); |
| 283 | assertTrue(response.contains("\"firstTimestamp\":1431561600000")); |
| 284 | assertTrue(response.contains("\"index\":1")); |
| 285 | assertTrue(response.contains("\"metrics\":[\"A\",\"B\"]")); |
| 286 | assertTrue(response.contains("\"index\":1")); |
| 287 | } |
| 288 | |
| 289 | @Test |
| 290 | public void twoExpressionsDefaultOutput() throws Exception { |
nothing calls this directly
no test coverage detected