jm.printAllValues(); } else { for (String key : args) {
jm.printAllValues(); } else { for (String key: args) {
private static boolean checkPrintAllValues(JMXGet jmx) throws Exception { int size = 0; byte[] bytes = null; String pattern = "List of all the available keys:"; PipedOutputStream pipeOut = new PipedOutputStream(); PipedInputStream pipeIn = new PipedInputStream(pipeOut); System.setErr(new PrintStream(pipeOut)); jmx.printAllValues(); if ((size = pipeIn.available()) != 0) { bytes = new byte[size]; pipeIn.read(bytes, 0, bytes.length); } pipeOut.close(); pipeIn.close(); return bytes != null ? new String(bytes).contains(pattern) : false; }
jm.printAllValues(); } else { for (String key : args) {
jm.printAllValues(); } else { for (String key : args) {