From 983cb0d831302f21069ac0d5175d5f82dfb23b19 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sun, 22 Apr 2007 18:30:04 +0000 Subject: [PATCH] assert Pid.Pid.eq=$$ matches 1 process --- bindings/java/src/org/hyperic/sigar/test/TestPTQL.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bindings/java/src/org/hyperic/sigar/test/TestPTQL.java b/bindings/java/src/org/hyperic/sigar/test/TestPTQL.java index 079c0574..d314c2d0 100644 --- a/bindings/java/src/org/hyperic/sigar/test/TestPTQL.java +++ b/bindings/java/src/org/hyperic/sigar/test/TestPTQL.java @@ -28,6 +28,8 @@ import org.hyperic.sigar.ptql.MalformedQueryException; public class TestPTQL extends SigarTestCase { + private static final String THIS_PROCESS = "Pid.Pid.eq=$$"; + private ProcessQueryFactory qf; private static final String[] OK_QUERIES = { @@ -60,7 +62,7 @@ public class TestPTQL extends SigarTestCase { "Port.tcp.eq=8080,Cred.Uid.eq=1003", //dougm owned jboss port "Pid.PidFile.eq=pid.file", "Pid.Pid.eq=1", - "Pid.Pid.eq=$$", + THIS_PROCESS, "Pid.Service.eq=Eventlog", "Pid.Service.eq=NOSUCHSERVICE", "Pid.Service.eq=Hyperic HQ Agent", @@ -135,6 +137,9 @@ public class TestPTQL extends SigarTestCase { } private void testOK(Sigar sigar) throws Exception { + assertTrue(THIS_PROCESS, + runQuery(sigar, THIS_PROCESS) == 1); + for (int i=0; i