use of com.axibase.tsd.api.method.checks.SeriesCheck in project atsd-api-test by axibase.
the class SeriesInsertTest method testXTextFieldExplicitNull.
@Issue("3480")
@Test
public void testXTextFieldExplicitNull() throws Exception {
String entityName = "e-series-insert-text-null-1";
String metricName = "m-series-insert-text-null-1";
Series series = new Series(entityName, metricName);
Sample sample = Sample.ofDateInteger("2016-10-11T13:00:00.000Z", 1);
series.addSamples(sample);
String commandJsonFormat = "[{'entity':'%s','metric':'%s','data':[{'d':'%s','v':%s,'x':null}]}]";
commandJsonFormat = commandJsonFormat.replace('\'', '"');
String json = String.format(commandJsonFormat, series.getEntity(), series.getMetric(), sample.getRawDate(), sample.getValue());
Response response = insertSeries(json);
assertEquals("Bad insertion request status code", OK.getStatusCode(), response.getStatus());
Checker.check(new SeriesCheck(Collections.singletonList(series)));
SeriesQuery seriesQuery = new SeriesQuery(series);
List<Series> seriesList = querySeriesAsList(seriesQuery);
assertEquals("Stored series are incorrect", Collections.singletonList(series), seriesList);
}
use of com.axibase.tsd.api.method.checks.SeriesCheck in project atsd-api-test by axibase.
the class TcpParsingTest method testNetworkParser.
/*
The main problem of #4411 was that series command after metric command with newlines
is interpreted as metric command also.
For example
metric m:"metric-name" d:"Some
description"
series e:"entity-name" m:"some-other-metric-name"=123
*/
@Issue("4411")
@Test(description = "Test that series command that follows metric command with newline " + "is parsed correctly")
public void testNetworkParser() throws Exception {
Metric expectedMetric = new Metric(METRIC_NAME);
expectedMetric.setDescription(METRIC_DESCRIPTION);
Series expectedSeries = new Series(ENTITY_NAME, METRIC_NAME);
expectedSeries.addSamples(Sample.ofDateInteger(Mocks.ISO_TIME, METRIC_VALUE));
TCPSender.send(NETWORK_COMMAND);
Checker.check(new MetricCheck(expectedMetric));
Checker.check(new SeriesCheck(Collections.singletonList(expectedSeries)));
}
use of com.axibase.tsd.api.method.checks.SeriesCheck in project atsd-api-test by axibase.
the class CompressedPayloadTest method gzipPayloadTest.
@Test
public void gzipPayloadTest() {
Series series = new Series(entityName, metricName);
series.addSamples(Sample.ofDateInteger(Mocks.ISO_TIME, 1));
CommandMethod.sendGzipCompressedBytes(gzipOutput);
Checker.check(new SeriesCheck(Collections.singletonList(series)));
}
use of com.axibase.tsd.api.method.checks.SeriesCheck in project atsd-api-test by axibase.
the class CSVInsertTest method testTimeRangeInMS.
@Issue("2957")
@Test
public void testTimeRangeInMS() {
Series series = Mocks.series();
series.setSamples(new ArrayList<>());
series.addSamples(Sample.ofDateDecimal(MIN_STORABLE_DATE, Mocks.DECIMAL_VALUE), Sample.ofDateDecimal(MAX_STORABLE_DATE, Mocks.DECIMAL_VALUE));
String csvPayload = String.format("time, %s%n%s, %s%n%s, %s%n", series.getMetric(), Util.parseDate(MIN_STORABLE_DATE).getTime(), Mocks.DECIMAL_VALUE, Util.parseDate(MAX_STORABLE_DATE).getTime(), Mocks.DECIMAL_VALUE);
csvInsertCheck(new SeriesCheck(singletonList(series)), series.getEntity(), csvPayload, series.getTags());
}
Aggregations