Search in sources :

Example 46 with Entity

use of com.axibase.tsd.api.model.entity.Entity in project atsd-api-test by axibase.

the class EntityCommandTest method testNullEnabled.

@Issue("3550")
@Test
public void testNullEnabled() throws Exception {
    Entity entity = new Entity(entity());
    entity.setEnabled(null);
    EntityCommand command = new EntityCommand(entity);
    CommandMethod.send(command);
    Checker.check(new EntityCheck(entity));
    Entity actualEntity = EntityMethod.getEntity(entity.getName());
    assertTrue("Failed to omit 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 47 with Entity

use of com.axibase.tsd.api.model.entity.Entity 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 48 with Entity

use of com.axibase.tsd.api.model.entity.Entity 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 49 with Entity

use of com.axibase.tsd.api.model.entity.Entity 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 50 with Entity

use of com.axibase.tsd.api.model.entity.Entity 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

Entity (com.axibase.tsd.api.model.entity.Entity)77 Test (org.testng.annotations.Test)60 Issue (io.qameta.allure.Issue)43 Metric (com.axibase.tsd.api.model.metric.Metric)21 Series (com.axibase.tsd.api.model.series.Series)21 BeforeClass (org.testng.annotations.BeforeClass)15 PropertyQuery (com.axibase.tsd.api.model.property.PropertyQuery)12 EntityCommand (com.axibase.tsd.api.model.command.EntityCommand)9 HashMap (java.util.HashMap)9 Property (com.axibase.tsd.api.model.property.Property)8 SeriesQuery (com.axibase.tsd.api.model.series.query.SeriesQuery)6 EntityCheck (com.axibase.tsd.api.method.checks.EntityCheck)5 Response (javax.ws.rs.core.Response)5 PlainCommand (com.axibase.tsd.api.model.command.PlainCommand)4 File (java.io.File)4 SqlTest (com.axibase.tsd.api.method.sql.SqlTest)3 SeriesSearchResultRecord (com.axibase.tsd.api.model.series.search.SeriesSearchResultRecord)3 Sample (com.axibase.tsd.api.model.series.Sample)2 SeriesSearchQuery (com.axibase.tsd.api.model.series.search.SeriesSearchQuery)2 BigDecimal (java.math.BigDecimal)2