use of com.axibase.tsd.api.method.checks.SeriesCheck in project atsd-api-test by axibase.
the class EntityCreateOrReplaceTest method testSeriesRemain.
@Issue("1968")
@Test
public void testSeriesRemain() throws Exception {
Series series = new Series("create-entity-17", "create-entity-metric-17");
series.addSamples(Sample.ofDateInteger(MIN_STORABLE_DATE, 0));
SeriesMethod.insertSeriesCheck(Collections.singletonList(series));
Entity entity = new Entity();
entity.setName(series.getEntity());
createOrReplaceEntityCheck(entity);
assertTrue("Inserted Series should remain", new SeriesCheck(Collections.singletonList(series)).isChecked());
}
use of com.axibase.tsd.api.method.checks.SeriesCheck in project atsd-api-test by axibase.
the class LineBreakInsideSeriesCommandTest method sendAndCheck.
private void sendAndCheck(String message, Series insert, Series response, TestType type) {
List<PlainCommand> commands = new ArrayList<>();
commands.addAll(insert.toCommands());
boolean checked;
try {
switch(type) {
case NETWORK_API:
TCPSender.sendChecked(new SeriesCheck(Collections.singletonList(response)), commands);
break;
case DATA_API:
CommandMethod.send(commands);
Checker.check(new SeriesCheck(Collections.singletonList(response)));
break;
}
checked = true;
} catch (IOException e) {
e.printStackTrace();
checked = false;
}
assertTrue(message, checked);
}
use of com.axibase.tsd.api.method.checks.SeriesCheck in project atsd-api-test by axibase.
the class CSVInsertTest method testMultipleISOFormat.
@Issue("2009")
@Test
public void testMultipleISOFormat() throws Exception {
Series series = Mocks.series();
series.setSamples(new ArrayList<Sample>());
String header = String.format("date, %s%n", series.getMetric());
StringBuilder payloadBuilder = new StringBuilder(header);
String[][] dateTemplatePairs = new String[][] { { "2016-05-21T00:00:00.000Z", "yyyy-MM-dd'T'HH:mm:ss'Z'" }, { "2016-05-21T00:00:00.001Z", "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" }, { "2016-05-21T00:00:15.000Z", "yyyy-MM-dd'T'HH:mm:ssXXX" }, { "2016-05-21T00:00:15.001Z", "yyyy-MM-dd'T'HH:mm:ss.SSSXXX" } };
for (int i = 0; i < dateTemplatePairs.length; i++) {
Date date = parseDate(dateTemplatePairs[i][0]);
String pattern = dateTemplatePairs[i][1];
String csvRow = String.format("%s, %s%n", formatISODate(date, pattern), Mocks.DECIMAL_VALUE);
payloadBuilder.append(csvRow);
series.addSamples(Sample.ofDateDecimal(dateTemplatePairs[i][0], Mocks.DECIMAL_VALUE));
}
String csvPayload = payloadBuilder.toString();
csvInsertCheck(new SeriesCheck(singletonList(series)), series.getEntity(), csvPayload, series.getTags());
}
use of com.axibase.tsd.api.method.checks.SeriesCheck in project atsd-api-test by axibase.
the class CSVInsertTest method testTimeRangeInISO.
@Issue("2957")
@Test
public void testTimeRangeInISO() throws Exception {
Series series = Mocks.series();
series.setSamples(Arrays.asList(Sample.ofDateDecimal(MIN_STORABLE_DATE, Mocks.DECIMAL_VALUE), Sample.ofDateDecimal(MAX_STORABLE_DATE, Mocks.DECIMAL_VALUE)));
String csvPayload = String.format("date, %s%n%s, %s%n%s, %s%n", series.getMetric(), MIN_STORABLE_DATE, Mocks.DECIMAL_VALUE, MAX_STORABLE_DATE, Mocks.DECIMAL_VALUE);
csvInsertCheck(new SeriesCheck(singletonList(series)), series.getEntity(), csvPayload, series.getTags());
}
use of com.axibase.tsd.api.method.checks.SeriesCheck in project atsd-api-test by axibase.
the class TCPSenderTest method testSend.
@Test
public void testSend() throws Exception {
Series series = Mocks.series();
TCPSender.send(series.toCommands());
assertCheck(new SeriesCheck(singletonList(series)));
}
Aggregations