repeatable test echo client
This commit is contained in:
parent
c93b36cc7f
commit
f917dc6722
@ -9,6 +9,8 @@ public class EchoClientListener extends AbstractClientListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
while (socket.isConnected()) {
|
||||||
writeLine(readLine());
|
writeLine(readLine());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,8 +57,11 @@ public class ServerTest {
|
|||||||
new Server("localhost", port, EchoClientListener.class);
|
new Server("localhost", port, EchoClientListener.class);
|
||||||
Client client = new Client("localhost", port);
|
Client client = new Client("localhost", port);
|
||||||
client.writeLine("hello");
|
client.writeLine("hello");
|
||||||
String response = client.readLine();
|
String response1 = client.readLine();
|
||||||
Assertions.assertEquals("hello", response);
|
Assertions.assertEquals("hello", response1);
|
||||||
|
client.writeLine("olleh");
|
||||||
|
String response2 = client.readLine();
|
||||||
|
Assertions.assertEquals("olleh", response2);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user