modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/metadata/ConfigurationMetadataManagerBean.java | 17 ++++------ modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateConfigurationSubsystemTest.java | 8 ++++ 2 files changed, 14 insertions(+), 11 deletions(-)
New commits: commit 3e6ba87e259514174c5825b43c09f62911ef499c Author: Ian P. Springer <ips@jetengine.(none)> Date: Wed Mar 31 13:46:01 2010 -0400
fix last failing test
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/metadata/ConfigurationMetadataManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/metadata/ConfigurationMetadataManagerBean.java index a3ea7ea..4abf76f 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/metadata/ConfigurationMetadataManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/metadata/ConfigurationMetadataManagerBean.java @@ -428,21 +428,18 @@ public class ConfigurationMetadataManagerBean implements ConfigurationMetadataMa /** * Replace the existing property of a given type with a new property of a (possibly) different type * - * @param existingProperty - * @param newProperty + * @param existingProperty the existing prop + * @param newProperty the new prop that should replace the existing prop */ private void replaceProperty(PropertyDefinition existingProperty, PropertyDefinition newProperty) { - // take id and definition from the existing one + ConfigurationDefinition configDef = existingProperty.getConfigurationDefinition(); + + // First take id from existing prop, and replace existing prop in the config def. newProperty.setId(existingProperty.getId()); - newProperty.setConfigurationDefinition(existingProperty.getConfigurationDefinition()); + configDef.put(newProperty);
- // need to remove the old crap - existingProperty.getConfigurationDefinition().getPropertyDefinitions().remove(existingProperty.getName()); - existingProperty.setConfigurationDefinition(null); entityManager.remove(existingProperty); - - // persist the new one - entityManager.merge(newProperty); + entityManager.merge(configDef); entityManager.flush(); }
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateConfigurationSubsystemTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateConfigurationSubsystemTest.java index b0dd0dd..2e6d94f 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateConfigurationSubsystemTest.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateConfigurationSubsystemTest.java @@ -43,7 +43,8 @@ import java.util.Map; import java.util.Set;
/** - * Tests for {@link org.rhq.enterprise.server.configuration.metadata.ConfigurationMetadataManagerBean}. + * Tests the updating of persisted ResourceTypes' resource and plugin ConfigurationDefinitions, which is essentially + * handled by {@link org.rhq.enterprise.server.configuration.metadata.ConfigurationMetadataManagerBean}. * * @author Heiko Rupp */
commit a004bc5d1c0845e3dd3d95963842ae3eb3245afd Merge: 43dce42... 7cc63cc... Author: Ian P. Springer <ips@jetengine.(none)> Date: Wed Mar 31 13:41:04 2010 -0400
Merge branch 'bugfixes' of ssh://git.fedorahosted.org/git/rhq/rhq into bugfixes
commit 43dce42ae731bfc0b591b1631e41a83db9b0e6ca Author: Ian P. Springer <ips@jetengine.(none)> Date: Wed Mar 31 13:40:59 2010 -0400
misc minor
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateConfigurationSubsystemTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateConfigurationSubsystemTest.java index 39bffd4..af2947c 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateConfigurationSubsystemTest.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateConfigurationSubsystemTest.java @@ -42,6 +42,11 @@ import java.util.List; import java.util.Map; import java.util.Set;
+/** + * Tests for {@link org.rhq.enterprise.server.configuration.metadata.ConfigurationMetadataManagerBean}. + * + * @author Heiko Rupp + */ public class UpdateConfigurationSubsystemTest extends UpdateSubsytemTestBase {
@Override @@ -50,7 +55,7 @@ public class UpdateConfigurationSubsystemTest extends UpdateSubsytemTestBase { }
/** - * Test updating of plugin and resource configs + * Test updating of plugin configs. * * @throws Exception */
rhq-commits@lists.fedorahosted.org