diff --git a/bindings/java/src/net/hyperic/sigar/test/SigarTestCase.java b/bindings/java/src/net/hyperic/sigar/test/SigarTestCase.java index 59547798..a5c3a3cd 100644 --- a/bindings/java/src/net/hyperic/sigar/test/SigarTestCase.java +++ b/bindings/java/src/net/hyperic/sigar/test/SigarTestCase.java @@ -55,6 +55,7 @@ public abstract class SigarTestCase extends TestCase { public static void closeSigar() { if (sigar != null) { sigar.close(); + sigar = null; } } diff --git a/bindings/java/src/net/hyperic/sigar/test/TestCpu.java b/bindings/java/src/net/hyperic/sigar/test/TestCpu.java index ce112351..e31dea04 100644 --- a/bindings/java/src/net/hyperic/sigar/test/TestCpu.java +++ b/bindings/java/src/net/hyperic/sigar/test/TestCpu.java @@ -2,7 +2,6 @@ package net.hyperic.sigar.test; import net.hyperic.sigar.Sigar; import net.hyperic.sigar.SigarNotImplementedException; -import net.hyperic.sigar.SigarProxy; import net.hyperic.sigar.Cpu; public class TestCpu extends SigarTestCase { @@ -29,8 +28,7 @@ public class TestCpu extends SigarTestCase { } public void testCreate() throws Exception { - SigarProxy sigar = Sigar.getInstance(); //test reuse - + Sigar sigar = getSigar(); Cpu cpu = sigar.getCpu(); traceln("getCpu:"); diff --git a/bindings/java/src/net/hyperic/sigar/test/TestPTQL.java b/bindings/java/src/net/hyperic/sigar/test/TestPTQL.java index 6b9424fa..1af3ff14 100644 --- a/bindings/java/src/net/hyperic/sigar/test/TestPTQL.java +++ b/bindings/java/src/net/hyperic/sigar/test/TestPTQL.java @@ -2,7 +2,7 @@ package net.hyperic.sigar.test; import net.hyperic.sigar.SigarException; import net.hyperic.sigar.SigarProxy; -import net.hyperic.sigar.SynchronizedSigarProxyCache; +import net.hyperic.sigar.SigarProxyCache; import net.hyperic.sigar.SigarNotImplementedException; import net.hyperic.sigar.ptql.ProcessQuery; @@ -140,7 +140,8 @@ public class TestPTQL extends SigarTestCase { } public void testCreate() throws Exception { - SigarProxy proxy = SynchronizedSigarProxyCache.getInstance(); + SigarProxy proxy = + SigarProxyCache.newInstance(getSigar()); testOK(proxy); testMalformed(proxy);