Java 类net.floodlightcontroller.core.internal.OFChannelInitializer.PipelineHandshakeTimeout 实例源码
项目:fresco_floodlight
文件:OFChannelHandler.java
/**
* Sets the channel pipeline's handshake timeout to a more appropriate value
* for the remaining part of the switch handshake.
*/
private void setSwitchHandshakeTimeout() {
HandshakeTimeoutHandler handler = new HandshakeTimeoutHandler(
this,
this.timer,
PipelineHandshakeTimeout.SWITCH);
pipeline.replace(PipelineHandler.CHANNEL_HANDSHAKE_TIMEOUT,
PipelineHandler.SWITCH_HANDSHAKE_TIMEOUT, handler);
}
项目:fresco_floodlight
文件:OFChannelHandlerVer13Test.java
/** Move the channel from scratch to WAIT_FEATURES_REPLY state
* Builds on moveToWaitHello()
* adds testing for WAIT_HELLO state
*/
@Test
public void moveToComplete() throws Exception {
moveToWaitFeaturesReply();
reset(pipeline);
HandshakeTimeoutHandler newHandler = new HandshakeTimeoutHandler(
handler,
timer,
PipelineHandshakeTimeout.SWITCH);
expect(
pipeline.replace(EasyMock.eq(PipelineHandler.CHANNEL_HANDSHAKE_TIMEOUT),
EasyMock.eq(PipelineHandler.SWITCH_HANDSHAKE_TIMEOUT),
EasyMock.anyObject(HandshakeTimeoutHandler.class))).andReturn(newHandler)
.once();
replay(pipeline);
newConnectionListener.connectionOpened(capture(newConnection), capture(newFeaturesReply));
expectLastCall().once();
replay(newConnectionListener);
sendMessageToHandlerWithControllerReset(Collections.<OFMessage>singletonList(featuresReply));
assertThat(handler.getStateForTesting(), CoreMatchers.instanceOf(OFChannelHandler.CompleteState.class));
assertTrue("A connection has been created and set", handler.getConnectionForTesting() != null);
verify(newConnectionListener);
assertTrue(newConnection.hasCaptured());
assertThat(newFeaturesReply.getValue(), equalTo(featuresReply));
}
项目:fresco_floodlight
文件:OFChannelHandlerVer10Test.java
/** Move the channel from scratch to WAIT_FEATURES_REPLY state
* Builds on moveToWaitHello()
* adds testing for WAIT_HELLO state
*/
@Test
public void moveToComplete() throws Exception {
moveToWaitFeaturesReply();
reset(pipeline);
HandshakeTimeoutHandler newHandler = new HandshakeTimeoutHandler(
handler,
timer,
PipelineHandshakeTimeout.SWITCH);
expect(
pipeline.replace(EasyMock.eq(PipelineHandler.CHANNEL_HANDSHAKE_TIMEOUT),
EasyMock.eq(PipelineHandler.SWITCH_HANDSHAKE_TIMEOUT),
EasyMock.anyObject(HandshakeTimeoutHandler.class))).andReturn(newHandler)
.once();
replay(pipeline);
reset(newConnectionListener);
newConnectionListener.connectionOpened(capture(newConnection), capture(newFeaturesReply));
expectLastCall().once();
replay(newConnectionListener);
sendMessageToHandlerWithControllerReset(Collections.<OFMessage>singletonList(featuresReply));
assertThat(handler.getStateForTesting(), CoreMatchers.instanceOf(OFChannelHandler.CompleteState.class));
assertTrue("A connection has been created and set", handler.getConnectionForTesting() != null);
}
项目:SDN-Multicast
文件:OFChannelHandler.java
/**
* Sets the channel pipeline's handshake timeout to a more appropriate value
* for the remaining part of the switch handshake.
*/
private void setSwitchHandshakeTimeout() {
HandshakeTimeoutHandler handler = new HandshakeTimeoutHandler(
this,
this.timer,
PipelineHandshakeTimeout.SWITCH);
pipeline.replace(PipelineHandler.CHANNEL_HANDSHAKE_TIMEOUT,
PipelineHandler.SWITCH_HANDSHAKE_TIMEOUT, handler);
}
项目:SDN-Multicast
文件:OFChannelHandlerVer13Test.java
/** Move the channel from scratch to WAIT_FEATURES_REPLY state
* Builds on moveToWaitHello()
* adds testing for WAIT_HELLO state
*/
@Test
public void moveToComplete() throws Exception {
moveToWaitFeaturesReply();
reset(pipeline);
HandshakeTimeoutHandler newHandler = new HandshakeTimeoutHandler(
handler,
timer,
PipelineHandshakeTimeout.SWITCH);
expect(
pipeline.replace(EasyMock.eq(PipelineHandler.CHANNEL_HANDSHAKE_TIMEOUT),
EasyMock.eq(PipelineHandler.SWITCH_HANDSHAKE_TIMEOUT),
EasyMock.anyObject(HandshakeTimeoutHandler.class))).andReturn(newHandler)
.once();
replay(pipeline);
newConnectionListener.connectionOpened(capture(newConnection), capture(newFeaturesReply));
expectLastCall().once();
replay(newConnectionListener);
sendMessageToHandlerWithControllerReset(Collections.<OFMessage>singletonList(featuresReply));
assertThat(handler.getStateForTesting(), CoreMatchers.instanceOf(OFChannelHandler.CompleteState.class));
assertTrue("A connection has been created and set", handler.getConnectionForTesting() != null);
verify(newConnectionListener);
assertTrue(newConnection.hasCaptured());
assertThat(newFeaturesReply.getValue(), equalTo(featuresReply));
}
项目:SDN-Multicast
文件:OFChannelHandlerVer10Test.java
/** Move the channel from scratch to WAIT_FEATURES_REPLY state
* Builds on moveToWaitHello()
* adds testing for WAIT_HELLO state
*/
@Test
public void moveToComplete() throws Exception {
moveToWaitFeaturesReply();
reset(pipeline);
HandshakeTimeoutHandler newHandler = new HandshakeTimeoutHandler(
handler,
timer,
PipelineHandshakeTimeout.SWITCH);
expect(
pipeline.replace(EasyMock.eq(PipelineHandler.CHANNEL_HANDSHAKE_TIMEOUT),
EasyMock.eq(PipelineHandler.SWITCH_HANDSHAKE_TIMEOUT),
EasyMock.anyObject(HandshakeTimeoutHandler.class))).andReturn(newHandler)
.once();
replay(pipeline);
reset(newConnectionListener);
newConnectionListener.connectionOpened(capture(newConnection), capture(newFeaturesReply));
expectLastCall().once();
replay(newConnectionListener);
sendMessageToHandlerWithControllerReset(Collections.<OFMessage>singletonList(featuresReply));
assertThat(handler.getStateForTesting(), CoreMatchers.instanceOf(OFChannelHandler.CompleteState.class));
assertTrue("A connection has been created and set", handler.getConnectionForTesting() != null);
}
项目:arscheduler
文件:OFChannelHandler.java
/**
* Sets the channel pipeline's handshake timeout to a more appropriate value
* for the remaining part of the switch handshake.
*/
private void setSwitchHandshakeTimeout() {
HandshakeTimeoutHandler handler = new HandshakeTimeoutHandler(
this,
this.timer,
PipelineHandshakeTimeout.SWITCH);
pipeline.replace(PipelineHandler.CHANNEL_HANDSHAKE_TIMEOUT,
PipelineHandler.SWITCH_HANDSHAKE_TIMEOUT, handler);
}
项目:arscheduler
文件:OFChannelHandlerVer13Test.java
/** Move the channel from scratch to WAIT_FEATURES_REPLY state
* Builds on moveToWaitHello()
* adds testing for WAIT_HELLO state
*/
@Test
public void moveToComplete() throws Exception {
moveToWaitFeaturesReply();
reset(pipeline);
HandshakeTimeoutHandler newHandler = new HandshakeTimeoutHandler(
handler,
timer,
PipelineHandshakeTimeout.SWITCH);
expect(
pipeline.replace(EasyMock.eq(PipelineHandler.CHANNEL_HANDSHAKE_TIMEOUT),
EasyMock.eq(PipelineHandler.SWITCH_HANDSHAKE_TIMEOUT),
EasyMock.anyObject(HandshakeTimeoutHandler.class))).andReturn(newHandler)
.once();
replay(pipeline);
newConnectionListener.connectionOpened(capture(newConnection), capture(newFeaturesReply));
expectLastCall().once();
replay(newConnectionListener);
sendMessageToHandlerWithControllerReset(Collections.<OFMessage>singletonList(featuresReply));
assertThat(handler.getStateForTesting(), CoreMatchers.instanceOf(OFChannelHandler.CompleteState.class));
assertTrue("A connection has been created and set", handler.getConnectionForTesting() != null);
verify(newConnectionListener);
assertTrue(newConnection.hasCaptured());
assertThat(newFeaturesReply.getValue(), equalTo(featuresReply));
}
项目:arscheduler
文件:OFChannelHandlerVer10Test.java
/** Move the channel from scratch to WAIT_FEATURES_REPLY state
* Builds on moveToWaitHello()
* adds testing for WAIT_HELLO state
*/
@Test
public void moveToComplete() throws Exception {
moveToWaitFeaturesReply();
reset(pipeline);
HandshakeTimeoutHandler newHandler = new HandshakeTimeoutHandler(
handler,
timer,
PipelineHandshakeTimeout.SWITCH);
expect(
pipeline.replace(EasyMock.eq(PipelineHandler.CHANNEL_HANDSHAKE_TIMEOUT),
EasyMock.eq(PipelineHandler.SWITCH_HANDSHAKE_TIMEOUT),
EasyMock.anyObject(HandshakeTimeoutHandler.class))).andReturn(newHandler)
.once();
replay(pipeline);
reset(newConnectionListener);
newConnectionListener.connectionOpened(capture(newConnection), capture(newFeaturesReply));
expectLastCall().once();
replay(newConnectionListener);
sendMessageToHandlerWithControllerReset(Collections.<OFMessage>singletonList(featuresReply));
assertThat(handler.getStateForTesting(), CoreMatchers.instanceOf(OFChannelHandler.CompleteState.class));
assertTrue("A connection has been created and set", handler.getConnectionForTesting() != null);
}
项目:floodlight1.2-delay
文件:OFChannelHandler.java
/**
* Sets the channel pipeline's handshake timeout to a more appropriate value
* for the remaining part of the switch handshake.
*/
private void setSwitchHandshakeTimeout() {
HandshakeTimeoutHandler handler = new HandshakeTimeoutHandler(
this,
this.timer,
PipelineHandshakeTimeout.SWITCH);
pipeline.replace(PipelineHandler.CHANNEL_HANDSHAKE_TIMEOUT,
PipelineHandler.SWITCH_HANDSHAKE_TIMEOUT, handler);
}
项目:floodlight1.2-delay
文件:OFChannelHandlerVer13Test.java
/** Move the channel from scratch to WAIT_FEATURES_REPLY state
* Builds on moveToWaitHello()
* adds testing for WAIT_HELLO state
*/
@Test
public void moveToComplete() throws Exception {
moveToWaitFeaturesReply();
reset(pipeline);
HandshakeTimeoutHandler newHandler = new HandshakeTimeoutHandler(
handler,
timer,
PipelineHandshakeTimeout.SWITCH);
expect(
pipeline.replace(EasyMock.eq(PipelineHandler.CHANNEL_HANDSHAKE_TIMEOUT),
EasyMock.eq(PipelineHandler.SWITCH_HANDSHAKE_TIMEOUT),
EasyMock.anyObject(HandshakeTimeoutHandler.class))).andReturn(newHandler)
.once();
replay(pipeline);
newConnectionListener.connectionOpened(capture(newConnection), capture(newFeaturesReply));
expectLastCall().once();
replay(newConnectionListener);
sendMessageToHandlerWithControllerReset(Collections.<OFMessage>singletonList(featuresReply));
assertThat(handler.getStateForTesting(), CoreMatchers.instanceOf(OFChannelHandler.CompleteState.class));
assertTrue("A connection has been created and set", handler.getConnectionForTesting() != null);
verify(newConnectionListener);
assertTrue(newConnection.hasCaptured());
assertThat(newFeaturesReply.getValue(), equalTo(featuresReply));
}
项目:floodlight1.2-delay
文件:OFChannelHandlerVer10Test.java
/** Move the channel from scratch to WAIT_FEATURES_REPLY state
* Builds on moveToWaitHello()
* adds testing for WAIT_HELLO state
*/
@Test
public void moveToComplete() throws Exception {
moveToWaitFeaturesReply();
reset(pipeline);
HandshakeTimeoutHandler newHandler = new HandshakeTimeoutHandler(
handler,
timer,
PipelineHandshakeTimeout.SWITCH);
expect(
pipeline.replace(EasyMock.eq(PipelineHandler.CHANNEL_HANDSHAKE_TIMEOUT),
EasyMock.eq(PipelineHandler.SWITCH_HANDSHAKE_TIMEOUT),
EasyMock.anyObject(HandshakeTimeoutHandler.class))).andReturn(newHandler)
.once();
replay(pipeline);
reset(newConnectionListener);
newConnectionListener.connectionOpened(capture(newConnection), capture(newFeaturesReply));
expectLastCall().once();
replay(newConnectionListener);
sendMessageToHandlerWithControllerReset(Collections.<OFMessage>singletonList(featuresReply));
assertThat(handler.getStateForTesting(), CoreMatchers.instanceOf(OFChannelHandler.CompleteState.class));
assertTrue("A connection has been created and set", handler.getConnectionForTesting() != null);
}
项目:floodlight-hardware
文件:OFChannelHandler.java
/**
* Sets the channel pipeline's handshake timeout to a more appropriate value
* for the remaining part of the switch handshake.
*/
private void setSwitchHandshakeTimeout() {
HandshakeTimeoutHandler handler = new HandshakeTimeoutHandler(
this,
this.timer,
PipelineHandshakeTimeout.SWITCH);
pipeline.replace(PipelineHandler.CHANNEL_HANDSHAKE_TIMEOUT,
PipelineHandler.SWITCH_HANDSHAKE_TIMEOUT, handler);
}
项目:floodlight-hardware
文件:OFChannelHandlerVer13Test.java
/** Move the channel from scratch to WAIT_FEATURES_REPLY state
* Builds on moveToWaitHello()
* adds testing for WAIT_HELLO state
*/
@Test
public void moveToComplete() throws Exception {
moveToWaitFeaturesReply();
reset(pipeline);
HandshakeTimeoutHandler newHandler = new HandshakeTimeoutHandler(
handler,
timer,
PipelineHandshakeTimeout.SWITCH);
expect(
pipeline.replace(EasyMock.eq(PipelineHandler.CHANNEL_HANDSHAKE_TIMEOUT),
EasyMock.eq(PipelineHandler.SWITCH_HANDSHAKE_TIMEOUT),
EasyMock.anyObject(HandshakeTimeoutHandler.class))).andReturn(newHandler)
.once();
replay(pipeline);
newConnectionListener.connectionOpened(capture(newConnection), capture(newFeaturesReply));
expectLastCall().once();
replay(newConnectionListener);
sendMessageToHandlerWithControllerReset(Collections.<OFMessage>singletonList(featuresReply));
assertThat(handler.getStateForTesting(), CoreMatchers.instanceOf(OFChannelHandler.CompleteState.class));
assertTrue("A connection has been created and set", handler.getConnectionForTesting() != null);
verify(newConnectionListener);
assertTrue(newConnection.hasCaptured());
assertThat(newFeaturesReply.getValue(), equalTo(featuresReply));
}
项目:floodlight-hardware
文件:OFChannelHandlerVer10Test.java
/** Move the channel from scratch to WAIT_FEATURES_REPLY state
* Builds on moveToWaitHello()
* adds testing for WAIT_HELLO state
*/
@Test
public void moveToComplete() throws Exception {
moveToWaitFeaturesReply();
reset(pipeline);
HandshakeTimeoutHandler newHandler = new HandshakeTimeoutHandler(
handler,
timer,
PipelineHandshakeTimeout.SWITCH);
expect(
pipeline.replace(EasyMock.eq(PipelineHandler.CHANNEL_HANDSHAKE_TIMEOUT),
EasyMock.eq(PipelineHandler.SWITCH_HANDSHAKE_TIMEOUT),
EasyMock.anyObject(HandshakeTimeoutHandler.class))).andReturn(newHandler)
.once();
replay(pipeline);
reset(newConnectionListener);
newConnectionListener.connectionOpened(capture(newConnection), capture(newFeaturesReply));
expectLastCall().once();
replay(newConnectionListener);
sendMessageToHandlerWithControllerReset(Collections.<OFMessage>singletonList(featuresReply));
assertThat(handler.getStateForTesting(), CoreMatchers.instanceOf(OFChannelHandler.CompleteState.class));
assertTrue("A connection has been created and set", handler.getConnectionForTesting() != null);
}
项目:ACAMPController
文件:OFChannelHandler.java
/**
* Sets the channel pipeline's handshake timeout to a more appropriate value
* for the remaining part of the switch handshake.
*/
private void setSwitchHandshakeTimeout() {
HandshakeTimeoutHandler handler = new HandshakeTimeoutHandler(
this,
this.timer,
PipelineHandshakeTimeout.SWITCH);
pipeline.replace(PipelineHandler.CHANNEL_HANDSHAKE_TIMEOUT,
PipelineHandler.SWITCH_HANDSHAKE_TIMEOUT, handler);
}
项目:ACAMPController
文件:OFChannelHandlerVer13Test.java
/** Move the channel from scratch to WAIT_FEATURES_REPLY state
* Builds on moveToWaitHello()
* adds testing for WAIT_HELLO state
*/
@Test
public void moveToComplete() throws Exception {
moveToWaitFeaturesReply();
reset(pipeline);
HandshakeTimeoutHandler newHandler = new HandshakeTimeoutHandler(
handler,
timer,
PipelineHandshakeTimeout.SWITCH);
expect(
pipeline.replace(EasyMock.eq(PipelineHandler.CHANNEL_HANDSHAKE_TIMEOUT),
EasyMock.eq(PipelineHandler.SWITCH_HANDSHAKE_TIMEOUT),
EasyMock.anyObject(HandshakeTimeoutHandler.class))).andReturn(newHandler)
.once();
replay(pipeline);
newConnectionListener.connectionOpened(capture(newConnection), capture(newFeaturesReply));
expectLastCall().once();
replay(newConnectionListener);
sendMessageToHandlerWithControllerReset(Collections.<OFMessage>singletonList(featuresReply));
assertThat(handler.getStateForTesting(), CoreMatchers.instanceOf(OFChannelHandler.CompleteState.class));
assertTrue("A connection has been created and set", handler.getConnectionForTesting() != null);
verify(newConnectionListener);
assertTrue(newConnection.hasCaptured());
assertThat(newFeaturesReply.getValue(), equalTo(featuresReply));
}
项目:ACAMPController
文件:OFChannelHandlerVer10Test.java
/** Move the channel from scratch to WAIT_FEATURES_REPLY state
* Builds on moveToWaitHello()
* adds testing for WAIT_HELLO state
*/
@Test
public void moveToComplete() throws Exception {
moveToWaitFeaturesReply();
reset(pipeline);
HandshakeTimeoutHandler newHandler = new HandshakeTimeoutHandler(
handler,
timer,
PipelineHandshakeTimeout.SWITCH);
expect(
pipeline.replace(EasyMock.eq(PipelineHandler.CHANNEL_HANDSHAKE_TIMEOUT),
EasyMock.eq(PipelineHandler.SWITCH_HANDSHAKE_TIMEOUT),
EasyMock.anyObject(HandshakeTimeoutHandler.class))).andReturn(newHandler)
.once();
replay(pipeline);
reset(newConnectionListener);
newConnectionListener.connectionOpened(capture(newConnection), capture(newFeaturesReply));
expectLastCall().once();
replay(newConnectionListener);
sendMessageToHandlerWithControllerReset(Collections.<OFMessage>singletonList(featuresReply));
assertThat(handler.getStateForTesting(), CoreMatchers.instanceOf(OFChannelHandler.CompleteState.class));
assertTrue("A connection has been created and set", handler.getConnectionForTesting() != null);
}