From db0622d0308ac857cb524afe9068a328b5b422a9 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Mon, 3 Apr 2006 16:50:38 +0000 Subject: [PATCH] catch SigarPermissionDeniedException (e.g. FreeBSD /dev/kmem) --- bindings/java/src/net/hyperic/sigar/test/TestProcEnv.java | 3 +++ bindings/java/src/net/hyperic/sigar/test/TestProcFd.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/bindings/java/src/net/hyperic/sigar/test/TestProcEnv.java b/bindings/java/src/net/hyperic/sigar/test/TestProcEnv.java index 74143c8d..afcbfb75 100644 --- a/bindings/java/src/net/hyperic/sigar/test/TestProcEnv.java +++ b/bindings/java/src/net/hyperic/sigar/test/TestProcEnv.java @@ -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 } } } diff --git a/bindings/java/src/net/hyperic/sigar/test/TestProcFd.java b/bindings/java/src/net/hyperic/sigar/test/TestProcFd.java index c3346546..432cc044 100644 --- a/bindings/java/src/net/hyperic/sigar/test/TestProcFd.java +++ b/bindings/java/src/net/hyperic/sigar/test/TestProcFd.java @@ -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 } } }