fixed reconnect test (it doesn't need to reconnect via a different

thread now)
This commit is contained in:
nathan 2016-03-17 02:58:58 +01:00
parent e2cdcab9ea
commit 14ec10e41a

View File

@ -78,23 +78,19 @@ class ReconnectTest extends BaseTest {
stopEndPoints(); stopEndPoints();
return; return;
} }
new Thread() {
@Override System.out.println("Reconnecting: " + reconnectCount.get());
public try {
void run() { client.reconnect();
System.out.println("Reconnecting: " + reconnectCount.get()); } catch (IOException e) {
try { e.printStackTrace();
client.reconnect(); }
} catch (IOException e) {
e.printStackTrace();
}
}
}.start();
} }
}); });
client.connect(5000); client.connect(5000);
waitForThreads(10); waitForThreads();
System.err.println("Connection count (after reconnecting) is: " + reconnectCount.get()); System.err.println("Connection count (after reconnecting) is: " + reconnectCount.get());
assertEquals(3, reconnectCount.get()); assertEquals(3, reconnectCount.get());
} }