use of com.axibase.tsd.api.model.command.StringCommand in project atsd-api-test by axibase.
the class MetricCommandTest method testIncorrectEnabled.
@Issue("3550")
@Issue("6319")
@Test(dataProvider = "incorrectEnabledProvider")
public void testIncorrectEnabled(String enabled) throws Exception {
String metricName = metric();
StringCommand command = new StringCommand(String.format("metric m:%s b:%s", metricName, enabled));
String assertMessage = "Bad metric was accepted :: " + command;
assertFalse(assertMessage, transport.send(command));
Response serverResponse = MetricMethod.queryMetric(metricName);
assertEquals(assertMessage, Util.responseFamily(serverResponse), Response.Status.Family.CLIENT_ERROR);
}
use of com.axibase.tsd.api.model.command.StringCommand in project atsd-api-test by axibase.
the class MetricCommandTest method testIncorrectTimeZone.
@Issue("3137")
@Issue("6319")
@Test(dataProvider = "incorrectTimeZoneProvider")
public void testIncorrectTimeZone(String incorrectTimeZone) throws Exception {
String metricName = metric();
StringCommand incorrectCommand = new StringCommand(String.format("metric m:%s z:%s", metricName, incorrectTimeZone));
String assertMessage = String.format("Metric with incorrect versioning field (%s) shouldn't be inserted", incorrectCommand);
assertFalse(assertMessage, transport.send(incorrectCommand));
}
use of com.axibase.tsd.api.model.command.StringCommand in project atsd-api-test by axibase.
the class MetricCommandTest method testRawEnabled.
@Issue("3550")
@Issue("6319")
@Test(dataProvider = "correctEnabledProvider")
public void testRawEnabled(String enabled) throws Exception {
String metricName = metric();
Metric metric = new Metric(metricName);
StringCommand command = new StringCommand(String.format("metric m:%s b:%s", metricName, enabled));
String assertMessage = "Failed to set enabled (raw)";
assertTrue(assertMessage, transport.send(command));
Checker.check(new MetricCheck(metric));
Metric actualMetric = MetricMethod.queryMetric(metricName).readEntity(Metric.class);
assertEquals(assertMessage, enabled.replaceAll("[\\'\\\"]", ""), actualMetric.getEnabled().toString());
}
Aggregations