Package com.vaadin.flow.testutil.net
Class PortProber
java.lang.Object
com.vaadin.flow.testutil.net.PortProber
Class for determining a free localhost port that is not used by any ipv4 or
ipv6 interfaces.
Derived from SeleniumHQ / selenium
For internal use only. May be renamed or removed in a future release.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionstatic intGet a free localhost port that is not in use by any interface.
-
Field Details
-
HIGHEST_PORT
public static final int HIGHEST_PORT- See Also:
-
START_OF_USER_PORTS
public static final int START_OF_USER_PORTS- See Also:
-
-
Method Details
-
findFreePort
public static int findFreePort()Get a free localhost port that is not in use by any interface.- Returns:
- found free port
- Throws:
RuntimeException- if no free port was found
-