use getSigar method.

rid traceln("").
This commit is contained in:
Doug MacEachern 2004-07-06 01:21:03 +00:00
parent ede1876709
commit 14f719659d
16 changed files with 14 additions and 37 deletions

View File

@ -26,8 +26,6 @@ public class TestCpu extends SigarTestCase {
Cpu cpu = sigar.getCpu(); Cpu cpu = sigar.getCpu();
traceln("");
traceln("getCpu:"); traceln("getCpu:");
checkCpu(cpu); checkCpu(cpu);

View File

@ -13,14 +13,13 @@ public class TestCpuInfo extends SigarTestCase {
} }
public void testCreate() throws Exception { public void testCreate() throws Exception {
Sigar sigar = new Sigar(); Sigar sigar = getSigar();
CpuInfo[] infos = sigar.getCpuInfoList(); CpuInfo[] infos = sigar.getCpuInfoList();
for (int i=0; i<infos.length; i++) { for (int i=0; i<infos.length; i++) {
CpuInfo info = infos[i]; CpuInfo info = infos[i];
traceln("");
traceln("num=" + i); traceln("num=" + i);
traceln("vendor=" + info.getVendor()); traceln("vendor=" + info.getVendor());
traceln("model=" + info.getModel()); traceln("model=" + info.getModel());

View File

@ -26,9 +26,8 @@ public class TestFQDN extends SigarTestCase {
} }
} }
String fqdn = new Sigar().getFQDN(); String fqdn = getSigar().getFQDN();
traceln("");
traceln("fqdn=" + fqdn); traceln("fqdn=" + fqdn);
boolean validFQDN = fqdn.indexOf(".") > 0; boolean validFQDN = fqdn.indexOf(".") > 0;

View File

@ -80,9 +80,7 @@ public class TestFileInfo extends SigarTestCase {
} }
public void testCreate() throws Exception { public void testCreate() throws Exception {
Sigar sigar = new Sigar(); Sigar sigar = getSigar();
traceln("");
String file; String file;
File dir = new File(System.getProperty("user.dir")); File dir = new File(System.getProperty("user.dir"));

View File

@ -13,7 +13,7 @@ public class TestFileSystem extends SigarTestCase {
} }
public void testCreate() throws Exception { public void testCreate() throws Exception {
Sigar sigar = new Sigar(); Sigar sigar = getSigar();
FileSystem[] fslist = sigar.getFileSystemList(); FileSystem[] fslist = sigar.getFileSystemList();
FileSystemMap mounts = sigar.getFileSystemMap(); FileSystemMap mounts = sigar.getFileSystemMap();
@ -25,7 +25,6 @@ public class TestFileSystem extends SigarTestCase {
for (int i=0; i<fslist.length; i++) { for (int i=0; i<fslist.length; i++) {
FileSystem fs = fslist[i]; FileSystem fs = fslist[i];
traceln("");
assertTrue(mounts.getFileSystem(fs.getDirName()) != null); assertTrue(mounts.getFileSystem(fs.getDirName()) != null);
assertLengthTrace("DevName", fs.getDevName()); assertLengthTrace("DevName", fs.getDevName());
assertLengthTrace("DirName", fs.getDirName()); assertLengthTrace("DirName", fs.getDirName());

View File

@ -47,8 +47,6 @@ public class TestInvoker extends SigarTestCase {
SigarProxy proxy = SigarProxy proxy =
SigarProxyCache.newInstance(sigar); SigarProxyCache.newInstance(sigar);
traceln("");
testOK(proxy); testOK(proxy);
} }

View File

@ -10,13 +10,13 @@ public class TestLoadAverage extends SigarTestCase {
} }
public void testCreate() throws Exception { public void testCreate() throws Exception {
Sigar sigar = new Sigar(); Sigar sigar = getSigar();
try { try {
double[] loadavg = sigar.getLoadAverage(); double[] loadavg = sigar.getLoadAverage();
assertTrue(loadavg.length == 3); assertTrue(loadavg.length == 3);
traceln("");
traceln("1min=" + loadavg[0]); traceln("1min=" + loadavg[0]);
traceln("5min=" + loadavg[1]); traceln("5min=" + loadavg[1]);
traceln("15min=" + loadavg[2]); traceln("15min=" + loadavg[2]);

View File

@ -10,12 +10,10 @@ public class TestMem extends SigarTestCase {
} }
public void testCreate() throws Exception { public void testCreate() throws Exception {
Sigar sigar = new Sigar(); Sigar sigar = getSigar();
Mem mem = sigar.getMem(); Mem mem = sigar.getMem();
traceln("");
assertGtZeroTrace("Total", mem.getTotal()); assertGtZeroTrace("Total", mem.getTotal());
assertGtZeroTrace("Used", mem.getUsed()); assertGtZeroTrace("Used", mem.getUsed());

View File

@ -21,7 +21,6 @@ public class TestNetIf extends SigarTestCase {
NetInterfaceConfig ifconfig = NetInterfaceConfig ifconfig =
sigar.getNetInterfaceConfig(name); sigar.getNetInterfaceConfig(name);
traceln("");
traceln("name=" + name); traceln("name=" + name);
assertTrueTrace("Address", ifconfig.getAddress()); assertTrueTrace("Address", ifconfig.getAddress());
@ -72,7 +71,7 @@ public class TestNetIf extends SigarTestCase {
} }
public void testCreate() throws Exception { public void testCreate() throws Exception {
Sigar sigar = new Sigar(); Sigar sigar = getSigar();
/* call twice to make sure caching works */ /* call twice to make sure caching works */
getNetIflist(sigar, false); getNetIflist(sigar, false);

View File

@ -136,7 +136,6 @@ public class TestPTQL extends SigarTestCase {
public void testCreate() throws Exception { public void testCreate() throws Exception {
SigarProxy proxy = SynchronizedSigarProxyCache.getInstance(); SigarProxy proxy = SynchronizedSigarProxyCache.getInstance();
traceln("");
testOK(proxy); testOK(proxy);
testMalformed(proxy); testMalformed(proxy);
testLoadFailure(proxy); testLoadFailure(proxy);

View File

@ -26,9 +26,7 @@ public class TestProcArgs extends SigarTestCase {
} }
public void testCreate() throws Exception { public void testCreate() throws Exception {
Sigar sigar = new Sigar(); Sigar sigar = getSigar();
traceln("");
try { try {
String[] args = sigar.getProcArgs(sigar.getPid()); String[] args = sigar.getProcArgs(sigar.getPid());

View File

@ -13,10 +13,9 @@ public class TestProcEnv extends SigarTestCase {
} }
public void testCreate() throws Exception { public void testCreate() throws Exception {
Sigar sigar = new Sigar(); Sigar sigar = getSigar();
long pid = sigar.getPid(); long pid = sigar.getPid();
traceln("");
try { try {
Map env = sigar.getProcEnv(pid); Map env = sigar.getProcEnv(pid);

View File

@ -13,9 +13,7 @@ public class TestProcExe extends SigarTestCase {
} }
public void testCreate() throws Exception { public void testCreate() throws Exception {
Sigar sigar = new Sigar(); Sigar sigar = getSigar();
traceln("");
try { try {
ProcExe exe = sigar.getProcExe(sigar.getPid()); ProcExe exe = sigar.getProcExe(sigar.getPid());

View File

@ -14,9 +14,7 @@ public class TestProcFd extends SigarTestCase {
} }
public void testCreate() throws Exception { public void testCreate() throws Exception {
Sigar sigar = new Sigar(); Sigar sigar = getSigar();
traceln("");
try { try {
long pid = sigar.getPid(); long pid = sigar.getPid();

View File

@ -11,9 +11,8 @@ public class TestProcList extends SigarTestCase {
} }
public void testCreate() throws Exception { public void testCreate() throws Exception {
Sigar sigar = new Sigar(); Sigar sigar = getSigar();
traceln("");
ArrayList traceList = new ArrayList(); ArrayList traceList = new ArrayList();
long[] pids = sigar.getProcList(); long[] pids = sigar.getProcList();

View File

@ -28,9 +28,7 @@ public class TestProcModules extends SigarTestCase {
} }
public void testCreate() throws Exception { public void testCreate() throws Exception {
Sigar sigar = new Sigar(); Sigar sigar = getSigar();
traceln("");
try { try {
printModules(sigar, sigar.getPid()); printModules(sigar, sigar.getPid());