Search in sources :

Example 16 with ErrorData

use of org.openkilda.messaging.error.ErrorData in project open-kilda by telstra.

the class FlowTopologyTest method errorFlowSpeakerCommand.

private ErrorMessage errorFlowSpeakerCommand(final String flowId) throws IOException {
    System.out.println("TOPOLOGY: Error rule");
    ErrorData errorData = new ErrorData(ErrorType.REQUEST_INVALID, "Could not operate with flow", flowId);
    ErrorMessage errorMessage = new ErrorMessage(errorData, 0, "error-flow", Destination.WFM_TRANSACTION);
    // sendSpeakerMessage(errorMessage);
    sendMessage(errorMessage, topologyConfig.getKafkaFlowTopic());
    return errorMessage;
}
Also used : ErrorMessage(org.openkilda.messaging.error.ErrorMessage) ErrorData(org.openkilda.messaging.error.ErrorData)

Example 17 with ErrorData

use of org.openkilda.messaging.error.ErrorData in project open-kilda by telstra.

the class FlowTopologyTest method getUnknownFlowTest.

@Test
public void getUnknownFlowTest() throws Exception {
    String flowId = UUID.randomUUID().toString();
    ConsumerRecord<String, String> record;
    getFlow(flowId);
    record = nbConsumer.pollMessage();
    assertNotNull(record);
    assertNotNull(record.value());
    ErrorMessage errorMessage = objectMapper.readValue(record.value(), ErrorMessage.class);
    assertNotNull(errorMessage);
    ErrorData errorData = errorMessage.getData();
    assertEquals(ErrorType.NOT_FOUND, errorData.getErrorType());
}
Also used : ErrorMessage(org.openkilda.messaging.error.ErrorMessage) ErrorData(org.openkilda.messaging.error.ErrorData) AbstractStormTest(org.openkilda.wfm.AbstractStormTest) Test(org.junit.Test)

Example 18 with ErrorData

use of org.openkilda.messaging.error.ErrorData in project open-kilda by telstra.

the class FlowTopologyTest method pathUnknownFlowTest.

@Test
public void pathUnknownFlowTest() throws Exception {
    String flowId = UUID.randomUUID().toString();
    ConsumerRecord<String, String> record;
    pathFlow(flowId);
    record = nbConsumer.pollMessage();
    assertNotNull(record);
    assertNotNull(record.value());
    ErrorMessage errorMessage = objectMapper.readValue(record.value(), ErrorMessage.class);
    assertNotNull(errorMessage);
    ErrorData errorData = errorMessage.getData();
    assertEquals(ErrorType.NOT_FOUND, errorData.getErrorType());
}
Also used : ErrorMessage(org.openkilda.messaging.error.ErrorMessage) ErrorData(org.openkilda.messaging.error.ErrorData) AbstractStormTest(org.openkilda.wfm.AbstractStormTest) Test(org.junit.Test)

Aggregations

ErrorData (org.openkilda.messaging.error.ErrorData)18 ErrorMessage (org.openkilda.messaging.error.ErrorMessage)18 Test (org.junit.Test)11 AbstractStormTest (org.openkilda.wfm.AbstractStormTest)10 InfoMessage (org.openkilda.messaging.info.InfoMessage)8 ISwitchManager (org.openkilda.floodlight.switchmanager.ISwitchManager)2 SwitchOperationException (org.openkilda.floodlight.switchmanager.SwitchOperationException)2 InstallOneSwitchFlow (org.openkilda.messaging.command.flow.InstallOneSwitchFlow)2 RemoveFlow (org.openkilda.messaging.command.flow.RemoveFlow)2 MessageException (org.openkilda.messaging.error.MessageException)2 InfoData (org.openkilda.messaging.info.InfoData)2 FlowStatusResponse (org.openkilda.messaging.info.flow.FlowStatusResponse)2 SwitchRulesResponse (org.openkilda.messaging.info.switches.SwitchRulesResponse)2 Flow (org.openkilda.messaging.model.Flow)2 FlowIdStatusPayload (org.openkilda.messaging.payload.flow.FlowIdStatusPayload)2 DatapathId (org.projectfloodlight.openflow.types.DatapathId)2 Message (org.openkilda.messaging.Message)1 CommandMessage (org.openkilda.messaging.command.CommandMessage)1 DeleteRulesAction (org.openkilda.messaging.command.switches.DeleteRulesAction)1 InstallRulesAction (org.openkilda.messaging.command.switches.InstallRulesAction)1