From 0410f0e4576f4e8e0b5aa4ef02fd86bddcdefc89 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sun, 17 Jul 2005 20:09:25 +0000 Subject: [PATCH] tests for recent stuff --- .../hyperic/sigar/test/SigarTestRunner.java | 4 +++ .../net/hyperic/sigar/test/TestNetInfo.java | 15 +++++++++++ .../net/hyperic/sigar/test/TestNetRoute.java | 25 +++++++++++++++++++ .../hyperic/sigar/test/TestResourceLimit.java | 15 +++++++++++ .../src/net/hyperic/sigar/test/TestWho.java | 20 +++++++++++++++ 5 files changed, 79 insertions(+) create mode 100644 bindings/java/src/net/hyperic/sigar/test/TestNetInfo.java create mode 100644 bindings/java/src/net/hyperic/sigar/test/TestNetRoute.java create mode 100644 bindings/java/src/net/hyperic/sigar/test/TestResourceLimit.java create mode 100644 bindings/java/src/net/hyperic/sigar/test/TestWho.java diff --git a/bindings/java/src/net/hyperic/sigar/test/SigarTestRunner.java b/bindings/java/src/net/hyperic/sigar/test/SigarTestRunner.java index 1ec547f9..4674b612 100644 --- a/bindings/java/src/net/hyperic/sigar/test/SigarTestRunner.java +++ b/bindings/java/src/net/hyperic/sigar/test/SigarTestRunner.java @@ -33,6 +33,8 @@ public class SigarTestRunner extends SigarCommandBase { TestLoadAverage.class, TestMem.class, TestNetIf.class, + TestNetInfo.class, + TestNetRoute.class, TestNetStat.class, TestProcArgs.class, TestProcEnv.class, @@ -44,9 +46,11 @@ public class SigarTestRunner extends SigarCommandBase { TestProcState.class, TestProcStat.class, TestProcTime.class, + TestResourceLimit.class, TestSwap.class, TestThreadCpu.class, TestUptime.class, + TestWho.class, }; private static final Class[] WIN32_TESTS = { diff --git a/bindings/java/src/net/hyperic/sigar/test/TestNetInfo.java b/bindings/java/src/net/hyperic/sigar/test/TestNetInfo.java new file mode 100644 index 00000000..8f660fd6 --- /dev/null +++ b/bindings/java/src/net/hyperic/sigar/test/TestNetInfo.java @@ -0,0 +1,15 @@ +package net.hyperic.sigar.test; + +import net.hyperic.sigar.NetInfo; +import net.hyperic.sigar.SigarException; + +public class TestNetInfo extends SigarTestCase { + + public TestNetInfo(String name) { + super(name); + } + + public void testNetInfo() throws SigarException { + NetInfo info = getSigar().getNetInfo(); + } +} diff --git a/bindings/java/src/net/hyperic/sigar/test/TestNetRoute.java b/bindings/java/src/net/hyperic/sigar/test/TestNetRoute.java new file mode 100644 index 00000000..340396a0 --- /dev/null +++ b/bindings/java/src/net/hyperic/sigar/test/TestNetRoute.java @@ -0,0 +1,25 @@ +package net.hyperic.sigar.test; + +import net.hyperic.sigar.NetRoute; +import net.hyperic.sigar.SigarException; +import net.hyperic.sigar.SigarNotImplementedException; + +public class TestNetRoute extends SigarTestCase { + + public TestNetRoute(String name) { + super(name); + } + + public void testNetRoute() throws SigarException { + NetRoute[] routes; + try { + routes = getSigar().getNetRouteList(); + } catch (SigarNotImplementedException e) { + return; + } + assertTrue(routes.length > 0); + for (int i=0; i 0); + } +}