+ finish Redis list tests

+ wire redis list test into PersonTest
This commit is contained in:
Costin Leau
2010-11-11 14:43:25 +02:00
parent 547b0f202d
commit 22a4240f70
2 changed files with 13 additions and 3 deletions

View File

@@ -244,7 +244,17 @@ public abstract class AbstractRedisListTest<T> extends AbstractRedisCollectionTe
assertEquals(t1, list.remove(0));
}
public RedisList trim(int start, int end) {
return list.trim(start, end);
@Test
public void testTrim() {
T t1 = getT();
T t2 = getT();
assertTrue(list.trim(0, 0).isEmpty());
list.add(t1);
list.add(t2);
assertEquals(2, list.size());
assertEquals(1, list.trim(0, 0).size());
assertEquals(1, list.size());
assertEquals(t1, list.get(0));
}
}

View File

@@ -27,7 +27,7 @@ import org.springframework.datastore.redis.connection.jedis.JedisConnectionFacto
*
* @author Costin Leau
*/
public class PersonRedisListTest extends AbstractRedisCollectionTest<Person> {
public class PersonRedisListTest extends AbstractRedisListTest<Person> {
private JedisConnectionFactory factory;
private int counter = 0;