InfoHandler extends AbstractCommandHandler { @Override protected void doHandle(String[] args, RedisClient redisClient) { logger.debug("[doHandle]{},{}", redisClient, StringUtil.join(" ", args)); RedisKeeperServer redisKeeperServer = redisClient.getRedisKeeperServer(); String result; if(args.length == 0){ result = new DefaultInfoSections().getInfo(redisKeeperServer); } else { result = doSectionHandler(args[0], redisKeeperServer); } redisClient.sendMessage(new BulkStringParser(result).format()); } InfoHandler(); @Override String[] getCommands(); @Override boolean isLog(String[] args);  }
@Ignore @Test public void testInfoStatsManually() throws Exception { int port = keeperServer.getListeningPort(); Socket socket = new Socket(); socket.connect(new InetSocketAddress("127.0.0.1", port)); socket.getOutputStream().write("info stats".getBytes()); BufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream())); new InfoHandler().doHandle(new String[]{"stats"}, new DefaultRedisClient(new EmbeddedChannel(), keeperServer)); String line = null; logger.info("listening-port: {}", port); while((line = reader.readLine()) != null) { logger.info("{}", line); } }