RKeys.count test added. #331

pull/365/head
Nikita 9 years ago
parent 176efb3498
commit 73f26357f0

@ -258,7 +258,7 @@ public class RedissonKeys implements RKeys {
} }
@Override @Override
public Long сount() { public Long count() {
return commandExecutor.get(countAsync()); return commandExecutor.get(countAsync());
} }

@ -93,6 +93,6 @@ public interface RKeys extends RKeysAsync {
* *
* @return * @return
*/ */
Long сount(); Long count();
} }

@ -1,5 +1,7 @@
package org.redisson; package org.redisson;
import static org.assertj.core.api.Assertions.assertThat;
import java.util.Collection; import java.util.Collection;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
@ -97,4 +99,13 @@ public class RedissonKeysTest extends BaseTest {
Assert.assertEquals(0, redisson.getKeys().delete("test", "map2")); Assert.assertEquals(0, redisson.getKeys().delete("test", "map2"));
} }
@Test
public void testCount() {
Long s = redisson.getKeys().count();
assertThat(s).isEqualTo(0);
redisson.getBucket("test1").set(23);
s = redisson.getKeys().count();
assertThat(s).isEqualTo(1);
}
} }

@ -18,6 +18,7 @@ import org.redisson.connection.ConnectionListener;
import org.redisson.core.ClusterNode; import org.redisson.core.ClusterNode;
import org.redisson.core.Node; import org.redisson.core.Node;
import org.redisson.core.NodesGroup; import org.redisson.core.NodesGroup;
import static org.assertj.core.api.Assertions.*;
import net.jodah.concurrentunit.Waiter; import net.jodah.concurrentunit.Waiter;

Loading…
Cancel
Save