Package net.greghaines.jesque.meta

Examples of net.greghaines.jesque.meta.KeyInfo


            oneOf(pool).getResource(); will(returnValue(jedis));
            oneOf(jedis).type(key); will(returnValue(KeyType.STRING.toString()));
            oneOf(jedis).strlen(key); will(returnValue(size));
            oneOf(pool).returnResource(jedis);
        }});
        final KeyInfo keyInfo = this.keysDAO.getKeyInfo(key);
        Assert.assertNotNull(keyInfo);
        Assert.assertEquals("foo", keyInfo.getNamespace());
        Assert.assertEquals("bar", keyInfo.getName());
        Assert.assertEquals(KeyType.STRING, keyInfo.getType());
        Assert.assertEquals((Long) size, keyInfo.getSize());
        Assert.assertNull(keyInfo.getArrayValue());
    }
View Full Code Here


            oneOf(jedis).type(key); will(returnValue(KeyType.STRING.toString()));
            oneOf(jedis).strlen(key); will(returnValue(size));
            oneOf(jedis).get(key); will(returnValue(value));
            oneOf(pool).returnResource(jedis);
        }});
        final KeyInfo keyInfo = this.keysDAO.getKeyInfo(key, 0, 1);
        Assert.assertNotNull(keyInfo);
        Assert.assertEquals("foo", keyInfo.getNamespace());
        Assert.assertEquals("bar", keyInfo.getName());
        Assert.assertEquals(KeyType.STRING, keyInfo.getType());
        Assert.assertEquals((Long) size, keyInfo.getSize());
        Assert.assertNotNull(keyInfo.getArrayValue());
        Assert.assertEquals(1, keyInfo.getArrayValue().size());
        Assert.assertEquals(value, keyInfo.getArrayValue().get(0));
    }
View Full Code Here

        final KeyDAOPoolWork work = new KeyDAOPoolWork(key);
        this.mockCtx.checking(new Expectations(){{
            oneOf(jedis).type(key); will(returnValue(KeyType.STRING.toString()));
            oneOf(jedis).strlen(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.STRING, keyInfo.getType());
        Assert.assertEquals((Long) size, keyInfo.getSize());
        Assert.assertNull(keyInfo.getArrayValue());
    }
View Full Code Here

        this.mockCtx.checking(new Expectations(){{
            oneOf(jedis).type(key); will(returnValue(KeyType.STRING.toString()));
            oneOf(jedis).strlen(key); will(returnValue(size));
            oneOf(jedis).get(key); 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.STRING, keyInfo.getType());
        Assert.assertEquals((Long) size, keyInfo.getSize());
        Assert.assertNotNull(keyInfo.getArrayValue());
        Assert.assertEquals(1, keyInfo.getArrayValue().size());
        Assert.assertEquals(value, keyInfo.getArrayValue().get(0));
    }
View Full Code Here

        final KeyDAOPoolWork work = new KeyDAOPoolWork(key);
        this.mockCtx.checking(new Expectations(){{
            oneOf(jedis).type(key); will(returnValue(KeyType.ZSET.toString()));
            oneOf(jedis).zcard(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.ZSET, keyInfo.getType());
        Assert.assertEquals((Long) size, keyInfo.getSize());
        Assert.assertNull(keyInfo.getArrayValue());
    }
View Full Code Here

        this.mockCtx.checking(new Expectations(){{
            oneOf(jedis).type(key); will(returnValue(KeyType.ZSET.toString()));
            oneOf(jedis).zcard(key); will(returnValue(size));
            oneOf(jedis).zrange(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.ZSET, keyInfo.getType());
        Assert.assertEquals((Long) size, keyInfo.getSize());
        Assert.assertNotNull(keyInfo.getArrayValue());
        Assert.assertEquals(count, keyInfo.getArrayValue().size());
        Assert.assertTrue(value.containsAll(keyInfo.getArrayValue()));
    }
View Full Code Here

        final KeyDAOPoolWork work = new KeyDAOPoolWork(key);
        this.mockCtx.checking(new Expectations(){{
            oneOf(jedis).type(key); will(returnValue(KeyType.SET.toString()));
            oneOf(jedis).scard(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.SET, keyInfo.getType());
        Assert.assertEquals((Long) size, keyInfo.getSize());
        Assert.assertNull(keyInfo.getArrayValue());
    }
View Full Code Here

        this.mockCtx.checking(new Expectations(){{
            oneOf(jedis).type(key); will(returnValue(KeyType.SET.toString()));
            oneOf(jedis).scard(key); will(returnValue(size));
            oneOf(jedis).smembers(key); 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.SET, keyInfo.getType());
        Assert.assertEquals((Long) size, keyInfo.getSize());
        Assert.assertNotNull(keyInfo.getArrayValue());
        Assert.assertEquals(1, keyInfo.getArrayValue().size());
        Assert.assertTrue(keyInfo.getArrayValue().contains("foo"));
    }
View Full Code Here

        this.mockCtx.checking(new Expectations(){{
            oneOf(jedis).type(key); will(returnValue(KeyType.SET.toString()));
            oneOf(jedis).scard(key); will(returnValue(size));
            oneOf(jedis).smembers(key); 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.SET, keyInfo.getType());
        Assert.assertEquals((Long) size, keyInfo.getSize());
        Assert.assertNotNull(keyInfo.getArrayValue());
        Assert.assertTrue(keyInfo.getArrayValue().isEmpty());
    }
View Full Code Here

        this.mockCtx.checking(new Expectations(){{
            oneOf(jedis).type(key); will(returnValue(KeyType.SET.toString()));
            oneOf(jedis).scard(key); will(returnValue(size));
            oneOf(jedis).smembers(key); 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.SET, keyInfo.getType());
        Assert.assertEquals((Long) size, keyInfo.getSize());
        Assert.assertNotNull(keyInfo.getArrayValue());
        Assert.assertEquals(1, keyInfo.getArrayValue().size());
        Assert.assertTrue(keyInfo.getArrayValue().contains("baz"));
    }
View Full Code Here

TOP

Related Classes of net.greghaines.jesque.meta.KeyInfo

Copyright © 2018 www.massapicom. 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.