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


Java HandshakeState.START属性代码示例

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


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

示例1: testChannelDisconnected

@Test
public void testChannelDisconnected() throws Exception {
    OFChannelState state = new OFChannelState();
    state.hsState = OFChannelState.HandshakeState.READY;
    Controller.OFChannelHandler chdlr = controller.new OFChannelHandler(state);
    chdlr.sw = createMock(OFSwitchImpl.class);
    
    // Switch is active 
    expect(chdlr.sw.getId()).andReturn(0L).anyTimes();
    expect(chdlr.sw.getStringId()).andReturn("00:00:00:00:00:00:00:00")
                .anyTimes();
    chdlr.sw.cancelAllStatisticsReplies();
    chdlr.sw.setConnected(false);
    expect(chdlr.sw.isConnected()).andReturn(true);
    
    controller.connectedSwitches.add(chdlr.sw);
    controller.activeSwitches.put(0L, chdlr.sw);
    
    replay(chdlr.sw);
    chdlr.channelDisconnected(null, null);
    verify(chdlr.sw);
    
    // Switch is connected but not active
    reset(chdlr.sw);
    expect(chdlr.sw.getId()).andReturn(0L).anyTimes();
    chdlr.sw.setConnected(false);
    replay(chdlr.sw);
    chdlr.channelDisconnected(null, null);
    verify(chdlr.sw);
    
    // Not in ready state
    state.hsState = HandshakeState.START;
    reset(chdlr.sw);
    replay(chdlr.sw);
    chdlr.channelDisconnected(null, null);
    verify(chdlr.sw);
    
    // Switch is null
    state.hsState = HandshakeState.READY;
    chdlr.sw = null;
    chdlr.channelDisconnected(null, null);
}
 
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:42,代码来源:ControllerTest.java

示例2: testChannelDisconnected

@Test
public void testChannelDisconnected() throws Exception {
    OFChannelState state = new OFChannelState();
    state.hsState = OFChannelState.HandshakeState.READY;
    Controller.OFChannelHandler chdlr = controller.new OFChannelHandler(state);
    chdlr.sw = createMock(IOFSwitch.class);

    // Switch is active
    expect(chdlr.sw.getId()).andReturn(0L).anyTimes();
    expect(chdlr.sw.getStringId()).andReturn("00:00:00:00:00:00:00:00")
                .anyTimes();
    chdlr.sw.cancelAllStatisticsReplies();
    chdlr.sw.setConnected(false);
    expect(chdlr.sw.isConnected()).andReturn(true);

    controller.connectedSwitches.add(chdlr.sw);
    controller.activeSwitches.put(0L, chdlr.sw);

    replay(chdlr.sw);
    chdlr.channelDisconnected(null, null);
    verify(chdlr.sw);

    // Switch is connected but not active
    reset(chdlr.sw);
    expect(chdlr.sw.getId()).andReturn(0L).anyTimes();
    chdlr.sw.setConnected(false);
    replay(chdlr.sw);
    chdlr.channelDisconnected(null, null);
    verify(chdlr.sw);

    // Not in ready state
    state.hsState = HandshakeState.START;
    reset(chdlr.sw);
    replay(chdlr.sw);
    chdlr.channelDisconnected(null, null);
    verify(chdlr.sw);

    // Switch is null
    state.hsState = HandshakeState.READY;
    chdlr.sw = null;
    chdlr.channelDisconnected(null, null);
}
 
开发者ID:dana-i2cat,项目名称:floodlight-nfv,代码行数:42,代码来源:ControllerTest.java

示例3: testChannelDisconnected

@Test
public void testChannelDisconnected() throws Exception {
    OFChannelState state = new OFChannelState();
    state.hsState = OFChannelState.HandshakeState.READY;
    Controller.OFChannelHandler chdlr = controller.new OFChannelHandler(state);
    chdlr.sw = createMock(IOFSwitch.class);
    
    // Switch is active 
    expect(chdlr.sw.getId()).andReturn(0L).anyTimes();
    expect(chdlr.sw.getStringId()).andReturn("00:00:00:00:00:00:00:00")
                .anyTimes();
    chdlr.sw.cancelAllStatisticsReplies();
    chdlr.sw.setConnected(false);
    expect(chdlr.sw.isConnected()).andReturn(true);
    
    controller.connectedSwitches.add(chdlr.sw);
    controller.activeSwitches.put(0L, chdlr.sw);
    
    replay(chdlr.sw);
    chdlr.channelDisconnected(null, null);
    verify(chdlr.sw);
    
    // Switch is connected but not active
    reset(chdlr.sw);
    expect(chdlr.sw.getId()).andReturn(0L).anyTimes();
    chdlr.sw.setConnected(false);
    replay(chdlr.sw);
    chdlr.channelDisconnected(null, null);
    verify(chdlr.sw);
    
    // Not in ready state
    state.hsState = HandshakeState.START;
    reset(chdlr.sw);
    replay(chdlr.sw);
    chdlr.channelDisconnected(null, null);
    verify(chdlr.sw);
    
    // Switch is null
    state.hsState = HandshakeState.READY;
    chdlr.sw = null;
    chdlr.channelDisconnected(null, null);
}
 
开发者ID:wallnerryan,项目名称:FL_HAND,代码行数:42,代码来源:ControllerTest.java


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