use of com.axibase.tsd.api.model.property.Property in project atsd-api-test by axibase.
the class PropertyInsertTest method testKeyValueBoolean.
@Issue("2416")
@Test
public void testKeyValueBoolean() throws Exception {
final Property storedProperty = new Property("insert-property-t-10", "insert-property-e-10");
storedProperty.addTag("t1", "tv1");
storedProperty.addKey("k1", "true");
Map<String, Object> property = new HashMap<>();
property.put("type", storedProperty.getType());
property.put("entity", storedProperty.getEntity());
property.put("tags", storedProperty.getTags());
Map<String, Object> key = new HashMap<>();
key.put("k1", true);
property.put("key", key);
Response response = insertProperty(property);
assertEquals("Incorrect response status code", OK.getStatusCode(), response.getStatus());
assertTrue("Fail to get inserted properties", propertyExist(storedProperty));
}
use of com.axibase.tsd.api.model.property.Property in project atsd-api-test by axibase.
the class PropertyInsertTest method testKeyValueSpaces.
@Issue("2416")
@Test
public void testKeyValueSpaces() throws Exception {
Property property = new Property("insert-property-t-6", "insert-property-e-6");
property.addKey("k1", " ");
property.addTag("t1", "tv1");
property.setDate("2016-06-09T09:50:00.000Z");
Response response = insertProperty(property);
Property storedProperty = new Property(property);
storedProperty.setKey(null);
assertEquals("Incorrect response status code", OK.getStatusCode(), response.getStatus());
assertTrue("Fail to get inserted properties", propertyExist(storedProperty));
}
use of com.axibase.tsd.api.model.property.Property in project atsd-api-test by axibase.
the class PropertyInsertTest method testISOTimezoneZ.
@Issue("2850")
@Test
public void testISOTimezoneZ() throws Exception {
Property property = new Property("test1", "property-insert-test-isoz");
property.addTag("test", "test");
property.setDate("2016-07-21T00:00:00Z");
insertProperty(property);
PropertyQuery propertyQuery = new PropertyQuery();
propertyQuery.setEntity("property-insert-test-isoz");
propertyQuery.setStartDate("2016-07-21T00:00:00.000Z");
propertyQuery.setInterval(new Period(1, TimeUnit.MILLISECOND));
propertyQuery.setType(property.getType());
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 testTimeRangeMaxTimeOverflow.
@Issue("2957")
@Test
public void testTimeRangeMaxTimeOverflow() throws Exception {
Property property = new Property("t-time-range-p-4", "e-time-range-p-4");
property.addTag("ttr-t", "ttr-v");
property.setDate(Util.addOneMS(MAX_STORABLE_DATE));
Response response = insertProperty(property);
assertNotSame("Managed to insert property with date out of range", response.getStatus(), OK.getStatusCode());
assertFalse(propertyExist(property));
}
use of com.axibase.tsd.api.model.property.Property in project atsd-api-test by axibase.
the class PropertyInsertTest method testKeyValueInteger.
@Issue("2416")
@Test
public void testKeyValueInteger() throws Exception {
final Property storedProperty = new Property("insert-property-t-9", "insert-property-e-9");
storedProperty.addTag("t1", "tv1");
storedProperty.addKey("k1", "111");
Map<String, Object> property = new HashMap<>();
property.put("type", storedProperty.getType());
property.put("entity", storedProperty.getEntity());
property.put("tags", storedProperty.getTags());
Map<String, Object> key = new HashMap<>();
key.put("k1", 111);
property.put("key", key);
Response response = insertProperty(property);
assertEquals("Incorrect response status code", OK.getStatusCode(), response.getStatus());
assertTrue("Fail to get inserted properties", propertyExist(storedProperty));
}
Aggregations