use of com.axibase.tsd.api.model.entity.Entity in project atsd-api-test by axibase.
the class EntityGetTest method testEntityNameContainsSlash.
@Issue("1278")
@Test
public void testEntityNameContainsSlash() throws Exception {
Entity entity = new Entity("getentity/2");
createOrReplaceEntityCheck(entity);
assertEntityExisting(entity);
}
use of com.axibase.tsd.api.model.entity.Entity in project atsd-api-test by axibase.
the class EntityUpdateTest method testEntityNameContainsWhitespace.
@Issue("1278")
@Test
public void testEntityNameContainsWhitespace() throws Exception {
Entity entity = new Entity("updateentity 1");
assertEquals("Method should fail if entityName contains whitespace", BAD_REQUEST.getStatusCode(), updateEntity(entity).getStatus());
}
use of com.axibase.tsd.api.model.entity.Entity in project atsd-api-test by axibase.
the class EntityUpdateTest method testEntityNameContainsCyrillic.
@Issue("1278")
@Test
public void testEntityNameContainsCyrillic() throws Exception {
Entity entity = new Entity("update_йёentity3");
entity.addTag("t1", "tv1");
createOrReplaceEntityCheck(entity);
Map<String, String> newTags = new HashMap<>();
newTags.put("t2", "tv2");
assertUrlencodedPathHandledSuccessfullyOnUpdate(entity, newTags);
}
use of com.axibase.tsd.api.model.entity.Entity in project atsd-api-test by axibase.
the class PropertyDeleteTest method testEntityTagsExactTrue.
@Test
public void testEntityTagsExactTrue() throws Exception {
final String entityTagsType = "$entity_tags";
final Entity entity = new Entity("delete-entity10");
entity.addTag("t1", "v1");
entity.addTag("t2", "v2");
final Property property = new Property();
property.setType(entityTagsType);
property.setEntity(entity.getName());
property.setTags(entity.getTags());
EntityMethod.createOrReplaceEntityCheck(entity);
assertTrue(propertyExist(property));
PropertyQuery deleteQuery = new PropertyQuery();
deleteQuery.setType("$entity_tags");
deleteQuery.setEntity(entity.getName());
deleteQuery.setExactMatch(true);
assertEquals("Fail to execute delete query", OK.getStatusCode(), deleteProperty(deleteQuery).getStatus());
assertTrue(propertyExist(property));
}
use of com.axibase.tsd.api.model.entity.Entity in project atsd-api-test by axibase.
the class CSVUploadTest method testFileWithLineBreak.
@Issue("3011")
@Test(dataProvider = "parserProvider")
public void testFileWithLineBreak(Method method, int numTest, String lineBreakType, String parser, Integer dataSize) throws Exception {
String nameSuffix = String.format("-%s-parser-ms-%d", lineBreakType, numTest);
Entity entity = new Entity("e" + nameSuffix);
Metric metric = new Metric("m" + nameSuffix);
String confFileName = String.format("test-%s-parser.csv", lineBreakType);
File csvPath = resolvePath(Paths.get(RESOURCE_DIR, confFileName).toString());
Response response = binaryCsvUpload(csvPath, parser, entity.getName());
assertEquals("Failed to upload file", OK.getStatusCode(), response.getStatus());
SeriesQuery seriesQuery = new SeriesQuery(entity.getName(), metric.getName(), MIN_QUERYABLE_DATE, MAX_QUERYABLE_DATE);
assertSeriesQueryDataSize(seriesQuery, dataSize);
Sample sample = SeriesMethod.querySeriesAsList(seriesQuery).get(0).getData().get(0);
Calendar serverCalendar = new GregorianCalendar(TimeZone.getTimeZone(timezone));
serverCalendar.clear();
serverCalendar.set(2015, Calendar.MARCH, 24, 6, 17);
assertEquals("Incorrect stored value", LINE_BREAKS_TEST_VALUE, sample.getValue().toString());
assertEquals("Date failed to save", serverCalendar.getTime(), parseDate(sample.getRawDate()));
}
Aggregations