@Test public void collectReturnsCorrectOwner() throws IOException { Integer pid = 6812; String owner = "Apple"; Path procPath = procRoot.resolve(pid + ""); Files.createDirectories(procPath); UserPrincipal user = fs.getUserPrincipalLookupService().lookupPrincipalByName(owner); Files.setOwner(procPath, user); NativeProcess process = collector.collect(pid); assertEquals(owner, process.getOwner()); }
@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);  }