Package redis.clients.jedis

Examples of redis.clients.jedis.Jedis.llen()


        TestUtils.stopWorker(worker, workerThread, false);

        Assert.assertTrue("The job should not be requeued after succesful processing",
                jedis.llen(JesqueUtils.createKey(config.getNamespace(), QUEUE, queue)) == 0L);
        Assert.assertEquals("In-flight list should be empty when finishing a job",
                jedis.llen(inFlightKey(worker, queue)), (Long)0L);
    }

    @Test
    public void testInterrupted() throws InterruptedException, JsonProcessingException {
        final String queue = "bar";
View Full Code Here


        workerThread.start();

        TestUtils.stopWorker(worker, workerThread, true);

        final Jedis jedis = TestUtils.createJedis(config);
        Assert.assertTrue("Job should be requeued", jedis.llen(JesqueUtils.createKey(config.getNamespace(), QUEUE, queue)) == 1L);
        Assert.assertEquals("Incorrect job was requeued", ObjectMapperFactory.get().writeValueAsString(sleepJob),
                jedis.lindex(JesqueUtils.createKey(config.getNamespace(), QUEUE, queue), 0));
        Assert.assertTrue("In-flight list should be empty when finishing a job", jedis.llen(inFlightKey(worker, queue)) == 0L);
    }
View Full Code Here

        final Jedis jedis = TestUtils.createJedis(config);
        Assert.assertTrue("Job should be requeued", jedis.llen(JesqueUtils.createKey(config.getNamespace(), QUEUE, queue)) == 1L);
        Assert.assertEquals("Incorrect job was requeued", ObjectMapperFactory.get().writeValueAsString(sleepJob),
                jedis.lindex(JesqueUtils.createKey(config.getNamespace(), QUEUE, queue), 0));
        Assert.assertTrue("In-flight list should be empty when finishing a job", jedis.llen(inFlightKey(worker, queue)) == 0L);
    }

    @Test
    public void testJSONException() throws InterruptedException, JsonProcessingException {
        final String queue = "baz";
View Full Code Here

        Thread.sleep(1000);

        TestUtils.stopWorker(worker, workerThread, false);

        Assert.assertEquals("In-flight list should have length zero if the worker failed during JSON deserialization",
                jedis.llen(inFlightKey(worker, queue)), (Long) 0L);
    }

    private static String inFlightKey(final Worker worker, final String queue) {
        return JesqueUtils.createKey(config.getNamespace(), ResqueConstants.INFLIGHT, worker.getName(), queue);
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.