use of org.onosproject.net.topology.Topology in project onos by opennetworkinglab.
the class VirtualNetworkTopologyManagerTest method testGetPathsUsingNullWeight.
/**
* Test getPaths() method using a null weight.
*/
@Test(expected = NullPointerException.class)
public void testGetPathsUsingNullWeight() {
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 getPaths() method using a null weight.
Set<Path> paths = topologyService.getPaths(topology, srcVirtualDevice.id(), dstVirtualDevice.id(), (LinkWeigher) null);
}
use of org.onosproject.net.topology.Topology in project onos by opennetworkinglab.
the class VirtualNetworkTopologyManagerTest method testGetDisjointPaths.
/**
* Test getDisjointPaths() methods.
*/
@Test
public void testGetDisjointPaths() {
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.
Set<DisjointPath> paths = topologyService.getDisjointPaths(topology, srcVirtualDevice.id(), dstVirtualDevice.id());
assertNotNull("The paths should not be null.", paths);
assertEquals("The paths size did not match.", 1, paths.size());
// test the getDisjointPaths() method using a weight.
LinkWeigher weight = new LinkWeigherAdapter(1.0);
Set<DisjointPath> paths1 = topologyService.getDisjointPaths(topology, srcVirtualDevice.id(), dstVirtualDevice.id(), weight);
assertNotNull("The paths should not be null.", paths1);
assertEquals("The paths size did not match.", 1, paths1.size());
}
use of org.onosproject.net.topology.Topology in project onos by opennetworkinglab.
the class VirtualNetworkTopologyManagerTest method testGetDisjointPathsUsingNullDstDeviceId.
/**
* Test getDisjointPaths() methods using a null dst device identifier.
*/
@Test(expected = NullPointerException.class)
public void testGetDisjointPathsUsingNullDstDeviceId() {
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 dst device identifier.
Set<DisjointPath> paths = topologyService.getDisjointPaths(topology, srcVirtualDevice.id(), null);
}
use of org.onosproject.net.topology.Topology in project onos by opennetworkinglab.
the class VirtualNetworkTopologyManagerTest method testGetClusters.
/**
* Test getClusters() method.
*/
@Test
public void testGetClusters() {
VirtualNetwork virtualNetwork = setupVirtualNetworkTopology();
TopologyService topologyService = manager.get(virtualNetwork.id(), TopologyService.class);
Topology topology = topologyService.currentTopology();
// test the getClusters() method.
assertNotNull("The clusters should not be null.", topologyService.getClusters(topology));
assertEquals("The clusters size did not match.", 2, topologyService.getClusters(topology).size());
}
use of org.onosproject.net.topology.Topology in project onos by opennetworkinglab.
the class TopologyViewMessageHandlerBase method summmaryMessage.
// Returns property panel model for summary response.
protected PropertyPanel summmaryMessage() {
// chose NOT to add debug messages, since this is called every few seconds
Topology topology = services.topology().currentTopology();
LionBundle lion = getLionBundle(LION_TOPO);
String panelTitle = lion.getSafe("title_panel_summary");
return new PropertyPanel(panelTitle, "bird").addProp(VERSION, lion.getSafe(VERSION), version).addSeparator().addProp(DEVICES, lion.getSafe(DEVICES), services.device().getDeviceCount()).addProp(LINKS, lion.getSafe(LINKS), topology.linkCount()).addProp(HOSTS, lion.getSafe(HOSTS), services.host().getHostCount()).addProp(TOPOLOGY_SSCS, lion.getSafe(TOPOLOGY_SSCS), topology.clusterCount()).addSeparator().addProp(INTENTS, lion.getSafe(INTENTS), services.intent().getIntentCount()).addProp(FLOWS, lion.getSafe(FLOWS), services.flow().getFlowRuleCount());
}
Aggregations