public class EnvTestUtil extends Object
Modifier and Type | Method and Description |
---|---|
static int |
getFreePort()
Get an arbitrary free port on the localhost
|
static String |
readToString(InputStream is)
Read an input stream into a plain string
|
static boolean |
trySocket(int port)
Try a given port on the localhost and check whether it is free
|
public static int getFreePort() throws IOException
IllegalArgumentException
- if no free port could be foundIOException
public static boolean trySocket(int port) throws IOException
port
- port to checkIOException
public static String readToString(InputStream is) throws IOException
is
- input stream to read fromIOException
- if something failsCopyright © 2017. All rights reserved.