Search in sources :

Example 1 with MetricCommand

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

the class MetricCommandTest method testInterpolate.

@Issue("3137")
@Test
public void testInterpolate() throws Exception {
    Metric metric = new Metric(metric());
    metric.setInterpolate(InterpolationMode.LINEAR);
    MetricCommand command = new MetricCommand(metric);
    CommandMethod.send(command);
    String assertMessage = String.format("Failed to insert metric with interpolate mode: %s", metric.getInterpolate());
    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 2 with MetricCommand

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

the class MetricCommandTest method testTags.

@Issue("3137")
@Test
public void testTags() throws Exception {
    Metric metric = new Metric(metric(), Mocks.TAGS);
    MetricCommand command = new MetricCommand(metric);
    CommandMethod.send(command);
    String assertMessage = String.format("Failed to insert metric with tags: %s", metric.getTags());
    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 3 with MetricCommand

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

the class MetricCommandTest method testEnabled.

@Issue("3550")
@Test
public void testEnabled() throws Exception {
    String metricName = metric();
    Metric metric = new Metric(metricName);
    MetricCommand command = new MetricCommand(metric);
    command.setEnabled(true);
    CommandMethod.send(command);
    Checker.check(new MetricCheck(metric));
    Metric actualMetric = MetricMethod.queryMetric(metricName).readEntity(Metric.class);
    assertTrue("Failed to set enabled", 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 4 with MetricCommand

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

the class MetricCommandTest method testDescription.

@Issue("3137")
@Test
public void testDescription() throws Exception {
    Metric metric = new Metric(metric());
    metric.setDescription(Mocks.DESCRIPTION);
    MetricCommand command = new MetricCommand(metric);
    CommandMethod.send(command);
    String assertMessage = String.format("Failed to insert metric with description: %s", metric.getDescription());
    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 5 with MetricCommand

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

the class MetricCommandTest method testNullEnabled.

@Issue("3550")
@Test
public void testNullEnabled() throws Exception {
    String metricName = metric();
    Metric metric = new Metric(metricName);
    MetricCommand command = new MetricCommand(metricName);
    command.setEnabled(null);
    CommandMethod.send(command);
    Checker.check(new MetricCheck(metric));
    Metric actualMetric = MetricMethod.queryMetric(metricName).readEntity(Metric.class);
    assertTrue("Failed to omit enabled", 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)

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