diff --git a/bindings/java/src/net/hyperic/sigar/test/SigarTestRunner.java b/bindings/java/src/net/hyperic/sigar/test/SigarTestRunner.java index f40d7c12..1ec547f9 100644 --- a/bindings/java/src/net/hyperic/sigar/test/SigarTestRunner.java +++ b/bindings/java/src/net/hyperic/sigar/test/SigarTestRunner.java @@ -33,6 +33,7 @@ public class SigarTestRunner extends SigarCommandBase { TestLoadAverage.class, TestMem.class, TestNetIf.class, + TestNetStat.class, TestProcArgs.class, TestProcEnv.class, TestProcExe.class, diff --git a/bindings/java/src/net/hyperic/sigar/test/TestNetStat.java b/bindings/java/src/net/hyperic/sigar/test/TestNetStat.java new file mode 100644 index 00000000..9b0f2779 --- /dev/null +++ b/bindings/java/src/net/hyperic/sigar/test/TestNetStat.java @@ -0,0 +1,27 @@ +package net.hyperic.sigar.test; + +import net.hyperic.sigar.NetStat; +import net.hyperic.sigar.Sigar; +import net.hyperic.sigar.SigarNotImplementedException; + +public class TestNetStat extends SigarTestCase { + + public TestNetStat(String name) { + super(name); + } + + public void testCreate() throws Exception { + Sigar sigar = getSigar(); + NetStat netstat; + + try { + netstat = sigar.getNetStat(); + } catch (SigarNotImplementedException e) { + return; + } + + assertGtEqZeroTrace("Outbound", netstat.getTcpOutboundTotal()); + assertGtEqZeroTrace("Inbound", netstat.getTcpInboundTotal()); + assertGtEqZeroTrace("Listen", netstat.getTcpListen()); + } +}