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