dont print listeners by default

This commit is contained in:
Doug MacEachern 2006-06-20 01:01:45 +00:00
parent 417ee0d439
commit 6ff7de288c
1 changed files with 10 additions and 2 deletions

View File

@ -7,6 +7,8 @@ import net.hyperic.sigar.Sigar;
import net.hyperic.sigar.SigarNotImplementedException; import net.hyperic.sigar.SigarNotImplementedException;
public class TestNetStat extends SigarTestCase { public class TestNetStat extends SigarTestCase {
private static boolean printListeners =
"true".equals(System.getProperty("sigar.netstat.listeners"));
public TestNetStat(String name) { public TestNetStat(String name) {
super(name); super(name);
@ -22,9 +24,15 @@ public class TestNetStat extends SigarTestCase {
return; return;
} }
traceln("");
assertGtEqZeroTrace("Outbound", netstat.getTcpOutboundTotal()); assertGtEqZeroTrace("Outbound", netstat.getTcpOutboundTotal());
assertGtEqZeroTrace("Inbound", netstat.getTcpInboundTotal()); assertGtEqZeroTrace("Inbound", netstat.getTcpInboundTotal());
assertGtEqZeroTrace("Listen", netstat.getTcpListen()); assertGtEqZeroTrace("Listen", netstat.getTcpListen());
assertGtEqZeroTrace("Established", netstat.getTcpEstablished());
if (!printListeners) {
return;
}
int flags = NetFlags.CONN_SERVER | NetFlags.CONN_TCP; int flags = NetFlags.CONN_SERVER | NetFlags.CONN_TCP;