Search in sources :

Example 11 with Entity

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

the class EntityCreateOrReplaceTest method testEmptyTagsReplaceExisting.

@Issue("1968")
@Test
public void testEmptyTagsReplaceExisting() throws Exception {
    Entity entity = new Entity("create-entity-9");
    entity.addTag("tagkey", "tagvalue");
    createOrReplaceEntityCheck(entity);
    entity.setTags(new HashMap<String, String>());
    try {
        createOrReplaceEntityCheck(entity);
    } catch (IllegalStateException e) {
        fail("Fail to replace tags if new tags are empty");
    }
}
Also used : Entity(com.axibase.tsd.api.model.entity.Entity) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 12 with Entity

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

the class EntityGetGroupsTest method testEntityNameContainsSlash.

@Issue("1278")
@Test
public void testEntityNameContainsSlash() throws Exception {
    Entity entity = new Entity("getgroups/entity-2");
    createOrReplaceEntityCheck(entity);
    assertUrlencodedPathHandledSuccessfullyOnGetGroups(entity);
}
Also used : Entity(com.axibase.tsd.api.model.entity.Entity) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 13 with Entity

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

the class EntityGetGroupsTest method testEntityNameContainsCyrillic.

@Issue("1278")
@Test
public void testEntityNameContainsCyrillic() throws Exception {
    Entity entity = new Entity("getgroupsйёentity-3");
    createOrReplaceEntityCheck(entity);
    assertUrlencodedPathHandledSuccessfullyOnGetGroups(entity);
}
Also used : Entity(com.axibase.tsd.api.model.entity.Entity) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 14 with Entity

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

the class EntityGetPropertyTypesTest method testEntityNameContainsCyrillic.

@Issue("1278")
@Test
public void testEntityNameContainsCyrillic() throws Exception {
    Entity entity = new Entity("get_property_types_йёentity-3");
    createOrReplaceEntityCheck(entity);
    assertUrlencodedPathHandledSuccessfullyOnGetPropertyTypes(entity);
}
Also used : Entity(com.axibase.tsd.api.model.entity.Entity) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 15 with Entity

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

the class GroupByEntityTagTest method prepareData.

@BeforeClass
public static void prepareData() throws Exception {
    List<Series> seriesList = new ArrayList<>();
    String[] tags = { "1", "-1", "-3.14", "word", "word1 word2_" };
    Metric metric = new Metric(TEST_METRIC_NAME);
    MetricMethod.createOrReplaceMetricCheck(metric);
    ZonedDateTime seriesStartDate = ZonedDateTime.parse("2016-01-01T00:00:00Z");
    for (int i = 0; i < tags.length; i++) {
        String testEntityNameTagsCase = entity();
        Entity entity = new Entity(testEntityNameTagsCase);
        entity.addTag("tagname", tags[i]);
        EntityMethod.createOrReplaceEntityCheck(entity);
        Series series = new Series();
        series.setEntity(testEntityNameTagsCase);
        series.setMetric(TEST_METRIC_NAME);
        series.addSamples(Sample.ofDateInteger(seriesStartDate.plusSeconds(i).toString(), i), Sample.ofDateInteger(seriesStartDate.plusSeconds(i + 60).toString(), i + 1));
        seriesList.add(series);
    }
    SeriesMethod.insertSeriesCheck(seriesList);
}
Also used : Series(com.axibase.tsd.api.model.series.Series) Entity(com.axibase.tsd.api.model.entity.Entity) ZonedDateTime(java.time.ZonedDateTime) ArrayList(java.util.ArrayList) Metric(com.axibase.tsd.api.model.metric.Metric) BeforeClass(org.testng.annotations.BeforeClass)

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