use of org.onosproject.net.DisjointPath in project onos by opennetworkinglab.
the class VirtualNetworkTopologyManagerTest method testGetDisjointPathsUsingNullRiskProfile.
/**
* Test getDisjointPaths() methods using a null risk profile.
*/
@Test(expected = NullPointerException.class)
public void testGetDisjointPathsUsingNullRiskProfile() {
VirtualNetwork virtualNetwork = setupVirtualNetworkTopology();
TopologyService topologyService = manager.get(virtualNetwork.id(), TopologyService.class);
Topology topology = topologyService.currentTopology();
VirtualDevice srcVirtualDevice = getVirtualDevice(virtualNetwork.id(), DID1);
VirtualDevice dstVirtualDevice = getVirtualDevice(virtualNetwork.id(), DID2);
// test the getDisjointPaths() method using a null risk profile.
Set<DisjointPath> paths = topologyService.getDisjointPaths(topology, srcVirtualDevice.id(), dstVirtualDevice.id(), (Map<Link, Object>) null);
}
use of org.onosproject.net.DisjointPath in project onos by opennetworkinglab.
the class VirtualNetworkTopologyManagerTest method testGetDisjointPathsUsingNullWeight.
/**
* Test getDisjointPaths() methods using a null weight.
*/
@Test(expected = NullPointerException.class)
public void testGetDisjointPathsUsingNullWeight() {
VirtualNetwork virtualNetwork = setupVirtualNetworkTopology();
TopologyService topologyService = manager.get(virtualNetwork.id(), TopologyService.class);
Topology topology = topologyService.currentTopology();
VirtualDevice srcVirtualDevice = getVirtualDevice(virtualNetwork.id(), DID1);
VirtualDevice dstVirtualDevice = getVirtualDevice(virtualNetwork.id(), DID2);
// test the getDisjointPaths() method using a null weight.
Set<DisjointPath> paths = topologyService.getDisjointPaths(topology, srcVirtualDevice.id(), dstVirtualDevice.id(), (LinkWeigher) null);
}
use of org.onosproject.net.DisjointPath in project onos by opennetworkinglab.
the class VirtualNetworkTopologyManagerTest method testGetDisjointPathsUsingNullSrcDeviceId.
/**
* Test getDisjointPaths() methods using a null src device identifier.
*/
@Test(expected = NullPointerException.class)
public void testGetDisjointPathsUsingNullSrcDeviceId() {
VirtualNetwork virtualNetwork = setupVirtualNetworkTopology();
TopologyService topologyService = manager.get(virtualNetwork.id(), TopologyService.class);
Topology topology = topologyService.currentTopology();
VirtualDevice srcVirtualDevice = getVirtualDevice(virtualNetwork.id(), DID1);
VirtualDevice dstVirtualDevice = getVirtualDevice(virtualNetwork.id(), DID2);
// test the getDisjointPaths() method using a null src device identifier.
Set<DisjointPath> paths = topologyService.getDisjointPaths(topology, null, dstVirtualDevice.id());
}
use of org.onosproject.net.DisjointPath in project onos by opennetworkinglab.
the class PathPainterTopovMessageHandler method hilightAndSendPaths.
private void hilightAndSendPaths() {
PathLinkMap linkMap = new PathLinkMap();
allPathLinks.forEach(linkMap::add);
Set<Link> selectedPathLinks;
// the other containing all paths links.
if (currentMode.equals(Mode.DISJOINT)) {
DisjointPath dp = (DisjointPath) paths.get(pathIndex);
selectedPathLinks = paths.isEmpty() ? ImmutableSet.of() : Sets.newHashSet(dp.primary().links());
selectedPathLinks.addAll(dp.backup().links());
} else {
selectedPathLinks = paths.isEmpty() ? ImmutableSet.of() : ImmutableSet.copyOf(paths.get(pathIndex).links());
}
Highlights highlights = new Highlights();
if (highlightDelay > 0) {
highlights.delay(highlightDelay);
}
for (PathLink plink : linkMap.biLinks()) {
plink.computeHilight(selectedPathLinks, allPathLinks);
highlights.add(plink.highlight(null));
}
if (src != null) {
highlights = addBadge(highlights, srcType, src.toString(), SRC);
}
if (dst != null) {
highlights = addBadge(highlights, dstType, dst.toString(), DST);
}
sendMessage(highlightsMessage(highlights));
}
Aggregations