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) {
String build = msmq.getStringValue("CurrentBuild"); try {
assertLengthTrace("CurrentBuild", build); String build = msmq.getStringValue("CurrentBuild");
int id = msmq.getIntValue("SeqID"); assertLengthTrace("CurrentBuild", build);
assertGtZeroTrace("SeqID", id); int id = msmq.getIntValue("SeqID");
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...");
String edition = sql.getStringValue("Edition"); try {
assertLengthTrace("Edition", edition); String edition = sql.getStringValue("Edition");
assertLengthTrace("Edition", edition);
} catch (Exception e) {}
sql.close(); sql.close();
} }
ms.close(); ms.close();