Skip to content

Commit 9dbb23c

Browse files
author
tox
committed
move node server in test package, make acknowledge test working again.
1 parent c9455dc commit 9dbb23c

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

tests/io/socket/TestSocketIO.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
@RunWith(io.socket.RandomBlockJUnit4ClassRunner.class)
2121
public class TestSocketIO implements IOCallback {
22-
private final static String NODE = "/opt/local/bin/node";
22+
private final static String NODE = "C:\\Program Files (x86)\\nodejs\\node.exe";
2323
private static final int PORT = 10214;
24-
private static final int TIMEOUT = 200;
24+
private static final int TIMEOUT = 2;
2525
LinkedBlockingQueue<String> events;
2626
LinkedBlockingQueue<String> outputs;
2727
LinkedBlockingQueue<Object> args;
@@ -205,7 +205,6 @@ public void namespaces() throws Exception {
205205
assertEquals("ns2", takeArg());
206206

207207
ns2_2.disconnect();
208-
209208
ns2.disconnect();
210209
assertEquals("onDisconnect", takeEvent());
211210
assertEquals("onDisconnect", takeEvent());
@@ -215,7 +214,7 @@ public void namespaces() throws Exception {
215214
@Test
216215
public void error() throws Exception {
217216
doConnect();
218-
SocketIO error = new SocketIO(
217+
new SocketIO(
219218
"http://127.0.0.1:" + (PORT + 1) + "/ns1", this);
220219
assertEquals("onError", takeEvent());
221220
doClose();
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ var main = io.sockets.on('connection', function(socket) {
2323
socket.send(data);
2424
}
2525
});
26+
socket.on('echoAck', function(data, ack) {
27+
ack(data);
28+
});
2629
socket.on('message', function(m) {
2730
process.stdout.write("__:MESSAGE:"+m+"\n");
2831
});

0 commit comments

Comments
 (0)