本文整理汇总了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);
}
示例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);
}