Use a random port in test server 03/5703/2
authorDavid K. Bainbridge <dbainbri@ciena.com>
Wed, 19 Mar 2014 18:04:51 +0000 (11:04 -0700)
committerRobert Varga <rovarga@cisco.com>
Tue, 25 Mar 2014 10:48:55 +0000 (11:48 +0100)
commit56f88fff3c7cab67e2e1999cb262db386e5556c8
tree2a0a0c60d620ca1c88ca44529ea23edc1e312fc9
parenta791edb78424e32a3b02c92491d941e092248c3f
Use a random port in test server

This patch updates the test server to bind to a random port number and expose
this port number via a Future can be fetched by the test client so that it
knows to which port to connect.

Version 2:
Modified the code to use the guava SettableFuture as opposed to a custom built
future, as well as cleaned up a few other things, including makding sure that
the message was received from the server before considering the test passed.
was seeing different behavior on different platforms without this (i.e. some
times the message was display, sometimes not). Also, failed the test case wh
exceptions were caught.

Change-Id: Ia11c374bfbf206a6214d2afe3ba328b1231d6fad
Signed-off-by: David K. Bainbridge <dbainbri@ciena.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
websocket/websocket-client/pom.xml
websocket/websocket-client/src/test/java/org/opendaylight/yangtools/websocket/WebSocketClientTest.java
websocket/websocket-client/src/test/java/org/opendaylight/yangtools/websocket/server/WebSocketServer.java