use of com.axibase.tsd.api.model.entity.Entity in project atsd-api-test by axibase.
the class CSVUploadTest method testTimeRangeInMS.
@Issue("2957")
@Test
public void testTimeRangeInMS(Method method) throws Exception {
Entity entity = new Entity("e-csv-simple-parser-ms-1");
Metric metric = new Metric("m-csv-simple-parser-ms-1");
File csvPath = resolvePath(Paths.get(RESOURCE_DIR, "test-time-range-ms.csv").toString());
Response response = binaryCsvUpload(csvPath, SIMPLE_PARSER_MS);
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, 2);
List<Series> seriesList = SeriesMethod.querySeriesAsList(seriesQuery);
Series series = seriesList.get(0);
assertEquals("Managed to insert dataset with date out of range", 2, series.getData().size());
assertEquals("Min storable date failed to save", MIN_STORABLE_DATE, series.getData().get(0).getRawDate());
assertEquals("Incorrect stored value", "12.45", series.getData().get(0).getValue().toString());
assertEquals("Max storable date failed to save", MAX_STORABLE_DATE, series.getData().get(1).getRawDate());
assertEquals("Incorrect stored value", "10.8", series.getData().get(1).getValue().toString());
}
use of com.axibase.tsd.api.model.entity.Entity in project atsd-api-test by axibase.
the class EntityCommandTest method testModels.
/**
* Model test
*/
@Test
public void testModels() throws Exception {
final Entity sourceEntity = new Entity(entity(), Mocks.TAGS);
sourceEntity.setInterpolationMode(InterpolationMode.PREVIOUS);
sourceEntity.setLabel(Mocks.LABEL);
sourceEntity.setTimeZoneID(Mocks.TIMEZONE_ID);
sourceEntity.setEnabled(true);
EntityCommand command = new EntityCommand(sourceEntity);
CommandMethod.send(command);
String assertMessage = String.format("Inserted entity doesn't exist.%nCommand: %s", command);
assertEntityExisting(assertMessage, sourceEntity);
}
use of com.axibase.tsd.api.model.entity.Entity in project atsd-api-test by axibase.
the class EntityCommandTest method testAddNewEntityTagsMailformedForNewEntity.
@Issue("3111")
@Test
public void testAddNewEntityTagsMailformedForNewEntity() throws Exception {
Entity entity = new Entity("ent-for-test-add-tags-mailformed");
entity.addTag("hello 1", "world");
PlainCommand command = new EntityCommand(entity);
CommandSendingResult expectedResult = new CommandSendingResult(1, 0);
assertEquals(expectedResult, CommandMethod.send(command));
}
use of com.axibase.tsd.api.model.entity.Entity in project atsd-api-test by axibase.
the class EntityDeleteTest method testEntityNameContainsSlash.
@Issue("1278")
@Test
public void testEntityNameContainsSlash() throws Exception {
final Entity entity = new Entity("deleteentity/2");
createOrReplaceEntityCheck(entity);
assertEquals("Fail to execute deleteEntity query", OK.getStatusCode(), deleteEntity(entity.getName()).getStatus());
assertFalse("Entity should be deleted", entityExist(entity));
}
use of com.axibase.tsd.api.model.entity.Entity in project atsd-api-test by axibase.
the class EntityDeleteTest method testEntityNameContainsCyrillic.
@Issue("1278")
@Test
public void testEntityNameContainsCyrillic() throws Exception {
Entity entity = new Entity("deleteйёentity3");
createOrReplaceEntityCheck(entity);
assertEquals("Fail to execute deleteEntity query", OK.getStatusCode(), deleteEntity(entity.getName()).getStatus());
assertFalse("Entity should be deleted", entityExist(entity));
}
Aggregations