use of com.axibase.tsd.api.model.message.Message in project atsd-api-test by axibase.
the class MessageQueryTest method testISOTimezoneZ.
@Issue("2850")
@Test
public void testISOTimezoneZ() throws Exception {
MessageQuery messageQuery = buildMessageQuery();
messageQuery.setStartDate("2018-05-21T00:00:00Z");
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 testEntityEntitiesWildcardSame.
@Issue("2979")
@Test
public void testEntityEntitiesWildcardSame() throws Exception {
Message message = new Message("message-query-wildcard-4-1");
message.setMessage("msgtext");
message.setDate("2018-01-01T00:00:00.000Z");
insertMessageCheck(message);
message.setEntity("message-query-wildcard-4-2");
insertMessageCheck(message);
message.setEntity("message-query-wildcard-4-3");
insertMessageCheck(message);
final String pattern = "message-query-wildcard-4*";
Map<String, Object> query = new HashMap<>();
query.put("entity", pattern);
query.put("startDate", message.getDate());
query.put("endDate", Util.addOneMS(message.getDate()));
final String entitiesResponse = queryMessageResponse(query).readEntity(String.class);
query.remove("entity");
query.put("entities", Collections.singletonList(pattern));
final String entityResponse = queryMessageResponse(query).readEntity(String.class);
assertEquals("Message in response does not match to inserted", entitiesResponse, entityResponse);
}
use of com.axibase.tsd.api.model.message.Message in project atsd-api-test by axibase.
the class DQuoteCharEscapeTest method testType.
@Issue("2854")
@Test
public void testType() throws Exception {
Message message = new Message("message-command-test-e2", "message-command-\"test-t2");
message.setMessage("message2");
message.setDate(getCurrentDate());
PlainCommand command = new MessageCommand(message);
CommandMethod.send(command);
assertMessageExisting("Inserted message can not be received", message);
}
use of com.axibase.tsd.api.model.message.Message in project atsd-api-test by axibase.
the class DQuoteCharEscapeTest method testText.
@Issue("2854")
@Test
public void testText() throws Exception {
Message message = new Message("message-command-test-e3", "message-command-test-t3");
message.setMessage("mess\"age3");
message.setDate(getCurrentDate());
PlainCommand command = new MessageCommand(message);
CommandMethod.send(command);
assertMessageExisting("Inserted message can not be received", message);
}
use of com.axibase.tsd.api.model.message.Message in project atsd-api-test by axibase.
the class EqualCharEscapeTest method testEscapeText.
@Issue("2854")
@Test
public void testEscapeText() throws Exception {
Message message = new Message("message-command-test-e6", "message-command-test-t6");
message.setMessage("mess=age6");
message.setDate(getCurrentDate());
PlainCommand command = new MessageCommand(message);
CommandMethod.send(command);
assertMessageExisting("Inserted message can not be received", message);
}
Aggregations