public final class TestingUtilities extends Object
Modifier and Type | Method and Description |
---|---|
static void |
waitListening(AbstractInternetProtocolReceivingChannelAdapter adapter,
Long delayArg)
Wait for a server connection factory to actually start listening before
starting a test.
|
static void |
waitListening(AbstractServerConnectionFactory serverConnectionFactory,
Long delayArg)
Wait for a server connection factory to actually start listening before
starting a test.
|
static void |
waitStopListening(AbstractServerConnectionFactory serverConnectionFactory,
Long delayArg)
Wait for a server connection factory to stop listening.
|
static void |
waitUntilFactoryHasThisNumberOfConnections(AbstractConnectionFactory factory,
int n)
Wait for up to 10 seconds for the connection factory to have the specified number
of connections.
|
public static void waitListening(AbstractServerConnectionFactory serverConnectionFactory, @Nullable Long delayArg) throws IllegalStateException
serverConnectionFactory
- The server connection factory.delayArg
- How long to wait in milliseconds; default 10000 (10 seconds) if null.IllegalStateException
- If the server does not start listening in time.public static void waitListening(AbstractInternetProtocolReceivingChannelAdapter adapter, @Nullable Long delayArg) throws IllegalStateException
adapter
- The server connection factory.delayArg
- How long to wait in milliseconds; default 10000 (10 seconds) if null.IllegalStateException
- If the server does not start listening in time.public static void waitStopListening(AbstractServerConnectionFactory serverConnectionFactory, @Nullable Long delayArg) throws IllegalStateException
serverConnectionFactory
- The server connection factory.delayArg
- How long to wait in milliseconds; default 10000 (10 seconds) if null.IllegalStateException
- If the server doesn't stop listening in time.public static void waitUntilFactoryHasThisNumberOfConnections(AbstractConnectionFactory factory, int n) throws InterruptedException
factory
- The factory.n
- The required number of connections.InterruptedException
- if interrupted.IllegalStateException
- if the count does not match.