use of com.axibase.tsd.api.method.checks.EntityCheck in project atsd-api-test by axibase.
the class SqlInsertNonExistentEntityTest method testEntityCreationWithLabelWhenInserting.
@Test(description = "Tests that entity with label is created after INSERT INTO command if it did not exist.")
@Issue("5962")
public void testEntityCreationWithLabelWhenInserting() {
Entity entity = new Entity(Mocks.entity()).setLabel(Mocks.LABEL);
String sqlQuery = insertionType.insertionQuery(metric, ImmutableMap.of("entity", entity.getName(), "datetime", ISO_TIME, "value", VALUE, "entity.label", entity.getLabel()));
assertOkRequest("Insertion of series with nonexistent entity with label failed!", sqlQuery);
Checker.check(new EntityCheck(entity));
}
use of com.axibase.tsd.api.method.checks.EntityCheck in project atsd-api-test by axibase.
the class SqlInsertNonExistentEntityTest method testEntityCreationWithWhitespacesWhenInserting.
@Test(description = "Tests that entity with whitespaces in is created after INSERT INTO command if it did not exist.")
@Issue("5962")
public void testEntityCreationWithWhitespacesWhenInserting() {
String entityNameWithWhiteSpaces = Mocks.entity().replaceAll("-", " ");
Entity entity = new Entity(entityNameWithWhiteSpaces.replaceAll(" ", "_"));
String sqlQuery = insertionType.insertionQuery(metric, ImmutableMap.of("entity", entityNameWithWhiteSpaces, "datetime", ISO_TIME, "value", VALUE));
assertOkRequest("Insertion of series with nonexistent entity with whitespaces in name entity failed!", sqlQuery);
Checker.check(new EntityCheck(entity));
}
use of com.axibase.tsd.api.method.checks.EntityCheck in project atsd-api-test by axibase.
the class EntityCommandTest method testNullEnabled.
@Issue("3550")
@Issue("6319")
@Test
public void testNullEnabled() throws Exception {
Entity entity = new Entity(Mocks.entity());
entity.setEnabled(null);
EntityCommand command = new EntityCommand(entity);
String assertMessage = "Failed to omit enabled";
assertTrue(assertMessage, transport.send(command));
Checker.check(new EntityCheck(entity));
Entity actualEntity = EntityMethod.getEntity(entity.getName());
assertTrue(assertMessage, actualEntity.getEnabled());
}
use of com.axibase.tsd.api.method.checks.EntityCheck 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());
}
use of com.axibase.tsd.api.method.checks.EntityCheck in project atsd-api-test by axibase.
the class EntityCommandTest method testEnabled.
@Issue("3550")
@Issue("6319")
@Test
public void testEnabled() throws Exception {
Entity entity = new Entity(Mocks.entity());
entity.setEnabled(true);
EntityCommand command = new EntityCommand(entity);
String assertMessage = "Failed to set enabled";
assertTrue(assertMessage, transport.send(command));
Checker.check(new EntityCheck(entity));
Entity actualEntity = EntityMethod.getEntity(entity.getName());
assertTrue(assertMessage, actualEntity.getEnabled());
}
Aggregations