Search in sources :

Example 6 with EntityCommand

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

the class EntityCommandTest method testNewEntityTagsForNewEntity.

@Issue("3111")
@Test
public void testNewEntityTagsForNewEntity() throws Exception {
    Entity storedEntityForTags = new Entity("e-for-test-add-tags");
    storedEntityForTags.addTag(E_TAG_1, E_VAL_1);
    PlainCommand command = new EntityCommand(storedEntityForTags);
    CommandMethod.send(command);
    String assertMessage = String.format("Failed to check entity with updated tags %s", storedEntityForTags.getTags());
    assertEntityExisting(assertMessage, storedEntityForTags);
}
Also used : Entity(com.axibase.tsd.api.model.entity.Entity) PlainCommand(com.axibase.tsd.api.model.command.PlainCommand) EntityCommand(com.axibase.tsd.api.model.command.EntityCommand) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 7 with EntityCommand

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

the class EntityCommandTest method testAddNewEntityTagForExistEntity.

@Issue("3111")
@Test
public void testAddNewEntityTagForExistEntity() throws Exception {
    Entity storedEntityWithTags = new Entity("e-with-tags");
    storedEntityWithTags.addTag(E_TAG_1, E_VAL_1);
    createOrReplaceEntityCheck(storedEntityWithTags);
    storedEntityWithTags.addTag(E_TAG_2, E_VAL_2);
    PlainCommand command = new EntityCommand(storedEntityWithTags);
    CommandMethod.send(command);
    assertEntityExisting("Entity tag isn't add for existing entity", storedEntityWithTags);
}
Also used : Entity(com.axibase.tsd.api.model.entity.Entity) PlainCommand(com.axibase.tsd.api.model.command.PlainCommand) EntityCommand(com.axibase.tsd.api.model.command.EntityCommand) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 8 with EntityCommand

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

the class EntityCommandTest method testEnabled.

@Issue("3550")
@Test
public void testEnabled() throws Exception {
    Entity entity = new Entity(entity());
    entity.setEnabled(true);
    EntityCommand command = new EntityCommand(entity);
    CommandMethod.send(command);
    Checker.check(new EntityCheck(entity));
    Entity actualEntity = EntityMethod.getEntity(entity.getName());
    assertTrue("Failed to set enabled", actualEntity.getEnabled());
}
Also used : Entity(com.axibase.tsd.api.model.entity.Entity) EntityCheck(com.axibase.tsd.api.method.checks.EntityCheck) EntityCommand(com.axibase.tsd.api.model.command.EntityCommand) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 9 with EntityCommand

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

the class EntityCommandTest method testDisabled.

@Issue("3550")
@Test
public void testDisabled() throws Exception {
    Entity entity = new Entity(entity());
    entity.setEnabled(false);
    EntityCommand command = new EntityCommand(entity);
    CommandMethod.send(command);
    Checker.check(new EntityCheck(entity));
    Entity actualEntity = EntityMethod.getEntity(entity.getName());
    assertFalse("Failed to set disabled", actualEntity.getEnabled());
}
Also used : Entity(com.axibase.tsd.api.model.entity.Entity) EntityCheck(com.axibase.tsd.api.method.checks.EntityCheck) EntityCommand(com.axibase.tsd.api.model.command.EntityCommand) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Aggregations

EntityCommand (com.axibase.tsd.api.model.command.EntityCommand)9 Entity (com.axibase.tsd.api.model.entity.Entity)9 Test (org.testng.annotations.Test)9 Issue (io.qameta.allure.Issue)7 EntityCheck (com.axibase.tsd.api.method.checks.EntityCheck)4 PlainCommand (com.axibase.tsd.api.model.command.PlainCommand)4 CommandSendingResult (com.axibase.tsd.api.model.extended.CommandSendingResult)1