Search in sources :

Example 16 with Message

use of com.axibase.tsd.api.model.message.Message in project atsd-api-test by axibase.

the class EqualCharEscapeTest method testEntity.

@Issue("2854")
@Test
public void testEntity() throws Exception {
    Message message = new Message("message-command-test=-e4", "message-command-test-t4");
    message.setMessage("message4");
    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 17 with Message

use of com.axibase.tsd.api.model.message.Message in project atsd-api-test by axibase.

the class EqualCharEscapeTest method testType.

@Issue("2854")
@Test
public void testType() throws Exception {
    Message message = new Message("message-command-test-e5", "message-command-=test-t5");
    message.setMessage("message5");
    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 18 with Message

use of com.axibase.tsd.api.model.message.Message 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)

Example 19 with Message

use of com.axibase.tsd.api.model.message.Message in project atsd-api-test by axibase.

the class MessageQueryStatsTest method insertMessages.

@BeforeClass
public void insertMessages() throws Exception {
    Message message = new Message(MESSAGE_STATS_ENTITY, MESSAGE_STATS_TYPE);
    message.setMessage("message-stats-test");
    for (String date : DATES) {
        message.setDate(date);
        insertMessageCheck(message);
    }
}
Also used : Message(com.axibase.tsd.api.model.message.Message) BeforeClass(org.testng.annotations.BeforeClass)

Example 20 with Message

use of com.axibase.tsd.api.model.message.Message in project atsd-api-test by axibase.

the class MessageSeverityQueryTest method testMinSeverityFilter.

@Issue("2917")
@Test(dataProvider = "severities", description = "minSeverity is >= filter")
public void testMinSeverityFilter(Severity severity) throws Exception {
    String key = severity.name();
    Integer minimumSeverity = severity.getNumVal();
    messageQuery.setMinSeverity(key);
    List<Message> messages = queryMessageResponse(messageQuery).readEntity(new GenericType<List<Message>>() {
    });
    for (Message m : messages) {
        int actualSeverity = valueOf(m.getSeverity()).getNumVal();
        String errMessage = String.format("Received severity (%d) should be greater than minSeverity (%d)", actualSeverity, minimumSeverity);
        assertTrue(errMessage, actualSeverity >= minimumSeverity);
    }
}
Also used : Message(com.axibase.tsd.api.model.message.Message) List(java.util.List) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Aggregations

Message (com.axibase.tsd.api.model.message.Message)35 Issue (io.qameta.allure.Issue)32 Test (org.testng.annotations.Test)32 MessageCommand (com.axibase.tsd.api.model.command.MessageCommand)14 PlainCommand (com.axibase.tsd.api.model.command.PlainCommand)12 MessageQuery (com.axibase.tsd.api.model.message.MessageQuery)10 List (java.util.List)8 Response (javax.ws.rs.core.Response)4 Period (com.axibase.tsd.api.model.Period)3 Date (java.util.Date)2 BeforeClass (org.testng.annotations.BeforeClass)2 CommandSendingResult (com.axibase.tsd.api.model.extended.CommandSendingResult)1 Severity (com.axibase.tsd.api.model.message.Severity)1 GenericType (javax.ws.rs.core.GenericType)1