use of org.openkilda.messaging.info.event.PathInfoData in project open-kilda by telstra.
the class FlowCrudStepsTest method shouldDefineFlowsOverTheSameSwitches.
@Test
public void shouldDefineFlowsOverTheSameSwitches() {
// given
when(topologyEngineService.getPaths(eq("00:00:00:00:00:01"), eq("00:00:00:00:00:01"))).thenReturn(singletonList(new PathInfoData()));
// when
flowCrudSteps.defineFlowsOverAllSwitches();
// then
assertEquals(1, flowCrudSteps.flows.size());
final FlowPayload flowPayload = flowCrudSteps.flows.get(0);
assertEquals(20, (int) flowPayload.getSource().getPortId());
assertEquals(1, (int) flowPayload.getSource().getVlanId());
assertEquals(21, (int) flowPayload.getDestination().getPortId());
assertEquals(1, (int) flowPayload.getDestination().getVlanId());
}
use of org.openkilda.messaging.info.event.PathInfoData in project open-kilda by telstra.
the class FlowPathTest method flowPathCorrect.
@Then("^flow (.*) with (.*) (\\d+) (\\d+) and (.*) (\\d+) (\\d+) and (\\d+) path correct$")
public void flowPathCorrect(String flowId, String sourceSwitch, int sourcePort, int sourceVlan, String destinationSwitch, int destinationPort, int destinationVlan, int bandwidth) throws UnroutablePathException, InterruptedException {
Flow flow = new Flow(FlowUtils.getFlowName(flowId), bandwidth, false, flowId, sourceSwitch, sourcePort, sourceVlan, destinationSwitch, destinationPort, destinationVlan);
ImmutablePair<PathInfoData, PathInfoData> path = FlowUtils.getFlowPath(flow);
System.out.println(path);
assertEquals(expectedShortestPath, path);
}
Aggregations