Search in sources :

Example 21 with EntityGroup

use of com.axibase.tsd.api.model.entitygroup.EntityGroup in project atsd-api-test by axibase.

the class EntityGroupUpdateTest method testNameContainsWhitespace.

@Issue("1278")
@Test
public void testNameContainsWhitespace() throws Exception {
    EntityGroup entityGroup = new EntityGroup("urlencodeupdate entitygroup1");
    assertUrlEncodePathHandledCorrectly(entityGroup);
}
Also used : EntityGroup(com.axibase.tsd.api.model.entitygroup.EntityGroup) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 22 with EntityGroup

use of com.axibase.tsd.api.model.entitygroup.EntityGroup in project atsd-api-test by axibase.

the class EntityGroupUpdateTest method assertUrlEncodePathHandledCorrectly.

public void assertUrlEncodePathHandledCorrectly(final EntityGroup entityGroup) throws Exception {
    entityGroup.addTag("oldtag1", "oldtagvalue1");
    createOrReplaceEntityGroupCheck(entityGroup);
    EntityGroup updatedEntityGroup = new EntityGroup();
    updatedEntityGroup.setName(entityGroup.getName());
    updatedEntityGroup.addTag("oldtag1", "newtagvalue1");
    updatedEntityGroup.setEnabled(true);
    if (entityGroupExist(updatedEntityGroup)) {
        throw new IllegalArgumentException("Updated entity group should not exist before execution of updateEntityGroup query");
    }
    Response response = updateEntityGroup(updatedEntityGroup);
    assertEquals("Fail to execute updateEntityGroup query", OK.getStatusCode(), response.getStatus());
    assertTrue("Updated entityGroup should exist", entityGroupExist(updatedEntityGroup));
    assertFalse("Old entityGroup should not exist", entityGroupExist(entityGroup));
}
Also used : Response(javax.ws.rs.core.Response) EntityGroup(com.axibase.tsd.api.model.entitygroup.EntityGroup)

Example 23 with EntityGroup

use of com.axibase.tsd.api.model.entitygroup.EntityGroup in project atsd-api-test by axibase.

the class EntityGroupUpdateTest method testCanSetEmptyExpression.

@Issue("3301")
@Test
public void testCanSetEmptyExpression() throws Exception {
    EntityGroup entityGroup = new EntityGroup("update-entitygroup-4");
    entityGroup.setExpression(SYNTAX_ALLOWED_ENTITYGROUP_EXPRESSION);
    createOrReplaceEntityGroupCheck(entityGroup);
    entityGroup.setExpression("");
    assertEquals("Fail to execute updateEntityGroup query", OK.getStatusCode(), updateEntityGroup(entityGroup).getStatus());
    assertTrue("Specified entityGroup does not exist", entityGroupExist(entityGroup));
}
Also used : EntityGroup(com.axibase.tsd.api.model.entitygroup.EntityGroup) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 24 with EntityGroup

use of com.axibase.tsd.api.model.entitygroup.EntityGroup in project atsd-api-test by axibase.

the class SqlStandardCollectionViewTest method prepareData.

@BeforeClass
public static void prepareData() throws Exception {
    // Series data
    List<Series> seriesList = new ArrayList<>();
    seriesList.add(new Series(TEST_ENTITY1_NAME, TEST_METRIC1_NAME, TAGS) {

        {
            addSamples(Sample.ofDateInteger("2016-06-29T08:00:00.000Z", 0));
        }
    });
    seriesList.add(new Series(TEST_ENTITY2_NAME, TEST_METRIC2_NAME) {

        {
            addSamples(Sample.ofDateInteger("2016-06-29T08:00:00.000Z", 1));
        }
    });
    // Entity data
    EntityMethod.createOrReplaceEntity(new Entity(TEST_ENTITY1_NAME, TAGS));
    // Metric data
    MetricMethod.createOrReplaceMetric(new Metric(TEST_METRIC1_NAME, TAGS));
    SeriesMethod.insertSeriesCheck(seriesList);
    // Entity groups data
    EntityGroupMethod.createOrReplaceEntityGroup(new EntityGroup(TEST_ENTITY_GROUP1_NAME));
    EntityGroupMethod.createOrReplaceEntityGroup(new EntityGroup(TEST_ENTITY_GROUP2_NAME));
    EntityGroupMethod.addEntities(TEST_ENTITY_GROUP1_NAME, Collections.singletonList(TEST_ENTITY1_NAME));
    EntityGroupMethod.addEntities(TEST_ENTITY_GROUP2_NAME, Collections.singletonList(TEST_ENTITY1_NAME));
}
Also used : Series(com.axibase.tsd.api.model.series.Series) Entity(com.axibase.tsd.api.model.entity.Entity) EntityGroup(com.axibase.tsd.api.model.entitygroup.EntityGroup) Metric(com.axibase.tsd.api.model.metric.Metric) BeforeClass(org.testng.annotations.BeforeClass)

Example 25 with EntityGroup

use of com.axibase.tsd.api.model.entitygroup.EntityGroup in project atsd-api-test by axibase.

the class SqlEntityGroupsWhereClauseTest method prepareData.

@BeforeClass
public static void prepareData() throws Exception {
    Series series = new Series(TEST_ENTITY_NAME, TEST_METRIC_NAME) {

        {
            addSamples(Sample.ofDateInteger("2016-07-14T15:00:07.000Z", 0));
        }
    };
    SeriesMethod.insertSeriesCheck(Collections.singletonList(series));
    EntityGroupMethod.createOrReplaceEntityGroup(new EntityGroup(TEST_ENTITY_GROUP1_NAME));
    EntityGroupMethod.createOrReplaceEntityGroup(new EntityGroup(TEST_ENTITY_GROUP2_NAME));
    EntityGroupMethod.createOrReplaceEntityGroup(new EntityGroup(TEST_CASE_SENSITIVITY_GROUP_NAME));
}
Also used : Series(com.axibase.tsd.api.model.series.Series) EntityGroup(com.axibase.tsd.api.model.entitygroup.EntityGroup) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

EntityGroup (com.axibase.tsd.api.model.entitygroup.EntityGroup)33 Issue (io.qameta.allure.Issue)29 Test (org.testng.annotations.Test)29 Response (javax.ws.rs.core.Response)4 Series (com.axibase.tsd.api.model.series.Series)3 BeforeClass (org.testng.annotations.BeforeClass)3 Entity (com.axibase.tsd.api.model.entity.Entity)1 Metric (com.axibase.tsd.api.model.metric.Metric)1 Property (com.axibase.tsd.api.model.property.Property)1