modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml | 4 - modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java | 29 ++++++---- 2 files changed, 21 insertions(+), 12 deletions(-)
New commits: commit ef5f203efbd77817f65dc72f9bf300a89d5660c3 Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu Sep 26 09:51:24 2013 -0400
A change to solve an ora test failure for SynchronizationManagerBeanTest#testExport, due to oracle treating "" as null for config settings initialized to "".
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java index 86bb1b8..4c2e4d4 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java @@ -208,8 +208,8 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot public void setStorageClusterSettings(Subject subject, SystemSettings settings) { for (SystemSetting setting : settings.keySet()) { if (!isStorageSetting(setting)) { - throw new IllegalArgumentException(setting + " cannot be updated through this method. This method " + - "only allows updating of storage cluster settings."); + throw new IllegalArgumentException(setting + " cannot be updated through this method. This method " + + "only allows updating of storage cluster settings."); } } setSystemSettings(settings, false, true); @@ -255,12 +255,13 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot String existingValue = transformSystemConfigurationProperty(prop, existingConfig.getPropertyValue(), true);
- if ((existingValue == null && value != null) || !existingValue.equals(value)) { + //also for oracle, treat null and empty string as the same. + if ((isEmpty(existingValue) && !isEmpty(value)) + || (null != existingValue && !existingValue.equals(value))) { //SystemSetting#isReadOnly should be a superset of the "fReadOnly" field in the database //but let's just be super paranoid here... - if ((prop.isReadOnly() - || (existingConfig.getFreadOnly() != null && existingConfig.getFreadOnly().booleanValue())) && - !(isStorageSetting(prop) || updateStorageSettings)) { + if ((prop.isReadOnly() || (existingConfig.getFreadOnly() != null && existingConfig.getFreadOnly() + .booleanValue())) && !(isStorageSetting(prop) || updateStorageSettings)) { throw new IllegalArgumentException("The setting [" + prop.getInternalName() + "] is read-only - you cannot change its current value! Current value is [" + existingConfig.getPropertyValue() + "] while the new value was [" + value + "]."); @@ -282,12 +283,20 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot cachedSystemSettings = null; }
+ private static boolean isEmpty(String string) { + return null == string || string.trim().isEmpty(); + } + private boolean isStorageSetting(SystemSetting setting) { switch (setting) { - case STORAGE_CQL_PORT: return true; - case STORAGE_GOSSIP_PORT: return true; - case STORAGE_AUTOMATIC_DEPLOYMENT: return true; - default: return false; + case STORAGE_CQL_PORT: + return true; + case STORAGE_GOSSIP_PORT: + return true; + case STORAGE_AUTOMATIC_DEPLOYMENT: + return true; + default: + return false; } }
commit b9c792694d2ba6d604a7837cba71fc8644655ed9 Author: Simeon Pinder spinder@redhat.com Date: Thu Sep 26 09:50:11 2013 -0400
Revert " updating itest fix for oracle failures."
This reverts commit 7abad911acaf15b7b0dd58af64df2be2c75c905a.
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml b/modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml index 223042a..ebf7189 100644 --- a/modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml +++ b/modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml @@ -148,9 +148,9 @@
<data ID="62" PROPERTY_KEY="STORAGE_GOSSIP_PORT" FREAD_ONLY="TRUE"/>
- <data ID="63" PROPERTY_KEY="STORAGE_USERNAME" PROPERTY_VALUE=" " DEFAULT_PROPERTY_VALUE=" " FREAD_ONLY="TRUE"/> + <data ID="63" PROPERTY_KEY="STORAGE_USERNAME" PROPERTY_VALUE="" DEFAULT_PROPERTY_VALUE="" FREAD_ONLY="TRUE"/>
- <data ID="64" PROPERTY_KEY="STORAGE_PASSWORD" PROPERTY_VALUE=" " DEFAULT_PROPERTY_VALUE=" " FREAD_ONLY="TRUE"/> + <data ID="64" PROPERTY_KEY="STORAGE_PASSWORD" PROPERTY_VALUE="" DEFAULT_PROPERTY_VALUE="" FREAD_ONLY="TRUE"/>
</table>
rhq-commits@lists.fedorahosted.org