Search in sources :

Example 11 with MessageCommand

use of com.axibase.tsd.api.model.command.MessageCommand in project atsd-api-test by axibase.

the class BackslashNoEscapeTest method testType.

@Issue("2854")
@Test
public void testType() throws Exception {
    Message message = new Message("message-command-test-e8", "message-command-\\test-t8");
    message.setMessage("message8");
    message.setDate(getCurrentDate());
    PlainCommand command = new MessageCommand(message);
    CommandMethod.send(command);
    assertMessageExisting("Inserted message can not be received", message);
}
Also used : Message(com.axibase.tsd.api.model.message.Message) PlainCommand(com.axibase.tsd.api.model.command.PlainCommand) MessageCommand(com.axibase.tsd.api.model.command.MessageCommand) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 12 with MessageCommand

use of com.axibase.tsd.api.model.command.MessageCommand in project atsd-api-test by axibase.

the class DoubleBackslashNoEscapeTest method testType.

@Issue("2854")
@Test
public void testType() throws Exception {
    Message message = new Message("message-command-test-e11", "message-command-\\\\test-t11");
    message.setMessage("message11");
    message.setDate(getCurrentDate());
    PlainCommand command = new MessageCommand(message);
    CommandMethod.send(command);
    assertMessageExisting("Inserted message can not be received", message);
}
Also used : Message(com.axibase.tsd.api.model.message.Message) PlainCommand(com.axibase.tsd.api.model.command.PlainCommand) MessageCommand(com.axibase.tsd.api.model.command.MessageCommand) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 13 with MessageCommand

use of com.axibase.tsd.api.model.command.MessageCommand in project atsd-api-test by axibase.

the class LengthTest method testMaxLength.

@Issue("2412")
@Test
public void testMaxLength() throws Exception {
    final Message message = new Message("e-message-max-cmd-length", "t-message-max-cmd-length");
    message.setDate(getCurrentDate());
    message.setSeverity(Severity.MAJOR.name());
    message.setMessage("");
    MessageCommand command = new MessageCommand(message);
    Integer currentLength = command.compose().length();
    String newMessage = new String(new char[MAX_LENGTH - currentLength]).replace("\0", "m");
    message.setMessage(newMessage);
    command = new MessageCommand(message);
    assertEquals("Command length is not maximal", command.compose().length(), MAX_LENGTH);
    CommandMethod.send(command);
    assertMessageExisting("Inserted message can not be received", message);
}
Also used : Message(com.axibase.tsd.api.model.message.Message) MessageCommand(com.axibase.tsd.api.model.command.MessageCommand) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 14 with MessageCommand

use of com.axibase.tsd.api.model.command.MessageCommand in project atsd-api-test by axibase.

the class DQuoteCharEscapeTest method testEntity.

@Issue("2854")
@Test
public void testEntity() throws Exception {
    Message message = new Message("message-command-test\"-e1", "message-command-test-t1");
    message.setMessage("message1");
    message.setDate(getCurrentDate());
    PlainCommand command = new MessageCommand(message);
    CommandMethod.send(command);
    assertMessageExisting("Inserted message can not be received", message);
}
Also used : Message(com.axibase.tsd.api.model.message.Message) PlainCommand(com.axibase.tsd.api.model.command.PlainCommand) MessageCommand(com.axibase.tsd.api.model.command.MessageCommand) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Aggregations

MessageCommand (com.axibase.tsd.api.model.command.MessageCommand)14 Message (com.axibase.tsd.api.model.message.Message)14 Issue (io.qameta.allure.Issue)14 Test (org.testng.annotations.Test)14 PlainCommand (com.axibase.tsd.api.model.command.PlainCommand)12 CommandSendingResult (com.axibase.tsd.api.model.extended.CommandSendingResult)1