Skip to content

Commit

Permalink
[[HHQ-3144] Updated data validation logic for some server config prop…
Browse files Browse the repository at this point in the history
…erties
  • Loading branch information
pnguyen committed Jul 8, 2010
1 parent f3f86e0 commit 0237773
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions hqu/hqapi1/app/ServerconfigController.groovy
Expand Up @@ -114,12 +114,15 @@ class ServerconfigController extends ApiController {
minVal = 24*oneHourInMillis
maxVal = 7*24*oneHourInMillis
multiple = 24*oneHourInMillis
} else if (key.equals(HQConstants.DataMaintenance)
|| key.equals(HQConstants.AlertPurge)
|| key.equals(HQConstants.EventLogPurge)) {
} else if (key.equals(HQConstants.DataMaintenance)) {
minVal = oneHourInMillis
maxVal = 9999*oneHourInMillis
multiple = oneHourInMillis
} else if (key.equals(HQConstants.AlertPurge)
|| key.equals(HQConstants.EventLogPurge)) {
minVal = 24*oneHourInMillis
maxVal = 9999*24*oneHourInMillis
multiple = 24*oneHourInMillis
}

if (minVal && maxVal && multiple) {
Expand Down
4 changes: 2 additions & 2 deletions src/org/hyperic/hq/hqapi1/test/ServerConfigSet_test.java
Expand Up @@ -132,7 +132,7 @@ public void testSetConfigAtMax() throws Exception {
String configName = "ALERT_PURGE";
String serverValue = getConfigValue(configName);

long maxValue = 9999 * 60 * 60 * 1000L;
long maxValue = 9999 * 24 * 60 * 60 * 1000L;
ServerConfig c = new ServerConfig();
c.setKey(configName);
c.setValue(Long.toString(maxValue));
Expand Down Expand Up @@ -171,7 +171,7 @@ public void testSetConfigValidMultiple() throws Exception {
String configName = "EVENT_LOG_PURGE";
String serverValue = getConfigValue(configName);

long multipleValue = 50 * 60 * 60 * 1000L;
long multipleValue = 50 * 24 * 60 * 60 * 1000L;
ServerConfig c = new ServerConfig();
c.setKey(configName);
c.setValue(Long.toString(multipleValue));
Expand Down

0 comments on commit 0237773

Please sign in to comment.