Implemented by SORT parameter

This commit is contained in:
Jonathan Leibiusky
2010-08-03 00:37:05 -03:00
parent ef5518e581
commit 350865c868

View File

@@ -45,6 +45,29 @@ public class SortingCommandsTest extends Assert {
assertEquals(expected, result);
}
@Test
public void sortBy() throws JedisException {
jedis.lpush("foo", "2");
jedis.lpush("foo", "3");
jedis.lpush("foo", "1");
jedis.set("bar1", "3");
jedis.set("bar2", "2");
jedis.set("bar3", "1");
SortingParams sp = new SortingParams();
sp.by("bar*");
List<String> result = jedis.sort("foo", sp);
List<String> expected = new ArrayList<String>();
expected.add("3");
expected.add("2");
expected.add("1");
assertEquals(expected, result);
}
@Test
public void sortDesc() throws JedisException {
jedis.lpush("foo", "3");