|
|
|
@ -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");
|
|
|
|
|