improve tests
This commit is contained in:
@@ -3,6 +3,7 @@ package io.socket.client.executions;
|
||||
import io.socket.emitter.Emitter;
|
||||
import io.socket.client.IO;
|
||||
import io.socket.client.Socket;
|
||||
import okhttp3.OkHttpClient;
|
||||
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
@@ -14,6 +15,11 @@ public class ConnectionFailure {
|
||||
IO.Options options = new IO.Options();
|
||||
options.forceNew = true;
|
||||
options.reconnection = false;
|
||||
|
||||
final OkHttpClient client = new OkHttpClient();
|
||||
options.webSocketFactory = client;
|
||||
options.callFactory = client;
|
||||
|
||||
final Socket socket = IO.socket("http://localhost:" + port, options);
|
||||
socket.on(Socket.EVENT_CONNECT_TIMEOUT, new Emitter.Listener() {
|
||||
@Override
|
||||
@@ -24,6 +30,7 @@ public class ConnectionFailure {
|
||||
@Override
|
||||
public void call(Object... args) {
|
||||
System.out.println("connect error");
|
||||
client.dispatcher().executorService().shutdown();
|
||||
}
|
||||
}).on(Socket.EVENT_DISCONNECT, new Emitter.Listener() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user