RLexSortedSet.addAll fixed. #640

pull/653/head
Nikita 8 years ago
parent 30f7c421db
commit 733ac70c00

@ -199,11 +199,12 @@ public class RedissonLexSortedSet extends RedissonScoredSortedSet<String> implem
return newSucceededFuture(false);
}
List<Object> params = new ArrayList<Object>(2*c.size());
params.add(getName());
for (Object param : c) {
params.add(0);
params.add(param);
}
return commandExecutor.writeAsync(getName(), StringCodec.INSTANCE, RedisCommands.ZADD_BOOL_RAW, getName(), params.toArray());
return commandExecutor.writeAsync(getName(), StringCodec.INSTANCE, RedisCommands.ZADD_BOOL_RAW, params.toArray());
}
@Override

@ -2,12 +2,23 @@ package org.redisson;
import static org.assertj.core.api.Assertions.assertThat;
import java.util.Arrays;
import org.junit.Assert;
import org.junit.Test;
import org.redisson.api.RLexSortedSet;
public class RedissonLexSortedSetTest extends BaseTest {
@Test
public void testAll() {
RLexSortedSet set = redisson.getLexSortedSet("simple");
set.addAll(Arrays.asList("foo", "bar"));
assertThat(set.contains("foo")).isTrue();
assertThat(set.contains("bar")).isTrue();
assertThat(set.contains("123")).isFalse();
}
@Test
public void testPollLast() {
RLexSortedSet set = redisson.getLexSortedSet("simple");

Loading…
Cancel
Save