use of org.openkilda.messaging.payload.flow.OverlappingSegmentsStats in project open-kilda by telstra.
the class IntersectionComputerTest method shouldNotFailIfNoSegments.
@Test
public void shouldNotFailIfNoSegments() {
IntersectionComputer computer = new IntersectionComputer(FLOW_ID, PATH_ID, PATH_ID_REVERSE, Collections.emptyList());
OverlappingSegmentsStats stats = computer.getOverlappingStats(NEW_PATH_ID, NEW_PATH_ID_REVERSE);
assertEquals(ZERO_STATS, stats);
}
use of org.openkilda.messaging.payload.flow.OverlappingSegmentsStats in project open-kilda by telstra.
the class IntersectionComputerTest method fullIntersection.
@Test
public void fullIntersection() {
List<FlowPath> paths = getFlowPaths();
paths.addAll(getFlowPaths(NEW_PATH_ID, NEW_PATH_ID_REVERSE, flow2));
IntersectionComputer computer = new IntersectionComputer(FLOW_ID, PATH_ID, PATH_ID_REVERSE, paths);
OverlappingSegmentsStats stats = computer.getOverlappingStats(NEW_PATH_ID, NEW_PATH_ID_REVERSE);
assertEquals(new OverlappingSegmentsStats(2, 3, 100, 100), stats);
}
use of org.openkilda.messaging.payload.flow.OverlappingSegmentsStats in project open-kilda by telstra.
the class IntersectionComputerTest method noGroupIntersections.
@Test
public void noGroupIntersections() {
List<FlowPath> paths = getFlowPaths();
IntersectionComputer computer = new IntersectionComputer(FLOW_ID, PATH_ID, PATH_ID_REVERSE, paths);
OverlappingSegmentsStats stats = computer.getOverlappingStats();
assertEquals(ZERO_STATS, stats);
}
use of org.openkilda.messaging.payload.flow.OverlappingSegmentsStats in project open-kilda by telstra.
the class IntersectionComputerTest method shouldNotIntersectPathInSameFlow.
@Test
public void shouldNotIntersectPathInSameFlow() {
List<FlowPath> paths = getFlowPaths();
FlowPath newPath = FlowPath.builder().pathId(NEW_PATH_ID).srcSwitch(makeSwitch(SWITCH_ID_A)).destSwitch(makeSwitch(SWITCH_ID_D)).segments(Lists.newArrayList(buildPathSegment(NEW_PATH_ID, SWITCH_ID_A, SWITCH_ID_D, 10, 10))).build();
flow.addPaths(newPath);
paths.add(newPath);
IntersectionComputer computer = new IntersectionComputer(FLOW_ID, PATH_ID, PATH_ID_REVERSE, paths);
OverlappingSegmentsStats stats = computer.getOverlappingStats(NEW_PATH_ID, NEW_PATH_ID_REVERSE);
assertEquals(ZERO_STATS, stats);
}
use of org.openkilda.messaging.payload.flow.OverlappingSegmentsStats in project open-kilda by telstra.
the class IntersectionComputerTest method noGroupIntersectionsInOneFlow.
@Test
public void noGroupIntersectionsInOneFlow() {
List<FlowPath> paths = getFlowPaths();
paths.addAll(getFlowPaths(NEW_PATH_ID, NEW_PATH_ID_REVERSE, flow));
IntersectionComputer computer = new IntersectionComputer(FLOW_ID, PATH_ID, PATH_ID_REVERSE, paths);
OverlappingSegmentsStats stats = computer.getOverlappingStats();
assertEquals(ZERO_STATS, stats);
}
Aggregations