public class TestUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static long |
LONG_TIMEOUT |
static long |
MEDIUM_TIMEOUT |
static long |
SHORT_TIMEOUT |
| Modifier and Type | Method and Description |
|---|---|
static void |
awaitNon404HttpStatus(URL url,
int timeout,
int delay) |
static void |
awaitPortOpen(InetSocketAddress address,
int timeout,
int delay) |
static File |
createTempDir(String prefix) |
static org.eclipse.jetty.http.HttpTester.Response |
execute(org.eclipse.jetty.servlet.ServletTester server,
org.eclipse.jetty.http.HttpTester.Request request) |
static int |
findFreePort() |
static String |
getResourceName(Class clazz,
String name) |
static Reader |
getResourceReader(Class clazz,
String name,
Charset charset) |
static Reader |
getResourceReader(String name,
Charset charset) |
static InputStream |
getResourceStream(Class clazz,
String name) |
static InputStream |
getResourceStream(String name) |
static String |
getResourceString(Class clazz,
String name,
Charset charset) |
static URL |
getResourceUrl(Class clazz,
String name) |
static URL |
getResourceUrl(String name) |
static void |
LOG_ENTER() |
static void |
LOG_EXIT() |
static String |
merge(Class base,
String resource,
Properties properties) |
static String |
merge(String resource,
Properties properties) |
static boolean |
waitUntil(Callable<Boolean> function,
boolean expected,
long timeout)
Waits until a given function meets a given condition
|
static void |
waitUntilNextSecond() |
public static final long SHORT_TIMEOUT
public static final long MEDIUM_TIMEOUT
public static final long LONG_TIMEOUT
public static URL getResourceUrl(Class clazz, String name) throws FileNotFoundException
FileNotFoundExceptionpublic static URL getResourceUrl(String name) throws FileNotFoundException
FileNotFoundExceptionpublic static InputStream getResourceStream(String name) throws IOException
IOExceptionpublic static InputStream getResourceStream(Class clazz, String name) throws IOException
IOExceptionpublic static Reader getResourceReader(String name, Charset charset) throws IOException
IOExceptionpublic static Reader getResourceReader(Class clazz, String name, Charset charset) throws IOException
IOExceptionpublic static String getResourceString(Class clazz, String name, Charset charset) throws IOException
IOExceptionpublic static File createTempDir(String prefix) throws IOException
IOExceptionpublic static void LOG_ENTER()
public static void LOG_EXIT()
public static void awaitPortOpen(InetSocketAddress address, int timeout, int delay) throws InterruptedException
InterruptedExceptionpublic static void awaitNon404HttpStatus(URL url, int timeout, int delay) throws InterruptedException
InterruptedExceptionpublic static String merge(String resource, Properties properties)
public static String merge(Class base, String resource, Properties properties)
public static int findFreePort()
throws IOException
IOExceptionpublic static boolean waitUntil(Callable<Boolean> function, boolean expected, long timeout) throws Exception
function - function to check before the timeoutexpected - boolean expected value to checktimeout - Timeout in milliseconds to wait for condition to be metException - on any errorpublic static void waitUntilNextSecond()
Copyright © 2022 The Apache Software Foundation. All rights reserved.