Class PortProber

java.lang.Object
com.vaadin.flow.testutil.net.PortProber

public class PortProber extends Object
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 Details

  • 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