Search in sources :

Example 1 with StringCommand

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

the class EntityCommandTest method testIncorrectEnabled.

@Issue("3550")
@Issue("6319")
@Test(dataProvider = "incorrectEnabledProvider")
public void testIncorrectEnabled(String enabled) throws Exception {
    String entityName = Mocks.entity();
    StringCommand command = new StringCommand(String.format("entity  e:%s b:%s", entityName, enabled));
    String assertMessage = "Bad entity was accepted :: " + command.toString();
    assertFalse(assertMessage, transport.send(command));
    Response serverResponse = EntityMethod.getEntityResponse(entityName);
    assertEquals(assertMessage, NOT_FOUND.getStatusCode(), serverResponse.getStatus());
}
Also used : Response(javax.ws.rs.core.Response) StringCommand(com.axibase.tsd.api.model.command.StringCommand) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 2 with StringCommand

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

the class MetricCommandTest method testIncorrectVersioning.

@Issue("3137")
@Issue("6319")
@Test(dataProvider = "incorrectInterpolationFieldProvider")
public void testIncorrectVersioning(String value) throws Exception {
    String metricName = metric();
    StringCommand incorrectCommand = new StringCommand(String.format("metric m:%s v:%s", metricName, value));
    String assertMessage = String.format("Metric with incorrect versioning field (%s) shouldn't be inserted", value);
    assertFalse(assertMessage, transport.send(incorrectCommand));
}
Also used : StringCommand(com.axibase.tsd.api.model.command.StringCommand) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 3 with StringCommand

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

the class MetricCommandTest method testIncorrectDataType.

@Issue("3137")
@Issue("6319")
@Test(dataProvider = "incorrectDataTypeFieldProvider")
public void testIncorrectDataType(String value) throws Exception {
    String metricName = metric();
    StringCommand incorrectCommand = new StringCommand(String.format("metric m:%s p:%s", metricName, value));
    String assertMessage = String.format("Metric with incorrect type field (%s) shouldn't be inserted", value);
    assertFalse(assertMessage, transport.send(incorrectCommand));
}
Also used : StringCommand(com.axibase.tsd.api.model.command.StringCommand) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 4 with StringCommand

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

the class EntityCommandTest method testRawEnabled.

@Issue("3550")
@Issue("6319")
@Test(dataProvider = "correctEnabledProvider")
public void testRawEnabled(String enabled) throws Exception {
    String entityName = Mocks.entity();
    Entity entity = new Entity(entityName);
    StringCommand command = new StringCommand(String.format("entity  e:%s b:%s", entityName, enabled));
    String assertMessage = "Failed to set enabled (raw)";
    assertTrue(assertMessage, transport.send(command));
    Checker.check(new EntityCheck(entity));
    Entity actualEntity = EntityMethod.getEntity(entityName);
    assertEquals(assertMessage, enabled.replaceAll("[\\'\\\"]", ""), actualEntity.getEnabled().toString());
}
Also used : Entity(com.axibase.tsd.api.model.entity.Entity) StringCommand(com.axibase.tsd.api.model.command.StringCommand) EntityCheck(com.axibase.tsd.api.method.checks.EntityCheck) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 5 with StringCommand

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

the class MetricCommandTest method testIncorrectInterpolation.

@Issue("3137")
@Issue("6319")
@Test(dataProvider = "incorrectInterpolationFieldProvider")
public void testIncorrectInterpolation(String value) throws Exception {
    String metricName = metric();
    StringCommand incorrectCommand = new StringCommand(String.format("metric m:%s i:%s", metricName, value));
    String assertMessage = String.format("Metric with incorrect interpolate field (%s) shouldn't be inserted", value);
    assertFalse(assertMessage, transport.send(incorrectCommand));
}
Also used : StringCommand(com.axibase.tsd.api.model.command.StringCommand) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Aggregations

StringCommand (com.axibase.tsd.api.model.command.StringCommand)8 Issue (io.qameta.allure.Issue)8 Test (org.testng.annotations.Test)8 Response (javax.ws.rs.core.Response)2 EntityCheck (com.axibase.tsd.api.method.checks.EntityCheck)1 MetricCheck (com.axibase.tsd.api.method.checks.MetricCheck)1 Entity (com.axibase.tsd.api.model.entity.Entity)1 Metric (com.axibase.tsd.api.model.metric.Metric)1