X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflowplugin-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fimpl%2Fconnection%2FConnectionManagerImplTest.java;h=813c1bd372a04084d63bc47ff05d8e098847a437;hb=b977adac522d210e9fea06b77a40f8bd87c2d193;hp=0f228516affb5d98396a2ce78820b7af0413e737;hpb=7fffede33481db0b1adf36974a1717c13ae7fdac;p=openflowplugin.git diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/connection/ConnectionManagerImplTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/connection/ConnectionManagerImplTest.java index 0f228516af..813c1bd372 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/connection/ConnectionManagerImplTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/connection/ConnectionManagerImplTest.java @@ -55,12 +55,14 @@ public class ConnectionManagerImplTest { @Captor private ArgumentCaptor ofpListenerAC; + private final static int ECHO_REPLY_TIMEOUT = 500; + /** * before each test method */ @Before public void setUp() { - connectionManagerImpl = new ConnectionManagerImpl(); + connectionManagerImpl = new ConnectionManagerImpl(ECHO_REPLY_TIMEOUT); connectionManagerImpl.setDeviceConnectedHandler(deviceConnectedHandler); final InetSocketAddress deviceAddress = InetSocketAddress.createUnresolved("yahoo", 42); Mockito.when(connection.getRemoteAddress()).thenReturn(deviceAddress); @@ -90,7 +92,7 @@ public class ConnectionManagerImplTest { * @throws InterruptedException */ @Test - public void testOnSwitchConnected1() throws InterruptedException { + public void testOnSwitchConnected1() throws Exception { connectionManagerImpl.onSwitchConnected(connection); Mockito.verify(connection).setConnectionReadyListener(connectionReadyListenerAC.capture()); Mockito.verify(connection).setMessageListener(ofpListenerAC.capture()); @@ -141,7 +143,7 @@ public class ConnectionManagerImplTest { * @throws InterruptedException */ @Test - public void testOnSwitchConnected2() throws InterruptedException { + public void testOnSwitchConnected2() throws Exception { connectionManagerImpl.onSwitchConnected(connection); Mockito.verify(connection).setConnectionReadyListener(connectionReadyListenerAC.capture()); Mockito.verify(connection).setMessageListener(ofpListenerAC.capture());