Search in sources :

Example 1 with HealthCheckCommandData

use of org.openkilda.messaging.command.discovery.HealthCheckCommandData in project open-kilda by telstra.

the class AbstractSerializerTest method dumpNetworkCommandTest.

@Test
public void dumpNetworkCommandTest() throws IOException, ClassNotFoundException {
    HealthCheckCommandData data = new HealthCheckCommandData("requester");
    System.out.println(data);
    CommandMessage command = new CommandMessage(data, System.currentTimeMillis(), CORRELATION_ID, DESTINATION);
    command.setData(data);
    serialize(command);
    Message message = (Message) deserialize();
    assertTrue(message instanceof CommandMessage);
    CommandMessage resultCommand = (CommandMessage) message;
    assertTrue(resultCommand.getData() != null);
    HealthCheckCommandData resultData = (HealthCheckCommandData) resultCommand.getData();
    System.out.println(resultData);
    assertEquals(data, resultData);
    assertEquals(data.hashCode(), resultData.hashCode());
}
Also used : HealthCheckCommandData(org.openkilda.messaging.command.discovery.HealthCheckCommandData) InfoMessage(org.openkilda.messaging.info.InfoMessage) Message(org.openkilda.messaging.Message) CommandMessage(org.openkilda.messaging.command.CommandMessage) ErrorMessage(org.openkilda.messaging.error.ErrorMessage) CommandMessage(org.openkilda.messaging.command.CommandMessage) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 Message (org.openkilda.messaging.Message)1 CommandMessage (org.openkilda.messaging.command.CommandMessage)1 HealthCheckCommandData (org.openkilda.messaging.command.discovery.HealthCheckCommandData)1 ErrorMessage (org.openkilda.messaging.error.ErrorMessage)1 InfoMessage (org.openkilda.messaging.info.InfoMessage)1