Merge "BUG-4117: add support of Old Notif. for Statistics"
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / connection / ConnectionManagerImplTest.java
index 0f228516affb5d98396a2ce78820b7af0413e737..813c1bd372a04084d63bc47ff05d8e098847a437 100644 (file)
@@ -55,12 +55,14 @@ public class ConnectionManagerImplTest {
     @Captor
     private ArgumentCaptor<OpenflowProtocolListener> 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());