make sigar instance static for getSigar()

This commit is contained in:
Doug MacEachern 2005-07-21 04:13:10 +00:00
parent 4e27c142d0
commit c6dd77749b

View File

@ -14,7 +14,7 @@ import net.hyperic.sigar.Sigar;
//helper to add optional tracing. //helper to add optional tracing.
public abstract class SigarTestCase extends TestCase { public abstract class SigarTestCase extends TestCase {
private Sigar sigar = null; private static Sigar sigar = null;
private Properties props = new Properties(); private Properties props = new Properties();
private static boolean verbose = false; private static boolean verbose = false;
@ -43,13 +43,13 @@ public abstract class SigarTestCase extends TestCase {
} }
public Sigar getSigar() { public Sigar getSigar() {
if (this.sigar == null) { if (sigar == null) {
this.sigar = new Sigar(); sigar = new Sigar();
if (getVerbose()) { if (getVerbose()) {
this.sigar.enableLogging(true); sigar.enableLogging(true);
} }
} }
return this.sigar; return sigar;
} }
public Properties getProperties() { public Properties getProperties() {