当前位置: 首页>>代码示例>>Java>>正文


Java LinkDiscoveryManager.addOrUpdateLink方法代码示例

本文整理汇总了Java中net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager.addOrUpdateLink方法的典型用法代码示例。如果您正苦于以下问题:Java LinkDiscoveryManager.addOrUpdateLink方法的具体用法?Java LinkDiscoveryManager.addOrUpdateLink怎么用?Java LinkDiscoveryManager.addOrUpdateLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager的用法示例。


在下文中一共展示了LinkDiscoveryManager.addOrUpdateLink方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testAddOrUpdateLink

import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入方法依赖的package包/类
@Test
public void testAddOrUpdateLink() throws Exception {
    LinkDiscoveryManager topology = getTopology();

    Link lt = new Link(1L, 2, 2L, 1);
    LinkInfo info = new LinkInfo(System.currentTimeMillis(),
                                 System.currentTimeMillis(), null,
                                 0, 0);
    topology.addOrUpdateLink(lt, info);


    NodePortTuple srcNpt = new NodePortTuple(1L, 2);
    NodePortTuple dstNpt = new NodePortTuple(2L, 1);

    // check invariants hold
    assertNotNull(topology.switchLinks.get(lt.getSrc()));
    assertTrue(topology.switchLinks.get(lt.getSrc()).contains(lt));
    assertNotNull(topology.portLinks.get(srcNpt));
    assertTrue(topology.portLinks.get(srcNpt).contains(lt));
    assertNotNull(topology.portLinks.get(dstNpt));
    assertTrue(topology.portLinks.get(dstNpt).contains(lt));
    assertTrue(topology.links.containsKey(lt));
}
 
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:24,代码来源:LinkDiscoveryManagerTest.java

示例2: testDeleteLink

import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入方法依赖的package包/类
@Test
public void testDeleteLink() throws Exception {
    LinkDiscoveryManager topology = getTopology();

    Link lt = new Link(1L, 2, 2L, 1);
    LinkInfo info = new LinkInfo(System.currentTimeMillis(),
                                 System.currentTimeMillis(), null,
                                 0, 0);
    topology.addOrUpdateLink(lt, info);
    topology.deleteLinks(Collections.singletonList(lt), "Test");

    // check invariants hold
    assertNull(topology.switchLinks.get(lt.getSrc()));
    assertNull(topology.switchLinks.get(lt.getDst()));
    assertNull(topology.portLinks.get(lt.getSrc()));
    assertNull(topology.portLinks.get(lt.getDst()));
    assertTrue(topology.links.isEmpty());
}
 
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:19,代码来源:LinkDiscoveryManagerTest.java

示例3: testAddOrUpdateLinkToSelf

import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入方法依赖的package包/类
@Test
public void testAddOrUpdateLinkToSelf() throws Exception {
    LinkDiscoveryManager topology = getTopology();

    Link lt = new Link(1L, 2, 2L, 3);
    NodePortTuple srcNpt = new NodePortTuple(1L, 2);
    NodePortTuple dstNpt = new NodePortTuple(2L, 3);

    LinkInfo info = new LinkInfo(System.currentTimeMillis(),
                                 System.currentTimeMillis(), null,
                                 0, 0);
    topology.addOrUpdateLink(lt, info);

    // check invariants hold
    assertNotNull(topology.switchLinks.get(lt.getSrc()));
    assertTrue(topology.switchLinks.get(lt.getSrc()).contains(lt));
    assertNotNull(topology.portLinks.get(srcNpt));
    assertTrue(topology.portLinks.get(srcNpt).contains(lt));
    assertNotNull(topology.portLinks.get(dstNpt));
    assertTrue(topology.portLinks.get(dstNpt).contains(lt));
    assertTrue(topology.links.containsKey(lt));
}
 
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:23,代码来源:LinkDiscoveryManagerTest.java

示例4: testDeleteLinkToSelf

import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入方法依赖的package包/类
@Test
public void testDeleteLinkToSelf() throws Exception {
    LinkDiscoveryManager topology = getTopology();

    Link lt = new Link(1L, 2, 1L, 3);
    NodePortTuple srcNpt = new NodePortTuple(1L, 2);
    NodePortTuple dstNpt = new NodePortTuple(2L, 3);

    LinkInfo info = new LinkInfo(System.currentTimeMillis(),
                                 System.currentTimeMillis(), null,
                                 0, 0);
    topology.addOrUpdateLink(lt, info);
    topology.deleteLinks(Collections.singletonList(lt), "Test to self");

    // 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,代码行数:22,代码来源:LinkDiscoveryManagerTest.java

示例5: 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

示例6: 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

示例7: testAddOrUpdateLink

import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入方法依赖的package包/类
@Test
public void testAddOrUpdateLink() throws Exception {
    LinkDiscoveryManager linkDiscovery = getLinkDiscoveryManager();

    Link lt = new Link(1L, 2, 2L, 1);
    LinkInfo info = new LinkInfo(System.currentTimeMillis(),
                                 System.currentTimeMillis(), null,
                                 0, 0);
    linkDiscovery.addOrUpdateLink(lt, info);


    NodePortTuple srcNpt = new NodePortTuple(1L, 2);
    NodePortTuple dstNpt = new NodePortTuple(2L, 1);

    // check invariants hold
    assertNotNull(linkDiscovery.switchLinks.get(lt.getSrc()));
    assertTrue(linkDiscovery.switchLinks.get(lt.getSrc()).contains(lt));
    assertNotNull(linkDiscovery.portLinks.get(srcNpt));
    assertTrue(linkDiscovery.portLinks.get(srcNpt).contains(lt));
    assertNotNull(linkDiscovery.portLinks.get(dstNpt));
    assertTrue(linkDiscovery.portLinks.get(dstNpt).contains(lt));
    assertTrue(linkDiscovery.links.containsKey(lt));
}
 
开发者ID:dana-i2cat,项目名称:floodlight-nfv,代码行数:24,代码来源:LinkDiscoveryManagerTest.java

示例8: testDeleteLink

import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入方法依赖的package包/类
@Test
public void testDeleteLink() throws Exception {
    LinkDiscoveryManager linkDiscovery = getLinkDiscoveryManager();

    Link lt = new Link(1L, 2, 2L, 1);
    LinkInfo info = new LinkInfo(System.currentTimeMillis(),
                                 System.currentTimeMillis(), null,
                                 0, 0);
    linkDiscovery.addOrUpdateLink(lt, info);
    linkDiscovery.deleteLinks(Collections.singletonList(lt), "Test");

    // check invariants hold
    assertNull(linkDiscovery.switchLinks.get(lt.getSrc()));
    assertNull(linkDiscovery.switchLinks.get(lt.getDst()));
    assertNull(linkDiscovery.portLinks.get(lt.getSrc()));
    assertNull(linkDiscovery.portLinks.get(lt.getDst()));
    assertTrue(linkDiscovery.links.isEmpty());
}
 
开发者ID:dana-i2cat,项目名称:floodlight-nfv,代码行数:19,代码来源:LinkDiscoveryManagerTest.java

示例9: 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());
}
 
开发者ID:wallnerryan,项目名称:FL_HAND,代码行数:26,代码来源:LinkDiscoveryManagerTest.java

示例10: testAddOrUpdateLinkToSelf

import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入方法依赖的package包/类
@Test
public void testAddOrUpdateLinkToSelf() throws Exception {
    LinkDiscoveryManager linkDiscovery = getLinkDiscoveryManager();

    Link lt = new Link(1L, 2, 2L, 3);
    NodePortTuple srcNpt = new NodePortTuple(1L, 2);
    NodePortTuple dstNpt = new NodePortTuple(2L, 3);

    LinkInfo info = new LinkInfo(System.currentTimeMillis(),
                                 System.currentTimeMillis(), null,
                                 0, 0);
    linkDiscovery.addOrUpdateLink(lt, info);

    // check invariants hold
    assertNotNull(linkDiscovery.switchLinks.get(lt.getSrc()));
    assertTrue(linkDiscovery.switchLinks.get(lt.getSrc()).contains(lt));
    assertNotNull(linkDiscovery.portLinks.get(srcNpt));
    assertTrue(linkDiscovery.portLinks.get(srcNpt).contains(lt));
    assertNotNull(linkDiscovery.portLinks.get(dstNpt));
    assertTrue(linkDiscovery.portLinks.get(dstNpt).contains(lt));
    assertTrue(linkDiscovery.links.containsKey(lt));
}
 
开发者ID:andi-bigswitch,项目名称:floodlight-oss,代码行数:23,代码来源:LinkDiscoveryManagerTest.java

示例11: testHARoleChange

import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入方法依赖的package包/类
@Test
public void testHARoleChange() throws Exception {
    LinkDiscoveryManager topology = getTopology();
    IOFSwitch sw1 = createMockSwitch(1L);
    IOFSwitch sw2 = createMockSwitch(2L);
    replay(sw1, sw2);
    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);

    // check invariants hold
    assertNotNull(topology.switchLinks.get(lt.getSrc()));
    assertTrue(topology.switchLinks.get(lt.getSrc()).contains(lt));
    assertNotNull(topology.portLinks.get(srcNpt));
    assertTrue(topology.portLinks.get(srcNpt).contains(lt));
    assertNotNull(topology.portLinks.get(dstNpt));
    assertTrue(topology.portLinks.get(dstNpt).contains(lt));
    assertTrue(topology.links.containsKey(lt));
    
    // check that it clears from memory
    getMockFloodlightProvider().dispatchRoleChanged(null, Role.SLAVE);
    assertTrue(topology.switchLinks.isEmpty());
    getMockFloodlightProvider().dispatchRoleChanged(Role.SLAVE, Role.MASTER);
    // check that lldps were sent
    assertTrue(ldm.isSendLLDPsCalled);
    assertTrue(ldm.isClearLinksCalled);
    ldm.reset();
}
 
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:33,代码来源:LinkDiscoveryManagerTest.java

示例12: testHARoleChange

import net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager; //导入方法依赖的package包/类
@Test
public void testHARoleChange() throws Exception {
    LinkDiscoveryManager linkDiscovery = getLinkDiscoveryManager();
    IOFSwitch sw1 = createMockSwitch(1L);
    IOFSwitch sw2 = createMockSwitch(2L);
    replay(sw1, sw2);
    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);

    // check invariants hold
    assertNotNull(linkDiscovery.switchLinks.get(lt.getSrc()));
    assertTrue(linkDiscovery.switchLinks.get(lt.getSrc()).contains(lt));
    assertNotNull(linkDiscovery.portLinks.get(srcNpt));
    assertTrue(linkDiscovery.portLinks.get(srcNpt).contains(lt));
    assertNotNull(linkDiscovery.portLinks.get(dstNpt));
    assertTrue(linkDiscovery.portLinks.get(dstNpt).contains(lt));
    assertTrue(linkDiscovery.links.containsKey(lt));
    
    // check that it clears from memory
    getMockFloodlightProvider().dispatchRoleChanged(null, Role.SLAVE);
    assertTrue(linkDiscovery.switchLinks.isEmpty());
    getMockFloodlightProvider().dispatchRoleChanged(Role.SLAVE, Role.MASTER);
    // check that lldps were sent
    assertTrue(ldm.isSendLLDPsCalled);
    assertTrue(ldm.isClearLinksCalled);
    ldm.reset();
}
 
开发者ID:dana-i2cat,项目名称:floodlight-nfv,代码行数:33,代码来源:LinkDiscoveryManagerTest.java


注:本文中的net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager.addOrUpdateLink方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。