tests for recent stuff
This commit is contained in:
parent
3ff4089db1
commit
0410f0e457
|
@ -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 = {
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
|
@ -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<routes.length; i++) {
|
||||
NetRoute route = routes[i];
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package net.hyperic.sigar.test;
|
||||
|
||||
import net.hyperic.sigar.ResourceLimit;
|
||||
import net.hyperic.sigar.SigarException;
|
||||
|
||||
public class TestResourceLimit extends SigarTestCase {
|
||||
|
||||
public TestResourceLimit(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public void testResourceLimit() throws SigarException {
|
||||
ResourceLimit limit = getSigar().getResourceLimit();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package net.hyperic.sigar.test;
|
||||
|
||||
import net.hyperic.sigar.OperatingSystem;
|
||||
import net.hyperic.sigar.SigarException;
|
||||
import net.hyperic.sigar.Who;
|
||||
|
||||
public class TestWho extends SigarTestCase {
|
||||
|
||||
public TestWho(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public void testWho() throws SigarException {
|
||||
if (OperatingSystem.IS_WIN32) {
|
||||
return;
|
||||
}
|
||||
Who[] who = getSigar().getWhoList();
|
||||
assertTrue(who.length > 0);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue