com.vaadin.testbench.
Class IPAddress
- java.lang.Object
-
- com.vaadin.testbench.IPAddress
-
public class IPAddress extends Object
-
-
Constructor Summary
Constructors Constructor and Description IPAddress()
-
Method Summary
All Methods Modifier and Type Method and Description static Optional<String>
findIPAddress(Function<InetAddress,Boolean> acceptor)
Enumerates the available IP addresses until one is found which is accepted by the given function.
static String
findSiteLocalAddress()
Tries to determine a site local (10.0.0.0, 172.16.0.0 or 192.168.0.0) IP address of the machine the test is running on.
-
-
-
Method Detail
-
findSiteLocalAddress
public static String findSiteLocalAddress()
Tries to determine a site local (10.0.0.0, 172.16.0.0 or 192.168.0.0) IP address of the machine the test is running on.
Returns:
An IP address of one of the network interfaces in the machine or an empty optional
Throws:
RuntimeException
- if no IP was found
-
findIPAddress
public static Optional<String> findIPAddress(Function<InetAddress,Boolean> acceptor)
Enumerates the available IP addresses until one is found which is accepted by the given function.
Parameters:
acceptor
- the function which determines if an IP address should be returned or notReturns:
An IP address of one of the network interfaces in the machine or an empty optional.
-
-