[undertow-dev] Let undertow pick a port

Oliver Dain oliver at analyticspot.com
Mon Feb 8 18:27:02 EST 2016


I'm trying to write some unit tests with an embedded undertow server. I’d
like to have the server find an open port. This makes the tests more robust
in many ways. For example, tests can be run in parallel and if a socket is
held in CLOSE_WAIT or something from a previous test the next test will
still run and succeed. With most servers I’ve used you can pass 0 for the
port and the server will find an open port. This doesn’t seem to be the
case with Undertow. Even if that would work, I don't see a method like
getPort() on the Undertow object so I don't know how I'd discover the port
to which it bound. Is this possible??

Thanks,
Oliver
-- 
CTO, Analytic Spot
44 West Broadway #222
Eugene, OR 97401
analyticspot.com • 425-296-6556
www.linkedin.com/in/oliverdain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20160208/d26f3cf0/attachment-0001.html 


More information about the undertow-dev mailing list