use of org.openkilda.messaging.info.InfoMessage in project open-kilda by telstra.
the class FlowTopologyTest method getFlowTopologyEngineBoltTest.
@Test
@Ignore
public void getFlowTopologyEngineBoltTest() throws Exception {
ConsumerRecord<String, String> nbRecord;
String flowId = UUID.randomUUID().toString();
Flow payload = getFlowCommand(flowId);
nbRecord = nbConsumer.pollMessage();
assertNotNull(nbRecord);
assertNotNull(nbRecord.value());
InfoMessage response = objectMapper.readValue(nbRecord.value(), InfoMessage.class);
assertNotNull(response);
FlowResponse responseData = (FlowResponse) response.getData();
assertNotNull(responseData);
assertEquals(payload, responseData.getPayload());
}
use of org.openkilda.messaging.info.InfoMessage in project open-kilda by telstra.
the class FlowTopologyTest method pathFlowCommand.
private PathInfoData pathFlowCommand(final String flowId) throws IOException {
System.out.println("TOPOLOGY: Path flow");
PathInfoData payload = new PathInfoData(0L, Collections.singletonList(new PathNode("test-switch", 1, 0, null)));
FlowPathResponse infoData = new FlowPathResponse(payload);
InfoMessage infoMessage = new InfoMessage(infoData, 0, "path-flow", Destination.WFM);
sendTopologyEngineMessage(infoMessage);
return payload;
}
use of org.openkilda.messaging.info.InfoMessage in project open-kilda by telstra.
the class FlowTopologyTest method deleteFlowCommandBoltTest.
@Test
public void deleteFlowCommandBoltTest() throws Exception {
String flowId = UUID.randomUUID().toString();
ConsumerRecord<String, String> record;
createFlow(flowId);
record = cacheConsumer.pollMessage();
assertNotNull(record);
assertNotNull(record.value());
record = nbConsumer.pollMessage();
assertNotNull(record);
assertNotNull(record.value());
Flow payload = deleteFlow(flowId);
record = cacheConsumer.pollMessage();
assertNotNull(record);
assertNotNull(record.value());
InfoMessage message = objectMapper.readValue(record.value(), InfoMessage.class);
assertNotNull(message);
ImmutablePair<Flow, Flow> flow = getFlowPayload(message);
assertNotNull(flow);
Flow flowTePayload = flow.getLeft();
assertEquals(payload.getFlowId(), flowTePayload.getFlowId());
record = nbConsumer.pollMessage();
assertNotNull(record);
assertNotNull(record.value());
System.out.println("record = " + record);
InfoMessage infoMessage = objectMapper.readValue(record.value(), InfoMessage.class);
FlowResponse response = (FlowResponse) infoMessage.getData();
assertNotNull(response);
}
use of org.openkilda.messaging.info.InfoMessage in project open-kilda by telstra.
the class FlowTopologyTest method errorMessageStatusBoltSpeakerBoltTest.
@Test
public void errorMessageStatusBoltSpeakerBoltTest() throws Exception {
String flowId = UUID.randomUUID().toString();
ConsumerRecord<String, String> record;
createFlow(flowId);
record = cacheConsumer.pollMessage();
assertNotNull(record);
assertNotNull(record.value());
record = nbConsumer.pollMessage();
assertNotNull(record);
assertNotNull(record.value());
statusFlow(flowId);
record = nbConsumer.pollMessage();
assertNotNull(record);
assertNotNull(record.value());
InfoMessage infoMessageUp = objectMapper.readValue(record.value(), InfoMessage.class);
assertNotNull(infoMessageUp);
FlowStatusResponse infoDataUp = (FlowStatusResponse) infoMessageUp.getData();
assertNotNull(infoDataUp);
FlowIdStatusPayload flowNbPayloadUp = infoDataUp.getPayload();
assertNotNull(flowNbPayloadUp);
assertEquals(flowId, flowNbPayloadUp.getId());
assertEquals(FlowState.ALLOCATED, flowNbPayloadUp.getStatus());
errorFlowSpeakerCommand(flowId);
statusFlow(flowId);
record = nbConsumer.pollMessage();
assertNotNull(record);
assertNotNull(record.value());
InfoMessage infoMessageDown = objectMapper.readValue(record.value(), InfoMessage.class);
assertNotNull(infoMessageDown);
FlowStatusResponse infoDataDown = (FlowStatusResponse) infoMessageDown.getData();
assertNotNull(infoDataDown);
FlowIdStatusPayload flowNbPayloadDown = infoDataDown.getPayload();
assertNotNull(flowNbPayloadDown);
assertEquals(flowId, flowNbPayloadDown.getId());
assertEquals(FlowState.DOWN, flowNbPayloadDown.getStatus());
}
use of org.openkilda.messaging.info.InfoMessage in project open-kilda by telstra.
the class FlowTopologyTest method getPathTopologyEngineBoltTest.
@Test
@Ignore
public void getPathTopologyEngineBoltTest() throws Exception {
ConsumerRecord<String, String> nbRecord;
String flowId = UUID.randomUUID().toString();
PathInfoData payload = pathFlowCommand(flowId);
nbRecord = nbConsumer.pollMessage();
assertNotNull(nbRecord);
assertNotNull(nbRecord.value());
InfoMessage response = objectMapper.readValue(nbRecord.value(), InfoMessage.class);
assertNotNull(response);
FlowPathResponse responseData = (FlowPathResponse) response.getData();
assertNotNull(responseData);
assertEquals(payload, responseData.getPayload());
}
Aggregations