catch SigarPermissionDeniedException (e.g. FreeBSD /dev/kmem)
This commit is contained in:
parent
933b7734a6
commit
db0622d030
|
@ -6,6 +6,7 @@ import java.util.Map;
|
|||
import net.hyperic.sigar.Sigar;
|
||||
import net.hyperic.sigar.SigarException;
|
||||
import net.hyperic.sigar.SigarNotImplementedException;
|
||||
import net.hyperic.sigar.SigarPermissionDeniedException;
|
||||
|
||||
public class TestProcEnv extends SigarTestCase {
|
||||
|
||||
|
@ -46,6 +47,8 @@ public class TestProcEnv extends SigarTestCase {
|
|||
assertTrue(val == null);
|
||||
} catch (SigarNotImplementedException e) {
|
||||
//ok
|
||||
} catch (SigarPermissionDeniedException e) {
|
||||
//ok
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.hyperic.sigar.Sigar;
|
|||
import net.hyperic.sigar.SigarException;
|
||||
import net.hyperic.sigar.SigarLoader;
|
||||
import net.hyperic.sigar.SigarNotImplementedException;
|
||||
import net.hyperic.sigar.SigarPermissionDeniedException;
|
||||
|
||||
public class TestProcFd extends SigarTestCase {
|
||||
|
||||
|
@ -42,6 +43,8 @@ public class TestProcFd extends SigarTestCase {
|
|||
sigar.getProcFd(pid).getTotal());
|
||||
} catch (SigarNotImplementedException e) {
|
||||
//ok
|
||||
} catch (SigarPermissionDeniedException e) {
|
||||
//ok
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue