Skip to content

Commit

Permalink
Implemented commands are retreived from Protocol.Command enum
Browse files Browse the repository at this point in the history
  • Loading branch information
yaourt committed Nov 4, 2010
1 parent fd8e311 commit abd464f
Showing 1 changed file with 23 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

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 {
Expand All @@ -36,23 +37,28 @@ public void checkJedisIsUpdated() throws IOException {
}

private Set<String> getImplementedCommands() {
Method[] methods = Jedis.class.getDeclaredMethods();
Set<String> implementedCommands = new HashSet<String>();
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<String> implementedCommands = new HashSet<String>();
// 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<String> implementedCommands = new HashSet<String>();
for(Command cmd : Command.values()){
implementedCommands.add(cmd.name().toLowerCase());
}
return implementedCommands;
}

private String[] getAvailableCommands() throws MalformedURLException,
Expand Down

0 comments on commit abd464f

Please sign in to comment.