use of com.axibase.tsd.api.model.message.Message in project atsd-api-test by axibase.
the class MessageInsertTest method testTimeRangeMaxTimeOverflow.
@Issue("2957")
@Test
public void testTimeRangeMaxTimeOverflow() throws Exception {
Message message = new Message("e-time-range-msg-4");
message.setMessage("msg-time-range-msg-4");
message.setDate(addOneMS(MAX_STORABLE_DATE));
Boolean success = insertMessage(message);
if (success) {
fail("Managed to insert message with date out of range");
}
}
use of com.axibase.tsd.api.model.message.Message in project atsd-api-test by axibase.
the class MessageQueryTest method testEntitiesWildcardStarChar.
@Issue("2979")
@Test
public void testEntitiesWildcardStarChar() throws Exception {
Message message = new Message("message-query-wildcard-2-1");
message.setMessage("msgtext");
message.setDate("2018-01-01T00:00:00.000Z");
insertMessageCheck(message);
Map<String, Object> query = new HashMap<>();
query.put("entities", Arrays.asList("message-query-wildcard-2*"));
query.put("startDate", message.getDate());
query.put("endDate", Util.addOneMS(message.getDate()));
final String given = queryMessageResponse(query).readEntity(String.class);
final String expected = jacksonMapper.writeValueAsString(Arrays.asList(message));
assertTrue("Message in response does not match to inserted", compareJsonString(expected, given));
}
use of com.axibase.tsd.api.model.message.Message in project atsd-api-test by axibase.
the class MessageQueryTest method testISOTimezoneMinusHourMinute.
@Issue("2850")
@Test
public void testISOTimezoneMinusHourMinute() throws Exception {
MessageQuery messageQuery = buildMessageQuery();
messageQuery.setStartDate("2018-05-20T22:37:00-01:23");
List<Message> storedMessageList = queryMessageResponse(messageQuery).readEntity(new GenericType<List<Message>>() {
});
Message storedMessage = storedMessageList.get(0);
assertEquals("Incorrect message entity", message.getEntity(), storedMessage.getEntity());
assertEquals("Incorrect message text", message.getMessage(), storedMessage.getMessage());
assertEquals("Incorrect message date", message.getDate(), storedMessage.getDate());
}
use of com.axibase.tsd.api.model.message.Message in project atsd-api-test by axibase.
the class MessageQueryTest method testISOTimezonePlusHourMinute.
@Issue("2850")
@Test
public void testISOTimezonePlusHourMinute() throws Exception {
MessageQuery messageQuery = buildMessageQuery();
messageQuery.setStartDate("2018-05-21T01:23:00+01:23");
List<Message> storedMessageList = queryMessageResponse(messageQuery).readEntity(new GenericType<List<Message>>() {
});
Message storedMessage = storedMessageList.get(0);
assertEquals("Incorrect message entity", message.getEntity(), storedMessage.getEntity());
assertEquals("Incorrect message text", message.getMessage(), storedMessage.getMessage());
assertEquals("Incorrect message date", message.getDate(), storedMessage.getDate());
}
use of com.axibase.tsd.api.model.message.Message in project atsd-api-test by axibase.
the class MessageQueryTest method testEntitiesWildcardQuestionChar.
@Issue("2979")
@Test
public void testEntitiesWildcardQuestionChar() throws Exception {
Message message = new Message("message-query-wildcard-3-1");
message.setMessage("msgtext");
message.setDate("2018-01-01T00:00:00.000Z");
insertMessageCheck(message);
Map<String, Object> query = new HashMap<>();
query.put("entities", Arrays.asList("message-query-wildcard-3-?"));
query.put("startDate", message.getDate());
query.put("endDate", Util.addOneMS(message.getDate()));
final String given = queryMessageResponse(query).readEntity(String.class);
final String expected = jacksonMapper.writeValueAsString(Arrays.asList(message));
assertTrue("Message in response does not match to inserted", compareJsonString(expected, given));
}
Aggregations