more Service query tests

This commit is contained in:
Doug MacEachern 2008-04-01 23:19:13 +00:00
parent 05ae74a5df
commit 31a5f214d3
2 changed files with 16 additions and 0 deletions

View File

@ -108,6 +108,7 @@ public class TestPTQL extends SigarTestCase {
"Port.tcp.gt=8080",
"Port.tcp.eq=http",
"Cpu.Sys.ew=lots",
"Service.Invalid.ew=.exe",
"",
null,
};

View File

@ -70,6 +70,21 @@ public class TestService extends SigarTestCase {
services = Service.getServiceNames(getSigar(), ptql[i]);
assertGtZeroTrace(ptql[i], services.size());
}
final String[] invalid = {
"State.Name.ct=Ev",
"Service.Invalid.ew=.exe",
"-"
};
for (int i=0; i<invalid.length; i++) {
try {
services = Service.getServiceNames(getSigar(), invalid[i]);
fail("'" + invalid[i] + "' did not throw Exception");
} catch (Exception e) {
//expected
}
}
}
public void testServiceConfig() throws Exception {