Search in sources :

Example 6 with MetricCommand

use of com.axibase.tsd.api.model.command.MetricCommand in project atsd-api-test by axibase.

the class MetricCommandTest method testTimezone.

@Issue("3137")
@Test
public void testTimezone() throws Exception {
    Metric metric = new Metric(metric());
    metric.setFilter("GMT0");
    MetricCommand command = new MetricCommand(metric);
    CommandMethod.send(command);
    String assertMessage = String.format("Failed to insert metric with filter expression: %s", metric.getTimeZoneID());
    assertMetricExisting(assertMessage, metric);
}
Also used : MetricCommand(com.axibase.tsd.api.model.command.MetricCommand) Metric(com.axibase.tsd.api.model.metric.Metric) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 7 with MetricCommand

use of com.axibase.tsd.api.model.command.MetricCommand in project atsd-api-test by axibase.

the class MetricCommandTest method testLabel.

@Issue("3137")
@Test
public void testLabel() throws Exception {
    Metric metric = new Metric(metric());
    metric.setLabel(Mocks.LABEL);
    MetricCommand command = new MetricCommand(metric);
    CommandMethod.send(command);
    String assertMessage = String.format("Failed to insert metric with label: %s", metric.getLabel());
    assertMetricExisting(assertMessage, metric);
}
Also used : MetricCommand(com.axibase.tsd.api.model.command.MetricCommand) Metric(com.axibase.tsd.api.model.metric.Metric) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 8 with MetricCommand

use of com.axibase.tsd.api.model.command.MetricCommand in project atsd-api-test by axibase.

the class MetricCommandTest method testVersioning.

@Issue("3137")
@Test
public void testVersioning() throws Exception {
    Metric metric = new Metric(metric());
    metric.setVersioned(true);
    MetricCommand command = new MetricCommand(metric);
    CommandMethod.send(command);
    String assertMessage = String.format("Failed to insert metric with versioned: %s", metric.getVersioned());
    assertMetricExisting(assertMessage, metric);
}
Also used : MetricCommand(com.axibase.tsd.api.model.command.MetricCommand) Metric(com.axibase.tsd.api.model.metric.Metric) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 9 with MetricCommand

use of com.axibase.tsd.api.model.command.MetricCommand in project atsd-api-test by axibase.

the class MetricCommandTest method testDisabled.

@Issue("3550")
@Test
public void testDisabled() throws Exception {
    String metricName = metric();
    Metric metric = new Metric(metricName);
    MetricCommand command = new MetricCommand(metric);
    command.setEnabled(false);
    CommandMethod.send(command);
    Checker.check(new MetricCheck(metric));
    Metric actualMetric = MetricMethod.queryMetric(metricName).readEntity(Metric.class);
    assertFalse("Failed to set disabled", actualMetric.getEnabled());
}
Also used : MetricCheck(com.axibase.tsd.api.method.checks.MetricCheck) MetricCommand(com.axibase.tsd.api.model.command.MetricCommand) Metric(com.axibase.tsd.api.model.metric.Metric) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 10 with MetricCommand

use of com.axibase.tsd.api.model.command.MetricCommand in project atsd-api-test by axibase.

the class MetricCommandTest method testFilterExpression.

@Issue("3137")
@Test
public void testFilterExpression() throws Exception {
    Metric metric = new Metric(metric());
    metric.setFilter("expression");
    MetricCommand command = new MetricCommand(metric);
    CommandMethod.send(command);
    String assertMessage = String.format("Failed to insert metric with filter expression: %s", metric.getFilter());
    assertMetricExisting(assertMessage, metric);
}
Also used : MetricCommand(com.axibase.tsd.api.model.command.MetricCommand) Metric(com.axibase.tsd.api.model.metric.Metric) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Aggregations

MetricCommand (com.axibase.tsd.api.model.command.MetricCommand)11 Issue (io.qameta.allure.Issue)11 Test (org.testng.annotations.Test)11 Metric (com.axibase.tsd.api.model.metric.Metric)10 MetricCheck (com.axibase.tsd.api.method.checks.MetricCheck)3 CommandSendingResult (com.axibase.tsd.api.model.extended.CommandSendingResult)1