//ok
}
}
public void testCreate() throws Exception {
Sigar sigar = getSigar();
try {
sigar.getProcExe(getInvalidPid());
} catch (SigarException e) {
}
try {
ProcExe exe = sigar.getProcExe(sigar.getPid());
File exeFile = new File(exe.getName());
String cwd = exe.getCwd();
traceln("cwd='" + cwd + "'");
if (cwd.length() > 0) {
assertTrue(new File(cwd).isDirectory());
}
traceln("exe='" + exe.getName() + "'");
if (exe.getName().length() > 0) {
assertTrue(exeFile.exists());
//win32 has .exe
assertTrue(exeFile.getName().startsWith("java"));
}
} catch (SigarNotImplementedException e) {
//ok
}
long[] pids = sigar.getProcList();
//go through all just to make sure no crashes
for (int i=0; i<pids.length; i++) {
try {
printExe(sigar, pids[i]);