use of com.axibase.tsd.api.model.property.Property in project atsd-api-test by axibase.
the class PropertyInsertTest method testSameTimeSamePropertyConjunction.
@Issue("2957")
@Test
public void testSameTimeSamePropertyConjunction() throws Exception {
final long timeMillis = System.currentTimeMillis();
final Property property = new Property("insert-type8", "insert-entity8");
property.addTag("t1", "tv1");
property.setDate(timeMillis);
insertPropertyCheck(property);
final Property property2 = new Property();
property2.setType(property.getType());
property2.setEntity(property.getEntity());
property2.setDate(timeMillis);
property2.addTag("t2", "tv2");
insertPropertyCheck(property2);
final Property resultProperty = new Property();
resultProperty.setType(property.getType());
resultProperty.setEntity(property.getEntity());
resultProperty.setDate(timeMillis);
resultProperty.addTag("t1", "tv1");
resultProperty.addTag("t2", "tv2");
assertTrue(propertyExist(resultProperty));
}
use of com.axibase.tsd.api.model.property.Property in project atsd-api-test by axibase.
the class PropertyInsertTest method testISOTimezoneMinusHourMinute.
@Issue("2850")
@Test
public void testISOTimezoneMinusHourMinute() throws Exception {
String entityName = "property-insert-test-iso-hm";
Property property = new Property("test3", entityName);
property.addTag("test", "test");
property.setDate("2016-07-20T22:37:00-01:23");
insertProperty(property);
PropertyQuery propertyQuery = new PropertyQuery();
propertyQuery.setType(property.getType());
propertyQuery.setEntity(entityName);
propertyQuery.setStartDate("2016-07-21T00:00:00.000Z");
propertyQuery.setInterval(new Period(1, TimeUnit.MILLISECOND));
List<Property> storedPropertyList = queryProperty(propertyQuery).readEntity(new GenericType<List<Property>>() {
});
Property storedProperty = storedPropertyList.get(0);
assertEquals("Incorrect property entity", property.getEntity(), storedProperty.getEntity());
assertEquals("Incorrect property tags", property.getTags(), storedProperty.getTags());
assertEquals("Incorrect property date", propertyQuery.getStartDate(), storedProperty.getDate());
}
use of com.axibase.tsd.api.model.property.Property in project atsd-api-test by axibase.
the class PropertyInsertTest method testTagValueNull.
@Issue("2416")
@Test
public void testTagValueNull() throws Exception {
Property property = new Property("insert-property-t-3", "insert-property-e-3");
property.addTag("t1", null);
property.setDate("2016-06-09T09:50:00.000Z");
Response response = insertProperty(property);
assertEquals("Query should fail if tag contain only null values", BAD_REQUEST.getStatusCode(), response.getStatus());
assertFalse("Inserted property should not be stored", propertyExist(property));
}
use of com.axibase.tsd.api.model.property.Property in project atsd-api-test by axibase.
the class PropertyInsertTest method testXXTimezoneUnsupported.
@Issue("2850")
@Test
public void testXXTimezoneUnsupported() throws Exception {
String entityName = "property-insert-test-xx-timezone";
String type = "test5";
Property property = new Property(type, entityName);
property.addTag("test", "test");
property.setDate("2016-06-09T09:50:00-1010");
Response response = insertProperty(property);
assertEquals("Incorrect response status code", BAD_REQUEST.getStatusCode(), response.getStatus());
assertEquals("Error message mismatch", DATE_FILTER_INVALID_FORMAT, extractErrorMessage(response));
}
use of com.axibase.tsd.api.model.property.Property in project atsd-api-test by axibase.
the class PropertyInsertTest method testKeyValueNull.
@Issue("2416")
@Test
public void testKeyValueNull() throws Exception {
Property property = new Property("insert-property-t-1", "insert-property-e-1");
property.addKey("k1", null);
property.addTag("t1", "tv1");
property.setDate("2016-06-09T09:50:00.000Z");
Response response = insertProperty(property);
Property storedProperty = new Property(property);
storedProperty.setKey(new HashMap<String, String>());
assertEquals("Incorrect response status code", OK.getStatusCode(), response.getStatus());
assertTrue("Fail to get inserted properties", propertyExist(storedProperty));
}
Aggregations