String os = System.getProperty("os.name").toLowerCase();
char terminatorChar = '\n';
if (os.indexOf("win") >= 0)
terminatorChar = '\r';
String line=Util.readLine(client.getInputStream(), terminatorChar);
This obviously won't work if the server runs in Windows and the client in Unix; but it helps with the unit tests, because client and server run on the same machine/OS.
Thanks,
Alexander
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am testing all my programs in both Windows and Unix settings, and I noticed two unit tests failing in Windows.
To enable tests in both settings, the line (in TestEchoServer.test1 and TestEchoServerMultiClient.doClientCommunication)
String line=Util.readLine(client.getInputStream());
Should be changed to something like this:
String os = System.getProperty("os.name").toLowerCase();
char terminatorChar = '\n';
if (os.indexOf("win") >= 0)
terminatorChar = '\r';
String line=Util.readLine(client.getInputStream(), terminatorChar);
This obviously won't work if the server runs in Windows and the client in Unix; but it helps with the unit tests, because client and server run on the same machine/OS.
Thanks,
Alexander
fixed, thanks!
Bernd.