use of com.axibase.tsd.api.model.message.Message in project atsd-api-test by axibase.
the class DoubleBackslashNoEscapeTest method testType.
@Issue("2854")
@Issue("6319")
@Test
public void testType() throws Exception {
Message message = new Message(Mocks.entity(), "message-command-\\\\test-t11");
message.setMessage("message11");
message.setDate(getCurrentDate());
PlainCommand command = new MessageCommand(message);
transport.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 LengthTest method testMaxLength.
@Issue("2412")
@Issue("6319")
@Test
public void testMaxLength() throws Exception {
final Message message = new Message(Mocks.entity(), "t-message-max-cmd-length");
message.setDate(getCurrentDate());
message.setSeverity(Severity.MAJOR.name());
String msg = "Length-Test-";
message.setMessage(msg);
MessageCommand command = new MessageCommand(message);
int currentLength = command.compose().length();
message.setMessage(msg + StringUtils.repeat('m', MAX_LENGTH - currentLength));
command = new MessageCommand(message);
assertEquals("Command length is not maximal", MAX_LENGTH, command.compose().length());
transport.sendNoDebug(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 MessageQuerySizeCheck method isChecked.
@Override
public boolean isChecked() {
Response response = MessageMethod.queryMessageResponse(query);
if (Response.Status.Family.SUCCESSFUL != Util.responseFamily(response)) {
return false;
}
List<Message> storedMessageList = response.readEntity(ResponseAsList.ofMessages());
return storedMessageList.size() == size;
}
Aggregations