more Service query tests
This commit is contained in:
parent
05ae74a5df
commit
31a5f214d3
@ -108,6 +108,7 @@ public class TestPTQL extends SigarTestCase {
|
|||||||
"Port.tcp.gt=8080",
|
"Port.tcp.gt=8080",
|
||||||
"Port.tcp.eq=http",
|
"Port.tcp.eq=http",
|
||||||
"Cpu.Sys.ew=lots",
|
"Cpu.Sys.ew=lots",
|
||||||
|
"Service.Invalid.ew=.exe",
|
||||||
"",
|
"",
|
||||||
null,
|
null,
|
||||||
};
|
};
|
||||||
|
@ -70,6 +70,21 @@ public class TestService extends SigarTestCase {
|
|||||||
services = Service.getServiceNames(getSigar(), ptql[i]);
|
services = Service.getServiceNames(getSigar(), ptql[i]);
|
||||||
assertGtZeroTrace(ptql[i], services.size());
|
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 {
|
public void testServiceConfig() throws Exception {
|
||||||
|
Loading…
Reference in New Issue
Block a user