possible for subkeys/values not to exist

This commit is contained in:
Doug MacEachern 2008-09-12 00:48:03 +00:00
parent 29d57da8a9
commit 9b4dd7b263
1 changed files with 12 additions and 7 deletions

View File

@ -65,11 +65,14 @@ public class TestRegistryKey extends SigarTestCase {
} catch (Exception e) { /*not installed - ok*/ } } catch (Exception e) { /*not installed - ok*/ }
if (msmq != null) { if (msmq != null) {
traceln("MSMQ..."); traceln("MSMQ...");
assertTrue(msmq.getSubKeyNames().length > 0); if (msmq.getSubKeyNames().length > 0) {
try {
String build = msmq.getStringValue("CurrentBuild"); String build = msmq.getStringValue("CurrentBuild");
assertLengthTrace("CurrentBuild", build); assertLengthTrace("CurrentBuild", build);
int id = msmq.getIntValue("SeqID"); int id = msmq.getIntValue("SeqID");
assertGtZeroTrace("SeqID", id); assertGtZeroTrace("SeqID", id);
} catch (Exception e) {}
}
msmq.close(); msmq.close();
} }
@ -79,8 +82,10 @@ public class TestRegistryKey extends SigarTestCase {
} catch (Exception e) { /*not installed - ok*/ } } catch (Exception e) { /*not installed - ok*/ }
if (sql != null) { if (sql != null) {
traceln("MsSQL..."); traceln("MsSQL...");
try {
String edition = sql.getStringValue("Edition"); String edition = sql.getStringValue("Edition");
assertLengthTrace("Edition", edition); assertLengthTrace("Edition", edition);
} catch (Exception e) {}
sql.close(); sql.close();
} }
ms.close(); ms.close();