@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);
* @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());
* @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());