Java 类net.floodlightcontroller.core.internal.OpenflowPipelineFactory.PipelineHandshakeTimeout 实例源码

项目:iTAP-controller    文件: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);
}
项目:iTAP-controller    文件: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));
}
项目:iTAP-controller    文件: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);


}
项目:fast-failover-demo    文件: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);
}
项目:fast-failover-demo    文件: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));
}
项目:fast-failover-demo    文件: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);


}
项目:floodlightLB    文件: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);
}
项目:floodlightLB    文件: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));
}
项目:floodlightLB    文件: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);


}
项目:DSC    文件: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);
}
项目:DSC    文件: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));
}
项目:DSC    文件: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    文件: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    文件: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    文件: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);


}