@Test public void testExecuteAndReadPs() throws IOException { final List<ProcessInformations> processes = ProcessInformations.buildProcessInformations(); assertNotNull("processes null", processes); assertFalse("processes vide", processes.isEmpty()); final boolean windows = System.getProperty("os.name").toLowerCase(Locale.getDefault()) .contains("windows"); checkProcesses(processes, windows); }
public static List<ProcessInformations> buildProcessInformations(InputStream in, boolean windows, boolean macOrAix) { final String charset; if (windows) { charset = "Cp1252"; } else { charset = "UTF-8"; } final Scanner sc = new Scanner(in, charset); sc.useRadix(10); sc.useLocale(Locale.US); sc.nextLine(); if (windows) { sc.nextLine(); sc.nextLine(); } final List<ProcessInformations> processInfos = new ArrayList<ProcessInformations>(); while (sc.hasNext()) { final ProcessInformations processInfo = new ProcessInformations(sc, windows, macOrAix); processInfos.add(processInfo); } return Collections.unmodifiableList(processInfos); }
ProcessInformations implements Serializable { public static List<ProcessInformations> buildProcessInformations(InputStream in, boolean windows, boolean macOrAix) { final String charset; if (windows) { charset = "Cp1252"; } else { charset = "UTF-8"; } final Scanner sc = new Scanner(in, charset); sc.useRadix(10); sc.useLocale(Locale.US); sc.nextLine(); if (windows) { sc.nextLine(); sc.nextLine(); } final List<ProcessInformations> processInfos = new ArrayList<ProcessInformations>(); while (sc.hasNext()) { final ProcessInformations processInfo = new ProcessInformations(sc, windows, macOrAix); processInfos.add(processInfo); } return Collections.unmodifiableList(processInfos); } }
ProcessInformations implements Serializable { public static List<ProcessInformations> buildProcessInformations(InputStream in, boolean windows, boolean macOrAix) { final String charset; if (windows) { charset = "Cp1252"; } else { charset = "UTF-8"; } final Scanner sc = new Scanner(in, charset); sc.useRadix(10); sc.useLocale(Locale.US); sc.nextLine(); if (windows) { sc.nextLine(); sc.nextLine(); } final List<ProcessInformations> processInfos = new ArrayList<ProcessInformations>(); while (sc.hasNext()) { final ProcessInformations processInfo = new ProcessInformations(sc, windows, macOrAix); processInfos.add(processInfo); } return Collections.unmodifiableList(processInfos); } private  ProcessInformations(Scanner sc, boolean windows, boolean macOrAix); }
ProcessInformations implements Serializable { public static List<ProcessInformations> buildProcessInformations(InputStream in, boolean windows, boolean macOrAix) { final String charset; if (windows) { charset = "Cp1252"; } else { charset = "UTF-8"; } final Scanner sc = new Scanner(in, charset); sc.useRadix(10); sc.useLocale(Locale.US); sc.nextLine(); if (windows) { sc.nextLine(); sc.nextLine(); } final List<ProcessInformations> processInfos = new ArrayList<ProcessInformations>(); while (sc.hasNext()) { final ProcessInformations processInfo = new ProcessInformations(sc, windows, macOrAix); processInfos.add(processInfo); } return Collections.unmodifiableList(processInfos); } private  ProcessInformations(Scanner sc, boolean windows, boolean macOrAix); static List<ProcessInformations> buildProcessInformations(InputStream in,
			boolean windows, boolean macOrAix); static List<ProcessInformations> buildProcessInformations(); String getUser(); int getPid(); float getCpuPercentage(); float getMemPercentage(); int getVsz(); int getRss(); String getTty(); String getStat(); String getStart(); String getCpuTime(); String getCommand(); }
ProcessInformations implements Serializable { public static List<ProcessInformations> buildProcessInformations(InputStream in, boolean windows, boolean macOrAix) { final String charset; if (windows) { charset = "Cp1252"; } else { charset = "UTF-8"; } final Scanner sc = new Scanner(in, charset); sc.useRadix(10); sc.useLocale(Locale.US); sc.nextLine(); if (windows) { sc.nextLine(); sc.nextLine(); } final List<ProcessInformations> processInfos = new ArrayList<ProcessInformations>(); while (sc.hasNext()) { final ProcessInformations processInfo = new ProcessInformations(sc, windows, macOrAix); processInfos.add(processInfo); } return Collections.unmodifiableList(processInfos); } private  ProcessInformations(Scanner sc, boolean windows, boolean macOrAix); static List<ProcessInformations> buildProcessInformations(InputStream in,
			boolean windows, boolean macOrAix); static List<ProcessInformations> buildProcessInformations(); String getUser(); int getPid(); float getCpuPercentage(); float getMemPercentage(); int getVsz(); int getRss(); String getTty(); String getStat(); String getStart(); String getCpuTime(); String getCommand();  }