Tcp fields can be == FIELD_NOTIMPL
This commit is contained in:
parent
c1d79d091c
commit
61f443ba07
|
@ -152,6 +152,12 @@ public abstract class SigarTestCase extends TestCase {
|
||||||
assertTrue(msg, value >= 0);
|
assertTrue(msg, value >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void assertValidFieldTrace(String msg, long value) {
|
||||||
|
if (value != Sigar.FIELD_NOTIMPL) {
|
||||||
|
assertGtEqZeroTrace(msg, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void assertEqualsTrace(String msg, long expected, long actual) {
|
public void assertEqualsTrace(String msg, long expected, long actual) {
|
||||||
traceln(msg + "=" + actual + "/" + expected);
|
traceln(msg + "=" + actual + "/" + expected);
|
||||||
assertEquals(msg, expected, actual);
|
assertEquals(msg, expected, actual);
|
||||||
|
|
|
@ -39,14 +39,14 @@ public class TestTcpStat extends SigarTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
traceln("");
|
traceln("");
|
||||||
assertGtEqZeroTrace("ActiveOpens", tcp.getActiveOpens());
|
assertValidFieldTrace("ActiveOpens", tcp.getActiveOpens());
|
||||||
assertGtEqZeroTrace("PassiveOpens", tcp.getPassiveOpens());
|
assertValidFieldTrace("PassiveOpens", tcp.getPassiveOpens());
|
||||||
assertGtEqZeroTrace("AttemptFails", tcp.getAttemptFails());
|
assertValidFieldTrace("AttemptFails", tcp.getAttemptFails());
|
||||||
assertGtEqZeroTrace("EstabResets", tcp.getEstabResets());
|
assertValidFieldTrace("EstabResets", tcp.getEstabResets());
|
||||||
assertGtEqZeroTrace("CurrEstab", tcp.getCurrEstab());
|
assertValidFieldTrace("CurrEstab", tcp.getCurrEstab());
|
||||||
assertGtEqZeroTrace("InSegs", tcp.getInSegs());
|
assertValidFieldTrace("InSegs", tcp.getInSegs());
|
||||||
assertGtEqZeroTrace("OutSegs", tcp.getOutSegs());
|
assertValidFieldTrace("OutSegs", tcp.getOutSegs());
|
||||||
assertGtEqZeroTrace("RetransSegs", tcp.getRetransSegs());
|
assertValidFieldTrace("RetransSegs", tcp.getRetransSegs());
|
||||||
assertGtEqZeroTrace("OutRsts", tcp.getOutRsts());
|
assertValidFieldTrace("OutRsts", tcp.getOutRsts());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue