@Test public void testProcessList() throws Exception { ProcessLister testProcessLister = new ProcessLister() { @Override ProcessOutputs executeProcess() throws IOException, InterruptedException { ProcessOutputs fakeOutputs = new ProcessOutputs(); fakeOutputs.setOut(processOutputString); return fakeOutputs; } }; JmxStringifiedData<ProcessInfo> data = testProcessLister.list(); assertEquals(11, data.getDtoData().size()); assertEquals(12, data.getJmxStringData().size()); ProcessInfo info = data.getDtoData().iterator().next(); assertEquals("root", info.getUserId()); assertEquals("7.0", info.getCpuLoad()); assertEquals("marras05", info.getStartTime()); assertEquals("0.2", info.getMemUsed()); assertEquals("1", info.getProcessId()); assertEquals("init", info.getCommand()); String jmxData = data.getJmxStringData().get(1); assertEquals("root 7.0 marras05 0.2 1 init", jmxData); }
@Override protected String getCommand() { return LIST_PROCESSES_COMMAND; }
ProcessLister extends AbstractExecLister<ProcessInfo> { @Override protected String getCommand() { return LIST_PROCESSES_COMMAND; } }
ProcessLister extends AbstractExecLister<ProcessInfo> { @Override protected String getCommand() { return LIST_PROCESSES_COMMAND; }  }
ProcessLister extends AbstractExecLister<ProcessInfo> { @Override protected String getCommand() { return LIST_PROCESSES_COMMAND; }  static void main(String[] args); }
ProcessLister extends AbstractExecLister<ProcessInfo> { @Override protected String getCommand() { return LIST_PROCESSES_COMMAND; }  static void main(String[] args);  }