Search in sources :

Example 1 with JedisBusyException

use of redis.clients.jedis.exceptions.JedisBusyException in project jedis by xetorthio.

the class ProtocolTest method busyReply.

@Test
public void busyReply() {
    final String busyMessage = "BUSY Redis is busy running a script.";
    final InputStream is = new ByteArrayInputStream(('-' + busyMessage + "\r\n").getBytes());
    try {
        Protocol.read(new RedisInputStream(is));
    } catch (final JedisBusyException e) {
        assertEquals(busyMessage, e.getMessage());
        return;
    }
    fail("Expected a JedisBusyException to be thrown.");
}
Also used : JedisBusyException(redis.clients.jedis.exceptions.JedisBusyException) ByteArrayInputStream(java.io.ByteArrayInputStream) RedisInputStream(redis.clients.util.RedisInputStream) BufferedInputStream(java.io.BufferedInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) PipedInputStream(java.io.PipedInputStream) InputStream(java.io.InputStream) RedisInputStream(redis.clients.util.RedisInputStream) Test(org.junit.Test)

Aggregations

BufferedInputStream (java.io.BufferedInputStream)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1 PipedInputStream (java.io.PipedInputStream)1 Test (org.junit.Test)1 JedisBusyException (redis.clients.jedis.exceptions.JedisBusyException)1 RedisInputStream (redis.clients.util.RedisInputStream)1