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();
traceln("");
traceln("getCpu:");
checkCpu(cpu);

View File

@ -13,14 +13,13 @@ public class TestCpuInfo extends SigarTestCase {
}
public void testCreate() throws Exception {
Sigar sigar = new Sigar();
Sigar sigar = getSigar();
CpuInfo[] infos = sigar.getCpuInfoList();
for (int i=0; i<infos.length; i++) {
CpuInfo info = infos[i];
traceln("");
traceln("num=" + i);
traceln("vendor=" + info.getVendor());
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);
boolean validFQDN = fqdn.indexOf(".") > 0;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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