StartJVisualVMCommand extends OfflineGfshCommand { String getProcessOutput(String[] jvmArgs) throws IOException { String[] jvisualvmCommandLine = createJVisualVMCommandLine(jvmArgs); if (isDebugging()) { getGfsh().printAsInfo( String.format("JVisualVM command-line (%1$s)", Arrays.toString(jvisualvmCommandLine))); } Process jvisualvmProcess = Runtime.getRuntime().exec(jvisualvmCommandLine); getGfsh().printAsInfo(CliStrings.START_JVISUALVM__RUN); return waitAndCaptureProcessStandardErrorStream(jvisualvmProcess); }  @CliCommand(value = CliStrings.START_JVISUALVM, help = CliStrings.START_JVISUALVM__HELP) @CliMetaData(shellOnly = true, relatedTopic = {CliStrings.TOPIC_GEODE_MANAGER, CliStrings.TOPIC_GEODE_JMX, CliStrings.TOPIC_GEODE_M_AND_M}) ResultModel startJVisualVM(
      @CliOption(key = CliStrings.START_JCONSOLE__J, optionContext = GfshParser.J_OPTION_CONTEXT,
          help = CliStrings.START_JCONSOLE__J__HELP) final String[] jvmArgs);  }
@Test public void successOutput() throws Exception { doReturn("some output").when(command).getProcessOutput(null); gfshParser.executeAndAssertThat(command, "start jvisualvm") .hasInfoSection().hasOutput().contains("some output"); }