@Test public void collectReturnsEmptyDescriptionIfCmdLineIsEmpty() throws IOException { Integer pid = 4552; Path cmdlinePath = procRoot.resolve(pid + "").resolve("cmdline"); Files.createDirectories(cmdlinePath.getParent()); Files.createFile(cmdlinePath); assertEquals(0L, Files.size(cmdlinePath)); NativeProcess process = collector.collect(pid); assertEquals("", process.getDescription()); }
@Override public NativeProcess collect(int pid) { Path procPath = procRoot.resolve(Integer.toUnsignedString(pid)); NativeProcess process = readNativeProcess(procPath); process.setPid(pid); return process; }
LinuxNativeProcessCollector implements NativeProcessCollector { @Override public NativeProcess collect(int pid) { Path procPath = procRoot.resolve(Integer.toUnsignedString(pid)); NativeProcess process = readNativeProcess(procPath); process.setPid(pid); return process; } }
LinuxNativeProcessCollector implements NativeProcessCollector { @Override public NativeProcess collect(int pid) { Path procPath = procRoot.resolve(Integer.toUnsignedString(pid)); NativeProcess process = readNativeProcess(procPath); process.setPid(pid); return process; } LinuxNativeProcessCollector(Path procRoot); }
LinuxNativeProcessCollector implements NativeProcessCollector { @Override public NativeProcess collect(int pid) { Path procPath = procRoot.resolve(Integer.toUnsignedString(pid)); NativeProcess process = readNativeProcess(procPath); process.setPid(pid); return process; } LinuxNativeProcessCollector(Path procRoot); @Override NativeProcess collect(int pid); }
LinuxNativeProcessCollector implements NativeProcessCollector { @Override public NativeProcess collect(int pid) { Path procPath = procRoot.resolve(Integer.toUnsignedString(pid)); NativeProcess process = readNativeProcess(procPath); process.setPid(pid); return process; } LinuxNativeProcessCollector(Path procRoot); @Override NativeProcess collect(int pid);  }