updated log message to assist in debugging an issue

This commit is contained in:
Jeremy Long
2016-04-09 06:49:44 -04:00
parent b5c7fb747c
commit 9df12e6ff2
2 changed files with 13 additions and 1 deletions

View File

@@ -743,7 +743,7 @@ public final class Settings {
try {
value = Integer.parseInt(Settings.getString(key));
} catch (NumberFormatException ex) {
LOGGER.trace("Could not convert property '{}={}' to an int.", key, Settings.getString(key));
LOGGER.debug("Could not convert property '{}={}' to an int; using {} instead.", key, Settings.getString(key), defaultValue);
value = defaultValue;
}
return value;

View File

@@ -139,6 +139,18 @@ public class SettingsTest extends BaseTest {
Assert.assertEquals(expResult, result);
}
/**
* Test of getInt method, of class Settings.
*/
@Test
public void testGetIntDefault() throws InvalidSettingException {
String key = "SomeKey";
int expResult = 85;
Settings.setString(key, "blue");
int result = Settings.getInt(key, expResult);
Assert.assertEquals(expResult, result);
}
/**
* Test of getLong method, of class Settings.
*/