RSet.add serialization fixed. #102

pull/68/merge
Nikita 10 years ago
parent 05d2a7cf8c
commit aec7ec18a6

@ -626,7 +626,7 @@ public class RedisAsyncConnection<K, V> extends ChannelInboundHandlerAdapter {
}
public Future<Long> sadd(K key, V... members) {
CommandArgs<K, V> args = new CommandArgs<K, V>(codec).addKey(key).addMapValues(members);
CommandArgs<K, V> args = new CommandArgs<K, V>(codec).addKey(key).addValues(members);
return dispatch(SADD, new IntegerOutput<K, V>(codec), args);
}

@ -20,6 +20,29 @@ import org.redisson.core.RSortedSet;
public class RedissonSetTest extends BaseTest {
public static class SimpleBean {
private Long lng;
public Long getLng() {
return lng;
}
public void setLng(Long lng) {
this.lng = lng;
}
}
@Test
public void testAddBean() throws InterruptedException, ExecutionException {
SimpleBean sb = new SimpleBean();
sb.setLng(1L);
RSet<SimpleBean> set = redisson.getSet("simple");
set.add(sb);
Assert.assertEquals(sb.getLng(), set.iterator().next().getLng());
}
@Test
public void testAddAsync() throws InterruptedException, ExecutionException {
RSet<Integer> set = redisson.getSet("simple");

Loading…
Cancel
Save