Uploaded image for project: 'Edgent'
  1. Edgent
  2. EDGENT-52

WebSocketClientTest errors on Windows with java.lang.IllegalArgumentException: File does not exist ... serverKeyStore.jks

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • None
    • Test

    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"))

      { int indx = path.indexOf("/connectors/"); indx += "/connectors/".length() - 1; path = path.substring(0, indx); }

      path += "/wsclient-javax.websocket/src/test/keystores/" + storeLeaf;
      if (!new File(path).exists())
      throw new IllegalArgumentException("File does not exist: "+path);
      return path;
      }

      }

      Attachments

        Activity

          People

            dlaboss Dale LaBossiere
            kmarsden Katherine Marsden
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: