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 foundIOExceptionpublic static boolean trySocket(int port)
throws IOException
port - port to checkIOExceptionpublic static String readToString(InputStream is) throws IOException
is - input stream to read fromIOException - if something failsCopyright © 2014. All Rights Reserved.