s/SigarProxy/Sigar/g

This commit is contained in:
Doug MacEachern 2007-04-22 00:50:17 +00:00
parent 0d8c2d6014
commit e46b6e8e8a
1 changed files with 12 additions and 16 deletions

View File

@ -18,9 +18,8 @@
package org.hyperic.sigar.test; package org.hyperic.sigar.test;
import org.hyperic.sigar.Sigar;
import org.hyperic.sigar.SigarException; import org.hyperic.sigar.SigarException;
import org.hyperic.sigar.SigarProxy;
import org.hyperic.sigar.SigarProxyCache;
import org.hyperic.sigar.SigarNotImplementedException; import org.hyperic.sigar.SigarNotImplementedException;
import org.hyperic.sigar.ptql.ProcessQuery; import org.hyperic.sigar.ptql.ProcessQuery;
@ -105,7 +104,7 @@ public class TestPTQL extends SigarTestCase {
super(name); super(name);
} }
private int runQuery(SigarProxy proxy, String qs) private int runQuery(Sigar sigar, String qs)
throws MalformedQueryException, throws MalformedQueryException,
SigarException { SigarException {
@ -118,7 +117,7 @@ public class TestPTQL extends SigarTestCase {
throw e; throw e;
} }
ProcessFinder finder = new ProcessFinder(proxy); ProcessFinder finder = new ProcessFinder(sigar);
try { try {
long[] pids = finder.find(query); long[] pids = finder.find(query);
@ -136,27 +135,27 @@ public class TestPTQL extends SigarTestCase {
} }
} }
private void testOK(SigarProxy proxy) throws Exception { private void testOK(Sigar sigar) throws Exception {
for (int i=0; i<OK_QUERIES.length; i++) { for (int i=0; i<OK_QUERIES.length; i++) {
String qs = OK_QUERIES[i]; String qs = OK_QUERIES[i];
assertTrue(qs, assertTrue(qs,
runQuery(proxy, qs) >= 0); runQuery(sigar, qs) >= 0);
} }
} }
private void testReOK(SigarProxy proxy) throws Exception { private void testReOK(Sigar sigar) throws Exception {
for (int i=0; i<OK_RE_QUERIES.length; i++) { for (int i=0; i<OK_RE_QUERIES.length; i++) {
String qs = OK_RE_QUERIES[i]; String qs = OK_RE_QUERIES[i];
assertTrue(qs, assertTrue(qs,
runQuery(proxy, qs) >= 0); runQuery(sigar, qs) >= 0);
} }
} }
private void testMalformed(SigarProxy proxy) throws Exception { private void testMalformed(Sigar sigar) throws Exception {
for (int i=0; i<MALFORMED_QUERIES.length; i++) { for (int i=0; i<MALFORMED_QUERIES.length; i++) {
String qs = MALFORMED_QUERIES[i]; String qs = MALFORMED_QUERIES[i];
try { try {
runQuery(proxy, qs); runQuery(sigar, qs);
fail("'" + qs + "' did not throw MalformedQueryException"); fail("'" + qs + "' did not throw MalformedQueryException");
} catch (MalformedQueryException e) { } catch (MalformedQueryException e) {
traceln(qs + ": " + e.getMessage()); traceln(qs + ": " + e.getMessage());
@ -166,16 +165,13 @@ public class TestPTQL extends SigarTestCase {
} }
public void testCreate() throws Exception { public void testCreate() throws Exception {
SigarProxy proxy = testOK(getSigar());
SigarProxyCache.newInstance(getSigar());
testOK(proxy);
if (JDK_14_COMPAT) { if (JDK_14_COMPAT) {
testReOK(proxy); testReOK(getSigar());
} }
testMalformed(proxy); testMalformed(getSigar());
} }
} }