Search in sources :

Example 1 with OverlappingSegmentsStats

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);
}
Also used : OverlappingSegmentsStats(org.openkilda.messaging.payload.flow.OverlappingSegmentsStats) Test(org.junit.Test)

Example 2 with OverlappingSegmentsStats

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);
}
Also used : OverlappingSegmentsStats(org.openkilda.messaging.payload.flow.OverlappingSegmentsStats) FlowPath(org.openkilda.model.FlowPath) Test(org.junit.Test)

Example 3 with OverlappingSegmentsStats

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);
}
Also used : OverlappingSegmentsStats(org.openkilda.messaging.payload.flow.OverlappingSegmentsStats) FlowPath(org.openkilda.model.FlowPath) Test(org.junit.Test)

Example 4 with OverlappingSegmentsStats

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);
}
Also used : OverlappingSegmentsStats(org.openkilda.messaging.payload.flow.OverlappingSegmentsStats) FlowPath(org.openkilda.model.FlowPath) Test(org.junit.Test)

Example 5 with OverlappingSegmentsStats

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);
}
Also used : OverlappingSegmentsStats(org.openkilda.messaging.payload.flow.OverlappingSegmentsStats) FlowPath(org.openkilda.model.FlowPath) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)9 OverlappingSegmentsStats (org.openkilda.messaging.payload.flow.OverlappingSegmentsStats)9 FlowPath (org.openkilda.model.FlowPath)8