@Test public void testTopReportPlugin() { final TreeMap<String, org.springframework.core.io.Resource> entries = m_topReportPlugin.getEntries(); assertTrue(entries.containsKey("Output")); }
public TreeMap<String, Resource> getEntries() { final TreeMap<String,Resource> map = new TreeMap<String,Resource>(); final String top = findBinary("top"); String topOutput = null; if (top != null) { topOutput = slurpOutput(CommandLine.parse(top + " -h"), true); if (topOutput.contains("-b") && topOutput.contains("-n")) { topOutput = slurpOutput(CommandLine.parse(top + " -n 1 -b"), false); } else if (topOutput.contains("-l")) { topOutput = slurpOutput(CommandLine.parse(top + " -l 1"), false); } else { topOutput = null; } } if (topOutput != null) { File tempFile = createTemporaryFileFromString(topOutput); if(tempFile != null) { map.put("Output", new FileSystemResource(tempFile)); } } return map; }
TopReportPlugin extends AbstractSystemReportPlugin { public TreeMap<String, Resource> getEntries() { final TreeMap<String,Resource> map = new TreeMap<String,Resource>(); final String top = findBinary("top"); String topOutput = null; if (top != null) { topOutput = slurpOutput(CommandLine.parse(top + " -h"), true); if (topOutput.contains("-b") && topOutput.contains("-n")) { topOutput = slurpOutput(CommandLine.parse(top + " -n 1 -b"), false); } else if (topOutput.contains("-l")) { topOutput = slurpOutput(CommandLine.parse(top + " -l 1"), false); } else { topOutput = null; } } if (topOutput != null) { File tempFile = createTemporaryFileFromString(topOutput); if(tempFile != null) { map.put("Output", new FileSystemResource(tempFile)); } } return map; } }
TopReportPlugin extends AbstractSystemReportPlugin { public TreeMap<String, Resource> getEntries() { final TreeMap<String,Resource> map = new TreeMap<String,Resource>(); final String top = findBinary("top"); String topOutput = null; if (top != null) { topOutput = slurpOutput(CommandLine.parse(top + " -h"), true); if (topOutput.contains("-b") && topOutput.contains("-n")) { topOutput = slurpOutput(CommandLine.parse(top + " -n 1 -b"), false); } else if (topOutput.contains("-l")) { topOutput = slurpOutput(CommandLine.parse(top + " -l 1"), false); } else { topOutput = null; } } if (topOutput != null) { File tempFile = createTemporaryFileFromString(topOutput); if(tempFile != null) { map.put("Output", new FileSystemResource(tempFile)); } } return map; }  }
TopReportPlugin extends AbstractSystemReportPlugin { public TreeMap<String, Resource> getEntries() { final TreeMap<String,Resource> map = new TreeMap<String,Resource>(); final String top = findBinary("top"); String topOutput = null; if (top != null) { topOutput = slurpOutput(CommandLine.parse(top + " -h"), true); if (topOutput.contains("-b") && topOutput.contains("-n")) { topOutput = slurpOutput(CommandLine.parse(top + " -n 1 -b"), false); } else if (topOutput.contains("-l")) { topOutput = slurpOutput(CommandLine.parse(top + " -l 1"), false); } else { topOutput = null; } } if (topOutput != null) { File tempFile = createTemporaryFileFromString(topOutput); if(tempFile != null) { map.put("Output", new FileSystemResource(tempFile)); } } return map; }  String getName(); String getDescription(); int getPriority(); TreeMap<String, Resource> getEntries(); }
TopReportPlugin extends AbstractSystemReportPlugin { public TreeMap<String, Resource> getEntries() { final TreeMap<String,Resource> map = new TreeMap<String,Resource>(); final String top = findBinary("top"); String topOutput = null; if (top != null) { topOutput = slurpOutput(CommandLine.parse(top + " -h"), true); if (topOutput.contains("-b") && topOutput.contains("-n")) { topOutput = slurpOutput(CommandLine.parse(top + " -n 1 -b"), false); } else if (topOutput.contains("-l")) { topOutput = slurpOutput(CommandLine.parse(top + " -l 1"), false); } else { topOutput = null; } } if (topOutput != null) { File tempFile = createTemporaryFileFromString(topOutput); if(tempFile != null) { map.put("Output", new FileSystemResource(tempFile)); } } return map; }  String getName(); String getDescription(); int getPriority(); TreeMap<String, Resource> getEntries();  }