Skip to content

Commit 987de3b

Browse files
committed
Slightly changed test.
1 parent 3b64c46 commit 987de3b

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

‎tests/io/socket/TestSocketIO.java‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
public class TestSocketIO implements IOCallback {
2222
private final static String NODE = "/opt/local/bin/node";
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;
@@ -94,10 +94,20 @@ public void run() {
9494

9595
@After
9696
public void tearDown() throws Exception {
97+
9798
node.destroy();
9899
stderrThread.interrupt();
99100
stdoutThread.interrupt();
100101
node.waitFor();
102+
for(String s : events) {
103+
System.out.println("Event in Queue: " + s);
104+
}
105+
for(String line : outputs) {
106+
System.out.println("Line in Queue: " + line);
107+
}
108+
for(Object o : args) {
109+
System.out.println("Argument in Queue: " + o.toString());
110+
}
101111
}
102112

103113
void doConnect() throws Exception {
@@ -135,6 +145,7 @@ public void send() throws Exception {
135145
@Test
136146
public void emitAndOn() throws Exception {
137147
doConnect();
148+
138149
String str = "TESTSTRING";
139150
socket.emit("echo", str);
140151
assertEquals("Test String", "on", takeEvent());
@@ -168,11 +179,11 @@ public void emitAndMessage() throws Exception {
168179

169180
@Test
170181
public void namespaces() throws Exception {
171-
doConnect();
172182
SocketIO ns1 = new SocketIO("http://127.0.0.1:" + PORT + "/ns1", this);
173183
assertEquals("onConnect", takeEvent());
174-
assertEquals("onMessage_string", takeEvent());
175-
assertEquals("ns1", takeArg());
184+
185+
doConnect();
186+
176187
ns1.disconnect();
177188
assertEquals("onDisconnect", takeEvent());
178189

0 commit comments

Comments
 (0)