Merge branch 'master' into 3.0.0

pull/985/head
Nikita 8 years ago
commit 1de086e1c0

@ -87,7 +87,7 @@
<groupId>io.netty</groupId> <groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId> <artifactId>netty-transport-native-epoll</artifactId>
<classifier>linux-x86_64</classifier> <classifier>linux-x86_64</classifier>
<version>4.1.12.Final</version> <version>4.1.13.Final</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.esotericsoftware</groupId> <groupId>com.esotericsoftware</groupId>
@ -103,19 +103,19 @@
<dependency> <dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId> <groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-cbor</artifactId> <artifactId>jackson-dataformat-cbor</artifactId>
<version>2.7.6</version> <version>2.7.9</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId> <groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-smile</artifactId> <artifactId>jackson-dataformat-smile</artifactId>
<version>2.7.6</version> <version>2.7.9</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId> <groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-avro</artifactId> <artifactId>jackson-dataformat-avro</artifactId>
<version>2.7.6</version> <version>2.7.9</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>

@ -34,33 +34,33 @@
<dependency> <dependency>
<groupId>io.netty</groupId> <groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId> <artifactId>netty-transport-native-epoll</artifactId>
<version>4.1.12.Final</version> <version>4.1.13.Final</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.netty</groupId> <groupId>io.netty</groupId>
<artifactId>netty-common</artifactId> <artifactId>netty-common</artifactId>
<version>4.1.12.Final</version> <version>4.1.13.Final</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.netty</groupId> <groupId>io.netty</groupId>
<artifactId>netty-codec</artifactId> <artifactId>netty-codec</artifactId>
<version>4.1.12.Final</version> <version>4.1.13.Final</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.netty</groupId> <groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId> <artifactId>netty-buffer</artifactId>
<version>4.1.12.Final</version> <version>4.1.13.Final</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.netty</groupId> <groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId> <artifactId>netty-transport</artifactId>
<version>4.1.12.Final</version> <version>4.1.13.Final</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.netty</groupId> <groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId> <artifactId>netty-handler</artifactId>
<version>4.1.12.Final</version> <version>4.1.13.Final</version>
</dependency> </dependency>
<dependency> <dependency>
@ -186,17 +186,17 @@
<dependency> <dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId> <groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId> <artifactId>jackson-dataformat-yaml</artifactId>
<version>2.7.6</version> <version>2.7.9</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId> <artifactId>jackson-core</artifactId>
<version>2.7.6</version> <version>2.7.9</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId> <artifactId>jackson-databind</artifactId>
<version>2.7.6</version> <version>2.7.9</version>
</dependency> </dependency>
<dependency> <dependency>
@ -209,21 +209,21 @@
<dependency> <dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId> <groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-cbor</artifactId> <artifactId>jackson-dataformat-cbor</artifactId>
<version>2.7.6</version> <version>2.7.9</version>
<scope>provided</scope> <scope>provided</scope>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId> <groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-smile</artifactId> <artifactId>jackson-dataformat-smile</artifactId>
<version>2.7.6</version> <version>2.7.9</version>
<scope>provided</scope> <scope>provided</scope>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId> <groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-avro</artifactId> <artifactId>jackson-dataformat-avro</artifactId>
<version>2.7.6</version> <version>2.7.9</version>
<scope>provided</scope> <scope>provided</scope>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
@ -235,7 +235,7 @@
<dependency> <dependency>
<groupId>net.bytebuddy</groupId> <groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId> <artifactId>byte-buddy</artifactId>
<version>1.6.8</version> <version>1.6.14</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.jodd</groupId> <groupId>org.jodd</groupId>

@ -19,34 +19,32 @@ import java.util.Collection;
import org.reactivestreams.Publisher; import org.reactivestreams.Publisher;
public interface RLexSortedSetReactive extends RCollectionReactive<String> { public interface RLexSortedSetReactive extends RScoredSortedSetReactive<String>, RCollectionReactive<String> {
Publisher<Integer> removeRangeByLex(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive); Publisher<Integer> removeRange(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
Publisher<Integer> removeRangeTailByLex(String fromElement, boolean fromInclusive); Publisher<Integer> removeRangeTail(String fromElement, boolean fromInclusive);
Publisher<Integer> removeRangeHeadByLex(String toElement, boolean toInclusive); Publisher<Integer> removeRangeHead(String toElement, boolean toInclusive);
Publisher<Integer> lexCountTail(String fromElement, boolean fromInclusive); Publisher<Integer> countTail(String fromElement, boolean fromInclusive);
Publisher<Integer> lexCountHead(String toElement, boolean toInclusive); Publisher<Integer> countHead(String toElement, boolean toInclusive);
Publisher<Collection<String>> lexRangeTail(String fromElement, boolean fromInclusive); Publisher<Collection<String>> rangeTail(String fromElement, boolean fromInclusive);
Publisher<Collection<String>> lexRangeHead(String toElement, boolean toInclusive); Publisher<Collection<String>> rangeHead(String toElement, boolean toInclusive);
Publisher<Collection<String>> lexRange(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive); Publisher<Collection<String>> range(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
Publisher<Collection<String>> lexRangeTail(String fromElement, boolean fromInclusive, int offset, int count); Publisher<Collection<String>> rangeTail(String fromElement, boolean fromInclusive, int offset, int count);
Publisher<Collection<String>> lexRangeHead(String toElement, boolean toInclusive, int offset, int count); Publisher<Collection<String>> rangeHead(String toElement, boolean toInclusive, int offset, int count);
Publisher<Collection<String>> lexRange(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count); Publisher<Collection<String>> range(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count);
Publisher<Integer> lexCount(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive); Publisher<Integer> count(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
Publisher<Integer> rank(String o); Publisher<Collection<String>> range(int startIndex, int endIndex);
Publisher<Collection<String>> valueRange(int startIndex, int endIndex);
} }

@ -103,6 +103,7 @@ public interface RedisCommands {
RedisCommand<Boolean> ZADD_NX_BOOL = new RedisCommand<Boolean>("ZADD", new BooleanAmountReplayConvertor(), 4); RedisCommand<Boolean> ZADD_NX_BOOL = new RedisCommand<Boolean>("ZADD", new BooleanAmountReplayConvertor(), 4);
RedisCommand<Boolean> ZADD_BOOL_RAW = new RedisCommand<Boolean>("ZADD", new BooleanAmountReplayConvertor()); RedisCommand<Boolean> ZADD_BOOL_RAW = new RedisCommand<Boolean>("ZADD", new BooleanAmountReplayConvertor());
RedisCommand<Boolean> ZADD_RAW = new RedisCommand<Boolean>("ZADD"); RedisCommand<Boolean> ZADD_RAW = new RedisCommand<Boolean>("ZADD");
RedisStrictCommand<Integer> ZADD_INT = new RedisStrictCommand<Integer>("ZADD", new IntegerReplayConvertor());
RedisCommand<Long> ZADD = new RedisCommand<Long>("ZADD"); RedisCommand<Long> ZADD = new RedisCommand<Long>("ZADD");
RedisCommand<Boolean> ZREM = new RedisCommand<Boolean>("ZREM", new BooleanAmountReplayConvertor(), 2, ValueType.OBJECTS); RedisCommand<Boolean> ZREM = new RedisCommand<Boolean>("ZREM", new BooleanAmountReplayConvertor(), 2, ValueType.OBJECTS);
RedisStrictCommand<Integer> ZCARD_INT = new RedisStrictCommand<Integer>("ZCARD", new IntegerReplayConvertor()); RedisStrictCommand<Integer> ZCARD_INT = new RedisStrictCommand<Integer>("ZCARD", new IntegerReplayConvertor());

@ -20,11 +20,16 @@ import java.util.Collection;
import java.util.List; import java.util.List;
import org.reactivestreams.Publisher; import org.reactivestreams.Publisher;
import org.redisson.RedissonLexSortedSet;
import org.redisson.api.RFuture;
import org.redisson.api.RLexSortedSetAsync;
import org.redisson.api.RLexSortedSetReactive; import org.redisson.api.RLexSortedSetReactive;
import org.redisson.client.codec.StringCodec; import org.redisson.client.codec.StringCodec;
import org.redisson.client.protocol.RedisCommands; import org.redisson.client.protocol.RedisCommands;
import org.redisson.command.CommandReactiveExecutor; import org.redisson.command.CommandReactiveExecutor;
import reactor.fn.Supplier;
/** /**
* *
* @author Nikita Koksharov * @author Nikita Koksharov
@ -32,8 +37,11 @@ import org.redisson.command.CommandReactiveExecutor;
*/ */
public class RedissonLexSortedSetReactive extends RedissonScoredSortedSetReactive<String> implements RLexSortedSetReactive { public class RedissonLexSortedSetReactive extends RedissonScoredSortedSetReactive<String> implements RLexSortedSetReactive {
private final RLexSortedSetAsync instance;
public RedissonLexSortedSetReactive(CommandReactiveExecutor commandExecutor, String name) { public RedissonLexSortedSetReactive(CommandReactiveExecutor commandExecutor, String name) {
super(StringCodec.INSTANCE, commandExecutor, name); super(StringCodec.INSTANCE, commandExecutor, name);
instance = new RedissonLexSortedSet(commandExecutor, name, null);
} }
@Override @Override
@ -42,101 +50,128 @@ public class RedissonLexSortedSetReactive extends RedissonScoredSortedSetReactiv
} }
@Override @Override
public Publisher<Integer> removeRangeHeadByLex(String toElement, boolean toInclusive) { public Publisher<Integer> removeRangeHead(final String toElement, final boolean toInclusive) {
String toValue = value(toElement, toInclusive); return reactive(new Supplier<RFuture<Integer>>() {
return commandExecutor.writeReactive(getName(), StringCodec.INSTANCE, RedisCommands.ZREMRANGEBYLEX, getName(), "-", toValue);
}
@Override @Override
public Publisher<Integer> removeRangeTailByLex(String fromElement, boolean fromInclusive) { public RFuture<Integer> get() {
String fromValue = value(fromElement, fromInclusive); return instance.removeRangeHeadAsync(toElement, toInclusive);
return commandExecutor.writeReactive(getName(), StringCodec.INSTANCE, RedisCommands.ZREMRANGEBYLEX, getName(), fromValue, "+"); }
});
} }
@Override @Override
public Publisher<Integer> removeRangeByLex(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive) { public Publisher<Integer> removeRangeTail(final String fromElement, final boolean fromInclusive) {
String fromValue = value(fromElement, fromInclusive); return reactive(new Supplier<RFuture<Integer>>() {
String toValue = value(toElement, toInclusive); @Override
public RFuture<Integer> get() {
return commandExecutor.writeReactive(getName(), StringCodec.INSTANCE, RedisCommands.ZREMRANGEBYLEX, getName(), fromValue, toValue); return instance.removeRangeTailAsync(fromElement, fromInclusive);
}
});
} }
@Override @Override
public Publisher<Collection<String>> lexRangeHead(String toElement, boolean toInclusive) { public Publisher<Integer> removeRange(final String fromElement, final boolean fromInclusive, final String toElement, final boolean toInclusive) {
String toValue = value(toElement, toInclusive); return reactive(new Supplier<RFuture<Integer>>() {
return commandExecutor.readReactive(getName(), StringCodec.INSTANCE, RedisCommands.ZRANGEBYLEX, getName(), "-", toValue); @Override
public RFuture<Integer> get() {
return instance.removeRangeAsync(fromElement, fromInclusive, toElement, toInclusive);
}
});
} }
@Override @Override
public Publisher<Collection<String>> lexRangeTail(String fromElement, boolean fromInclusive) { public Publisher<Collection<String>> rangeHead(final String toElement, final boolean toInclusive) {
String fromValue = value(fromElement, fromInclusive); return reactive(new Supplier<RFuture<Collection<String>>>() {
return commandExecutor.readReactive(getName(), StringCodec.INSTANCE, RedisCommands.ZRANGEBYLEX, getName(), fromValue, "+"); @Override
public RFuture<Collection<String>> get() {
return instance.rangeHeadAsync(toElement, toInclusive);
}
});
} }
@Override @Override
public Publisher<Collection<String>> lexRange(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive) { public Publisher<Collection<String>> rangeTail(final String fromElement, final boolean fromInclusive) {
String fromValue = value(fromElement, fromInclusive); return reactive(new Supplier<RFuture<Collection<String>>>() {
String toValue = value(toElement, toInclusive); @Override
public RFuture<Collection<String>> get() {
return commandExecutor.readReactive(getName(), StringCodec.INSTANCE, RedisCommands.ZRANGEBYLEX, getName(), fromValue, toValue); return instance.rangeTailAsync(fromElement, fromInclusive);
}
});
} }
@Override @Override
public Publisher<Collection<String>> lexRangeHead(String toElement, boolean toInclusive, int offset, int count) { public Publisher<Collection<String>> range(final String fromElement, final boolean fromInclusive, final String toElement, final boolean toInclusive) {
String toValue = value(toElement, toInclusive); return reactive(new Supplier<RFuture<Collection<String>>>() {
return commandExecutor.readReactive(getName(), StringCodec.INSTANCE, RedisCommands.ZRANGEBYLEX, getName(), "-", toValue, "LIMIT", offset, count); @Override
public RFuture<Collection<String>> get() {
return instance.rangeAsync(fromElement, fromInclusive, toElement, toInclusive);
}
});
} }
@Override @Override
public Publisher<Collection<String>> lexRangeTail(String fromElement, boolean fromInclusive, int offset, int count) { public Publisher<Collection<String>> rangeHead(final String toElement, final boolean toInclusive, final int offset, final int count) {
String fromValue = value(fromElement, fromInclusive); return reactive(new Supplier<RFuture<Collection<String>>>() {
return commandExecutor.readReactive(getName(), StringCodec.INSTANCE, RedisCommands.ZRANGEBYLEX, getName(), fromValue, "+", "LIMIT", offset, count); @Override
public RFuture<Collection<String>> get() {
return instance.rangeHeadAsync(toElement, toInclusive, offset, count);
}
});
} }
@Override @Override
public Publisher<Collection<String>> lexRange(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count) { public Publisher<Collection<String>> rangeTail(final String fromElement, final boolean fromInclusive, final int offset, final int count) {
String fromValue = value(fromElement, fromInclusive); return reactive(new Supplier<RFuture<Collection<String>>>() {
String toValue = value(toElement, toInclusive); @Override
public RFuture<Collection<String>> get() {
return commandExecutor.readReactive(getName(), StringCodec.INSTANCE, RedisCommands.ZRANGEBYLEX, getName(), fromValue, toValue, "LIMIT", offset, count); return instance.rangeTailAsync(fromElement, fromInclusive, offset, count);
}
});
} }
@Override @Override
public Publisher<Integer> lexCountTail(String fromElement, boolean fromInclusive) { public Publisher<Collection<String>> range(final String fromElement, final boolean fromInclusive, final String toElement, final boolean toInclusive, final int offset, final int count) {
String fromValue = value(fromElement, fromInclusive); return reactive(new Supplier<RFuture<Collection<String>>>() {
@Override
return commandExecutor.readReactive(getName(), StringCodec.INSTANCE, RedisCommands.ZLEXCOUNT, getName(), fromValue, "+"); public RFuture<Collection<String>> get() {
return instance.rangeAsync(fromElement, fromInclusive, toElement, toInclusive, offset, count);
}
});
} }
@Override @Override
public Publisher<Integer> lexCountHead(String toElement, boolean toInclusive) { public Publisher<Integer> countTail(final String fromElement, final boolean fromInclusive) {
String toValue = value(toElement, toInclusive); return reactive(new Supplier<RFuture<Integer>>() {
@Override
return commandExecutor.readReactive(getName(), StringCodec.INSTANCE, RedisCommands.ZLEXCOUNT, getName(), "-", toValue); public RFuture<Integer> get() {
return instance.countTailAsync(fromElement, fromInclusive);
}
});
} }
@Override @Override
public Publisher<Integer> lexCount(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive) { public Publisher<Integer> countHead(final String toElement, final boolean toInclusive) {
String fromValue = value(fromElement, fromInclusive); return reactive(new Supplier<RFuture<Integer>>() {
String toValue = value(toElement, toInclusive); @Override
public RFuture<Integer> get() {
return commandExecutor.readReactive(getName(), StringCodec.INSTANCE, RedisCommands.ZLEXCOUNT, getName(), fromValue, toValue); return instance.countHeadAsync(toElement, toInclusive);
}
});
} }
private String value(String fromElement, boolean fromInclusive) { @Override
String fromValue = fromElement.toString(); public Publisher<Integer> count(final String fromElement, final boolean fromInclusive, final String toElement, final boolean toInclusive) {
if (fromInclusive) { return reactive(new Supplier<RFuture<Integer>>() {
fromValue = "[" + fromValue; @Override
} else { public RFuture<Integer> get() {
fromValue = "(" + fromValue; return instance.countAsync(fromElement, fromInclusive, toElement, toInclusive);
} }
return fromValue; });
} }
@Override @Override
public Publisher<Integer> add(String e) { public Publisher<Integer> add(final String e) {
return commandExecutor.writeReactive(getName(), StringCodec.INSTANCE, RedisCommands.ZADD_RAW, getName(), 0, e); return commandExecutor.writeReactive(getName(), StringCodec.INSTANCE, RedisCommands.ZADD_INT, getName(), 0, e);
} }
@Override @Override
@ -146,7 +181,12 @@ public class RedissonLexSortedSetReactive extends RedissonScoredSortedSetReactiv
params.add(0); params.add(0);
params.add(param); params.add(param);
} }
return commandExecutor.writeReactive(getName(), StringCodec.INSTANCE, RedisCommands.ZADD_RAW, getName(), params.toArray()); return commandExecutor.writeReactive(getName(), StringCodec.INSTANCE, RedisCommands.ZADD_INT, getName(), params.toArray());
}
@Override
public Publisher<Collection<String>> range(int startIndex, int endIndex) {
return valueRange(startIndex, endIndex);
} }
} }

@ -1,12 +1,20 @@
package org.redisson; package org.redisson;
import static org.assertj.core.api.Assertions.*; import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.redisson.api.RLexSortedSetReactive; import org.redisson.api.RLexSortedSetReactive;
import reactor.rx.Streams;
public class RedissonLexSortedSetReactiveTest extends BaseReactiveTest { public class RedissonLexSortedSetReactiveTest extends BaseReactiveTest {
public static <V> Iterable<V> sync(RLexSortedSetReactive list) {
return (Iterable<V>) Streams.create(list.iterator()).toList().poll();
}
@Test @Test
public void testAddAllReactive() { public void testAddAllReactive() {
RLexSortedSetReactive list = redisson.getLexSortedSet("set"); RLexSortedSetReactive list = redisson.getLexSortedSet("set");
@ -33,11 +41,11 @@ public class RedissonLexSortedSetReactiveTest extends BaseReactiveTest {
Assert.assertTrue(sync(set.add("f")) == 1); Assert.assertTrue(sync(set.add("f")) == 1);
Assert.assertTrue(sync(set.add("g")) == 1); Assert.assertTrue(sync(set.add("g")) == 1);
Assert.assertEquals(0, sync(set.removeRangeTailByLex("z", false)).intValue()); Assert.assertEquals(0, sync(set.removeRangeTail("z", false)).intValue());
Assert.assertEquals(4, sync(set.removeRangeTailByLex("c", false)).intValue()); Assert.assertEquals(4, sync(set.removeRangeTail("c", false)).intValue());
assertThat(sync(set)).containsExactly("a", "b", "c"); assertThat(sync(set)).containsExactly("a", "b", "c");
Assert.assertEquals(1, sync(set.removeRangeTailByLex("c", true)).intValue()); Assert.assertEquals(1, sync(set.removeRangeTail("c", true)).intValue());
assertThat(sync(set)).containsExactly("a", "b"); assertThat(sync(set)).containsExactly("a", "b");
} }
@ -53,9 +61,9 @@ public class RedissonLexSortedSetReactiveTest extends BaseReactiveTest {
sync(set.add("f")); sync(set.add("f"));
sync(set.add("g")); sync(set.add("g"));
Assert.assertEquals(2, sync(set.removeRangeHeadByLex("c", false)).intValue()); Assert.assertEquals(2, sync(set.removeRangeHead("c", false)).intValue());
assertThat(sync(set)).containsExactly("c", "d", "e", "f", "g"); assertThat(sync(set)).containsExactly("c", "d", "e", "f", "g");
Assert.assertEquals(1, (int)sync(set.removeRangeHeadByLex("c", true))); Assert.assertEquals(1, (int)sync(set.removeRangeHead("c", true)));
assertThat(sync(set)).containsExactly("d", "e", "f", "g"); assertThat(sync(set)).containsExactly("d", "e", "f", "g");
} }
@ -70,7 +78,7 @@ public class RedissonLexSortedSetReactiveTest extends BaseReactiveTest {
sync(set.add("f")); sync(set.add("f"));
sync(set.add("g")); sync(set.add("g"));
Assert.assertEquals(5, sync(set.removeRangeByLex("aaa", true, "g", false)).intValue()); Assert.assertEquals(5, sync(set.removeRange("aaa", true, "g", false)).intValue());
assertThat(sync(set)).containsExactly("a", "g"); assertThat(sync(set)).containsExactly("a", "g");
} }
@ -87,8 +95,8 @@ public class RedissonLexSortedSetReactiveTest extends BaseReactiveTest {
Assert.assertTrue(sync(set.add("f")) == 1); Assert.assertTrue(sync(set.add("f")) == 1);
Assert.assertTrue(sync(set.add("g")) == 1); Assert.assertTrue(sync(set.add("g")) == 1);
assertThat(sync(set.lexRangeTail("c", false))).containsExactly("d", "e", "f", "g"); assertThat(sync(set.rangeTail("c", false))).containsExactly("d", "e", "f", "g");
assertThat(sync(set.lexRangeTail("c", true))).containsExactly("c", "d", "e", "f", "g"); assertThat(sync(set.rangeTail("c", true))).containsExactly("c", "d", "e", "f", "g");
} }
@ -103,8 +111,8 @@ public class RedissonLexSortedSetReactiveTest extends BaseReactiveTest {
sync(set.add("f")); sync(set.add("f"));
sync(set.add("g")); sync(set.add("g"));
assertThat(sync(set.lexRangeHead("c", false))).containsExactly("a", "b"); assertThat(sync(set.rangeHead("c", false))).containsExactly("a", "b");
assertThat(sync(set.lexRangeHead("c", true))).containsExactly("a", "b", "c"); assertThat(sync(set.rangeHead("c", true))).containsExactly("a", "b", "c");
} }
@ -119,7 +127,7 @@ public class RedissonLexSortedSetReactiveTest extends BaseReactiveTest {
sync(set.add("f")); sync(set.add("f"));
sync(set.add("g")); sync(set.add("g"));
assertThat(sync(set.lexRange("aaa", true, "g", false))).contains("b", "c", "d", "e", "f"); assertThat(sync(set.range("aaa", true, "g", false))).contains("b", "c", "d", "e", "f");
} }
@Test @Test
@ -133,8 +141,8 @@ public class RedissonLexSortedSetReactiveTest extends BaseReactiveTest {
sync(set.add("f")); sync(set.add("f"));
sync(set.add("g")); sync(set.add("g"));
Assert.assertEquals(5, (int)sync(set.lexCount("b", true, "f", true))); Assert.assertEquals(5, (int)sync(set.count("b", true, "f", true)));
Assert.assertEquals(3, (int)sync(set.lexCount("b", false, "f", false))); Assert.assertEquals(3, (int)sync(set.count("b", false, "f", false)));
} }
} }

Loading…
Cancel
Save