From abd464f9bd52f1072e4af1fbaebcc9c2e5407657 Mon Sep 17 00:00:00 2001 From: Yaourt Date: Thu, 4 Nov 2010 17:48:58 +0100 Subject: [PATCH] Implemented commands are retreived from Protocol.Command enum --- .../tests/JedisNewCommandsCheckTest.java | 40 +++++++++++-------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/src/test/java/redis/clients/jedis/tests/JedisNewCommandsCheckTest.java b/src/test/java/redis/clients/jedis/tests/JedisNewCommandsCheckTest.java index 3fd5cb6..db2db14 100644 --- a/src/test/java/redis/clients/jedis/tests/JedisNewCommandsCheckTest.java +++ b/src/test/java/redis/clients/jedis/tests/JedisNewCommandsCheckTest.java @@ -15,6 +15,7 @@ import org.junit.Test; import redis.clients.jedis.Jedis; import redis.clients.jedis.JedisPubSub; +import redis.clients.jedis.Protocol.Command; import redis.clients.jedis.Transaction; public class JedisNewCommandsCheckTest extends Assert { @@ -36,23 +37,28 @@ public class JedisNewCommandsCheckTest extends Assert { } private Set getImplementedCommands() { - Method[] methods = Jedis.class.getDeclaredMethods(); - Set implementedCommands = new HashSet(); - for (Method method : methods) { - implementedCommands.add(method.getName().trim().toLowerCase()); - } - - methods = JedisPubSub.class.getDeclaredMethods(); - for (Method method : methods) { - implementedCommands.add(method.getName().trim().toLowerCase()); - } - - methods = Transaction.class.getDeclaredMethods(); - for (Method method : methods) { - implementedCommands.add(method.getName().trim().toLowerCase()); - } - implementedCommands.add("config"); - return implementedCommands; +// Method[] methods = Jedis.class.getDeclaredMethods(); +// Set implementedCommands = new HashSet(); +// for (Method method : methods) { +// implementedCommands.add(method.getName().trim().toLowerCase()); +// } +// +// methods = JedisPubSub.class.getDeclaredMethods(); +// for (Method method : methods) { +// implementedCommands.add(method.getName().trim().toLowerCase()); +// } +// +// methods = Transaction.class.getDeclaredMethods(); +// for (Method method : methods) { +// implementedCommands.add(method.getName().trim().toLowerCase()); +// } +// implementedCommands.add("config"); +// return implementedCommands; + Set implementedCommands = new HashSet(); + for(Command cmd : Command.values()){ + implementedCommands.add(cmd.name().toLowerCase()); + } + return implementedCommands; } private String[] getAvailableCommands() throws MalformedURLException,