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);
}
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));
}
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));
}
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));
}
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));
}
Aggregations