@@ -20,7 +20,7 @@ public class ClusterWSTest {
20
20
21
21
@ Before
22
22
public void init () {
23
- mClusterWS = new ClusterWS ("ws://localhost:80 " );
23
+ mClusterWS = new ClusterWS ("ws://localhost:3000 " );
24
24
receivedData = null ;
25
25
gotTheData = false ;
26
26
}
@@ -36,7 +36,7 @@ public void connect() throws Exception {
36
36
mClusterWS .connect ();
37
37
Thread .sleep (1000 );
38
38
39
- assertEquals ("Socket did not connect" , WebSocket .READYSTATE .OPEN ,mClusterWS .getState ());
39
+ assertEquals ("Socket did not connect" , WebSocket .READYSTATE .OPEN , mClusterWS .getState ());
40
40
}
41
41
42
42
@ Test
@@ -233,24 +233,24 @@ public void onDisconnected(int code, String reason) {
233
233
}
234
234
235
235
@ Test
236
- public void testReconnection () throws Exception {
237
- mClusterWS .setReconnection (true ,1000 ,2000 ,null );
236
+ public void testReconnection () throws Exception {
237
+ mClusterWS .setReconnection (true , 1000 , 2000 , null );
238
238
mClusterWS .connect ();
239
239
Thread .sleep (1000 );
240
- mClusterWS .disconnect (3002 ,"test" );
241
- Thread .sleep (2000 );
240
+ mClusterWS .disconnect (3002 , "test" );
241
+ Thread .sleep (4000 );
242
242
assertEquals ("Did not reconnect" , WebSocket .READYSTATE .OPEN , mClusterWS .getState ());
243
243
}
244
244
245
245
@ Test
246
- public void testPingPong () throws Exception {
246
+ public void testPingPong () throws Exception {
247
247
mClusterWS .connect ();
248
248
Thread .sleep (1900 );
249
- assertEquals ("Websocket disconnected" , WebSocket .READYSTATE .OPEN ,mClusterWS .getState ());
249
+ assertEquals ("Websocket disconnected" , WebSocket .READYSTATE .OPEN , mClusterWS .getState ());
250
250
}
251
251
252
252
@ Test (expected = NullPointerException .class )
253
- public void testNullUrl () throws Exception {
253
+ public void testNullUrl () throws Exception {
254
254
mClusterWS = new ClusterWS (null );
255
255
}
256
256
0 commit comments