Description
WebSocketClientTest errors with the following exception
java.lang.RuntimeException: startEchoer
at quarks.tests.connectors.wsclient.javax.websocket.WebSocketClientTest.startEchoer(WebSocketClientTest.java:68)
at quarks.tests.connectors.wsclient.javax.websocket.WebSocketClientTest.testSslSystemProperty(WebSocketCliientTest.java:390)
Caused by: java.lang.IllegalArgumentException: File does not exist: C:\cygwin\/wsclient-javax.websocket/src/test/keystores/serverKeyStore.jks
at quarks.tests.connectors.wsclient.javax.websocket.KeystorePath.ggetStorePath(KeystorePath.java:22)
at quarks.tests.connectors.wsclient.javax.websocket.WebSoocketServerEcho.getStorePath(WebSocketServerEcho.java:132)
at quarks.tests.connectors.wsclient.javax.websocket.WebSocketServerEcho.createServer(WebSocketServerEcho.java::107)
at quarks.tests.connectors.wsclient.javax.websocket.WebSocketServerEcho.start(WebSocketServerEcho.java:70)
att quarks.tests.connectors.wsclient.javax.websocket.WebSocketClientTest.startEchoer(WebSocketClientTest.java:62)
I think that the problem is with backslashes in my path when we pass through this code KeyStorePath.getStorePath(), it ends up truncating the path.
public class KeystorePath {
public static String getStorePath(String storeLeaf) {
String path = System.getProperty("user.dir");
// Under eclipse/junit: path to project in repo: <repo>/connectors
// Under ant/junit: <repo>/connectors/<project>/unittests/testrunxxxxxxx
if (!path.endsWith("/connectors"))
path += "/wsclient-javax.websocket/src/test/keystores/" + storeLeaf;
if (!new File(path).exists())
throw new IllegalArgumentException("File does not exist: "+path);
return path;
}
}