This commit is contained in:
Doug MacEachern committed 2005-06-26 22:00:53 +00:00
1 parent 4fe5f84c59
commit 5b3c4c83db
1 file changed
+15 -4
@@ -2,6 +2,7 @@ package net.hyperic.sigar.win32.test;
import net.hyperic.sigar.test.SigarTestCase;
import net.hyperic.sigar.win32.Pdh;
import net.hyperic.sigar.win32.Win32Exception;
public class TestPdh extends SigarTestCase {
@@ -12,10 +13,10 @@ public class TestPdh extends SigarTestCase {
private void getValue(String key) throws Exception {
Pdh pdh = new Pdh();
assertGtZeroTrace("raw..." + key,
(long)pdh.getRawValue(key));
assertGtZeroTrace("fmt..." + key,
(long)pdh.getFormattedValue(key));
assertGtEqZeroTrace("raw..." + key,
(long)pdh.getRawValue(key));
assertGtEqZeroTrace("fmt..." + key,
(long)pdh.getFormattedValue(key));
}
public void testGetValue() throws Exception {
@@ -26,6 +27,16 @@ public class TestPdh extends SigarTestCase {
for (int i=0; i<keys.length; i++) {
getValue(keys[i]);
}
/* XXX hangs for a while on my XP box
String bogusKey = "\\Does Not\\Exist";
try {
new Pdh().getRawValue(bogusKey);
assertTrue(false);
} catch (Win32Exception e) {
assertTrue(true);
traceln(bogusKey + "=" + e.getMessage());
}
*/
}
public void testPdh () throws Exception {