Package net.greghaines.jesque.meta.dao.impl.KeysDAORedisImpl

Examples of net.greghaines.jesque.meta.dao.impl.KeysDAORedisImpl.KeyDAOPoolWork.doWork()


        this.mockCtx.checking(new Expectations(){{
            oneOf(jedis).type(key); will(returnValue(KeyType.HASH.toString()));
            oneOf(jedis).hlen(key); will(returnValue(size));
            oneOf(jedis).hkeys(key); will(returnValue(valueKeys));
        }});
        final KeyInfo keyInfo = work.doWork(this.jedis);
        Assert.assertNotNull(keyInfo);
        Assert.assertEquals("foo", keyInfo.getNamespace());
        Assert.assertEquals("bar", keyInfo.getName());
        Assert.assertEquals(KeyType.HASH, keyInfo.getType());
        Assert.assertEquals((Long) size, keyInfo.getSize());
View Full Code Here


            oneOf(jedis).type(key); will(returnValue(KeyType.HASH.toString()));
            oneOf(jedis).hlen(key); will(returnValue(size));
            oneOf(jedis).hkeys(key); will(returnValue(valueKeys));
            oneOf(jedis).hmget(key, "baz"); will(returnValue(valueValues));
        }});
        final KeyInfo keyInfo = work.doWork(this.jedis);
        Assert.assertNotNull(keyInfo);
        Assert.assertEquals("foo", keyInfo.getNamespace());
        Assert.assertEquals("bar", keyInfo.getName());
        Assert.assertEquals(KeyType.HASH, keyInfo.getType());
        Assert.assertEquals((Long) size, keyInfo.getSize());
View Full Code Here

        final KeyDAOPoolWork work = new KeyDAOPoolWork(key);
        this.mockCtx.checking(new Expectations(){{
            oneOf(jedis).type(key); will(returnValue(KeyType.LIST.toString()));
            oneOf(jedis).llen(key); will(returnValue(size));
        }});
        final KeyInfo keyInfo = work.doWork(this.jedis);
        Assert.assertNotNull(keyInfo);
        Assert.assertEquals("foo", keyInfo.getNamespace());
        Assert.assertEquals("bar", keyInfo.getName());
        Assert.assertEquals(KeyType.LIST, keyInfo.getType());
        Assert.assertEquals((Long) size, keyInfo.getSize());
View Full Code Here

        this.mockCtx.checking(new Expectations(){{
            oneOf(jedis).type(key); will(returnValue(KeyType.LIST.toString()));
            oneOf(jedis).llen(key); will(returnValue(size));
            oneOf(jedis).lrange(key, offset, offset + count); will(returnValue(value));
        }});
        final KeyInfo keyInfo = work.doWork(this.jedis);
        Assert.assertNotNull(keyInfo);
        Assert.assertEquals("foo", keyInfo.getNamespace());
        Assert.assertEquals("bar", keyInfo.getName());
        Assert.assertEquals(KeyType.LIST, keyInfo.getType());
        Assert.assertEquals((Long) size, keyInfo.getSize());
View Full Code Here

        final String key = "foo:bar";
        final KeyDAOPoolWork work = new KeyDAOPoolWork(key);
        this.mockCtx.checking(new Expectations(){{
            oneOf(jedis).type(key); will(returnValue("?"));
        }});
        final KeyInfo keyInfo = work.doWork(this.jedis);
        Assert.assertNull(keyInfo);
    }

    @Test
    public void testDoWork_None() throws Exception {
View Full Code Here

        final String key = "foo:bar";
        final KeyDAOPoolWork work = new KeyDAOPoolWork(key);
        this.mockCtx.checking(new Expectations(){{
            oneOf(jedis).type(key); will(returnValue(KeyType.NONE.toString()));
        }});
        final KeyInfo keyInfo = work.doWork(this.jedis);
        Assert.assertNull(keyInfo);
    }
}
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.