本文整理汇总了Java中net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager.removedSwitch方法的典型用法代码示例。如果您正苦于以下问题:Java LinkDiscoveryManager.removedSwitch方法的具体用法?Java LinkDiscoveryManager.removedSwitch怎么用?Java LinkDiscoveryManager.removedSwitch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager
的用法示例。
在下文中一共展示了LinkDiscoveryManager.removedSwitch方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testRemovedSwitch
import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入方法依赖的package包/类
@Test
public void testRemovedSwitch() {
LinkDiscoveryManager topology = getTopology();
Link lt = new Link(1L, 2, 2L, 1);
NodePortTuple srcNpt = new NodePortTuple(1L, 2);
NodePortTuple dstNpt = new NodePortTuple(2L, 1);
LinkInfo info = new LinkInfo(System.currentTimeMillis(),
System.currentTimeMillis(), null,
0, 0);
topology.addOrUpdateLink(lt, info);
IOFSwitch sw1 = getMockFloodlightProvider().getSwitches().get(1L);
IOFSwitch sw2 = getMockFloodlightProvider().getSwitches().get(2L);
// Mock up our expected behavior
topology.removedSwitch(sw1);
verify(sw1, sw2);
// check invariants hold
assertNull(topology.switchLinks.get(lt.getSrc()));
assertNull(topology.switchLinks.get(lt.getDst()));
assertNull(topology.portLinks.get(srcNpt));
assertNull(topology.portLinks.get(dstNpt));
assertTrue(topology.links.isEmpty());
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:26,代码来源:LinkDiscoveryManagerTest.java
示例2: testRemovedSwitchSelf
import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入方法依赖的package包/类
@Test
public void testRemovedSwitchSelf() {
LinkDiscoveryManager topology = getTopology();
IOFSwitch sw1 = createMockSwitch(1L);
replay(sw1);
Link lt = new Link(1L, 2, 1L, 3);
LinkInfo info = new LinkInfo(System.currentTimeMillis(),
System.currentTimeMillis(), null,
0, 0);
topology.addOrUpdateLink(lt, info);
// Mock up our expected behavior
topology.removedSwitch(sw1);
verify(sw1);
// check invariants hold
assertNull(topology.switchLinks.get(lt.getSrc()));
assertNull(topology.portLinks.get(lt.getSrc()));
assertNull(topology.portLinks.get(lt.getDst()));
assertTrue(topology.links.isEmpty());
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:22,代码来源:LinkDiscoveryManagerTest.java
示例3: testRemovedSwitch
import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入方法依赖的package包/类
@Test
public void testRemovedSwitch() {
LinkDiscoveryManager linkDiscovery = getLinkDiscoveryManager();
Link lt = new Link(1L, 2, 2L, 1);
NodePortTuple srcNpt = new NodePortTuple(1L, 2);
NodePortTuple dstNpt = new NodePortTuple(2L, 1);
LinkInfo info = new LinkInfo(System.currentTimeMillis(),
System.currentTimeMillis(), null,
0, 0);
linkDiscovery.addOrUpdateLink(lt, info);
IOFSwitch sw1 = getMockFloodlightProvider().getSwitches().get(1L);
IOFSwitch sw2 = getMockFloodlightProvider().getSwitches().get(2L);
// Mock up our expected behavior
linkDiscovery.removedSwitch(sw1);
verify(sw1, sw2);
// check invariants hold
assertNull(linkDiscovery.switchLinks.get(lt.getSrc()));
assertNull(linkDiscovery.switchLinks.get(lt.getDst()));
assertNull(linkDiscovery.portLinks.get(srcNpt));
assertNull(linkDiscovery.portLinks.get(dstNpt));
assertTrue(linkDiscovery.links.isEmpty());
}
示例4: testRemovedSwitchSelf
import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入方法依赖的package包/类
@Test
public void testRemovedSwitchSelf() {
LinkDiscoveryManager linkDiscovery = getLinkDiscoveryManager();
IOFSwitch sw1 = createMockSwitch(1L);
replay(sw1);
Link lt = new Link(1L, 2, 1L, 3);
LinkInfo info = new LinkInfo(System.currentTimeMillis(),
System.currentTimeMillis(), null,
0, 0);
linkDiscovery.addOrUpdateLink(lt, info);
// Mock up our expected behavior
linkDiscovery.removedSwitch(sw1);
verify(sw1);
// check invariants hold
assertNull(linkDiscovery.switchLinks.get(lt.getSrc()));
assertNull(linkDiscovery.portLinks.get(lt.getSrc()));
assertNull(linkDiscovery.portLinks.get(lt.getDst()));
assertTrue(linkDiscovery.links.isEmpty());
}