public TestProcFd(String name) {
super(name);
}
public void testCreate() throws Exception {
Sigar sigar = getSigar();
try {
sigar.getProcFd(getInvalidPid());
} catch (SigarException e) {
}
try {
long pid = sigar.getPid();
long total = sigar.getProcFd(pid).getTotal();
SigarLoader loader = new SigarLoader(Sigar.class);
String path = loader.findJarPath(null);
File file = new File(path, loader.getJarName());
traceln("Opening " + file);
FileInputStream is = new FileInputStream(file);
assertEqualsTrace("Total", total + 1,
sigar.getProcFd(pid).getTotal());
is.close();
assertEqualsTrace("Total", total,
sigar.getProcFd(pid).getTotal());
} catch (SigarNotImplementedException e) {
//ok
} catch (SigarPermissionDeniedException e) {
//ok
}