add NetStat test
This commit is contained in:
parent
3e48aa1c0b
commit
916a46bce3
|
@ -33,6 +33,7 @@ public class SigarTestRunner extends SigarCommandBase {
|
||||||
TestLoadAverage.class,
|
TestLoadAverage.class,
|
||||||
TestMem.class,
|
TestMem.class,
|
||||||
TestNetIf.class,
|
TestNetIf.class,
|
||||||
|
TestNetStat.class,
|
||||||
TestProcArgs.class,
|
TestProcArgs.class,
|
||||||
TestProcEnv.class,
|
TestProcEnv.class,
|
||||||
TestProcExe.class,
|
TestProcExe.class,
|
||||||
|
|
|
@ -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());
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue