[rhq] Changes to 'refs/tags/RHQ_4_0_1'
by John Sanda
Tag 'RHQ_4_0_1' created by John Sanda <jsanda(a)redhat.com> at 2011-05-18 16:13 +0000
[maven-release-plugin] copy for tag RHQ_4_0_1
Changes since RHQ_4_0_0:
Ian Springer (5):
add magic Event.NativePreviewHandler that makes anchor tags not reload the whole page in IE; remove unused printWidgetTree method
call CoreGUI.goToView(), rather than History.newItem(), in native event handler
re-implement top menu bar using SmartGWT widgets, rather than raw HTML (part of fix for https://bugzilla.redhat.com/show_bug.cgi?id=697590)
[BZ 693232] fix SLSB heap leak (https://bugzilla.redhat.com/show_bug.cgi?id=693232)
[BZ 697589] to load group member configs, call configurationManager.getResourceConfigurationsForCompatibleGroup(), rather than configurationManager.getResourceConfigurationMapForCompatibleGroup(), to ensure we get the latest/live configs for each of the group members (https://bugzilla.redhat.com/show_bug.cgi?id=697589)
Jay Shaughnessy (11):
[BZ 700176 - Several refresh issues in resource portlets]
[BZ 699842 - ORA-00907: missing right parenthesis]
[BZ 697751 - ResourcePackageDetails.getFileName() returns "c:\fakepath\xa.rar" when uploading file in Chrome and IE]
[BZ 702390 - Large number of BundleDeployments for a single Bundle causes fetch serialization issues]
Fix test compile problem
Related to [BZ 702390 - Large number of BundleDeployments for a single Bundle causes fetch serialization issues]
[BZ 703252 - IE (IE7, IE8) unable to load CoreGUI]
[704335 - Selected top menu button: balck text on dark blue background]
[704499 - Some button clicks in IE8 do not work]
[BZ 704354 - IE only, Operation Schedule New button throws Exception]
[704354 - IE only, Number Format Exception when scheduling an operation]
John Mazzitelli (5):
BZ 701774 - ignore when a condition value cannot be converted to a Double - its probably a trait and can't be converted anyway
BZ 696753 and 701314
BZ 702109 - skip fields that are static final or transient since they won't be serialized anyway.
BZ 702748 - be able to revert back multiple deployments
fixes pattern plugin - uses heiko's patch
John Sanda (2):
[maven-release-plugin] prepare for next development iteration
[maven-release-plugin] prepare release RHQ_4_0_1
Lukas Krejci (12):
BZ 694476 - apache vhost resource configuration loading/update converted to take advantage of the SNMP WWW Service Index property, no imperfect RK matching anymore.
BZ 702691 - ResourceContext.getNativeProcess() now always reports the current process info or null if no process exists for given resource.
Tests for the inclusion order and IfModule and IfDefine detection.
BZ 694476 - behave the same as apache when handling the corner case of unresolvable hostnames in virtual host address definition.
Adding IfVersion detection tests, removed the vhost-names test that will
Adding tests for the ability to produce the same server and port
BZ 694476 - Augeas tree abstraction now replaces the Include nodes with their contents instead of just appending their contents to their children list. This seems to be the original intended behavior of the class according to its description but actually was not the case.
BZ 694476 - improved module detection by assuming that the module is not loaded
PERF - don't compile the regex patterns each time we instantiate a directive
Fixing the apache hostnames tests - let's not assume that InetAddress.getLocalHost() returns the loopback address and specifically require it.
BZ 694476 - fixing the handling of loaded modules.
Merging resource-upgrade-fixes from master.
Simeon Pinder (2):
BZ: 698100: ability to add graphable elements to monitor/graphs tab.
BZ 698607: fix issue with monitor portlet not retrieving details for autogroups and erroneous msg.
---
modules/common/ant-bundle/pom.xml | 2
modules/common/filetemplate-bundle/pom.xml | 2
modules/common/jboss-as/pom.xml | 2
modules/common/pom.xml | 2
modules/core/client-api/pom.xml | 2
modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/upgrade/ResourceUpgradeRequest.java | 30
modules/core/comm-api/pom.xml | 2
modules/core/dbutils/pom.xml | 2
modules/core/domain/pom.xml | 2
modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeployment.java | 31
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDeploymentCriteria.java | 5
modules/core/gui/pom.xml | 2
modules/core/native-system/pom.xml | 2
modules/core/plugin-api/pom.xml | 2
modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/inventory/ResourceContext.java | 26
modules/core/plugin-container/pom.xml | 42
modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java | 189 ++-
modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java | 140 ++
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java | 145 +-
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeFailureHandlingTest.java | 69 +
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeProgressHandlingTest.java | 183 +++
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeTestBase.java | 4
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/duplicate/v1/rhq-plugin.xml | 31
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/duplicate/v2/rhq-plugin.xml | 30
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/multi/base/BaseUpgradingDiscoveryComponent.java | 14
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v1/rhq-plugin.xml | 32
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v2/rhq-plugin.xml | 30
modules/core/plugin-validator/pom.xml | 2
modules/core/plugindoc/pom.xml | 2
modules/core/pom.xml | 2
modules/core/util/pom.xml | 2
modules/enterprise/agent/pom.xml | 2
modules/enterprise/agentupdate/pom.xml | 2
modules/enterprise/binding/pom.xml | 4
modules/enterprise/comm/pom.xml | 2
modules/enterprise/gui/base-perspective-jar/pom.xml | 2
modules/enterprise/gui/base-perspective-war/pom.xml | 2
modules/enterprise/gui/content_http-war/pom.xml | 2
modules/enterprise/gui/coregui/pom.xml | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java | 53 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java | 18
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java | 1
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java | 43
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/DynamicCallbackFormImpl.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/DynamicCallbackFormImplIE6.java | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletWindow.java | 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupBundleDeploymentsPortlet.java | 20
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java | 31
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupEventsPortlet.java | 23
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java | 28
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java | 19
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java | 27
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupPkgHistoryPortlet.java | 20
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/OperationSchedulePortlet.java | 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceBundleDeploymentsPortlet.java | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceEventsPortlet.java | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceOobsPortlet.java | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourcePkgHistoryPortlet.java | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDetailsView.java | 7
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java | 7
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupContextMenu.java | 213 +++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/schedule/GroupOperationScheduleDetailsView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java | 240 +++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/ResourceAutodiscoveryView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java | 143 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/ErrorHandler.java | 13
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableHStack.java | 82 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java | 9
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/FileUploadServlet.java | 15
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml | 2
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 5
modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css | 45
modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html | 19
modules/enterprise/gui/coregui/src/main/webapp/images/header/header_bg_selected.png |binary
modules/enterprise/gui/installer-war/pom.xml | 2
modules/enterprise/gui/pom.xml | 2
modules/enterprise/gui/portal-war/pom.xml | 2
modules/enterprise/pom.xml | 2
modules/enterprise/remoting/cli/pom.xml | 2
modules/enterprise/remoting/client-api/pom.xml | 2
modules/enterprise/remoting/client-deps/pom.xml | 2
modules/enterprise/remoting/pom.xml | 2
modules/enterprise/remoting/webservices/pom.xml | 2
modules/enterprise/server/client-api/pom.xml | 4
modules/enterprise/server/container-lib/pom.xml | 2
modules/enterprise/server/container/pom.xml | 2
modules/enterprise/server/ear/pom.xml | 2
modules/enterprise/server/jar/pom.xml | 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java | 33
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java | 4
modules/enterprise/server/jar/src/main/resources/META-INF/jboss.xml | 165 +++
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java | 4
modules/enterprise/server/plugins/alert-cli/pom.xml | 4
modules/enterprise/server/plugins/alert-email/pom.xml | 4
modules/enterprise/server/plugins/alert-irc/pom.xml | 4
modules/enterprise/server/plugins/alert-log4j/pom.xml | 4
modules/enterprise/server/plugins/alert-microblog/pom.xml | 4
modules/enterprise/server/plugins/alert-mobicents/pom.xml | 4
modules/enterprise/server/plugins/alert-operations/pom.xml | 4
modules/enterprise/server/plugins/alert-roles/pom.xml | 4
modules/enterprise/server/plugins/alert-snmp/pom.xml | 4
modules/enterprise/server/plugins/alert-subject/pom.xml | 4
modules/enterprise/server/plugins/ant-bundle/pom.xml | 2
modules/enterprise/server/plugins/cobbler/pom.xml | 4
modules/enterprise/server/plugins/disk/pom.xml | 2
modules/enterprise/server/plugins/filetemplate-bundle/pom.xml | 2
modules/enterprise/server/plugins/groovy-script/pom.xml | 4
modules/enterprise/server/plugins/jboss-software/pom.xml | 2
modules/enterprise/server/plugins/packagetype-cli/pom.xml | 4
modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml | 2
modules/enterprise/server/plugins/perspectives/core/pom.xml | 2
modules/enterprise/server/plugins/pom.xml | 2
modules/enterprise/server/plugins/rhnhosted/pom.xml | 2
modules/enterprise/server/plugins/url/pom.xml | 2
modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml | 2
modules/enterprise/server/plugins/yum/pom.xml | 2
modules/enterprise/server/safe-invoker/pom.xml | 2
modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/util/HibernateDetachUtility.java | 34
modules/enterprise/server/sars/agent-sar/pom.xml | 2
modules/enterprise/server/sars/pom.xml | 2
modules/enterprise/server/xml-schemas/pom.xml | 2
modules/helpers/bundleGen/pom.xml | 4
modules/helpers/perftest-support/pom.xml | 4
modules/helpers/pom.xml | 2
modules/helpers/rtfilter/pom.xml | 2
modules/plugins/aliases/pom.xml | 2
modules/plugins/ant-bundle/pom.xml | 2
modules/plugins/apache/pom.xml | 2
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java | 4
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java | 88 -
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java | 6
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/ApacheAugeasNode.java | 69 -
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasTreeBuilderApache.java | 23
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheDirective.java | 12
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/ApacheBinaryInfo.java | 2
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/HttpdAddressUtility.java | 12
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java | 511 +++++++---
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/RuntimeConfigurationTest.java | 208 ++++
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/SnmpMappingTest.java | 140 ++
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/MockApacheBinaryInfo.java | 126 ++
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/MockProcessInfo.java | 51
modules/plugins/apache/src/test/resources/runtime-config/conditional/httpd.conf | 2
modules/plugins/apache/src/test/resources/runtime-config/conditional/ifdefine-defined.conf | 5
modules/plugins/apache/src/test/resources/runtime-config/conditional/ifdefine-undefined.conf | 5
modules/plugins/apache/src/test/resources/runtime-config/conditional/ifmodule-loaded.conf | 13
modules/plugins/apache/src/test/resources/runtime-config/conditional/ifmodule-not-loaded.conf | 11
modules/plugins/apache/src/test/resources/runtime-config/conditional/ifversion.conf | 43
modules/plugins/apache/src/test/resources/runtime-config/conditional/nested-mess.conf | 51
modules/plugins/apache/src/test/resources/runtime-config/incl-order/a.conf | 1
modules/plugins/apache/src/test/resources/runtime-config/incl-order/b.conf | 1
modules/plugins/apache/src/test/resources/runtime-config/incl-order/c.conf | 1
modules/plugins/apache/src/test/resources/runtime-config/incl-order/httpd.conf | 1
modules/plugins/apache/src/test/resources/snmp-mapping/httpd.conf | 5
modules/plugins/apache/src/test/resources/snmp-mapping/vhost-with-servername-by-ip.conf | 3
modules/plugins/apache/src/test/resources/snmp-mapping/vhost-with-servername-by-unresolvable-hostname.conf | 3
modules/plugins/apache/src/test/resources/snmp-mapping/vhost-without-servername-resolvable-ip.conf | 3
modules/plugins/apache/src/test/resources/snmp-mapping/vhost-without-servername-unresolvable-hostname.conf | 3
modules/plugins/apache/src/test/resources/snmp-mapping/vhost-without-servername-unresolvable-ip.conf | 3
modules/plugins/augeas/pom.xml | 2
modules/plugins/byteman/pom.xml | 2
modules/plugins/cobbler/pom.xml | 2
modules/plugins/cron/pom.xml | 2
modules/plugins/database/pom.xml | 2
modules/plugins/filetemplate-bundle/pom.xml | 2
modules/plugins/grub/pom.xml | 2
modules/plugins/hadoop/pom.xml | 2
modules/plugins/hibernate/pom.xml | 2
modules/plugins/hosts/pom.xml | 2
modules/plugins/hudson/pom.xml | 4
modules/plugins/iis/pom.xml | 2
modules/plugins/irc/pom.xml | 2
modules/plugins/jboss-as-5/pom.xml | 2
modules/plugins/jboss-as/pom.xml | 2
modules/plugins/jboss-cache-v3/pom.xml | 2
modules/plugins/jboss-cache/pom.xml | 2
modules/plugins/jmx/pom.xml | 2
modules/plugins/kickstart/pom.xml | 2
modules/plugins/mysql/pom.xml | 2
modules/plugins/netservices/pom.xml | 2
modules/plugins/oracle/pom.xml | 2
modules/plugins/pattern-generator/pom.xml | 22
modules/plugins/perftest/pom.xml | 2
modules/plugins/platform/pom.xml | 2
modules/plugins/pom.xml | 2
modules/plugins/postfix/pom.xml | 2
modules/plugins/postgres/pom.xml | 2
modules/plugins/rhq-agent/pom.xml | 2
modules/plugins/rhq-server/pom.xml | 2
modules/plugins/samba/pom.xml | 2
modules/plugins/script/pom.xml | 2
modules/plugins/script2/pom.xml | 2
modules/plugins/snmptrapd/pom.xml | 2
modules/plugins/sshd/pom.xml | 2
modules/plugins/sudoers/pom.xml | 2
modules/plugins/tomcat/pom.xml | 2
modules/plugins/twitter/pom.xml | 2
modules/plugins/validate-all-plugins/pom.xml | 2
modules/plugins/virt/pom.xml | 2
modules/pom.xml | 2
modules/test-utils/pom.xml | 2
pom.xml | 2
203 files changed, 3158 insertions(+), 913 deletions(-)
---
13 years
[rhq] Branch 'release-4.0.0' - modules/common modules/core modules/enterprise modules/helpers modules/plugins modules/pom.xml modules/test-utils pom.xml
by John Sanda
modules/common/ant-bundle/pom.xml | 2 +-
modules/common/filetemplate-bundle/pom.xml | 2 +-
modules/common/jboss-as/pom.xml | 2 +-
modules/common/pom.xml | 2 +-
modules/core/client-api/pom.xml | 2 +-
modules/core/comm-api/pom.xml | 2 +-
modules/core/dbutils/pom.xml | 2 +-
modules/core/domain/pom.xml | 2 +-
modules/core/gui/pom.xml | 2 +-
modules/core/native-system/pom.xml | 2 +-
modules/core/plugin-api/pom.xml | 2 +-
modules/core/plugin-container/pom.xml | 2 +-
modules/core/plugin-validator/pom.xml | 2 +-
modules/core/plugindoc/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
modules/core/util/pom.xml | 2 +-
modules/enterprise/agent/pom.xml | 2 +-
modules/enterprise/agentupdate/pom.xml | 2 +-
modules/enterprise/binding/pom.xml | 4 ++--
modules/enterprise/comm/pom.xml | 2 +-
modules/enterprise/gui/base-perspective-jar/pom.xml | 2 +-
modules/enterprise/gui/base-perspective-war/pom.xml | 2 +-
modules/enterprise/gui/content_http-war/pom.xml | 2 +-
modules/enterprise/gui/coregui/pom.xml | 2 +-
modules/enterprise/gui/installer-war/pom.xml | 2 +-
modules/enterprise/gui/pom.xml | 2 +-
modules/enterprise/gui/portal-war/pom.xml | 2 +-
modules/enterprise/pom.xml | 2 +-
modules/enterprise/remoting/cli/pom.xml | 2 +-
modules/enterprise/remoting/client-api/pom.xml | 2 +-
modules/enterprise/remoting/client-deps/pom.xml | 2 +-
modules/enterprise/remoting/pom.xml | 2 +-
modules/enterprise/remoting/webservices/pom.xml | 2 +-
modules/enterprise/server/client-api/pom.xml | 4 ++--
modules/enterprise/server/container-lib/pom.xml | 2 +-
modules/enterprise/server/container/pom.xml | 2 +-
modules/enterprise/server/ear/pom.xml | 2 +-
modules/enterprise/server/jar/pom.xml | 2 +-
modules/enterprise/server/plugins/alert-cli/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-email/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-irc/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-log4j/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-microblog/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-mobicents/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-operations/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-roles/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-snmp/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-subject/pom.xml | 4 ++--
modules/enterprise/server/plugins/ant-bundle/pom.xml | 2 +-
modules/enterprise/server/plugins/cobbler/pom.xml | 4 ++--
modules/enterprise/server/plugins/disk/pom.xml | 2 +-
modules/enterprise/server/plugins/filetemplate-bundle/pom.xml | 2 +-
modules/enterprise/server/plugins/groovy-script/pom.xml | 4 ++--
modules/enterprise/server/plugins/jboss-software/pom.xml | 2 +-
modules/enterprise/server/plugins/packagetype-cli/pom.xml | 4 ++--
modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml | 2 +-
modules/enterprise/server/plugins/perspectives/core/pom.xml | 2 +-
modules/enterprise/server/plugins/pom.xml | 2 +-
modules/enterprise/server/plugins/rhnhosted/pom.xml | 2 +-
modules/enterprise/server/plugins/url/pom.xml | 2 +-
modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml | 2 +-
modules/enterprise/server/plugins/yum/pom.xml | 2 +-
modules/enterprise/server/safe-invoker/pom.xml | 2 +-
modules/enterprise/server/sars/agent-sar/pom.xml | 2 +-
modules/enterprise/server/sars/pom.xml | 2 +-
modules/enterprise/server/xml-schemas/pom.xml | 2 +-
modules/helpers/bundleGen/pom.xml | 4 ++--
modules/helpers/perftest-support/pom.xml | 4 ++--
modules/helpers/pom.xml | 2 +-
modules/helpers/rtfilter/pom.xml | 2 +-
modules/plugins/aliases/pom.xml | 2 +-
modules/plugins/ant-bundle/pom.xml | 2 +-
modules/plugins/apache/pom.xml | 2 +-
modules/plugins/augeas/pom.xml | 2 +-
modules/plugins/byteman/pom.xml | 2 +-
modules/plugins/cobbler/pom.xml | 2 +-
modules/plugins/cron/pom.xml | 2 +-
modules/plugins/database/pom.xml | 2 +-
modules/plugins/filetemplate-bundle/pom.xml | 2 +-
modules/plugins/grub/pom.xml | 2 +-
modules/plugins/hadoop/pom.xml | 2 +-
modules/plugins/hibernate/pom.xml | 2 +-
modules/plugins/hosts/pom.xml | 2 +-
modules/plugins/hudson/pom.xml | 4 ++--
modules/plugins/iis/pom.xml | 2 +-
modules/plugins/irc/pom.xml | 2 +-
modules/plugins/jboss-as-5/pom.xml | 2 +-
modules/plugins/jboss-as/pom.xml | 2 +-
modules/plugins/jboss-cache-v3/pom.xml | 2 +-
modules/plugins/jboss-cache/pom.xml | 2 +-
modules/plugins/jmx/pom.xml | 2 +-
modules/plugins/kickstart/pom.xml | 2 +-
modules/plugins/mysql/pom.xml | 2 +-
modules/plugins/netservices/pom.xml | 2 +-
modules/plugins/oracle/pom.xml | 2 +-
modules/plugins/pattern-generator/pom.xml | 2 +-
modules/plugins/perftest/pom.xml | 2 +-
modules/plugins/platform/pom.xml | 2 +-
modules/plugins/pom.xml | 2 +-
modules/plugins/postfix/pom.xml | 2 +-
modules/plugins/postgres/pom.xml | 2 +-
modules/plugins/rhq-agent/pom.xml | 2 +-
modules/plugins/rhq-server/pom.xml | 2 +-
modules/plugins/samba/pom.xml | 2 +-
modules/plugins/script/pom.xml | 2 +-
modules/plugins/script2/pom.xml | 2 +-
modules/plugins/snmptrapd/pom.xml | 2 +-
modules/plugins/sshd/pom.xml | 2 +-
modules/plugins/sudoers/pom.xml | 2 +-
modules/plugins/tomcat/pom.xml | 2 +-
modules/plugins/twitter/pom.xml | 2 +-
modules/plugins/validate-all-plugins/pom.xml | 2 +-
modules/plugins/virt/pom.xml | 2 +-
modules/pom.xml | 2 +-
modules/test-utils/pom.xml | 2 +-
pom.xml | 2 +-
116 files changed, 134 insertions(+), 134 deletions(-)
New commits:
commit 5472781850a5a34ccfe4030094634204363f407d
Author: John Sanda <jsanda(a)redhat.com>
Date: Wed May 18 12:13:24 2011 -0400
[maven-release-plugin] prepare release RHQ_4_0_1
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml
index 313d189..c479f35 100644
--- a/modules/common/ant-bundle/pom.xml
+++ b/modules/common/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/filetemplate-bundle/pom.xml b/modules/common/filetemplate-bundle/pom.xml
index 222403c..2ce723f 100644
--- a/modules/common/filetemplate-bundle/pom.xml
+++ b/modules/common/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml
index 4a6909b..60e0ef1 100644
--- a/modules/common/jboss-as/pom.xml
+++ b/modules/common/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/pom.xml b/modules/common/pom.xml
index 29fb134..a419918 100644
--- a/modules/common/pom.xml
+++ b/modules/common/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index a7f1999..ba06c10 100644
--- a/modules/core/client-api/pom.xml
+++ b/modules/core/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml
index d988423..e334d91 100644
--- a/modules/core/comm-api/pom.xml
+++ b/modules/core/comm-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index aef0914..919db35 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml
index d47458f..42ed4be 100644
--- a/modules/core/domain/pom.xml
+++ b/modules/core/domain/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml
index b88e04b..9de71a2 100644
--- a/modules/core/gui/pom.xml
+++ b/modules/core/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml
index 8cacc8e..67c49e8 100644
--- a/modules/core/native-system/pom.xml
+++ b/modules/core/native-system/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml
index 8f8382b..ec2a9b9 100644
--- a/modules/core/plugin-api/pom.xml
+++ b/modules/core/plugin-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml
index e366757..eb72598 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-validator/pom.xml b/modules/core/plugin-validator/pom.xml
index bfedcf1..08c4147 100644
--- a/modules/core/plugin-validator/pom.xml
+++ b/modules/core/plugin-validator/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml
index 2c18207..e0e0afc 100644
--- a/modules/core/plugindoc/pom.xml
+++ b/modules/core/plugindoc/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index d22acdc..fcc9be1 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml
index 136f9db..b75c88a 100644
--- a/modules/core/util/pom.xml
+++ b/modules/core/util/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index 085042f..aded251 100644
--- a/modules/enterprise/agent/pom.xml
+++ b/modules/enterprise/agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml
index be70655..b57bb98 100644
--- a/modules/enterprise/agentupdate/pom.xml
+++ b/modules/enterprise/agentupdate/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/binding/pom.xml b/modules/enterprise/binding/pom.xml
index 48bae2d..e5f3ed7 100644
--- a/modules/enterprise/binding/pom.xml
+++ b/modules/enterprise/binding/pom.xml
@@ -3,11 +3,11 @@
<parent>
<artifactId>rhq-enterprise-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-script-bindings</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<name>RHQ Script Bindings</name>
<description>Abstraction of different facilities and default configurations for script bindings</description>
diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml
index e03e8cb..f1122aa 100644
--- a/modules/enterprise/comm/pom.xml
+++ b/modules/enterprise/comm/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml
index 3d0852a..c828f15 100644
--- a/modules/enterprise/gui/base-perspective-jar/pom.xml
+++ b/modules/enterprise/gui/base-perspective-jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml b/modules/enterprise/gui/base-perspective-war/pom.xml
index d2fd85c..6a933d5 100644
--- a/modules/enterprise/gui/base-perspective-war/pom.xml
+++ b/modules/enterprise/gui/base-perspective-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/content_http-war/pom.xml b/modules/enterprise/gui/content_http-war/pom.xml
index e915555..f5be60a 100644
--- a/modules/enterprise/gui/content_http-war/pom.xml
+++ b/modules/enterprise/gui/content_http-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-gui-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml
index d28f562..8b4033f 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml
index 8499b18..4490677 100644
--- a/modules/enterprise/gui/installer-war/pom.xml
+++ b/modules/enterprise/gui/installer-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml
index f8ca5d2..704c040 100644
--- a/modules/enterprise/gui/pom.xml
+++ b/modules/enterprise/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml
index b82ff6b..dae73e2 100644
--- a/modules/enterprise/gui/portal-war/pom.xml
+++ b/modules/enterprise/gui/portal-war/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml
index d785c54..701ae0a 100644
--- a/modules/enterprise/pom.xml
+++ b/modules/enterprise/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml
index 16ad01c..fcd6fc8 100644
--- a/modules/enterprise/remoting/cli/pom.xml
+++ b/modules/enterprise/remoting/cli/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/client-api/pom.xml b/modules/enterprise/remoting/client-api/pom.xml
index aa8bb79..4f81104 100644
--- a/modules/enterprise/remoting/client-api/pom.xml
+++ b/modules/enterprise/remoting/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/client-deps/pom.xml b/modules/enterprise/remoting/client-deps/pom.xml
index 4e0c3b8..929be38 100644
--- a/modules/enterprise/remoting/client-deps/pom.xml
+++ b/modules/enterprise/remoting/client-deps/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml
index 7299a24..8dc5b31 100644
--- a/modules/enterprise/remoting/pom.xml
+++ b/modules/enterprise/remoting/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml
index 08a6920..6c26cb0 100644
--- a/modules/enterprise/remoting/webservices/pom.xml
+++ b/modules/enterprise/remoting/webservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/client-api/pom.xml b/modules/enterprise/server/client-api/pom.xml
index 9d68a09..20213c5 100644
--- a/modules/enterprise/server/client-api/pom.xml
+++ b/modules/enterprise/server/client-api/pom.xml
@@ -5,13 +5,13 @@
<parent>
<artifactId>rhq-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-server-client-api</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<name>RHQ Enterprise Server Client API</name>
<description>The implementation of the client API when accessing the server locally</description>
diff --git a/modules/enterprise/server/container-lib/pom.xml b/modules/enterprise/server/container-lib/pom.xml
index 6bacdf8..c0936b9 100644
--- a/modules/enterprise/server/container-lib/pom.xml
+++ b/modules/enterprise/server/container-lib/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml
index 63c230b..4e7c76d 100644
--- a/modules/enterprise/server/container/pom.xml
+++ b/modules/enterprise/server/container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml
index e07e22c..fe8325f 100644
--- a/modules/enterprise/server/ear/pom.xml
+++ b/modules/enterprise/server/ear/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml
index d711eee..e39ea86 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/alert-cli/pom.xml b/modules/enterprise/server/plugins/alert-cli/pom.xml
index 0e57513..75d853c 100644
--- a/modules/enterprise/server/plugins/alert-cli/pom.xml
+++ b/modules/enterprise/server/plugins/alert-cli/pom.xml
@@ -3,11 +3,11 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>alert-cli</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<name>RHQ Enterprise Server CLI Script Alert Plugin</name>
<description>An alert sender able to execute an arbitrary CLI script as a response to an alert</description>
diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml b/modules/enterprise/server/plugins/alert-email/pom.xml
index b61f303..eea2614 100644
--- a/modules/enterprise/server/plugins/alert-email/pom.xml
+++ b/modules/enterprise/server/plugins/alert-email/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.server</groupId>
<artifactId>alert-email</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<name>RHQ Enterprise Server Email Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml b/modules/enterprise/server/plugins/alert-irc/pom.xml
index d2d8e61..7a2f630 100644
--- a/modules/enterprise/server/plugins/alert-irc/pom.xml
+++ b/modules/enterprise/server/plugins/alert-irc/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-irc</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<name>RHQ Enterprise Server IRC Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-log4j/pom.xml b/modules/enterprise/server/plugins/alert-log4j/pom.xml
index a1fdacf..b4ec474 100644
--- a/modules/enterprise/server/plugins/alert-log4j/pom.xml
+++ b/modules/enterprise/server/plugins/alert-log4j/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-log4j</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<name>RHQ Enterprise Server Log4J Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml b/modules/enterprise/server/plugins/alert-microblog/pom.xml
index ffa9738..7e02115 100644
--- a/modules/enterprise/server/plugins/alert-microblog/pom.xml
+++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-microblog</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<name>RHQ Enterprise Server Microblog Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
index 196af5a..c1b5430 100644
--- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
+++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-mobicents</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<name>RHQ Enterprise Server Mobicents Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml b/modules/enterprise/server/plugins/alert-operations/pom.xml
index d5c3922..fcc6111 100644
--- a/modules/enterprise/server/plugins/alert-operations/pom.xml
+++ b/modules/enterprise/server/plugins/alert-operations/pom.xml
@@ -2,14 +2,14 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-operations</artifactId>
<packaging>jar</packaging>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<name>RHQ Enterprise Server Opertions Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml b/modules/enterprise/server/plugins/alert-roles/pom.xml
index 9d01093..22cf0f5 100644
--- a/modules/enterprise/server/plugins/alert-roles/pom.xml
+++ b/modules/enterprise/server/plugins/alert-roles/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-roles</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<name>RHQ Enterprise Server Roles Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml b/modules/enterprise/server/plugins/alert-snmp/pom.xml
index dddfb8b..a06ef84 100644
--- a/modules/enterprise/server/plugins/alert-snmp/pom.xml
+++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-snmp</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<name>RHQ Enterprise Server SNMP Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml b/modules/enterprise/server/plugins/alert-subject/pom.xml
index d5647c1..f4ca86a 100644
--- a/modules/enterprise/server/plugins/alert-subject/pom.xml
+++ b/modules/enterprise/server/plugins/alert-subject/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-subject</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<name>RHQ Enterprise Server Subject Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml
index 9e70e72..2a6fb9c 100644
--- a/modules/enterprise/server/plugins/ant-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml b/modules/enterprise/server/plugins/cobbler/pom.xml
index c6b360f..7f66b88 100644
--- a/modules/enterprise/server/plugins/cobbler/pom.xml
+++ b/modules/enterprise/server/plugins/cobbler/pom.xml
@@ -4,14 +4,14 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>rhq-serverplugin-cobbler</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<name>RHQ Enterprise Server Cobbler Plugin</name>
diff --git a/modules/enterprise/server/plugins/disk/pom.xml b/modules/enterprise/server/plugins/disk/pom.xml
index 2983096..e22ab20 100644
--- a/modules/enterprise/server/plugins/disk/pom.xml
+++ b/modules/enterprise/server/plugins/disk/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
index 3a77bd2..bb88cf3 100644
--- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/groovy-script/pom.xml b/modules/enterprise/server/plugins/groovy-script/pom.xml
index 27bb4ee..29b794d 100644
--- a/modules/enterprise/server/plugins/groovy-script/pom.xml
+++ b/modules/enterprise/server/plugins/groovy-script/pom.xml
@@ -4,14 +4,14 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>groovy-script-server-plugin</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<name>RHQ Enterprise Server Groovy Script Plugin</name>
diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml b/modules/enterprise/server/plugins/jboss-software/pom.xml
index 2cec96c..446e44a 100644
--- a/modules/enterprise/server/plugins/jboss-software/pom.xml
+++ b/modules/enterprise/server/plugins/jboss-software/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/packagetype-cli/pom.xml b/modules/enterprise/server/plugins/packagetype-cli/pom.xml
index fc6d661..bc7bacc 100644
--- a/modules/enterprise/server/plugins/packagetype-cli/pom.xml
+++ b/modules/enterprise/server/plugins/packagetype-cli/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>packagetype-cli</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<name>RHQ Enterprise Server CLI Package Type Plugin</name>
diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
index aaa2ae6..0dacba2 100644
--- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../../../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml b/modules/enterprise/server/plugins/perspectives/core/pom.xml
index 1bc2df8..00d174a 100644
--- a/modules/enterprise/server/plugins/perspectives/core/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml
index fda4fa7..c69334f 100644
--- a/modules/enterprise/server/plugins/pom.xml
+++ b/modules/enterprise/server/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml b/modules/enterprise/server/plugins/rhnhosted/pom.xml
index 10c717a..d46f152 100644
--- a/modules/enterprise/server/plugins/rhnhosted/pom.xml
+++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/url/pom.xml b/modules/enterprise/server/plugins/url/pom.xml
index 427accb..438180c 100644
--- a/modules/enterprise/server/plugins/url/pom.xml
+++ b/modules/enterprise/server/plugins/url/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
index e1e370b..7e9e9e5 100644
--- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
+++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/yum/pom.xml b/modules/enterprise/server/plugins/yum/pom.xml
index c706970..399196e 100644
--- a/modules/enterprise/server/plugins/yum/pom.xml
+++ b/modules/enterprise/server/plugins/yum/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml
index 328cb09..26d3fc8 100644
--- a/modules/enterprise/server/safe-invoker/pom.xml
+++ b/modules/enterprise/server/safe-invoker/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml
index ca8f421..6df9198 100644
--- a/modules/enterprise/server/sars/agent-sar/pom.xml
+++ b/modules/enterprise/server/sars/agent-sar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-sars-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml
index 1bdc286..6ff6a00 100644
--- a/modules/enterprise/server/sars/pom.xml
+++ b/modules/enterprise/server/sars/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/xml-schemas/pom.xml b/modules/enterprise/server/xml-schemas/pom.xml
index 4b7b9bd..d13ef5c 100644
--- a/modules/enterprise/server/xml-schemas/pom.xml
+++ b/modules/enterprise/server/xml-schemas/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/bundleGen/pom.xml b/modules/helpers/bundleGen/pom.xml
index 39c59f0..f7f1bb1 100644
--- a/modules/helpers/bundleGen/pom.xml
+++ b/modules/helpers/bundleGen/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.helpers</groupId>
<artifactId>bundleGen</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<build>
<plugins>
diff --git a/modules/helpers/perftest-support/pom.xml b/modules/helpers/perftest-support/pom.xml
index dfca572..277b800 100644
--- a/modules/helpers/perftest-support/pom.xml
+++ b/modules/helpers/perftest-support/pom.xml
@@ -3,11 +3,11 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>perftest-support</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<name>Performance Testing Support</name>
<description>To support performance testing, this is a basic tool to support extracting and later reimporting of
data from/to a database.
diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml
index 4b633f5..35fba10 100644
--- a/modules/helpers/pom.xml
+++ b/modules/helpers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml
index 435286a..077dedb 100644
--- a/modules/helpers/rtfilter/pom.xml
+++ b/modules/helpers/rtfilter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml
index 5a80015..642c19b 100644
--- a/modules/plugins/aliases/pom.xml
+++ b/modules/plugins/aliases/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml
index de6075c..23a7457 100644
--- a/modules/plugins/ant-bundle/pom.xml
+++ b/modules/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index 8de2d23..5e6af81 100644
--- a/modules/plugins/apache/pom.xml
+++ b/modules/plugins/apache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index af07702..de043d6 100644
--- a/modules/plugins/augeas/pom.xml
+++ b/modules/plugins/augeas/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/byteman/pom.xml b/modules/plugins/byteman/pom.xml
index 1b23882..2ace7c4 100644
--- a/modules/plugins/byteman/pom.xml
+++ b/modules/plugins/byteman/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml
index 8bfdeea..b992055 100644
--- a/modules/plugins/cobbler/pom.xml
+++ b/modules/plugins/cobbler/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml
index ec14f28..d115e55 100644
--- a/modules/plugins/cron/pom.xml
+++ b/modules/plugins/cron/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml
index 099fdd6..914aa3d 100644
--- a/modules/plugins/database/pom.xml
+++ b/modules/plugins/database/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/filetemplate-bundle/pom.xml b/modules/plugins/filetemplate-bundle/pom.xml
index f055861..2220335 100644
--- a/modules/plugins/filetemplate-bundle/pom.xml
+++ b/modules/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml
index 112c581..b8d705d 100644
--- a/modules/plugins/grub/pom.xml
+++ b/modules/plugins/grub/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hadoop/pom.xml b/modules/plugins/hadoop/pom.xml
index fad5fd0..401b9c2 100644
--- a/modules/plugins/hadoop/pom.xml
+++ b/modules/plugins/hadoop/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml
index 38b45c9..d53736b 100644
--- a/modules/plugins/hibernate/pom.xml
+++ b/modules/plugins/hibernate/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<!-- Bypass the jopr-plugins-parent which can not have children. It must build after the plugins in order to execute integration tests on them. -->
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml
index da058ee..61002f8 100644
--- a/modules/plugins/hosts/pom.xml
+++ b/modules/plugins/hosts/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml
index dbc972f..a0deddd 100644
--- a/modules/plugins/hudson/pom.xml
+++ b/modules/plugins/hudson/pom.xml
@@ -6,12 +6,12 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-hudson-plugin</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<packaging>jar</packaging>
<name>RHQ Hudson Plugin</name>
diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml
index 4b44b48..9f6b519 100644
--- a/modules/plugins/iis/pom.xml
+++ b/modules/plugins/iis/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/irc/pom.xml b/modules/plugins/irc/pom.xml
index 552d3d6..2c5f6bc 100644
--- a/modules/plugins/irc/pom.xml
+++ b/modules/plugins/irc/pom.xml
@@ -5,7 +5,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml
index 6dfe25a..8c2f2bb 100644
--- a/modules/plugins/jboss-as-5/pom.xml
+++ b/modules/plugins/jboss-as-5/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml
index f74f357..be336bc 100644
--- a/modules/plugins/jboss-as/pom.xml
+++ b/modules/plugins/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache-v3/pom.xml b/modules/plugins/jboss-cache-v3/pom.xml
index 7858853..8a31b82 100644
--- a/modules/plugins/jboss-cache-v3/pom.xml
+++ b/modules/plugins/jboss-cache-v3/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml
index 7d3833b..3a75978 100644
--- a/modules/plugins/jboss-cache/pom.xml
+++ b/modules/plugins/jboss-cache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml
index 1b383ed..91ed495 100644
--- a/modules/plugins/jmx/pom.xml
+++ b/modules/plugins/jmx/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/kickstart/pom.xml b/modules/plugins/kickstart/pom.xml
index b2265f9..c5b17c4 100644
--- a/modules/plugins/kickstart/pom.xml
+++ b/modules/plugins/kickstart/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml
index f22caf8..8e06082 100644
--- a/modules/plugins/mysql/pom.xml
+++ b/modules/plugins/mysql/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml
index ea24a5d..ff258fb 100644
--- a/modules/plugins/netservices/pom.xml
+++ b/modules/plugins/netservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml
index 94d0517..d5ce7f8 100644
--- a/modules/plugins/oracle/pom.xml
+++ b/modules/plugins/oracle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pattern-generator/pom.xml b/modules/plugins/pattern-generator/pom.xml
index 12385b1..469370a 100644
--- a/modules/plugins/pattern-generator/pom.xml
+++ b/modules/plugins/pattern-generator/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index 89b903f..66fee5c 100644
--- a/modules/plugins/perftest/pom.xml
+++ b/modules/plugins/perftest/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml
index 5251175..e4f96b8 100644
--- a/modules/plugins/platform/pom.xml
+++ b/modules/plugins/platform/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index cda812e..dc7cf00 100644
--- a/modules/plugins/pom.xml
+++ b/modules/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml
index 7eff98e..a0e5d05 100644
--- a/modules/plugins/postfix/pom.xml
+++ b/modules/plugins/postfix/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml
index 08f9d48..37ddf5e 100644
--- a/modules/plugins/postgres/pom.xml
+++ b/modules/plugins/postgres/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml
index c1d7c26..48b58b4 100644
--- a/modules/plugins/rhq-agent/pom.xml
+++ b/modules/plugins/rhq-agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml
index f6085c6..9b71e98 100644
--- a/modules/plugins/rhq-server/pom.xml
+++ b/modules/plugins/rhq-server/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml
index 3a35487..a9ea12d 100644
--- a/modules/plugins/samba/pom.xml
+++ b/modules/plugins/samba/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml
index 6e0e0bb..aa5fe0b 100644
--- a/modules/plugins/script/pom.xml
+++ b/modules/plugins/script/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script2/pom.xml b/modules/plugins/script2/pom.xml
index 49d9a88..305d370 100644
--- a/modules/plugins/script2/pom.xml
+++ b/modules/plugins/script2/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml
index 0de4591..b8672e9 100644
--- a/modules/plugins/snmptrapd/pom.xml
+++ b/modules/plugins/snmptrapd/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml
index 862b260..c5d0191 100644
--- a/modules/plugins/sshd/pom.xml
+++ b/modules/plugins/sshd/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml
index ae42746..64cd12e 100644
--- a/modules/plugins/sudoers/pom.xml
+++ b/modules/plugins/sudoers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml
index 81cc832..87a83a3 100644
--- a/modules/plugins/tomcat/pom.xml
+++ b/modules/plugins/tomcat/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml
index b6a799f..56e83cd 100644
--- a/modules/plugins/twitter/pom.xml
+++ b/modules/plugins/twitter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/validate-all-plugins/pom.xml b/modules/plugins/validate-all-plugins/pom.xml
index aec6468..de497e9 100644
--- a/modules/plugins/validate-all-plugins/pom.xml
+++ b/modules/plugins/validate-all-plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/virt/pom.xml b/modules/plugins/virt/pom.xml
index f6d8bdd..e454f67 100644
--- a/modules/plugins/virt/pom.xml
+++ b/modules/plugins/virt/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/pom.xml b/modules/pom.xml
index d6a87a8..1ae4285 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml
index d4f3d06..ea1cc6e 100644
--- a/modules/test-utils/pom.xml
+++ b/modules/test-utils/pom.xml
@@ -7,7 +7,7 @@
<parent>
<artifactId>rhq-modules-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
</parent>
<artifactId>test-utils</artifactId>
diff --git a/pom.xml b/pom.xml
index 80a54ec..74d0889 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.0.1-SNAPSHOT</version>
+ <version>4.0.1</version>
<packaging>pom</packaging>
<name>RHQ</name>
13 years
[rhq] Branch 'release-4.0.0' - modules/enterprise
by ips
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
New commits:
commit b91e857e9b48331fc66b742cdeab11c13640c7a2
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed May 18 10:12:23 2011 -0400
[BZ 697589] to load group member configs, call configurationManager.getResourceConfigurationsForCompatibleGroup(), rather than configurationManager.getResourceConfigurationMapForCompatibleGroup(), to ensure we get the latest/live configs for each of the group members (https://bugzilla.redhat.com/show_bug.cgi?id=697589)
(cherry picked from commit ed1744867c5a3a3bd50f7b822e3400f223daa0b0)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java
index e1eac94..7026b08 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java
@@ -17,7 +17,6 @@ import org.rhq.core.domain.criteria.GroupResourceConfigurationUpdateCriteria;
import org.rhq.core.domain.criteria.PluginConfigurationUpdateCriteria;
import org.rhq.core.domain.criteria.ResourceConfigurationUpdateCriteria;
import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.gwt.ConfigurationGWTService;
@@ -263,10 +262,11 @@ public class ConfigurationGWTServiceImpl extends AbstractGWTServiceImpl implemen
@Override
public Map<Integer, Configuration> findResourceConfigurationsForGroup(int groupId) throws RuntimeException {
try {
- ResourceGroup group = this.groupManager.getResourceGroup(getSessionSubject(), groupId);
+ //ResourceGroup group = this.groupManager.getResourceGroup(getSessionSubject(), groupId);
+ //Map<Integer, Configuration> configurations = this.configurationManager
+ // .getResourceConfigurationMapForCompatibleGroup(group);
Map<Integer, Configuration> configurations = this.configurationManager
- .getResourceConfigurationMapForCompatibleGroup(group);
-
+ .getResourceConfigurationsForCompatibleGroup(getSessionSubject(), groupId);
return SerialUtility.prepare(configurations, "ConfigurationService.findResourceConfigurationsForGroup");
} catch (Throwable t) {
throw getExceptionToThrowToClient(t);
@@ -388,4 +388,5 @@ public class ConfigurationGWTServiceImpl extends AbstractGWTServiceImpl implemen
throw getExceptionToThrowToClient(t);
}
}
+
}
13 years
[rhq] modules/enterprise
by ips
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java | 24 ----------
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java | 7 --
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java | 2
3 files changed, 33 deletions(-)
New commits:
commit eac0b5c9abaeaf5919b8a27709905d19e71082d1
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed May 18 11:08:36 2011 -0400
[BZ 697589] remove getResourceConfigurationMapForCompatibleGroup() from ConfigurationManagerLocal and ConfigurationManagerBean, since it is not a method anyone would ever want to call (getResourceConfigurationsForCompatibleGroup() should be used instead) (https://bugzilla.redhat.com/show_bug.cgi?id=697589)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java
index 7026b08..7f7c31b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java
@@ -22,8 +22,6 @@ import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.gwt.ConfigurationGWTService;
import org.rhq.enterprise.gui.coregui.server.util.SerialUtility;
import org.rhq.enterprise.server.configuration.ConfigurationManagerLocal;
-import org.rhq.enterprise.server.resource.ResourceManagerLocal;
-import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal;
import org.rhq.enterprise.server.util.LookupUtil;
/**
@@ -34,8 +32,6 @@ public class ConfigurationGWTServiceImpl extends AbstractGWTServiceImpl implemen
private static final long serialVersionUID = 1L;
private ConfigurationManagerLocal configurationManager = LookupUtil.getConfigurationManager();
- private ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();
- private ResourceGroupManagerLocal groupManager = LookupUtil.getResourceGroupManager();
@Override
public void purgePluginConfigurationUpdates(int[] configUpdateIds, boolean purgeInProgress) throws RuntimeException {
@@ -262,9 +258,6 @@ public class ConfigurationGWTServiceImpl extends AbstractGWTServiceImpl implemen
@Override
public Map<Integer, Configuration> findResourceConfigurationsForGroup(int groupId) throws RuntimeException {
try {
- //ResourceGroup group = this.groupManager.getResourceGroup(getSessionSubject(), groupId);
- //Map<Integer, Configuration> configurations = this.configurationManager
- // .getResourceConfigurationMapForCompatibleGroup(group);
Map<Integer, Configuration> configurations = this.configurationManager
.getResourceConfigurationsForCompatibleGroup(getSessionSubject(), groupId);
return SerialUtility.prepare(configurations, "ConfigurationService.findResourceConfigurationsForGroup");
@@ -358,23 +351,6 @@ public class ConfigurationGWTServiceImpl extends AbstractGWTServiceImpl implemen
}
}
- private List<ResourceConfigurationComposite> convertToCompositesList(Map<Integer, Configuration> configurations)
- throws RuntimeException {
- try {
- List<ResourceConfigurationComposite> configurationComposites = new ArrayList<ResourceConfigurationComposite>(
- configurations.size());
- for (Integer resourceId : configurations.keySet()) {
- Configuration configuration = configurations.get(resourceId);
- ResourceConfigurationComposite configurationComposite = new ResourceConfigurationComposite(resourceId,
- configuration);
- configurationComposites.add(configurationComposite);
- }
- return configurationComposites;
- } catch (Throwable t) {
- throw getExceptionToThrowToClient(t);
- }
- }
-
private Map<Integer, Configuration> convertToMap(List<ResourceConfigurationComposite> resourceConfigurations)
throws RuntimeException {
try {
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java
index eab8623..9282df5 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java
@@ -1814,13 +1814,6 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf
}
@SuppressWarnings("unchecked")
- public Map<Integer, Configuration> getResourceConfigurationMapForCompatibleGroup(ResourceGroup compatibleGroup) {
- Tuple<String, Object> groupIdParameter = new Tuple<String, Object>("resourceGroupId", compatibleGroup.getId());
- return executeGetConfigurationMapQuery(Configuration.QUERY_GET_RESOURCE_CONFIG_MAP_BY_GROUP_ID, 100,
- groupIdParameter);
- }
-
- @SuppressWarnings("unchecked")
private Map<Integer, Configuration> executeGetConfigurationMapQuery(String memberQueryName, int maxSize,
Tuple<String, Object>... parameters) {
Query countQuery = PersistenceUtility.createCountQuery(entityManager, memberQueryName);
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java
index c36e403..c1222c1 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java
@@ -400,8 +400,6 @@ public interface ConfigurationManagerLocal {
Map<Integer, Configuration> getResourceConfigurationMapForGroupUpdate(Subject subject,
Integer groupResourceConfigurationUpdateId);
- Map<Integer, Configuration> getResourceConfigurationMapForCompatibleGroup(ResourceGroup compatibleGroup);
-
/**
* Returns the current Resource configurations for the members in the specified compatible group.
*
13 years
[rhq] modules/enterprise
by ips
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
New commits:
commit ed1744867c5a3a3bd50f7b822e3400f223daa0b0
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed May 18 10:12:23 2011 -0400
[BZ 697589] to load group member configs, call configurationManager.getResourceConfigurationsForCompatibleGroup(), rather than configurationManager.getResourceConfigurationMapForCompatibleGroup(), to ensure we get the latest/live configs for each of the group members (https://bugzilla.redhat.com/show_bug.cgi?id=697589)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java
index e1eac94..7026b08 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java
@@ -17,7 +17,6 @@ import org.rhq.core.domain.criteria.GroupResourceConfigurationUpdateCriteria;
import org.rhq.core.domain.criteria.PluginConfigurationUpdateCriteria;
import org.rhq.core.domain.criteria.ResourceConfigurationUpdateCriteria;
import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.gwt.ConfigurationGWTService;
@@ -263,10 +262,11 @@ public class ConfigurationGWTServiceImpl extends AbstractGWTServiceImpl implemen
@Override
public Map<Integer, Configuration> findResourceConfigurationsForGroup(int groupId) throws RuntimeException {
try {
- ResourceGroup group = this.groupManager.getResourceGroup(getSessionSubject(), groupId);
+ //ResourceGroup group = this.groupManager.getResourceGroup(getSessionSubject(), groupId);
+ //Map<Integer, Configuration> configurations = this.configurationManager
+ // .getResourceConfigurationMapForCompatibleGroup(group);
Map<Integer, Configuration> configurations = this.configurationManager
- .getResourceConfigurationMapForCompatibleGroup(group);
-
+ .getResourceConfigurationsForCompatibleGroup(getSessionSubject(), groupId);
return SerialUtility.prepare(configurations, "ConfigurationService.findResourceConfigurationsForGroup");
} catch (Throwable t) {
throw getExceptionToThrowToClient(t);
@@ -388,4 +388,5 @@ public class ConfigurationGWTServiceImpl extends AbstractGWTServiceImpl implemen
throw getExceptionToThrowToClient(t);
}
}
+
}
13 years
[rhq] Branch 'release-4.0.0' - modules/core
by lkrejci
modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/upgrade/ResourceUpgradeRequest.java | 30 +
modules/core/plugin-container/pom.xml | 40 ++
modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java | 189 +++++-----
modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java | 140 +++++--
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java | 145 ++++---
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeFailureHandlingTest.java | 69 +++
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeProgressHandlingTest.java | 183 +++++++++
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeTestBase.java | 4
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/duplicate/v1/rhq-plugin.xml | 31 +
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/duplicate/v2/rhq-plugin.xml | 30 +
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/multi/base/BaseUpgradingDiscoveryComponent.java | 14
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v1/rhq-plugin.xml | 32 +
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v2/rhq-plugin.xml | 30 +
13 files changed, 756 insertions(+), 181 deletions(-)
New commits:
commit bd8335935aff914bc2a40860afda96daed6ad20e
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Wed May 18 15:50:47 2011 +0200
Merging resource-upgrade-fixes from master.
diff --git a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/upgrade/ResourceUpgradeRequest.java b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/upgrade/ResourceUpgradeRequest.java
index aca9c90..164ea13 100644
--- a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/upgrade/ResourceUpgradeRequest.java
+++ b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/upgrade/ResourceUpgradeRequest.java
@@ -26,6 +26,7 @@ package org.rhq.core.clientapi.agent.upgrade;
import java.io.PrintWriter;
import java.io.StringWriter;
+import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceUpgradeReport;
/**
@@ -119,6 +120,35 @@ public class ResourceUpgradeRequest extends ResourceUpgradeReport {
setNewResourceKey(report.getNewResourceKey());
}
+ public void fillInFromResource(Resource resource) {
+ setNewDescription(resource.getDescription());
+ setNewName(resource.getName());
+ setNewResourceKey(resource.getResourceKey());
+ }
+
+ public void updateResource(Resource resource) {
+ if (getNewResourceKey() != null) {
+ resource.setResourceKey(getNewResourceKey());
+ }
+
+ if (getNewName() != null) {
+ resource.setName(getNewName());
+ }
+
+ if (getNewDescription() != null) {
+ resource.setDescription(getNewDescription());
+ }
+ }
+
+ /**
+ * Clears all the data to be upgraded apart from the error message, stacktrace and timestamp
+ */
+ public void clearUpgradeData() {
+ setNewDescription(null);
+ setNewName(null);
+ setNewResourceKey(null);
+ }
+
@Override
public boolean hasSomethingToUpgrade() {
return super.hasSomethingToUpgrade() || upgradeErrorMessage != null || upgradeErrorStackTrace != null;
diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml
index 08f6c84..e366757 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -295,6 +295,46 @@
<fileset dir="${project.build.testOutputDirectory}/tmp/multi/v2" includes="**/*.class,**/rhq-plugin.xml" />
</jar>
+ <copy toDir="${project.build.testOutputDirectory}/tmp/progress/v1/META-INF">
+ <fileset file="${project.build.testSourceDirectory}/org/rhq/core/pc/upgrade/plugins/progress/v1/rhq-plugin.xml" />
+ </copy>
+ <!-- <copy toDir="${project.build.testOutputDirectory}/tmp/progress/v1/org/rhq/core/pc/upgrade/plugins/progress/v1">
+ <fileset file="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/plugins/progress/v1/*.class" />
+ </copy> -->
+ <jar destfile="${project.build.testOutputDirectory}/resource-upgrade-test-plugin-progress-test-1.0.0.jar">
+ <fileset dir="${project.build.testOutputDirectory}/tmp/progress/v1" includes="**/*.class,**/rhq-plugin.xml" />
+ </jar>
+
+ <copy toDir="${project.build.testOutputDirectory}/tmp/progress/v2/META-INF">
+ <fileset file="${project.build.testSourceDirectory}/org/rhq/core/pc/upgrade/plugins/progress/v2/rhq-plugin.xml" />
+ </copy>
+ <!-- <copy toDir="${project.build.testOutputDirectory}/tmp/progress/v2/org/rhq/core/pc/upgrade/plugins/progress/v2">
+ <fileset file="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/plugins/progress/v2/*.class" />
+ </copy> -->
+ <jar destfile="${project.build.testOutputDirectory}/resource-upgrade-test-plugin-progress-test-2.0.0.jar">
+ <fileset dir="${project.build.testOutputDirectory}/tmp/progress/v2" includes="**/*.class,**/rhq-plugin.xml" />
+ </jar>
+
+ <copy toDir="${project.build.testOutputDirectory}/tmp/duplicate/v1/META-INF">
+ <fileset file="${project.build.testSourceDirectory}/org/rhq/core/pc/upgrade/plugins/duplicate/v1/rhq-plugin.xml" />
+ </copy>
+ <!-- <copy toDir="${project.build.testOutputDirectory}/tmp/duplicate/v1/org/rhq/core/pc/upgrade/plugins/duplicate/v1">
+ <fileset file="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/plugins/duplicate/v1/*.class" />
+ </copy> -->
+ <jar destfile="${project.build.testOutputDirectory}/resource-upgrade-test-plugin-duplicate-test-1.0.0.jar">
+ <fileset dir="${project.build.testOutputDirectory}/tmp/duplicate/v1" includes="**/*.class,**/rhq-plugin.xml" />
+ </jar>
+
+ <copy toDir="${project.build.testOutputDirectory}/tmp/duplicate/v2/META-INF">
+ <fileset file="${project.build.testSourceDirectory}/org/rhq/core/pc/upgrade/plugins/duplicate/v2/rhq-plugin.xml" />
+ </copy>
+ <!-- <copy toDir="${project.build.testOutputDirectory}/tmp/duplicate/v2/org/rhq/core/pc/upgrade/plugins/duplicate/v2">
+ <fileset file="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/plugins/duplicate/v2/*.class" />
+ </copy> -->
+ <jar destfile="${project.build.testOutputDirectory}/resource-upgrade-test-plugin-duplicate-test-2.0.0.jar">
+ <fileset dir="${project.build.testOutputDirectory}/tmp/duplicate/v2" includes="**/*.class,**/rhq-plugin.xml" />
+ </jar>
+
<delete dir="${project.build.testOutputDirectory}/tmp" />
</tasks>
</configuration>
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
index 6afb021..d29cd56 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
@@ -225,7 +225,7 @@ public class InventoryManager extends AgentService implements ContainerService,
//try the resource upgrade before we have any schedulers set up
//so that we don't get any interventions from concurrently running
//discoveries.
- upgradeResources();
+ activateAndUpgradeResources();
availabilityCollectors = new AvailabilityCollectorThreadPool();
availabilityCollectors.initialize();
@@ -1236,7 +1236,7 @@ public class InventoryManager extends AgentService implements ContainerService,
return resourceContainer.updateAvailability(availabilityType);
}
- public void mergeResourcesFromUpgrade(Set<ResourceUpgradeRequest> upgradeRequests) {
+ public void mergeResourcesFromUpgrade(Set<ResourceUpgradeRequest> upgradeRequests) throws Exception {
Set<ResourceUpgradeResponse> serverUpdates = null;
try {
ServerServices serverServices = this.configuration.getServerServices();
@@ -1247,6 +1247,7 @@ public class InventoryManager extends AgentService implements ContainerService,
}
} catch (Exception e) {
log.error("Failed to process resource upgrades on the server.", e);
+ throw e;
}
if (serverUpdates != null) {
@@ -1429,44 +1430,42 @@ public class InventoryManager extends AgentService implements ContainerService,
}
/**
- * This will start the resource's plugin component, creating it first if it has not yet been created. If the
- * component is already created and started, this method is a no-op.
- *
- * @param resource the resource that the component will manage
- * @param container the wrapper around the resource and its component
- * @param updatedPluginConfig if <code>true</code>, this will indicate that the resource's plugin configuration is
- * known to have changed since the last time the resource component was started
- *
- * @throws InvalidPluginConfigurationException when connecting to the managed resource fails due to an invalid
- * plugin configuration
- * @throws PluginContainerException for all other errors
+ * This method prepares the resource and container for activation.
+ * <p>
+ * After this method has processed the resource and container, it is enough
+ * to call ResourceComponent.start(). All the datastructures needed for that
+ * call are prepared in the container by this method.
+ *
+ * @param resource the resource that we are activating
+ * @param container the container to hold the datastructures
+ * @throws InvalidPluginConfigurationException
+ * @throws PluginContainerException
+ * @return true the resource has been successfully prepared and can be started. False if the resource should not be started.
*/
- @SuppressWarnings("unchecked")
- public void activateResource(Resource resource, @NotNull ResourceContainer container, boolean updatedPluginConfig)
- throws InvalidPluginConfigurationException, PluginContainerException {
+ private boolean prepareResourceForActivation(Resource resource, @NotNull ResourceContainer container, boolean forceReinitialization) throws InvalidPluginConfigurationException, PluginContainerException {
if (resourceUpgradeDelegate.hasUpgradeFailed(resource)) {
if (log.isTraceEnabled()) {
log.trace("Skipping activation of " + resource + " - it has failed to upgrade.");
}
- return;
+ return false;
}
-
+
ResourceComponent component = container.getResourceComponent();
// if the component already exists and is started, and the resource's plugin config has not changed, there is
// nothing to do, so return immediately
- if ((component != null) && (container.getResourceComponentState() == ResourceComponentState.STARTED)
- && !updatedPluginConfig) {
+ if ((component != null) && (container.getResourceComponentState() == ResourceComponentState.STARTED
+ && !forceReinitialization)) {
if (log.isTraceEnabled()) {
- log.trace("Skipping activation of " + resource + " - its component is already started and its plugin "
+ log.trace("No need to prepare the activation of resource " + resource + " - its component is already started and its plugin "
+ "config has not been updated since it was last started.");
}
- return;
+ return false;
}
if (log.isDebugEnabled()) {
- log.debug("Starting component for [" + resource + "], current state=["
- + container.getResourceComponentState() + "], new plugin config=[" + updatedPluginConfig + "]...");
+ log.debug("Preparing component for [" + resource + "] for activation, current state=["
+ + container.getResourceComponentState() + "], forcing reinitialization=[" + forceReinitialization + "]...");
}
// If the component does not even exist yet, we need to instantiate it and set it on the container.
@@ -1482,6 +1481,10 @@ public class InventoryManager extends AgentService implements ContainerService,
container.setResourceComponent(component);
}
+ //this is a transient field, so reinitialize it just in case this is invoked just after
+ //loadFromDisk()
+ container.setResourceComponentState(ResourceComponentState.STOPPED);
+
// start the resource, but only if its parent component is running. If the parent is null, that means
// the resource is, itself, the root platform and we always activate that.
ResourceContainer parentResourceContainer;
@@ -1514,7 +1517,7 @@ public class InventoryManager extends AgentService implements ContainerService,
ConfigurationUtility.normalizeConfiguration(resource.getPluginConfiguration(), type
.getPluginConfigurationDefinition());
- ResourceComponent parentComponent = null;
+ ResourceComponent<?> parentComponent = null;
if (resource.getParentResource() != null) {
parentComponent = getResourceComponent(resource.getParentResource());
}
@@ -1523,8 +1526,45 @@ public class InventoryManager extends AgentService implements ContainerService,
container.setResourceContext(context);
+ return true;
+ } else {
+ if (log.isDebugEnabled()) {
+ log.debug("Resource [" + resource + "] not being prepared for activation; parent isn't started: " + parentResourceContainer);
+ }
+
+ return false;
+ }
+ }
+
+ /**
+ * This will start the resource's plugin component, creating it first if it has not yet been created. If the
+ * component is already created and started, this method is a no-op.
+ *
+ * @param resource the resource that the component will manage
+ * @param container the wrapper around the resource and its component
+ * @param updatedPluginConfig if <code>true</code>, this will indicate that the resource's plugin configuration is
+ * known to have changed since the last time the resource component was started
+ *
+ * @throws InvalidPluginConfigurationException when connecting to the managed resource fails due to an invalid
+ * plugin configuration
+ * @throws PluginContainerException for all other errors
+ */
+ @SuppressWarnings("unchecked")
+ public void activateResource(Resource resource, @NotNull ResourceContainer container, boolean updatedPluginConfig)
+ throws InvalidPluginConfigurationException, PluginContainerException {
+ if (resourceUpgradeDelegate.hasUpgradeFailed(resource)) {
+ if (log.isTraceEnabled()) {
+ log.trace("Skipping activation of " + resource + " - it has failed to upgrade.");
+ }
+ return;
+ }
+
+ if (prepareResourceForActivation(resource, container, updatedPluginConfig)) {
+
+ ResourceContext context = container.getResourceContext();
+
// Wrap the component in a proxy that will provide locking and a timeout for the call to start().
- component = container.createResourceComponentProxy(ResourceComponent.class, FacetLockType.READ,
+ ResourceComponent component = container.createResourceComponentProxy(ResourceComponent.class, FacetLockType.READ,
COMPONENT_START_TIMEOUT, true, false);
try {
@@ -1560,10 +1600,6 @@ public class InventoryManager extends AgentService implements ContainerService,
// Finally, inform the rest of the plugin container that this resource has been activated
fireResourceActivated(resource);
- } else {
- if (log.isDebugEnabled()) {
- log.debug("Not activating [" + resource + "]; parent isn't started: " + parentResourceContainer);
- }
}
}
@@ -1760,10 +1796,7 @@ public class InventoryManager extends AgentService implements ContainerService,
this.resourceContainers.put(uuid, resourceContainer);
}
- initResourceContainer(this.platform);
- activateFromDisk(this.platform);
-
- log.info("Inventory with size [" + this.resourceContainers.size() + "] initialized from data file in ["
+ log.info("Inventory with size [" + this.resourceContainers.size() + "] loaded from data file in ["
+ (System.currentTimeMillis() - start) + "ms]");
}
} catch (Exception e) {
@@ -2630,6 +2663,11 @@ public class InventoryManager extends AgentService implements ContainerService,
}
private void refreshResourceComponentState(ResourceContainer container, boolean pluginConfigUpdated) {
+ if (resourceUpgradeDelegate.enabled()) {
+ //don't do anything during upgrade. The resources are only started during the upgrade process.
+ return;
+ }
+
Resource resource = container.getResource();
switch (resource.getInventoryStatus()) {
case COMMITTED: {
@@ -2652,66 +2690,65 @@ public class InventoryManager extends AgentService implements ContainerService,
container.setSynchronizationState(ResourceContainer.SynchronizationState.SYNCHRONIZED);
}
- private void upgradeResources() {
+ private void activateAndUpgradeResources() {
try {
- if (!configuration.isInsideAgent()) {
- log.debug("Skipping resource upgrade in embedded mode.");
- return;
- }
-
- log.debug("Executing resource upgrade.");
+ log.info("Starting resource activation and upgrade.");
+ long start = System.currentTimeMillis();
+
+ log.info("Executing the initial inventory synchronization before upgrade.");
+
boolean syncResult = handleReport(new InventoryReport(getAgent()));
if (!syncResult) {
- log.warn("Resource upgrade failed to sync up the inventory with the server.");
- return;
+ log.warn("Failed to sync up the inventory with the server. The resource upgrade will be disabled.");
}
- upgradeResource(getPlatform());
+ log.info("Starting to activate (and upgrade) resources.");
+
+ activateAndUpgradeResourceRecursively(getPlatform(), syncResult);
- log.debug("Sending the upgrade requests to the server.");
+ log.info("Inventory activated and upgrade requests gathered in " + (System.currentTimeMillis() - start) + "ms.");
+
+ log.info("Sending the upgrade requests to the server.");
resourceUpgradeDelegate.sendRequests();
resourceUpgradeDelegate.disable();
- log.debug("Resource upgrade finished.");
+ log.info("Resource activation and upgrade finished.");
} catch (Throwable t) {
- log.error("Resource upgrade failed with an exception.", t);
+ log.error("Resource activation or upgrade failed with an exception. An attempt to merely activate the resources will be made now.", t);
+
+ //make sure to at least activate the resources
+ activateAndUpgradeResourceRecursively(getPlatform(), false);
}
}
- private void upgradeResource(Resource resource) {
- ResourceContainer container = getResourceContainer(resource);
- if (container != null) {
- if (container.getResourceComponentState() == ResourceComponentState.STARTED) {
- try {
- if (resourceUpgradeDelegate.processAndQueue(container)) {
- for (Resource child : resource.getChildResources()) {
- upgradeResource(child);
- }
- }
- } catch (PluginContainerException e) {
- log.error("Exception thrown while upgrading [" + resource + "].", e);
- }
- } else {
- String message = "The resource container for resource [" + resource
- + "] wasn't started while upgrading.";
-
- if (resource.getChildResources().isEmpty()) {
- log
- .info(message
- + " If this is the first time the plugin container starts up and has completely empty inventory, you can ignore this message.");
- } else {
- log
- .error(message
- + " This can potentially cause the discovery to find resources logically equivalent to already "
- + "existing resources if the corresponding plugins support upgrade for that particular resource type.");
+ private void activateAndUpgradeResourceRecursively(Resource resource, boolean doUpgrade) {
+ ResourceContainer container = initResourceContainer(resource);
+
+ boolean activate = true;
+
+ //only do upgrade inside the agent. it does not make sense in embedded mode.
+ if (doUpgrade && configuration.isInsideAgent()) {
+ try {
+ activate = prepareResourceForActivation(resource, container, false);
+ activate = activate && resourceUpgradeDelegate.processAndQueue(container);
+ } catch (Throwable t) {
+ log.error("Exception thrown while upgrading [" + resource + "].", t);
+ activate = false;
+ }
+ }
+
+ if (activate) {
+ try {
+ activateResource(resource, container, false);
+ for (Resource child : resource.getChildResources()) {
+ activateAndUpgradeResourceRecursively(child, doUpgrade);
}
+ } catch (PluginContainerException e) {
+ log.error("Exception thrown while activating [" + resource + "].", e);
}
- } else {
- log.error("Resource container not initialized for resource [" + resource
- + "] during upgrade. This should not happen.");
}
}
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java
index b3b8716..cee582e 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java
@@ -59,6 +59,7 @@ public class ResourceUpgradeDelegate {
private boolean enabled = true;
private Set<ResourceUpgradeRequest> requests = new HashSet<ResourceUpgradeRequest>();
+ private Set<ResourceUpgradeRequest> originalResourceData = new HashSet<ResourceUpgradeRequest>();
private InventoryManager inventoryManager;
private Set<Resource> failedResources = new HashSet<Resource>();
private Map<Resource, Set<ResourceType>> failedResourceTypesPerParent = new HashMap<Resource, Set<ResourceType>>();
@@ -85,6 +86,14 @@ public class ResourceUpgradeDelegate {
/**
* Asks the resource's discovery component to upgrade the resource.
+ * The resource will be updated with the data from the upgrade. I.e. when the resource
+ * is activated after it was queued for upgrade, it will actually start with the upgraded
+ * data.
+ * <p>
+ * If later on the upgrade fails to finish due to communication error with server or the
+ * server doesn't approve some upgrades for whatever reason, the resources will be restarted
+ * with the original data.
+ *
* @param resourceContainer
* @return true if the resource was queued for upgrade with no problems,
* false if there was some problem upgrading and the resource container was deactivated as
@@ -135,7 +144,74 @@ public class ResourceUpgradeDelegate {
public void sendRequests() throws Throwable {
if (enabled && requests.size() > 0) {
try {
+ //check the validity of the upgrades now that we have a complete picture
+ //about the changes and the inventory looks like it was already upgraded.
+ for(ResourceUpgradeRequest request : requests) {
+ ResourceContainer container = inventoryManager.getResourceContainer(request.getResourceId());
+ if (container != null) {
+ Resource resource = container.getResource();
+ String upgradeErrors = null;
+ if ((upgradeErrors = checkUpgradeValid(resource, request)) != null) {
+ //the resource is in its upgraded state but it's going to get reverted back to the original state
+ //in the code below. Let's use the original resource for the error message so that we don't confuse
+ //the user.
+ for(ResourceUpgradeRequest orig : originalResourceData) {
+ if (orig.equals(request)) {
+ orig.updateResource(resource);
+ break;
+ }
+ }
+ String errorString = "Upgrading the resource [" + resource + "] using these updates [" + request
+ + "] would render the inventory invalid because of the following reasons: " + upgradeErrors;
+
+ //now switch the resource back to the upgraded state for the rest of the code below again
+ request.updateResource(resource);
+
+ log.error(errorString);
+
+ IllegalStateException ex = new IllegalStateException(errorString);
+ ex.fillInStackTrace();
+
+ //set the error and clear out everything else, so that we send the error
+ //to the server and locally roll back to the previous state.
+ request.setErrorProperties(ex);
+ request.clearUpgradeData();
+
+ if (request.getUpgradeErrorMessage() != null) {
+ rememberFailure(resource);
+ inventoryManager.deactivateResource(resource);
+ }
+
+ }
+ }
+ }
+
+ //now before we talk to server and sync up the upgraded data,
+ //reset the resources to their original values so that any changes
+ //the server makes to the upgrade data are applied to the "vanilla" state
+ //of the resources. i.e we only want to make changes the server approves.
+ for (ResourceUpgradeRequest request : originalResourceData) {
+ ResourceContainer container = inventoryManager.getResourceContainer(request.getResourceId());
+ if (container != null) {
+ Resource resource = container.getResource();
+ request.updateResource(resource);
+ }
+ }
+
+ //merge the resources with the data as received from the server
+ //(this can differ from what the upgrade "wants" because the server is
+ //free to disallow some changes, e.g. resource name change)
inventoryManager.mergeResourcesFromUpgrade(requests);
+
+ //and now restart all the "touched" resources with the true intended
+ //data
+ for (ResourceUpgradeRequest request : requests) {
+ ResourceContainer container = inventoryManager.getResourceContainer(request.getResourceId());
+ if (container != null) {
+ Resource resource = container.getResource();
+ inventoryManager.activateResource(resource, container, true);
+ }
+ }
} catch (Throwable t) {
mergeFailed = true;
@@ -168,7 +244,7 @@ public class ResourceUpgradeDelegate {
ResourceContext<?> parentResourceContext = parentResourceContainer == null ? null : parentResourceContainer.getResourceContext();
Resource resource = resourceContainer.getResource();
-
+
ResourceDiscoveryComponent<ResourceComponent<T>> discoveryComponent = PluginContainer.getInstance()
.getPluginComponentFactory().getDiscoveryComponent(resource.getResourceType(), parentResourceContainer);
@@ -194,44 +270,32 @@ public class ResourceUpgradeDelegate {
}
if (upgradeReport != null && upgradeReport.hasSomethingToUpgrade()) {
- String upgradeErrors = null;
- if ((upgradeErrors = checkUpgradeValid(resource, upgradeReport)) != null) {
- String errorString = "Upgrading the resource [" + resource + "] using these updates [" + upgradeReport
- + "] would render the inventory invalid because of the following reasons: " + upgradeErrors;
-
- log.error(errorString);
-
- IllegalStateException ex = new IllegalStateException(errorString);
- ex.fillInStackTrace();
-
- request.setErrorProperties(ex);
- } else {
- request.fillInFromReport(upgradeReport);
- }
-
+ request.fillInFromReport(upgradeReport);
}
- //everything went ok, let's queue a upgrade request that will be sent to the server
if (request.hasSomethingToUpgrade()) {
requests.add(request);
}
if (request.getUpgradeErrorMessage() != null) {
- failedResources.add(resource);
-
- Set<ResourceType> failedResourceTypesInParent = failedResourceTypesPerParent.get(parentResource);
- if (failedResourceTypesInParent == null) {
- failedResourceTypesInParent = new HashSet<ResourceType>();
- failedResourceTypesPerParent.put(parentResource, failedResourceTypesInParent);
- }
-
- failedResourceTypesInParent.add(resource.getResourceType());
-
- inventoryManager.deactivateResource(resource);
-
+ rememberFailure(resource);
return false;
}
-
+
+ //alright, everything went fine with the upgrade. Let's update the data of the resource
+ //right now so that it starts up as if it was already upgraded. This is to ensure that
+ //its children will use a parent component that behaves like the upgraded one.
+ //We are going to roll back the upgraded data if the upgrade fails to sync with the server
+ //later on.
+
+ //remember the original values
+ ResourceUpgradeRequest original = new ResourceUpgradeRequest(resource.getId());
+ original.fillInFromResource(resource);
+ originalResourceData.add(original);
+
+ //update the resource
+ request.updateResource(resource);
+
return true;
}
@@ -239,7 +303,7 @@ public class ResourceUpgradeDelegate {
StringBuilder s = new StringBuilder();
if (!checkResourceKeyUniqueAmongSiblings(resource, upgradeReport)) {
- s.append("\nAnother inventoried sibling resource of the same type already has the proposed resource key.");
+ s.append("\nAnother inventoried sibling resource of the same type already has the proposed resource key or would have it after the upgrade.");
}
return s.length() > 0 ? s.toString() : null;
@@ -248,6 +312,7 @@ public class ResourceUpgradeDelegate {
private boolean checkResourceKeyUniqueAmongSiblings(Resource resource, ResourceUpgradeReport upgradeReport) {
Resource parent = resource.getParentResource();
if (parent == null) {
+ //there is only a single platform resource on an agent
return true;
}
@@ -267,4 +332,17 @@ public class ResourceUpgradeDelegate {
return true;
}
+
+ private void rememberFailure(Resource resource) {
+ failedResources.add(resource);
+ Resource parentResource = resource.getParentResource();
+
+ Set<ResourceType> failedResourceTypesInParent = failedResourceTypesPerParent.get(parentResource);
+ if (failedResourceTypesInParent == null) {
+ failedResourceTypesInParent = new HashSet<ResourceType>();
+ failedResourceTypesPerParent.put(parentResource, failedResourceTypesInParent);
+ }
+
+ failedResourceTypesInParent.add(resource.getResourceType());
+ }
}
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java
index 0dd3459..d3b54aa 100644
--- a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java
@@ -59,7 +59,8 @@ public class FakeServerInventory {
private Map<String, Resource> resourceStore = new HashMap<String, Resource>();
private int counter;
private boolean failing;
-
+ private boolean failUpgrade;
+
private static final Comparator<Resource> ID_COMPARATOR = new Comparator<Resource>() {
public int compare(Resource o1, Resource o2) {
return o1.getId() - o2.getId();
@@ -83,18 +84,20 @@ public class FakeServerInventory {
public synchronized CustomAction mergeInventoryReport(final InventoryStatus requiredInventoryStatus) {
return new CustomAction("updateServerSideInventory") {
public Object invoke(Invocation invocation) throws Throwable {
- throwIfFailing();
-
- InventoryReport inventoryReport = (InventoryReport) invocation.getParameter(0);
-
- for (Resource res : inventoryReport.getAddedRoots()) {
- Resource persisted = fakePersist(res, requiredInventoryStatus, new HashSet<String>());
-
- if (res.getParentResource() == Resource.ROOT) {
- platform = persisted;
+ synchronized (FakeServerInventory.this) {
+ throwIfFailing();
+
+ InventoryReport inventoryReport = (InventoryReport) invocation.getParameter(0);
+
+ for (Resource res : inventoryReport.getAddedRoots()) {
+ Resource persisted = fakePersist(res, requiredInventoryStatus, new HashSet<String>());
+
+ if (res.getParentResource() == Resource.ROOT) {
+ platform = persisted;
+ }
}
+ return getSyncInfo();
}
- return getSyncInfo();
}
};
}
@@ -102,11 +105,13 @@ public class FakeServerInventory {
public synchronized CustomAction clearPlatform() {
return new CustomAction("updateServerSideInventory - report platform deleted on the server") {
public Object invoke(Invocation invocation) throws Throwable {
- throwIfFailing();
-
- platform = null;
-
- return getSyncInfo();
+ synchronized (FakeServerInventory.this) {
+ throwIfFailing();
+
+ platform = null;
+
+ return getSyncInfo();
+ }
}
};
}
@@ -115,45 +120,51 @@ public class FakeServerInventory {
return new CustomAction("upgradeServerSideInventory") {
@SuppressWarnings({ "serial", "unchecked" })
public Object invoke(Invocation invocation) throws Throwable {
- throwIfFailing();
-
- Set<ResourceUpgradeRequest> requests = (Set<ResourceUpgradeRequest>) invocation.getParameter(0);
- Set<ResourceUpgradeResponse> responses = new HashSet<ResourceUpgradeResponse>();
-
- for (final ResourceUpgradeRequest request : requests) {
- Resource resource = findResource(platform, new Resource() {
- public int getId() {
- return request.getResourceId();
- }
- }, ID_COMPARATOR);
- if (resource != null) {
- if (request.getNewDescription() != null) {
- resource.setDescription(request.getNewDescription());
- }
- if (request.getNewName() != null) {
- resource.setName(request.getNewName());
- }
-
- if (request.getNewResourceKey() != null) {
- resource.setResourceKey(request.getNewResourceKey());
- }
-
- if (request.getUpgradeErrorMessage() != null) {
- ResourceError error = new ResourceError(resource, ResourceErrorType.UPGRADE,
- request.getUpgradeErrorMessage(), request.getUpgradeErrorStackTrace(),
- request.getTimestamp());
- resource.getResourceErrors().add(error);
+ synchronized(FakeServerInventory.this) {
+ throwIfFailing();
+
+ if (failUpgrade) {
+ throw new RuntimeException("Failing the upgrade purposefully.");
+ }
+
+ Set<ResourceUpgradeRequest> requests = (Set<ResourceUpgradeRequest>) invocation.getParameter(0);
+ Set<ResourceUpgradeResponse> responses = new HashSet<ResourceUpgradeResponse>();
+
+ for (final ResourceUpgradeRequest request : requests) {
+ Resource resource = findResource(platform, new Resource() {
+ public int getId() {
+ return request.getResourceId();
+ }
+ }, ID_COMPARATOR);
+ if (resource != null) {
+ if (request.getNewDescription() != null) {
+ resource.setDescription(request.getNewDescription());
+ }
+ if (request.getNewName() != null) {
+ resource.setName(request.getNewName());
+ }
+
+ if (request.getNewResourceKey() != null) {
+ resource.setResourceKey(request.getNewResourceKey());
+ }
+
+ if (request.getUpgradeErrorMessage() != null) {
+ ResourceError error = new ResourceError(resource, ResourceErrorType.UPGRADE,
+ request.getUpgradeErrorMessage(), request.getUpgradeErrorStackTrace(),
+ request.getTimestamp());
+ resource.getResourceErrors().add(error);
+ }
+
+ ResourceUpgradeResponse resp = new ResourceUpgradeResponse();
+ resp.setResourceId(resource.getId());
+ resp.setUpgradedResourceName(resource.getName());
+ resp.setUpgradedResourceKey(resource.getResourceKey());
+ resp.setUpgradedResourceDescription(resource.getDescription());
+ responses.add(resp);
}
-
- ResourceUpgradeResponse resp = new ResourceUpgradeResponse();
- resp.setResourceId(resource.getId());
- resp.setUpgradedResourceName(resource.getName());
- resp.setUpgradedResourceKey(resource.getResourceKey());
- resp.setUpgradedResourceDescription(resource.getDescription());
- responses.add(resp);
}
+ return responses;
}
- return responses;
}
};
}
@@ -162,24 +173,34 @@ public class FakeServerInventory {
return new CustomAction("getResources") {
@SuppressWarnings("unchecked")
public Object invoke(Invocation invocation) throws Throwable {
- throwIfFailing();
-
- Set<Integer> resourceIds = (Set<Integer>) invocation.getParameter(0);
- boolean includeDescendants = (Boolean) invocation.getParameter(1);
-
- return getResources(resourceIds, includeDescendants);
+ synchronized (FakeServerInventory.this) {
+ throwIfFailing();
+
+ Set<Integer> resourceIds = (Set<Integer>) invocation.getParameter(0);
+ boolean includeDescendants = (Boolean) invocation.getParameter(1);
+
+ return getResources(resourceIds, includeDescendants);
+ }
}
};
}
- public boolean isFailing() {
+ public synchronized boolean isFailing() {
return failing;
}
- public void setFailing(boolean failing) {
+ public synchronized void setFailing(boolean failing) {
this.failing = failing;
}
+ public synchronized boolean isFailUpgrade() {
+ return failUpgrade;
+ }
+
+ public synchronized void setFailUpgrade(boolean failUpgrade) {
+ this.failUpgrade = failUpgrade;
+ }
+
@SuppressWarnings("serial")
public synchronized Set<Resource> findResourcesByType(final ResourceType type) {
Set<Resource> result = new HashSet<Resource>();
@@ -195,7 +216,9 @@ public class FakeServerInventory {
@SuppressWarnings("serial")
private Set<Resource> getResources(Set<Integer> resourceIds, boolean includeDescendants) {
- Set<Resource> result = new HashSet<Resource>();
+ //it is important to keep the hierarchical order of the resource in the returned set
+ //so that plugin container can merge the resources from top to bottom.
+ Set<Resource> result = new LinkedHashSet<Resource>();
for (final Integer id : resourceIds) {
Resource r = findResource(platform, new Resource() {
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeFailureHandlingTest.java b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeFailureHandlingTest.java
index 34732fd..5f493c9 100644
--- a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeFailureHandlingTest.java
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeFailureHandlingTest.java
@@ -331,6 +331,55 @@ public class ResourceUpgradeFailureHandlingTest extends ResourceUpgradeTestBase
});
}
+ @Test
+ public void testResourcesRevertedToOriginalStateAfterFailedUpgrade() throws Exception {
+ setCurrentServerSideInventory(new FakeServerInventory());
+
+ //let it all run in v1
+ executeTestWithPlugins(getAllDepsFor(TEST_V1_PLUGIN_NAME, PARENT_SIBLING_V1_PLUGIN_NAME),
+ new AbstractTestPayload(true, Collections.<ResType> emptyList()) {
+ public void test(Map<ResType, Set<Resource>> resourceUpgradeTestResources) {
+ }
+
+ public Expectations getExpectations(Mockery context) throws Exception {
+ return new Expectations() {
+ {
+ defineDefaultExpectations(this);
+ }
+ };
+ }
+ });
+
+ getCurrentServerSideInventory().setFailUpgrade(true);
+
+ //now let's run with v2 plugins and check the layout of the inventory
+ executeTestWithPlugins(getAllDepsFor(TEST_V2_PLUGIN_NAME, PARENT_SIBLING_V2_PLUGIN_NAME),
+ new AbstractTestPayload(false, ALL_TYPES) {
+
+ public void test(Map<ResType, Set<Resource>> resources) {
+ checkPresenceOfResourceTypes(resources, getExpectedResourceTypes());
+
+ checkNumberOfResources(resources, ROOT_TYPE, 1);
+ checkNumberOfResources(resources, PARENT_DEP_TYPE, 1);
+
+ //check that the resources are upgraded
+ checkResourcesNotUpgraded(resources.get(PARENT_DEP_SIBLING_TYPE), 1);
+ checkResourcesNotUpgraded(resources.get(PARENT_TYPE), 2);
+ checkResourcesNotUpgraded(resources.get(SIBLING_TYPE), 20);
+ checkResourcesNotUpgraded(resources.get(TEST_TYPE), 20);
+ }
+
+ public Expectations getExpectations(Mockery context) throws Exception {
+ return new Expectations() {
+ {
+ defineDefaultExpectations(this);
+ }
+ };
+ }
+ });
+ }
+
+
@SuppressWarnings("unchecked")
@Override
protected void defineDefaultExpectations(Expectations expectations) {
@@ -358,17 +407,17 @@ public class ResourceUpgradeFailureHandlingTest extends ResourceUpgradeTestBase
return deps;
}
- private static void checkPresenceOfResourceTypes(Map<ResType, Set<Resource>> resources, Set<ResType> expectedTypes) {
+ protected static void checkPresenceOfResourceTypes(Map<ResType, Set<Resource>> resources, Set<ResType> expectedTypes) {
for (ResType resType : expectedTypes) {
assertNotNull(resources.get(resType), "Expecting some resources of type " + resType);
}
}
- private static void checkNumberOfResources(Map<ResType, Set<Resource>> resources, ResType type, int count) {
+ protected static void checkNumberOfResources(Map<ResType, Set<Resource>> resources, ResType type, int count) {
assertEquals(resources.get(type).size(), count, "Unexpected number of " + type + " discovered.");
}
- private static void checkResourcesUpgraded(Set<Resource> resources, int expectedSize) {
+ protected static void checkResourcesUpgraded(Set<Resource> resources, int expectedSize) {
assertEquals(resources.size(), expectedSize, "The set of resources has unexpected size.");
for (Resource res : resources) {
assertTrue(res.getResourceKey().startsWith(UPGRADED_RESOURCE_KEY_PREFIX), "Resource " + res
@@ -381,7 +430,7 @@ public class ResourceUpgradeFailureHandlingTest extends ResourceUpgradeTestBase
}
}
- private static void checkResourcesNotUpgraded(Set<Resource> resources, int expectedSize) {
+ protected static void checkResourcesNotUpgraded(Set<Resource> resources, int expectedSize) {
assertEquals(resources.size(), expectedSize, "The set of resources has unexpected size.");
for(Resource res : resources) {
assertFalse(res.getResourceKey().startsWith(UPGRADED_RESOURCE_KEY_PREFIX), "Resource " + res
@@ -397,7 +446,7 @@ public class ResourceUpgradeFailureHandlingTest extends ResourceUpgradeTestBase
}
}
- private static void checkResourceFailedUpgrade(Resource resource) {
+ protected static void checkResourceFailedUpgrade(Resource resource) {
assertFalse(resource.getResourceKey().startsWith(UPGRADED_RESOURCE_KEY_PREFIX), "Resource " + resource
+ " seems to be upgraded even though it shouldn't.");
assertTrue(resource.getResourceErrors(ResourceErrorType.UPGRADE).size() == 1,
@@ -409,13 +458,13 @@ public class ResourceUpgradeFailureHandlingTest extends ResourceUpgradeTestBase
"A resource that failed to upgrade should be stopped.");
}
- private static void checkOthersUpgraded(Set<Resource> resources, Resource... failedResource) {
+ protected static void checkOthersUpgraded(Set<Resource> resources, Resource... failedResource) {
Set<Resource> others = new HashSet<Resource>(resources);
others.removeAll(Arrays.asList(failedResource));
checkResourcesUpgraded(others, others.size());
}
- private void addChildrenToFail(Resource parent, ResType childResType, int... childrenOrdinals) {
+ protected void addChildrenToFail(Resource parent, ResType childResType, int... childrenOrdinals) {
InventoryManager inventoryManager = PluginContainer.getInstance().getInventoryManager();
ResourceContainer parentContainer = inventoryManager.getResourceContainer(parent);
BaseResourceComponentInterface parentComponent = (BaseResourceComponentInterface) parentContainer
@@ -441,7 +490,7 @@ public class ResourceUpgradeFailureHandlingTest extends ResourceUpgradeTestBase
}
}
- private Resource findResourceWithOrdinal(ResType resType, int ordinal) {
+ protected Resource findResourceWithOrdinal(ResType resType, int ordinal) {
ResourceType resourceType = PluginContainer.getInstance().getPluginManager().getMetadataManager()
.getType(resType.getResourceTypeName(), resType.getResourceTypePluginName());
@@ -451,7 +500,7 @@ public class ResourceUpgradeFailureHandlingTest extends ResourceUpgradeTestBase
return findResourceWithOrdinal(resources, ordinal);
}
- private Resource findResourceWithOrdinal(Set<Resource> resources, int ordinal) {
+ protected Resource findResourceWithOrdinal(Set<Resource> resources, int ordinal) {
for (Resource r : resources) {
Configuration pluginConfig = r.getPluginConfiguration();
String ordinalString = pluginConfig.getSimpleValue("ordinal", null);
@@ -464,7 +513,7 @@ public class ResourceUpgradeFailureHandlingTest extends ResourceUpgradeTestBase
return null;
}
- private Set<Resource> filterResources(Set<Resource> resources, ResType resType) {
+ protected Set<Resource> filterResources(Set<Resource> resources, ResType resType) {
Set<Resource> ret = new HashSet<Resource>(resources);
Iterator<Resource> it = ret.iterator();
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeProgressHandlingTest.java b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeProgressHandlingTest.java
new file mode 100644
index 0000000..3234c30
--- /dev/null
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeProgressHandlingTest.java
@@ -0,0 +1,183 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.core.pc.upgrade;
+
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertEquals;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.jmock.Expectations;
+import org.jmock.Mockery;
+import org.testng.annotations.Test;
+
+import org.rhq.core.domain.resource.Resource;
+
+/**
+ *
+ *
+ * @author Lukas Krejci
+ */
+@Test
+public class ResourceUpgradeProgressHandlingTest extends ResourceUpgradeFailureHandlingTest {
+
+ private static final String BASE_PLUGIN_NAME = "/resource-upgrade-test-plugin-multi-base-1.0.0.jar";
+ private static final String PARENT_DEP_V1_PLUGIN_NAME = "/resource-upgrade-test-plugin-multi-parentdep-1.0.0.jar";
+ private static final String PARENT_DEP_V2_PLUGIN_NAME = "/resource-upgrade-test-plugin-multi-parentdep-2.0.0.jar";
+ private static final String ROOT_PLUGIN_NAME = "/resource-upgrade-test-plugin-multi-root-1.0.0.jar";
+ private static final String UPGRADE_PROGRESS_PLUGIN_V1_FILENAME = "/resource-upgrade-test-plugin-progress-test-1.0.0.jar";
+ private static final String UPGRADE_PROGRESS_PLUGIN_V2_FILENAME = "/resource-upgrade-test-plugin-progress-test-2.0.0.jar";
+ private static final String UPGRADE_DUPLICATE_PLUGIN_V1_FILENAME = "/resource-upgrade-test-plugin-duplicate-test-1.0.0.jar";
+ private static final String UPGRADE_DUPLICATE_PLUGIN_V2_FILENAME = "/resource-upgrade-test-plugin-duplicate-test-2.0.0.jar";
+
+ private static final ResType TEST_TYPE = new ResType("TestResource", "test");
+ private static final ResType PARENT_DEP_TYPE = new ResType("ParentDependency", "parentdep");
+ private static final ResType ROOT_TYPE = new ResType("Root", "root");
+
+ private static final HashMap<String, List<String>> DEPS;
+
+ static {
+ DEPS = new HashMap<String, List<String>>();
+
+ DEPS.put(BASE_PLUGIN_NAME, Collections.<String> emptyList());
+ DEPS.put(PARENT_DEP_V1_PLUGIN_NAME, Arrays.asList(BASE_PLUGIN_NAME, ROOT_PLUGIN_NAME));
+ DEPS.put(PARENT_DEP_V2_PLUGIN_NAME, DEPS.get(PARENT_DEP_V1_PLUGIN_NAME));
+ DEPS.put(ROOT_PLUGIN_NAME, Arrays.asList(BASE_PLUGIN_NAME));
+ DEPS.put(UPGRADE_PROGRESS_PLUGIN_V1_FILENAME, Arrays.asList(BASE_PLUGIN_NAME, ROOT_PLUGIN_NAME, PARENT_DEP_V1_PLUGIN_NAME));
+ DEPS.put(UPGRADE_PROGRESS_PLUGIN_V2_FILENAME, Arrays.asList(BASE_PLUGIN_NAME, ROOT_PLUGIN_NAME, PARENT_DEP_V2_PLUGIN_NAME));
+ DEPS.put(UPGRADE_DUPLICATE_PLUGIN_V1_FILENAME, Arrays.asList(BASE_PLUGIN_NAME, ROOT_PLUGIN_NAME, PARENT_DEP_V1_PLUGIN_NAME));
+ DEPS.put(UPGRADE_DUPLICATE_PLUGIN_V2_FILENAME, Arrays.asList(BASE_PLUGIN_NAME, ROOT_PLUGIN_NAME, PARENT_DEP_V2_PLUGIN_NAME));
+ }
+
+ private Set<String> getAllDepsFor(String... plugins) {
+ HashSet<String> deps = new HashSet<String>();
+ for (String plugin : plugins) {
+ deps.add(plugin);
+ deps.addAll(DEPS.get(plugin));
+ }
+
+ return deps;
+ }
+
+ @Override
+ protected Collection<String> getRequiredPlugins() {
+ return Arrays.asList(BASE_PLUGIN_NAME, ROOT_PLUGIN_NAME, PARENT_DEP_V1_PLUGIN_NAME, PARENT_DEP_V2_PLUGIN_NAME,
+ UPGRADE_PROGRESS_PLUGIN_V1_FILENAME, UPGRADE_PROGRESS_PLUGIN_V2_FILENAME, UPGRADE_DUPLICATE_PLUGIN_V1_FILENAME,
+ UPGRADE_DUPLICATE_PLUGIN_V2_FILENAME);
+ }
+
+ @Test
+ public void testParentResourceStartedUpgradedWhenChildResourceBeingUpgraded() throws Exception {
+ setCurrentServerSideInventory(new FakeServerInventory());
+
+ executeTestWithPlugins(getAllDepsFor(UPGRADE_PROGRESS_PLUGIN_V1_FILENAME),
+ new AbstractTestPayload(true, Collections.<ResType> emptyList()) {
+ public void test(Map<ResType, Set<Resource>> resourceUpgradeTestResources) {
+ //in here we set up the failures that are going to happen when
+ //the v2 plugins are run
+
+ Resource parent = findResourceWithOrdinal(PARENT_DEP_TYPE, 0);
+ assertNotNull(parent, "Failed to find the parent.");
+ }
+
+ public Expectations getExpectations(Mockery context) throws Exception {
+ return new Expectations() {
+ {
+ defineDefaultExpectations(this);
+ }
+ };
+ }
+ });
+
+ //the upgrade progress plugin is set to check that the parent resource key
+ //has been upgraded during its upgrade method, so we just need to check here
+ //that everything got upgraded. If it was not, it'd mean that the the progress
+ //plugin failed the upgrade because it didn't see its parent upgraded.
+ executeTestWithPlugins(getAllDepsFor(UPGRADE_PROGRESS_PLUGIN_V2_FILENAME),
+ new AbstractTestPayload(false, Arrays.asList(TEST_TYPE, PARENT_DEP_TYPE)) {
+ public void test(Map<ResType, Set<Resource>> resourceUpgradeTestResources) {
+ checkResourcesUpgraded(resourceUpgradeTestResources.get(PARENT_DEP_TYPE), 1);
+ checkResourcesUpgraded(resourceUpgradeTestResources.get(TEST_TYPE), 2);
+ }
+
+ public Expectations getExpectations(Mockery context) throws Exception {
+ return new Expectations() {
+ {
+ defineDefaultExpectations(this);
+ }
+ };
+ }
+ });
+ }
+
+ @Test
+ public void testDuplicitResourceKeysHandledCorrectly() throws Exception {
+ setCurrentServerSideInventory(new FakeServerInventory());
+
+ executeTestWithPlugins(getAllDepsFor(UPGRADE_DUPLICATE_PLUGIN_V1_FILENAME),
+ new AbstractTestPayload(true, Arrays.asList(PARENT_DEP_TYPE, TEST_TYPE)) {
+
+ public void test(Map<ResType, Set<Resource>> resourceUpgradeTestResources) {
+ //there's not much to check with the v1 plugins. let's just check all the
+ //resources have been discovered
+ assertEquals(resourceUpgradeTestResources.get(PARENT_DEP_TYPE).size(), 1, "The V1 inventory should have 1 parent.");
+ assertEquals(resourceUpgradeTestResources.get(TEST_TYPE).size(), 2, "The V1 inventory should have 2 test resources.");
+ }
+
+ public Expectations getExpectations(Mockery context) throws Exception {
+ return new Expectations() {
+ {
+ defineDefaultExpectations(this);
+ }
+ };
+ }
+ });
+
+ //now the V2 test resource is set to create 2 resources with the same resource keys.
+ //the upgrade should therefore fail.
+ executeTestWithPlugins(getAllDepsFor(UPGRADE_DUPLICATE_PLUGIN_V2_FILENAME),
+ new AbstractTestPayload(false, Arrays.asList(PARENT_DEP_TYPE, TEST_TYPE)) {
+ public void test(Map<ResType, Set<Resource>> resourceUpgradeTestResources) {
+ checkResourcesUpgraded(resourceUpgradeTestResources.get(PARENT_DEP_TYPE), 1);
+
+ checkResourcesNotUpgraded(resourceUpgradeTestResources.get(TEST_TYPE), 2);
+
+ for(Resource r : resourceUpgradeTestResources.get(TEST_TYPE)) {
+ checkResourceFailedUpgrade(r);
+ }
+ }
+
+ public Expectations getExpectations(Mockery context) throws Exception {
+ return new Expectations() {
+ {
+ defineDefaultExpectations(this);
+ }
+ };
+ }
+ });
+ }
+}
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeTestBase.java b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeTestBase.java
index afe3982..e0526a1 100644
--- a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeTestBase.java
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeTestBase.java
@@ -358,7 +358,9 @@ public abstract class ResourceUpgradeTestBase {
try {
//give the pc the time to finish resource upgrade
- Thread.sleep(1000);
+ while (!PluginContainer.getInstance().isStarted()) {
+ Thread.sleep(500);
+ }
//execute full discovery
InventoryManager im = PluginContainer.getInstance().getInventoryManager();
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/duplicate/v1/rhq-plugin.xml b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/duplicate/v1/rhq-plugin.xml
new file mode 100644
index 0000000..58db405
--- /dev/null
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/duplicate/v1/rhq-plugin.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<plugin name="test"
+ displayName="Resource Upgrade Multi Test"
+ description="Resource Upgrade Multi Test"
+ package="org.rhq.core.pc.upgrade.plugins.multi.base"
+ version="1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:xmlns:rhq-plugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
+
+ <depends plugin="base" useClasses="true"/>
+ <depends plugin="parentdep"/>
+
+ <server name="TestResource"
+ discovery="BaseDiscoveryComponent"
+ class="BaseResourceComponent">
+
+ <runs-inside>
+ <parent-resource-type name="ParentDependency" plugin="parentdep"/>
+ </runs-inside>
+
+ <plugin-configuration>
+ <c:simple-property name="count" default="2" />
+ <c:simple-property name="key" default="test-resource-%n,parent-%p" />
+ <c:simple-property name="upgradedKey" default="UPGRADED-test-resource-duplicate,parent-%p" />
+ </plugin-configuration>
+ </server>
+
+</plugin>
+
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/duplicate/v2/rhq-plugin.xml b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/duplicate/v2/rhq-plugin.xml
new file mode 100644
index 0000000..81240d9
--- /dev/null
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/duplicate/v2/rhq-plugin.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<plugin name="test"
+ displayName="Resource Upgrade Multi Test"
+ description="Resource Upgrade Multi Test"
+ package="org.rhq.core.pc.upgrade.plugins.multi.base"
+ version="1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:xmlns:rhq-plugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
+
+ <depends plugin="base" useClasses="true"/>
+ <depends plugin="parentdep"/>
+
+ <server name="TestResource"
+ discovery="BaseUpgradingDiscoveryComponent"
+ class="BaseResourceComponent">
+
+ <runs-inside>
+ <parent-resource-type name="ParentDependency" plugin="parentdep"/>
+ </runs-inside>
+
+ <plugin-configuration>
+ <c:simple-property name="count" default="2" />
+ <c:simple-property name="key" default="UPGRADED-test-resource-duplicate,parent-%p" />
+ </plugin-configuration>
+ </server>
+
+</plugin>
+
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/multi/base/BaseUpgradingDiscoveryComponent.java b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/multi/base/BaseUpgradingDiscoveryComponent.java
index 5b8af94..a1acf50 100644
--- a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/multi/base/BaseUpgradingDiscoveryComponent.java
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/multi/base/BaseUpgradingDiscoveryComponent.java
@@ -40,7 +40,7 @@ public class BaseUpgradingDiscoveryComponent<T extends BaseResourceComponent> ex
int ordinal = pluginConfig.getSimple("ordinal").getIntegerValue();
int parentOrdinal = parent == null ? 0 : parent.getOrdinal();
- boolean fail = Boolean.getBoolean(pluginConfig.getSimpleValue("failUpgrade", "false"));
+ boolean fail = Boolean.parseBoolean(pluginConfig.getSimpleValue("failUpgrade", "false"));
if (!fail && parent != null) {
String typeName = inventoriedResource.getResourceType().getName();
@@ -52,7 +52,17 @@ public class BaseUpgradingDiscoveryComponent<T extends BaseResourceComponent> ex
if (fail) {
throw new RuntimeException("Failing the resource upgrade purposefully.");
}
-
+
+ boolean checkParentUpgraded = Boolean.parseBoolean(pluginConfig.getSimpleValue("checkParentUpgraded", "false"));
+
+ if (checkParentUpgraded) {
+ if (!inventoriedResource.getParentResourceContext().getResourceKey().startsWith("UPGRADED")) {
+ throw new RuntimeException("The parent resource ["
+ + inventoriedResource.getParentResourceContext().getResourceKey()
+ + "] doesn't seem like it's upgraded but this resource expects it to be.");
+ }
+ }
+
String newKey = pluginConfig.getSimpleValue("upgradedKey", null);
if (newKey == null) {
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v1/rhq-plugin.xml b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v1/rhq-plugin.xml
new file mode 100644
index 0000000..9649422
--- /dev/null
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v1/rhq-plugin.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<plugin name="test"
+ displayName="Resource Upgrade Multi Test"
+ description="Resource Upgrade Multi Test"
+ package="org.rhq.core.pc.upgrade.plugins.multi.base"
+ version="1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:xmlns:rhq-plugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
+
+ <depends plugin="base" useClasses="true"/>
+ <depends plugin="parentdep"/>
+
+ <server name="TestResource"
+ discovery="BaseDiscoveryComponent"
+ class="BaseResourceComponent">
+
+ <runs-inside>
+ <parent-resource-type name="ParentDependency" plugin="parentdep"/>
+ </runs-inside>
+
+ <plugin-configuration>
+ <c:simple-property name="count" default="1" />
+ <c:simple-property name="key" default="test-resource-%n,parent-%p" />
+ <c:simple-property name="upgradedKey" default="UPGRADED-test-resource-%n,parent-%p" />
+ <c:simple-property name="checkParentUpgraded" default="true" />
+ </plugin-configuration>
+ </server>
+
+</plugin>
+
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v2/rhq-plugin.xml b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v2/rhq-plugin.xml
new file mode 100644
index 0000000..b909026
--- /dev/null
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v2/rhq-plugin.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<plugin name="test"
+ displayName="Resource Upgrade Multi Test"
+ description="Resource Upgrade Multi Test"
+ package="org.rhq.core.pc.upgrade.plugins.multi.base"
+ version="1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:xmlns:rhq-plugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
+
+ <depends plugin="base" useClasses="true"/>
+ <depends plugin="parentdep"/>
+
+ <server name="TestResource"
+ discovery="BaseUpgradingDiscoveryComponent"
+ class="BaseResourceComponent">
+
+ <runs-inside>
+ <parent-resource-type name="ParentDependency" plugin="parentdep"/>
+ </runs-inside>
+
+ <plugin-configuration>
+ <c:simple-property name="count" default="2" />
+ <c:simple-property name="key" default="UPGRADED-test-resource-%n,parent-%p" />
+ </plugin-configuration>
+ </server>
+
+</plugin>
+
13 years
[rhq] 6 commits - modules/core
by lkrejci
modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/upgrade/ResourceUpgradeRequest.java | 30 +
modules/core/plugin-container/pom.xml | 40 ++
modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java | 189 +++++-----
modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java | 140 +++++--
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java | 145 ++++---
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeFailureHandlingTest.java | 69 +++
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeProgressHandlingTest.java | 183 +++++++++
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeTestBase.java | 4
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/duplicate/v1/rhq-plugin.xml | 31 +
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/duplicate/v2/rhq-plugin.xml | 30 +
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/multi/base/BaseUpgradingDiscoveryComponent.java | 14
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v1/rhq-plugin.xml | 32 +
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v2/rhq-plugin.xml | 30 +
13 files changed, 756 insertions(+), 181 deletions(-)
New commits:
commit 6ea278d85a438acc216a33dcd831d53e34e3c85a
Merge: 241f8a1 3ff7587
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Wed May 18 15:39:23 2011 +0200
Merge branch 'master-resource-upgrade-fixes'
commit 3ff7587af61a2ee37ad28226f44102528d509f9f
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Wed May 18 15:30:04 2011 +0200
Adding tests for resource upgrade revert to original state after failed upgrade and duplicate resource key handling.
diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml
index 7a264f8..fd14685 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -315,6 +315,26 @@
<fileset dir="${project.build.testOutputDirectory}/tmp/progress/v2" includes="**/*.class,**/rhq-plugin.xml" />
</jar>
+ <copy toDir="${project.build.testOutputDirectory}/tmp/duplicate/v1/META-INF">
+ <fileset file="${project.build.testSourceDirectory}/org/rhq/core/pc/upgrade/plugins/duplicate/v1/rhq-plugin.xml" />
+ </copy>
+ <!-- <copy toDir="${project.build.testOutputDirectory}/tmp/duplicate/v1/org/rhq/core/pc/upgrade/plugins/duplicate/v1">
+ <fileset file="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/plugins/duplicate/v1/*.class" />
+ </copy> -->
+ <jar destfile="${project.build.testOutputDirectory}/resource-upgrade-test-plugin-duplicate-test-1.0.0.jar">
+ <fileset dir="${project.build.testOutputDirectory}/tmp/duplicate/v1" includes="**/*.class,**/rhq-plugin.xml" />
+ </jar>
+
+ <copy toDir="${project.build.testOutputDirectory}/tmp/duplicate/v2/META-INF">
+ <fileset file="${project.build.testSourceDirectory}/org/rhq/core/pc/upgrade/plugins/duplicate/v2/rhq-plugin.xml" />
+ </copy>
+ <!-- <copy toDir="${project.build.testOutputDirectory}/tmp/duplicate/v2/org/rhq/core/pc/upgrade/plugins/duplicate/v2">
+ <fileset file="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/plugins/duplicate/v2/*.class" />
+ </copy> -->
+ <jar destfile="${project.build.testOutputDirectory}/resource-upgrade-test-plugin-duplicate-test-2.0.0.jar">
+ <fileset dir="${project.build.testOutputDirectory}/tmp/duplicate/v2" includes="**/*.class,**/rhq-plugin.xml" />
+ </jar>
+
<delete dir="${project.build.testOutputDirectory}/tmp" />
</tasks>
</configuration>
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java
index 793c0f6..d3b54aa 100644
--- a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java
@@ -59,7 +59,8 @@ public class FakeServerInventory {
private Map<String, Resource> resourceStore = new HashMap<String, Resource>();
private int counter;
private boolean failing;
-
+ private boolean failUpgrade;
+
private static final Comparator<Resource> ID_COMPARATOR = new Comparator<Resource>() {
public int compare(Resource o1, Resource o2) {
return o1.getId() - o2.getId();
@@ -122,6 +123,10 @@ public class FakeServerInventory {
synchronized(FakeServerInventory.this) {
throwIfFailing();
+ if (failUpgrade) {
+ throw new RuntimeException("Failing the upgrade purposefully.");
+ }
+
Set<ResourceUpgradeRequest> requests = (Set<ResourceUpgradeRequest>) invocation.getParameter(0);
Set<ResourceUpgradeResponse> responses = new HashSet<ResourceUpgradeResponse>();
@@ -188,6 +193,14 @@ public class FakeServerInventory {
this.failing = failing;
}
+ public synchronized boolean isFailUpgrade() {
+ return failUpgrade;
+ }
+
+ public synchronized void setFailUpgrade(boolean failUpgrade) {
+ this.failUpgrade = failUpgrade;
+ }
+
@SuppressWarnings("serial")
public synchronized Set<Resource> findResourcesByType(final ResourceType type) {
Set<Resource> result = new HashSet<Resource>();
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeFailureHandlingTest.java b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeFailureHandlingTest.java
index f68ee01..5f493c9 100644
--- a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeFailureHandlingTest.java
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeFailureHandlingTest.java
@@ -331,6 +331,55 @@ public class ResourceUpgradeFailureHandlingTest extends ResourceUpgradeTestBase
});
}
+ @Test
+ public void testResourcesRevertedToOriginalStateAfterFailedUpgrade() throws Exception {
+ setCurrentServerSideInventory(new FakeServerInventory());
+
+ //let it all run in v1
+ executeTestWithPlugins(getAllDepsFor(TEST_V1_PLUGIN_NAME, PARENT_SIBLING_V1_PLUGIN_NAME),
+ new AbstractTestPayload(true, Collections.<ResType> emptyList()) {
+ public void test(Map<ResType, Set<Resource>> resourceUpgradeTestResources) {
+ }
+
+ public Expectations getExpectations(Mockery context) throws Exception {
+ return new Expectations() {
+ {
+ defineDefaultExpectations(this);
+ }
+ };
+ }
+ });
+
+ getCurrentServerSideInventory().setFailUpgrade(true);
+
+ //now let's run with v2 plugins and check the layout of the inventory
+ executeTestWithPlugins(getAllDepsFor(TEST_V2_PLUGIN_NAME, PARENT_SIBLING_V2_PLUGIN_NAME),
+ new AbstractTestPayload(false, ALL_TYPES) {
+
+ public void test(Map<ResType, Set<Resource>> resources) {
+ checkPresenceOfResourceTypes(resources, getExpectedResourceTypes());
+
+ checkNumberOfResources(resources, ROOT_TYPE, 1);
+ checkNumberOfResources(resources, PARENT_DEP_TYPE, 1);
+
+ //check that the resources are upgraded
+ checkResourcesNotUpgraded(resources.get(PARENT_DEP_SIBLING_TYPE), 1);
+ checkResourcesNotUpgraded(resources.get(PARENT_TYPE), 2);
+ checkResourcesNotUpgraded(resources.get(SIBLING_TYPE), 20);
+ checkResourcesNotUpgraded(resources.get(TEST_TYPE), 20);
+ }
+
+ public Expectations getExpectations(Mockery context) throws Exception {
+ return new Expectations() {
+ {
+ defineDefaultExpectations(this);
+ }
+ };
+ }
+ });
+ }
+
+
@SuppressWarnings("unchecked")
@Override
protected void defineDefaultExpectations(Expectations expectations) {
@@ -358,13 +407,13 @@ public class ResourceUpgradeFailureHandlingTest extends ResourceUpgradeTestBase
return deps;
}
- private static void checkPresenceOfResourceTypes(Map<ResType, Set<Resource>> resources, Set<ResType> expectedTypes) {
+ protected static void checkPresenceOfResourceTypes(Map<ResType, Set<Resource>> resources, Set<ResType> expectedTypes) {
for (ResType resType : expectedTypes) {
assertNotNull(resources.get(resType), "Expecting some resources of type " + resType);
}
}
- private static void checkNumberOfResources(Map<ResType, Set<Resource>> resources, ResType type, int count) {
+ protected static void checkNumberOfResources(Map<ResType, Set<Resource>> resources, ResType type, int count) {
assertEquals(resources.get(type).size(), count, "Unexpected number of " + type + " discovered.");
}
@@ -381,7 +430,7 @@ public class ResourceUpgradeFailureHandlingTest extends ResourceUpgradeTestBase
}
}
- private static void checkResourcesNotUpgraded(Set<Resource> resources, int expectedSize) {
+ protected static void checkResourcesNotUpgraded(Set<Resource> resources, int expectedSize) {
assertEquals(resources.size(), expectedSize, "The set of resources has unexpected size.");
for(Resource res : resources) {
assertFalse(res.getResourceKey().startsWith(UPGRADED_RESOURCE_KEY_PREFIX), "Resource " + res
@@ -397,7 +446,7 @@ public class ResourceUpgradeFailureHandlingTest extends ResourceUpgradeTestBase
}
}
- private static void checkResourceFailedUpgrade(Resource resource) {
+ protected static void checkResourceFailedUpgrade(Resource resource) {
assertFalse(resource.getResourceKey().startsWith(UPGRADED_RESOURCE_KEY_PREFIX), "Resource " + resource
+ " seems to be upgraded even though it shouldn't.");
assertTrue(resource.getResourceErrors(ResourceErrorType.UPGRADE).size() == 1,
@@ -409,13 +458,13 @@ public class ResourceUpgradeFailureHandlingTest extends ResourceUpgradeTestBase
"A resource that failed to upgrade should be stopped.");
}
- private static void checkOthersUpgraded(Set<Resource> resources, Resource... failedResource) {
+ protected static void checkOthersUpgraded(Set<Resource> resources, Resource... failedResource) {
Set<Resource> others = new HashSet<Resource>(resources);
others.removeAll(Arrays.asList(failedResource));
checkResourcesUpgraded(others, others.size());
}
- private void addChildrenToFail(Resource parent, ResType childResType, int... childrenOrdinals) {
+ protected void addChildrenToFail(Resource parent, ResType childResType, int... childrenOrdinals) {
InventoryManager inventoryManager = PluginContainer.getInstance().getInventoryManager();
ResourceContainer parentContainer = inventoryManager.getResourceContainer(parent);
BaseResourceComponentInterface parentComponent = (BaseResourceComponentInterface) parentContainer
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeProgressHandlingTest.java b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeProgressHandlingTest.java
index 0e3bd35..3234c30 100644
--- a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeProgressHandlingTest.java
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeProgressHandlingTest.java
@@ -20,6 +20,7 @@
package org.rhq.core.pc.upgrade;
import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertEquals;
import java.util.Arrays;
import java.util.Collection;
@@ -50,6 +51,8 @@ public class ResourceUpgradeProgressHandlingTest extends ResourceUpgradeFailureH
private static final String ROOT_PLUGIN_NAME = "/resource-upgrade-test-plugin-multi-root-1.0.0.jar";
private static final String UPGRADE_PROGRESS_PLUGIN_V1_FILENAME = "/resource-upgrade-test-plugin-progress-test-1.0.0.jar";
private static final String UPGRADE_PROGRESS_PLUGIN_V2_FILENAME = "/resource-upgrade-test-plugin-progress-test-2.0.0.jar";
+ private static final String UPGRADE_DUPLICATE_PLUGIN_V1_FILENAME = "/resource-upgrade-test-plugin-duplicate-test-1.0.0.jar";
+ private static final String UPGRADE_DUPLICATE_PLUGIN_V2_FILENAME = "/resource-upgrade-test-plugin-duplicate-test-2.0.0.jar";
private static final ResType TEST_TYPE = new ResType("TestResource", "test");
private static final ResType PARENT_DEP_TYPE = new ResType("ParentDependency", "parentdep");
@@ -66,6 +69,8 @@ public class ResourceUpgradeProgressHandlingTest extends ResourceUpgradeFailureH
DEPS.put(ROOT_PLUGIN_NAME, Arrays.asList(BASE_PLUGIN_NAME));
DEPS.put(UPGRADE_PROGRESS_PLUGIN_V1_FILENAME, Arrays.asList(BASE_PLUGIN_NAME, ROOT_PLUGIN_NAME, PARENT_DEP_V1_PLUGIN_NAME));
DEPS.put(UPGRADE_PROGRESS_PLUGIN_V2_FILENAME, Arrays.asList(BASE_PLUGIN_NAME, ROOT_PLUGIN_NAME, PARENT_DEP_V2_PLUGIN_NAME));
+ DEPS.put(UPGRADE_DUPLICATE_PLUGIN_V1_FILENAME, Arrays.asList(BASE_PLUGIN_NAME, ROOT_PLUGIN_NAME, PARENT_DEP_V1_PLUGIN_NAME));
+ DEPS.put(UPGRADE_DUPLICATE_PLUGIN_V2_FILENAME, Arrays.asList(BASE_PLUGIN_NAME, ROOT_PLUGIN_NAME, PARENT_DEP_V2_PLUGIN_NAME));
}
private Set<String> getAllDepsFor(String... plugins) {
@@ -81,13 +86,14 @@ public class ResourceUpgradeProgressHandlingTest extends ResourceUpgradeFailureH
@Override
protected Collection<String> getRequiredPlugins() {
return Arrays.asList(BASE_PLUGIN_NAME, ROOT_PLUGIN_NAME, PARENT_DEP_V1_PLUGIN_NAME, PARENT_DEP_V2_PLUGIN_NAME,
- UPGRADE_PROGRESS_PLUGIN_V1_FILENAME, UPGRADE_PROGRESS_PLUGIN_V2_FILENAME);
+ UPGRADE_PROGRESS_PLUGIN_V1_FILENAME, UPGRADE_PROGRESS_PLUGIN_V2_FILENAME, UPGRADE_DUPLICATE_PLUGIN_V1_FILENAME,
+ UPGRADE_DUPLICATE_PLUGIN_V2_FILENAME);
}
@Test
public void testParentResourceStartedUpgradedWhenChildResourceBeingUpgraded() throws Exception {
setCurrentServerSideInventory(new FakeServerInventory());
-
+
executeTestWithPlugins(getAllDepsFor(UPGRADE_PROGRESS_PLUGIN_V1_FILENAME),
new AbstractTestPayload(true, Collections.<ResType> emptyList()) {
public void test(Map<ResType, Set<Resource>> resourceUpgradeTestResources) {
@@ -107,6 +113,10 @@ public class ResourceUpgradeProgressHandlingTest extends ResourceUpgradeFailureH
}
});
+ //the upgrade progress plugin is set to check that the parent resource key
+ //has been upgraded during its upgrade method, so we just need to check here
+ //that everything got upgraded. If it was not, it'd mean that the the progress
+ //plugin failed the upgrade because it didn't see its parent upgraded.
executeTestWithPlugins(getAllDepsFor(UPGRADE_PROGRESS_PLUGIN_V2_FILENAME),
new AbstractTestPayload(false, Arrays.asList(TEST_TYPE, PARENT_DEP_TYPE)) {
public void test(Map<ResType, Set<Resource>> resourceUpgradeTestResources) {
@@ -125,13 +135,49 @@ public class ResourceUpgradeProgressHandlingTest extends ResourceUpgradeFailureH
}
@Test
- public void testDuplicitResourceKeysHandledCorrectly() {
- //TODO implement
- }
-
- @Test
- public void testResourcesRevertedToOriginalStateAfterFailedUpgrade() {
- //TODO implement
- }
+ public void testDuplicitResourceKeysHandledCorrectly() throws Exception {
+ setCurrentServerSideInventory(new FakeServerInventory());
+
+ executeTestWithPlugins(getAllDepsFor(UPGRADE_DUPLICATE_PLUGIN_V1_FILENAME),
+ new AbstractTestPayload(true, Arrays.asList(PARENT_DEP_TYPE, TEST_TYPE)) {
+
+ public void test(Map<ResType, Set<Resource>> resourceUpgradeTestResources) {
+ //there's not much to check with the v1 plugins. let's just check all the
+ //resources have been discovered
+ assertEquals(resourceUpgradeTestResources.get(PARENT_DEP_TYPE).size(), 1, "The V1 inventory should have 1 parent.");
+ assertEquals(resourceUpgradeTestResources.get(TEST_TYPE).size(), 2, "The V1 inventory should have 2 test resources.");
+ }
+
+ public Expectations getExpectations(Mockery context) throws Exception {
+ return new Expectations() {
+ {
+ defineDefaultExpectations(this);
+ }
+ };
+ }
+ });
+ //now the V2 test resource is set to create 2 resources with the same resource keys.
+ //the upgrade should therefore fail.
+ executeTestWithPlugins(getAllDepsFor(UPGRADE_DUPLICATE_PLUGIN_V2_FILENAME),
+ new AbstractTestPayload(false, Arrays.asList(PARENT_DEP_TYPE, TEST_TYPE)) {
+ public void test(Map<ResType, Set<Resource>> resourceUpgradeTestResources) {
+ checkResourcesUpgraded(resourceUpgradeTestResources.get(PARENT_DEP_TYPE), 1);
+
+ checkResourcesNotUpgraded(resourceUpgradeTestResources.get(TEST_TYPE), 2);
+
+ for(Resource r : resourceUpgradeTestResources.get(TEST_TYPE)) {
+ checkResourceFailedUpgrade(r);
+ }
+ }
+
+ public Expectations getExpectations(Mockery context) throws Exception {
+ return new Expectations() {
+ {
+ defineDefaultExpectations(this);
+ }
+ };
+ }
+ });
+ }
}
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/duplicate/v1/rhq-plugin.xml b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/duplicate/v1/rhq-plugin.xml
new file mode 100644
index 0000000..58db405
--- /dev/null
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/duplicate/v1/rhq-plugin.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<plugin name="test"
+ displayName="Resource Upgrade Multi Test"
+ description="Resource Upgrade Multi Test"
+ package="org.rhq.core.pc.upgrade.plugins.multi.base"
+ version="1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:xmlns:rhq-plugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
+
+ <depends plugin="base" useClasses="true"/>
+ <depends plugin="parentdep"/>
+
+ <server name="TestResource"
+ discovery="BaseDiscoveryComponent"
+ class="BaseResourceComponent">
+
+ <runs-inside>
+ <parent-resource-type name="ParentDependency" plugin="parentdep"/>
+ </runs-inside>
+
+ <plugin-configuration>
+ <c:simple-property name="count" default="2" />
+ <c:simple-property name="key" default="test-resource-%n,parent-%p" />
+ <c:simple-property name="upgradedKey" default="UPGRADED-test-resource-duplicate,parent-%p" />
+ </plugin-configuration>
+ </server>
+
+</plugin>
+
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/duplicate/v2/rhq-plugin.xml b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/duplicate/v2/rhq-plugin.xml
new file mode 100644
index 0000000..81240d9
--- /dev/null
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/duplicate/v2/rhq-plugin.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<plugin name="test"
+ displayName="Resource Upgrade Multi Test"
+ description="Resource Upgrade Multi Test"
+ package="org.rhq.core.pc.upgrade.plugins.multi.base"
+ version="1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:xmlns:rhq-plugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
+
+ <depends plugin="base" useClasses="true"/>
+ <depends plugin="parentdep"/>
+
+ <server name="TestResource"
+ discovery="BaseUpgradingDiscoveryComponent"
+ class="BaseResourceComponent">
+
+ <runs-inside>
+ <parent-resource-type name="ParentDependency" plugin="parentdep"/>
+ </runs-inside>
+
+ <plugin-configuration>
+ <c:simple-property name="count" default="2" />
+ <c:simple-property name="key" default="UPGRADED-test-resource-duplicate,parent-%p" />
+ </plugin-configuration>
+ </server>
+
+</plugin>
+
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v1/rhq-plugin.xml b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v1/rhq-plugin.xml
index 57c9010..9649422 100644
--- a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v1/rhq-plugin.xml
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v1/rhq-plugin.xml
@@ -22,8 +22,8 @@
<plugin-configuration>
<c:simple-property name="count" default="1" />
- <c:simple-property name="key" default="test-resource-parent-%n,parent-%p" />
- <c:simple-property name="upgradedKey" default="UPGRADED-test-resource-parent-%n,parent-%p" />
+ <c:simple-property name="key" default="test-resource-%n,parent-%p" />
+ <c:simple-property name="upgradedKey" default="UPGRADED-test-resource-%n,parent-%p" />
<c:simple-property name="checkParentUpgraded" default="true" />
</plugin-configuration>
</server>
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v2/rhq-plugin.xml b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v2/rhq-plugin.xml
index b4691ba..b909026 100644
--- a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v2/rhq-plugin.xml
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v2/rhq-plugin.xml
@@ -22,7 +22,7 @@
<plugin-configuration>
<c:simple-property name="count" default="2" />
- <c:simple-property name="key" default="UPGRADED-test-resource-parent-%n,parent-%p" />
+ <c:simple-property name="key" default="UPGRADED-test-resource-%n,parent-%p" />
</plugin-configuration>
</server>
commit 0be47f7781ad9be02d583ee42517ed91a268e2c7
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Wed May 18 15:24:07 2011 +0200
BZ 704028 - Rethrow the exception after failed upgrade merge with
the server so that stuff gets properly rolledback. Also slightly improved
logging.
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
index 9a98f81..d29cd56 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
@@ -1236,7 +1236,7 @@ public class InventoryManager extends AgentService implements ContainerService,
return resourceContainer.updateAvailability(availabilityType);
}
- public void mergeResourcesFromUpgrade(Set<ResourceUpgradeRequest> upgradeRequests) throws PluginContainerException {
+ public void mergeResourcesFromUpgrade(Set<ResourceUpgradeRequest> upgradeRequests) throws Exception {
Set<ResourceUpgradeResponse> serverUpdates = null;
try {
ServerServices serverServices = this.configuration.getServerServices();
@@ -1247,6 +1247,7 @@ public class InventoryManager extends AgentService implements ContainerService,
}
} catch (Exception e) {
log.error("Failed to process resource upgrades on the server.", e);
+ throw e;
}
if (serverUpdates != null) {
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java
index e8ca94e..cee582e 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java
@@ -152,9 +152,21 @@ public class ResourceUpgradeDelegate {
Resource resource = container.getResource();
String upgradeErrors = null;
if ((upgradeErrors = checkUpgradeValid(resource, request)) != null) {
+ //the resource is in its upgraded state but it's going to get reverted back to the original state
+ //in the code below. Let's use the original resource for the error message so that we don't confuse
+ //the user.
+ for(ResourceUpgradeRequest orig : originalResourceData) {
+ if (orig.equals(request)) {
+ orig.updateResource(resource);
+ break;
+ }
+ }
String errorString = "Upgrading the resource [" + resource + "] using these updates [" + request
+ "] would render the inventory invalid because of the following reasons: " + upgradeErrors;
+ //now switch the resource back to the upgraded state for the rest of the code below again
+ request.updateResource(resource);
+
log.error(errorString);
IllegalStateException ex = new IllegalStateException(errorString);
@@ -291,7 +303,7 @@ public class ResourceUpgradeDelegate {
StringBuilder s = new StringBuilder();
if (!checkResourceKeyUniqueAmongSiblings(resource, upgradeReport)) {
- s.append("\nAnother inventoried sibling resource of the same type already has the proposed resource key.");
+ s.append("\nAnother inventoried sibling resource of the same type already has the proposed resource key or would have it after the upgrade.");
}
return s.length() > 0 ? s.toString() : null;
commit db84c22836d6e1654fd704a1faf889c3affc21cf
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Tue May 17 17:40:00 2011 +0200
Adding the new ResourceUpgradeProgressHandlingTest to:
a) test that parent resources appear upgraded during upgrade of their children
b) test that potential duplicate resource keys are correctly refused during upgrade
c) that resources are rolledback to their original state if the upgrade fails.
diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml
index 367e1fa..7a264f8 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -295,6 +295,26 @@
<fileset dir="${project.build.testOutputDirectory}/tmp/multi/v2" includes="**/*.class,**/rhq-plugin.xml" />
</jar>
+ <copy toDir="${project.build.testOutputDirectory}/tmp/progress/v1/META-INF">
+ <fileset file="${project.build.testSourceDirectory}/org/rhq/core/pc/upgrade/plugins/progress/v1/rhq-plugin.xml" />
+ </copy>
+ <!-- <copy toDir="${project.build.testOutputDirectory}/tmp/progress/v1/org/rhq/core/pc/upgrade/plugins/progress/v1">
+ <fileset file="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/plugins/progress/v1/*.class" />
+ </copy> -->
+ <jar destfile="${project.build.testOutputDirectory}/resource-upgrade-test-plugin-progress-test-1.0.0.jar">
+ <fileset dir="${project.build.testOutputDirectory}/tmp/progress/v1" includes="**/*.class,**/rhq-plugin.xml" />
+ </jar>
+
+ <copy toDir="${project.build.testOutputDirectory}/tmp/progress/v2/META-INF">
+ <fileset file="${project.build.testSourceDirectory}/org/rhq/core/pc/upgrade/plugins/progress/v2/rhq-plugin.xml" />
+ </copy>
+ <!-- <copy toDir="${project.build.testOutputDirectory}/tmp/progress/v2/org/rhq/core/pc/upgrade/plugins/progress/v2">
+ <fileset file="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/plugins/progress/v2/*.class" />
+ </copy> -->
+ <jar destfile="${project.build.testOutputDirectory}/resource-upgrade-test-plugin-progress-test-2.0.0.jar">
+ <fileset dir="${project.build.testOutputDirectory}/tmp/progress/v2" includes="**/*.class,**/rhq-plugin.xml" />
+ </jar>
+
<delete dir="${project.build.testOutputDirectory}/tmp" />
</tasks>
</configuration>
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeFailureHandlingTest.java b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeFailureHandlingTest.java
index 34732fd..f68ee01 100644
--- a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeFailureHandlingTest.java
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeFailureHandlingTest.java
@@ -368,7 +368,7 @@ public class ResourceUpgradeFailureHandlingTest extends ResourceUpgradeTestBase
assertEquals(resources.get(type).size(), count, "Unexpected number of " + type + " discovered.");
}
- private static void checkResourcesUpgraded(Set<Resource> resources, int expectedSize) {
+ protected static void checkResourcesUpgraded(Set<Resource> resources, int expectedSize) {
assertEquals(resources.size(), expectedSize, "The set of resources has unexpected size.");
for (Resource res : resources) {
assertTrue(res.getResourceKey().startsWith(UPGRADED_RESOURCE_KEY_PREFIX), "Resource " + res
@@ -441,7 +441,7 @@ public class ResourceUpgradeFailureHandlingTest extends ResourceUpgradeTestBase
}
}
- private Resource findResourceWithOrdinal(ResType resType, int ordinal) {
+ protected Resource findResourceWithOrdinal(ResType resType, int ordinal) {
ResourceType resourceType = PluginContainer.getInstance().getPluginManager().getMetadataManager()
.getType(resType.getResourceTypeName(), resType.getResourceTypePluginName());
@@ -451,7 +451,7 @@ public class ResourceUpgradeFailureHandlingTest extends ResourceUpgradeTestBase
return findResourceWithOrdinal(resources, ordinal);
}
- private Resource findResourceWithOrdinal(Set<Resource> resources, int ordinal) {
+ protected Resource findResourceWithOrdinal(Set<Resource> resources, int ordinal) {
for (Resource r : resources) {
Configuration pluginConfig = r.getPluginConfiguration();
String ordinalString = pluginConfig.getSimpleValue("ordinal", null);
@@ -464,7 +464,7 @@ public class ResourceUpgradeFailureHandlingTest extends ResourceUpgradeTestBase
return null;
}
- private Set<Resource> filterResources(Set<Resource> resources, ResType resType) {
+ protected Set<Resource> filterResources(Set<Resource> resources, ResType resType) {
Set<Resource> ret = new HashSet<Resource>(resources);
Iterator<Resource> it = ret.iterator();
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeProgressHandlingTest.java b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeProgressHandlingTest.java
new file mode 100644
index 0000000..0e3bd35
--- /dev/null
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeProgressHandlingTest.java
@@ -0,0 +1,137 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.core.pc.upgrade;
+
+import static org.testng.Assert.assertNotNull;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.jmock.Expectations;
+import org.jmock.Mockery;
+import org.testng.annotations.Test;
+
+import org.rhq.core.domain.resource.Resource;
+
+/**
+ *
+ *
+ * @author Lukas Krejci
+ */
+@Test
+public class ResourceUpgradeProgressHandlingTest extends ResourceUpgradeFailureHandlingTest {
+
+ private static final String BASE_PLUGIN_NAME = "/resource-upgrade-test-plugin-multi-base-1.0.0.jar";
+ private static final String PARENT_DEP_V1_PLUGIN_NAME = "/resource-upgrade-test-plugin-multi-parentdep-1.0.0.jar";
+ private static final String PARENT_DEP_V2_PLUGIN_NAME = "/resource-upgrade-test-plugin-multi-parentdep-2.0.0.jar";
+ private static final String ROOT_PLUGIN_NAME = "/resource-upgrade-test-plugin-multi-root-1.0.0.jar";
+ private static final String UPGRADE_PROGRESS_PLUGIN_V1_FILENAME = "/resource-upgrade-test-plugin-progress-test-1.0.0.jar";
+ private static final String UPGRADE_PROGRESS_PLUGIN_V2_FILENAME = "/resource-upgrade-test-plugin-progress-test-2.0.0.jar";
+
+ private static final ResType TEST_TYPE = new ResType("TestResource", "test");
+ private static final ResType PARENT_DEP_TYPE = new ResType("ParentDependency", "parentdep");
+ private static final ResType ROOT_TYPE = new ResType("Root", "root");
+
+ private static final HashMap<String, List<String>> DEPS;
+
+ static {
+ DEPS = new HashMap<String, List<String>>();
+
+ DEPS.put(BASE_PLUGIN_NAME, Collections.<String> emptyList());
+ DEPS.put(PARENT_DEP_V1_PLUGIN_NAME, Arrays.asList(BASE_PLUGIN_NAME, ROOT_PLUGIN_NAME));
+ DEPS.put(PARENT_DEP_V2_PLUGIN_NAME, DEPS.get(PARENT_DEP_V1_PLUGIN_NAME));
+ DEPS.put(ROOT_PLUGIN_NAME, Arrays.asList(BASE_PLUGIN_NAME));
+ DEPS.put(UPGRADE_PROGRESS_PLUGIN_V1_FILENAME, Arrays.asList(BASE_PLUGIN_NAME, ROOT_PLUGIN_NAME, PARENT_DEP_V1_PLUGIN_NAME));
+ DEPS.put(UPGRADE_PROGRESS_PLUGIN_V2_FILENAME, Arrays.asList(BASE_PLUGIN_NAME, ROOT_PLUGIN_NAME, PARENT_DEP_V2_PLUGIN_NAME));
+ }
+
+ private Set<String> getAllDepsFor(String... plugins) {
+ HashSet<String> deps = new HashSet<String>();
+ for (String plugin : plugins) {
+ deps.add(plugin);
+ deps.addAll(DEPS.get(plugin));
+ }
+
+ return deps;
+ }
+
+ @Override
+ protected Collection<String> getRequiredPlugins() {
+ return Arrays.asList(BASE_PLUGIN_NAME, ROOT_PLUGIN_NAME, PARENT_DEP_V1_PLUGIN_NAME, PARENT_DEP_V2_PLUGIN_NAME,
+ UPGRADE_PROGRESS_PLUGIN_V1_FILENAME, UPGRADE_PROGRESS_PLUGIN_V2_FILENAME);
+ }
+
+ @Test
+ public void testParentResourceStartedUpgradedWhenChildResourceBeingUpgraded() throws Exception {
+ setCurrentServerSideInventory(new FakeServerInventory());
+
+ executeTestWithPlugins(getAllDepsFor(UPGRADE_PROGRESS_PLUGIN_V1_FILENAME),
+ new AbstractTestPayload(true, Collections.<ResType> emptyList()) {
+ public void test(Map<ResType, Set<Resource>> resourceUpgradeTestResources) {
+ //in here we set up the failures that are going to happen when
+ //the v2 plugins are run
+
+ Resource parent = findResourceWithOrdinal(PARENT_DEP_TYPE, 0);
+ assertNotNull(parent, "Failed to find the parent.");
+ }
+
+ public Expectations getExpectations(Mockery context) throws Exception {
+ return new Expectations() {
+ {
+ defineDefaultExpectations(this);
+ }
+ };
+ }
+ });
+
+ executeTestWithPlugins(getAllDepsFor(UPGRADE_PROGRESS_PLUGIN_V2_FILENAME),
+ new AbstractTestPayload(false, Arrays.asList(TEST_TYPE, PARENT_DEP_TYPE)) {
+ public void test(Map<ResType, Set<Resource>> resourceUpgradeTestResources) {
+ checkResourcesUpgraded(resourceUpgradeTestResources.get(PARENT_DEP_TYPE), 1);
+ checkResourcesUpgraded(resourceUpgradeTestResources.get(TEST_TYPE), 2);
+ }
+
+ public Expectations getExpectations(Mockery context) throws Exception {
+ return new Expectations() {
+ {
+ defineDefaultExpectations(this);
+ }
+ };
+ }
+ });
+ }
+
+ @Test
+ public void testDuplicitResourceKeysHandledCorrectly() {
+ //TODO implement
+ }
+
+ @Test
+ public void testResourcesRevertedToOriginalStateAfterFailedUpgrade() {
+ //TODO implement
+ }
+
+}
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/multi/base/BaseUpgradingDiscoveryComponent.java b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/multi/base/BaseUpgradingDiscoveryComponent.java
index 5b8af94..a1acf50 100644
--- a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/multi/base/BaseUpgradingDiscoveryComponent.java
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/multi/base/BaseUpgradingDiscoveryComponent.java
@@ -40,7 +40,7 @@ public class BaseUpgradingDiscoveryComponent<T extends BaseResourceComponent> ex
int ordinal = pluginConfig.getSimple("ordinal").getIntegerValue();
int parentOrdinal = parent == null ? 0 : parent.getOrdinal();
- boolean fail = Boolean.getBoolean(pluginConfig.getSimpleValue("failUpgrade", "false"));
+ boolean fail = Boolean.parseBoolean(pluginConfig.getSimpleValue("failUpgrade", "false"));
if (!fail && parent != null) {
String typeName = inventoriedResource.getResourceType().getName();
@@ -52,7 +52,17 @@ public class BaseUpgradingDiscoveryComponent<T extends BaseResourceComponent> ex
if (fail) {
throw new RuntimeException("Failing the resource upgrade purposefully.");
}
-
+
+ boolean checkParentUpgraded = Boolean.parseBoolean(pluginConfig.getSimpleValue("checkParentUpgraded", "false"));
+
+ if (checkParentUpgraded) {
+ if (!inventoriedResource.getParentResourceContext().getResourceKey().startsWith("UPGRADED")) {
+ throw new RuntimeException("The parent resource ["
+ + inventoriedResource.getParentResourceContext().getResourceKey()
+ + "] doesn't seem like it's upgraded but this resource expects it to be.");
+ }
+ }
+
String newKey = pluginConfig.getSimpleValue("upgradedKey", null);
if (newKey == null) {
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v1/rhq-plugin.xml b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v1/rhq-plugin.xml
new file mode 100644
index 0000000..57c9010
--- /dev/null
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v1/rhq-plugin.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<plugin name="test"
+ displayName="Resource Upgrade Multi Test"
+ description="Resource Upgrade Multi Test"
+ package="org.rhq.core.pc.upgrade.plugins.multi.base"
+ version="1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:xmlns:rhq-plugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
+
+ <depends plugin="base" useClasses="true"/>
+ <depends plugin="parentdep"/>
+
+ <server name="TestResource"
+ discovery="BaseDiscoveryComponent"
+ class="BaseResourceComponent">
+
+ <runs-inside>
+ <parent-resource-type name="ParentDependency" plugin="parentdep"/>
+ </runs-inside>
+
+ <plugin-configuration>
+ <c:simple-property name="count" default="1" />
+ <c:simple-property name="key" default="test-resource-parent-%n,parent-%p" />
+ <c:simple-property name="upgradedKey" default="UPGRADED-test-resource-parent-%n,parent-%p" />
+ <c:simple-property name="checkParentUpgraded" default="true" />
+ </plugin-configuration>
+ </server>
+
+</plugin>
+
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v2/rhq-plugin.xml b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v2/rhq-plugin.xml
new file mode 100644
index 0000000..b4691ba
--- /dev/null
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v2/rhq-plugin.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<plugin name="test"
+ displayName="Resource Upgrade Multi Test"
+ description="Resource Upgrade Multi Test"
+ package="org.rhq.core.pc.upgrade.plugins.multi.base"
+ version="1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:xmlns:rhq-plugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
+
+ <depends plugin="base" useClasses="true"/>
+ <depends plugin="parentdep"/>
+
+ <server name="TestResource"
+ discovery="BaseUpgradingDiscoveryComponent"
+ class="BaseResourceComponent">
+
+ <runs-inside>
+ <parent-resource-type name="ParentDependency" plugin="parentdep"/>
+ </runs-inside>
+
+ <plugin-configuration>
+ <c:simple-property name="count" default="2" />
+ <c:simple-property name="key" default="UPGRADED-test-resource-parent-%n,parent-%p" />
+ </plugin-configuration>
+ </server>
+
+</plugin>
+
commit 14433fc7a6f81e58d8a66907826ceab2742a09bc
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Tue May 17 17:37:14 2011 +0200
synchronizing the FakeServerInvetory to guard against concurrent access,
making sure the resources are returned in the hierarchical order to ensure
they are merged in the plugin container in the correct order.
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java
index 0dd3459..793c0f6 100644
--- a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java
@@ -83,18 +83,20 @@ public class FakeServerInventory {
public synchronized CustomAction mergeInventoryReport(final InventoryStatus requiredInventoryStatus) {
return new CustomAction("updateServerSideInventory") {
public Object invoke(Invocation invocation) throws Throwable {
- throwIfFailing();
-
- InventoryReport inventoryReport = (InventoryReport) invocation.getParameter(0);
-
- for (Resource res : inventoryReport.getAddedRoots()) {
- Resource persisted = fakePersist(res, requiredInventoryStatus, new HashSet<String>());
-
- if (res.getParentResource() == Resource.ROOT) {
- platform = persisted;
+ synchronized (FakeServerInventory.this) {
+ throwIfFailing();
+
+ InventoryReport inventoryReport = (InventoryReport) invocation.getParameter(0);
+
+ for (Resource res : inventoryReport.getAddedRoots()) {
+ Resource persisted = fakePersist(res, requiredInventoryStatus, new HashSet<String>());
+
+ if (res.getParentResource() == Resource.ROOT) {
+ platform = persisted;
+ }
}
+ return getSyncInfo();
}
- return getSyncInfo();
}
};
}
@@ -102,11 +104,13 @@ public class FakeServerInventory {
public synchronized CustomAction clearPlatform() {
return new CustomAction("updateServerSideInventory - report platform deleted on the server") {
public Object invoke(Invocation invocation) throws Throwable {
- throwIfFailing();
-
- platform = null;
-
- return getSyncInfo();
+ synchronized (FakeServerInventory.this) {
+ throwIfFailing();
+
+ platform = null;
+
+ return getSyncInfo();
+ }
}
};
}
@@ -115,45 +119,47 @@ public class FakeServerInventory {
return new CustomAction("upgradeServerSideInventory") {
@SuppressWarnings({ "serial", "unchecked" })
public Object invoke(Invocation invocation) throws Throwable {
- throwIfFailing();
-
- Set<ResourceUpgradeRequest> requests = (Set<ResourceUpgradeRequest>) invocation.getParameter(0);
- Set<ResourceUpgradeResponse> responses = new HashSet<ResourceUpgradeResponse>();
-
- for (final ResourceUpgradeRequest request : requests) {
- Resource resource = findResource(platform, new Resource() {
- public int getId() {
- return request.getResourceId();
- }
- }, ID_COMPARATOR);
- if (resource != null) {
- if (request.getNewDescription() != null) {
- resource.setDescription(request.getNewDescription());
+ synchronized(FakeServerInventory.this) {
+ throwIfFailing();
+
+ Set<ResourceUpgradeRequest> requests = (Set<ResourceUpgradeRequest>) invocation.getParameter(0);
+ Set<ResourceUpgradeResponse> responses = new HashSet<ResourceUpgradeResponse>();
+
+ for (final ResourceUpgradeRequest request : requests) {
+ Resource resource = findResource(platform, new Resource() {
+ public int getId() {
+ return request.getResourceId();
+ }
+ }, ID_COMPARATOR);
+ if (resource != null) {
+ if (request.getNewDescription() != null) {
+ resource.setDescription(request.getNewDescription());
+ }
+ if (request.getNewName() != null) {
+ resource.setName(request.getNewName());
+ }
+
+ if (request.getNewResourceKey() != null) {
+ resource.setResourceKey(request.getNewResourceKey());
+ }
+
+ if (request.getUpgradeErrorMessage() != null) {
+ ResourceError error = new ResourceError(resource, ResourceErrorType.UPGRADE,
+ request.getUpgradeErrorMessage(), request.getUpgradeErrorStackTrace(),
+ request.getTimestamp());
+ resource.getResourceErrors().add(error);
+ }
+
+ ResourceUpgradeResponse resp = new ResourceUpgradeResponse();
+ resp.setResourceId(resource.getId());
+ resp.setUpgradedResourceName(resource.getName());
+ resp.setUpgradedResourceKey(resource.getResourceKey());
+ resp.setUpgradedResourceDescription(resource.getDescription());
+ responses.add(resp);
}
- if (request.getNewName() != null) {
- resource.setName(request.getNewName());
- }
-
- if (request.getNewResourceKey() != null) {
- resource.setResourceKey(request.getNewResourceKey());
- }
-
- if (request.getUpgradeErrorMessage() != null) {
- ResourceError error = new ResourceError(resource, ResourceErrorType.UPGRADE,
- request.getUpgradeErrorMessage(), request.getUpgradeErrorStackTrace(),
- request.getTimestamp());
- resource.getResourceErrors().add(error);
- }
-
- ResourceUpgradeResponse resp = new ResourceUpgradeResponse();
- resp.setResourceId(resource.getId());
- resp.setUpgradedResourceName(resource.getName());
- resp.setUpgradedResourceKey(resource.getResourceKey());
- resp.setUpgradedResourceDescription(resource.getDescription());
- responses.add(resp);
}
+ return responses;
}
- return responses;
}
};
}
@@ -162,21 +168,23 @@ public class FakeServerInventory {
return new CustomAction("getResources") {
@SuppressWarnings("unchecked")
public Object invoke(Invocation invocation) throws Throwable {
- throwIfFailing();
-
- Set<Integer> resourceIds = (Set<Integer>) invocation.getParameter(0);
- boolean includeDescendants = (Boolean) invocation.getParameter(1);
-
- return getResources(resourceIds, includeDescendants);
+ synchronized (FakeServerInventory.this) {
+ throwIfFailing();
+
+ Set<Integer> resourceIds = (Set<Integer>) invocation.getParameter(0);
+ boolean includeDescendants = (Boolean) invocation.getParameter(1);
+
+ return getResources(resourceIds, includeDescendants);
+ }
}
};
}
- public boolean isFailing() {
+ public synchronized boolean isFailing() {
return failing;
}
- public void setFailing(boolean failing) {
+ public synchronized void setFailing(boolean failing) {
this.failing = failing;
}
@@ -195,7 +203,9 @@ public class FakeServerInventory {
@SuppressWarnings("serial")
private Set<Resource> getResources(Set<Integer> resourceIds, boolean includeDescendants) {
- Set<Resource> result = new HashSet<Resource>();
+ //it is important to keep the hierarchical order of the resource in the returned set
+ //so that plugin container can merge the resources from top to bottom.
+ Set<Resource> result = new LinkedHashSet<Resource>();
for (final Integer id : resourceIds) {
Resource r = findResource(platform, new Resource() {
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeTestBase.java b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeTestBase.java
index afe3982..e0526a1 100644
--- a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeTestBase.java
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeTestBase.java
@@ -358,7 +358,9 @@ public abstract class ResourceUpgradeTestBase {
try {
//give the pc the time to finish resource upgrade
- Thread.sleep(1000);
+ while (!PluginContainer.getInstance().isStarted()) {
+ Thread.sleep(500);
+ }
//execute full discovery
InventoryManager im = PluginContainer.getInstance().getInventoryManager();
commit ec038dd2d72eeebf345d952f12bdc96409c3154e
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Tue May 17 17:35:10 2011 +0200
BZ 704028 - Fixing the resource upgrade logic:
1) The resource key duplicates are checked against what the inventory
will look like after the upgrade finished.
2) The InventoryManager start-up logic has been changed to do the
resource activation and upgrade in one go so that we don't have to
restart the "parent" resources when upgrading their children so that
the upgrade methods of children see the parent resource as if it was
already upgraded.
The initial activation and upgrade will assume the upgrade succeeded
and will only rollback the resources to their initial state if the
upgrade fails.
diff --git a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/upgrade/ResourceUpgradeRequest.java b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/upgrade/ResourceUpgradeRequest.java
index aca9c90..164ea13 100644
--- a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/upgrade/ResourceUpgradeRequest.java
+++ b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/upgrade/ResourceUpgradeRequest.java
@@ -26,6 +26,7 @@ package org.rhq.core.clientapi.agent.upgrade;
import java.io.PrintWriter;
import java.io.StringWriter;
+import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceUpgradeReport;
/**
@@ -119,6 +120,35 @@ public class ResourceUpgradeRequest extends ResourceUpgradeReport {
setNewResourceKey(report.getNewResourceKey());
}
+ public void fillInFromResource(Resource resource) {
+ setNewDescription(resource.getDescription());
+ setNewName(resource.getName());
+ setNewResourceKey(resource.getResourceKey());
+ }
+
+ public void updateResource(Resource resource) {
+ if (getNewResourceKey() != null) {
+ resource.setResourceKey(getNewResourceKey());
+ }
+
+ if (getNewName() != null) {
+ resource.setName(getNewName());
+ }
+
+ if (getNewDescription() != null) {
+ resource.setDescription(getNewDescription());
+ }
+ }
+
+ /**
+ * Clears all the data to be upgraded apart from the error message, stacktrace and timestamp
+ */
+ public void clearUpgradeData() {
+ setNewDescription(null);
+ setNewName(null);
+ setNewResourceKey(null);
+ }
+
@Override
public boolean hasSomethingToUpgrade() {
return super.hasSomethingToUpgrade() || upgradeErrorMessage != null || upgradeErrorStackTrace != null;
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
index 6afb021..9a98f81 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
@@ -225,7 +225,7 @@ public class InventoryManager extends AgentService implements ContainerService,
//try the resource upgrade before we have any schedulers set up
//so that we don't get any interventions from concurrently running
//discoveries.
- upgradeResources();
+ activateAndUpgradeResources();
availabilityCollectors = new AvailabilityCollectorThreadPool();
availabilityCollectors.initialize();
@@ -1236,7 +1236,7 @@ public class InventoryManager extends AgentService implements ContainerService,
return resourceContainer.updateAvailability(availabilityType);
}
- public void mergeResourcesFromUpgrade(Set<ResourceUpgradeRequest> upgradeRequests) {
+ public void mergeResourcesFromUpgrade(Set<ResourceUpgradeRequest> upgradeRequests) throws PluginContainerException {
Set<ResourceUpgradeResponse> serverUpdates = null;
try {
ServerServices serverServices = this.configuration.getServerServices();
@@ -1429,44 +1429,42 @@ public class InventoryManager extends AgentService implements ContainerService,
}
/**
- * This will start the resource's plugin component, creating it first if it has not yet been created. If the
- * component is already created and started, this method is a no-op.
- *
- * @param resource the resource that the component will manage
- * @param container the wrapper around the resource and its component
- * @param updatedPluginConfig if <code>true</code>, this will indicate that the resource's plugin configuration is
- * known to have changed since the last time the resource component was started
- *
- * @throws InvalidPluginConfigurationException when connecting to the managed resource fails due to an invalid
- * plugin configuration
- * @throws PluginContainerException for all other errors
+ * This method prepares the resource and container for activation.
+ * <p>
+ * After this method has processed the resource and container, it is enough
+ * to call ResourceComponent.start(). All the datastructures needed for that
+ * call are prepared in the container by this method.
+ *
+ * @param resource the resource that we are activating
+ * @param container the container to hold the datastructures
+ * @throws InvalidPluginConfigurationException
+ * @throws PluginContainerException
+ * @return true the resource has been successfully prepared and can be started. False if the resource should not be started.
*/
- @SuppressWarnings("unchecked")
- public void activateResource(Resource resource, @NotNull ResourceContainer container, boolean updatedPluginConfig)
- throws InvalidPluginConfigurationException, PluginContainerException {
+ private boolean prepareResourceForActivation(Resource resource, @NotNull ResourceContainer container, boolean forceReinitialization) throws InvalidPluginConfigurationException, PluginContainerException {
if (resourceUpgradeDelegate.hasUpgradeFailed(resource)) {
if (log.isTraceEnabled()) {
log.trace("Skipping activation of " + resource + " - it has failed to upgrade.");
}
- return;
+ return false;
}
-
+
ResourceComponent component = container.getResourceComponent();
// if the component already exists and is started, and the resource's plugin config has not changed, there is
// nothing to do, so return immediately
- if ((component != null) && (container.getResourceComponentState() == ResourceComponentState.STARTED)
- && !updatedPluginConfig) {
+ if ((component != null) && (container.getResourceComponentState() == ResourceComponentState.STARTED
+ && !forceReinitialization)) {
if (log.isTraceEnabled()) {
- log.trace("Skipping activation of " + resource + " - its component is already started and its plugin "
+ log.trace("No need to prepare the activation of resource " + resource + " - its component is already started and its plugin "
+ "config has not been updated since it was last started.");
}
- return;
+ return false;
}
if (log.isDebugEnabled()) {
- log.debug("Starting component for [" + resource + "], current state=["
- + container.getResourceComponentState() + "], new plugin config=[" + updatedPluginConfig + "]...");
+ log.debug("Preparing component for [" + resource + "] for activation, current state=["
+ + container.getResourceComponentState() + "], forcing reinitialization=[" + forceReinitialization + "]...");
}
// If the component does not even exist yet, we need to instantiate it and set it on the container.
@@ -1482,6 +1480,10 @@ public class InventoryManager extends AgentService implements ContainerService,
container.setResourceComponent(component);
}
+ //this is a transient field, so reinitialize it just in case this is invoked just after
+ //loadFromDisk()
+ container.setResourceComponentState(ResourceComponentState.STOPPED);
+
// start the resource, but only if its parent component is running. If the parent is null, that means
// the resource is, itself, the root platform and we always activate that.
ResourceContainer parentResourceContainer;
@@ -1514,7 +1516,7 @@ public class InventoryManager extends AgentService implements ContainerService,
ConfigurationUtility.normalizeConfiguration(resource.getPluginConfiguration(), type
.getPluginConfigurationDefinition());
- ResourceComponent parentComponent = null;
+ ResourceComponent<?> parentComponent = null;
if (resource.getParentResource() != null) {
parentComponent = getResourceComponent(resource.getParentResource());
}
@@ -1523,8 +1525,45 @@ public class InventoryManager extends AgentService implements ContainerService,
container.setResourceContext(context);
+ return true;
+ } else {
+ if (log.isDebugEnabled()) {
+ log.debug("Resource [" + resource + "] not being prepared for activation; parent isn't started: " + parentResourceContainer);
+ }
+
+ return false;
+ }
+ }
+
+ /**
+ * This will start the resource's plugin component, creating it first if it has not yet been created. If the
+ * component is already created and started, this method is a no-op.
+ *
+ * @param resource the resource that the component will manage
+ * @param container the wrapper around the resource and its component
+ * @param updatedPluginConfig if <code>true</code>, this will indicate that the resource's plugin configuration is
+ * known to have changed since the last time the resource component was started
+ *
+ * @throws InvalidPluginConfigurationException when connecting to the managed resource fails due to an invalid
+ * plugin configuration
+ * @throws PluginContainerException for all other errors
+ */
+ @SuppressWarnings("unchecked")
+ public void activateResource(Resource resource, @NotNull ResourceContainer container, boolean updatedPluginConfig)
+ throws InvalidPluginConfigurationException, PluginContainerException {
+ if (resourceUpgradeDelegate.hasUpgradeFailed(resource)) {
+ if (log.isTraceEnabled()) {
+ log.trace("Skipping activation of " + resource + " - it has failed to upgrade.");
+ }
+ return;
+ }
+
+ if (prepareResourceForActivation(resource, container, updatedPluginConfig)) {
+
+ ResourceContext context = container.getResourceContext();
+
// Wrap the component in a proxy that will provide locking and a timeout for the call to start().
- component = container.createResourceComponentProxy(ResourceComponent.class, FacetLockType.READ,
+ ResourceComponent component = container.createResourceComponentProxy(ResourceComponent.class, FacetLockType.READ,
COMPONENT_START_TIMEOUT, true, false);
try {
@@ -1560,10 +1599,6 @@ public class InventoryManager extends AgentService implements ContainerService,
// Finally, inform the rest of the plugin container that this resource has been activated
fireResourceActivated(resource);
- } else {
- if (log.isDebugEnabled()) {
- log.debug("Not activating [" + resource + "]; parent isn't started: " + parentResourceContainer);
- }
}
}
@@ -1760,10 +1795,7 @@ public class InventoryManager extends AgentService implements ContainerService,
this.resourceContainers.put(uuid, resourceContainer);
}
- initResourceContainer(this.platform);
- activateFromDisk(this.platform);
-
- log.info("Inventory with size [" + this.resourceContainers.size() + "] initialized from data file in ["
+ log.info("Inventory with size [" + this.resourceContainers.size() + "] loaded from data file in ["
+ (System.currentTimeMillis() - start) + "ms]");
}
} catch (Exception e) {
@@ -2630,6 +2662,11 @@ public class InventoryManager extends AgentService implements ContainerService,
}
private void refreshResourceComponentState(ResourceContainer container, boolean pluginConfigUpdated) {
+ if (resourceUpgradeDelegate.enabled()) {
+ //don't do anything during upgrade. The resources are only started during the upgrade process.
+ return;
+ }
+
Resource resource = container.getResource();
switch (resource.getInventoryStatus()) {
case COMMITTED: {
@@ -2652,66 +2689,65 @@ public class InventoryManager extends AgentService implements ContainerService,
container.setSynchronizationState(ResourceContainer.SynchronizationState.SYNCHRONIZED);
}
- private void upgradeResources() {
+ private void activateAndUpgradeResources() {
try {
- if (!configuration.isInsideAgent()) {
- log.debug("Skipping resource upgrade in embedded mode.");
- return;
- }
-
- log.debug("Executing resource upgrade.");
+ log.info("Starting resource activation and upgrade.");
+ long start = System.currentTimeMillis();
+
+ log.info("Executing the initial inventory synchronization before upgrade.");
+
boolean syncResult = handleReport(new InventoryReport(getAgent()));
if (!syncResult) {
- log.warn("Resource upgrade failed to sync up the inventory with the server.");
- return;
+ log.warn("Failed to sync up the inventory with the server. The resource upgrade will be disabled.");
}
- upgradeResource(getPlatform());
+ log.info("Starting to activate (and upgrade) resources.");
+
+ activateAndUpgradeResourceRecursively(getPlatform(), syncResult);
- log.debug("Sending the upgrade requests to the server.");
+ log.info("Inventory activated and upgrade requests gathered in " + (System.currentTimeMillis() - start) + "ms.");
+
+ log.info("Sending the upgrade requests to the server.");
resourceUpgradeDelegate.sendRequests();
resourceUpgradeDelegate.disable();
- log.debug("Resource upgrade finished.");
+ log.info("Resource activation and upgrade finished.");
} catch (Throwable t) {
- log.error("Resource upgrade failed with an exception.", t);
+ log.error("Resource activation or upgrade failed with an exception. An attempt to merely activate the resources will be made now.", t);
+
+ //make sure to at least activate the resources
+ activateAndUpgradeResourceRecursively(getPlatform(), false);
}
}
- private void upgradeResource(Resource resource) {
- ResourceContainer container = getResourceContainer(resource);
- if (container != null) {
- if (container.getResourceComponentState() == ResourceComponentState.STARTED) {
- try {
- if (resourceUpgradeDelegate.processAndQueue(container)) {
- for (Resource child : resource.getChildResources()) {
- upgradeResource(child);
- }
- }
- } catch (PluginContainerException e) {
- log.error("Exception thrown while upgrading [" + resource + "].", e);
- }
- } else {
- String message = "The resource container for resource [" + resource
- + "] wasn't started while upgrading.";
-
- if (resource.getChildResources().isEmpty()) {
- log
- .info(message
- + " If this is the first time the plugin container starts up and has completely empty inventory, you can ignore this message.");
- } else {
- log
- .error(message
- + " This can potentially cause the discovery to find resources logically equivalent to already "
- + "existing resources if the corresponding plugins support upgrade for that particular resource type.");
+ private void activateAndUpgradeResourceRecursively(Resource resource, boolean doUpgrade) {
+ ResourceContainer container = initResourceContainer(resource);
+
+ boolean activate = true;
+
+ //only do upgrade inside the agent. it does not make sense in embedded mode.
+ if (doUpgrade && configuration.isInsideAgent()) {
+ try {
+ activate = prepareResourceForActivation(resource, container, false);
+ activate = activate && resourceUpgradeDelegate.processAndQueue(container);
+ } catch (Throwable t) {
+ log.error("Exception thrown while upgrading [" + resource + "].", t);
+ activate = false;
+ }
+ }
+
+ if (activate) {
+ try {
+ activateResource(resource, container, false);
+ for (Resource child : resource.getChildResources()) {
+ activateAndUpgradeResourceRecursively(child, doUpgrade);
}
+ } catch (PluginContainerException e) {
+ log.error("Exception thrown while activating [" + resource + "].", e);
}
- } else {
- log.error("Resource container not initialized for resource [" + resource
- + "] during upgrade. This should not happen.");
}
}
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java
index b3b8716..e8ca94e 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java
@@ -59,6 +59,7 @@ public class ResourceUpgradeDelegate {
private boolean enabled = true;
private Set<ResourceUpgradeRequest> requests = new HashSet<ResourceUpgradeRequest>();
+ private Set<ResourceUpgradeRequest> originalResourceData = new HashSet<ResourceUpgradeRequest>();
private InventoryManager inventoryManager;
private Set<Resource> failedResources = new HashSet<Resource>();
private Map<Resource, Set<ResourceType>> failedResourceTypesPerParent = new HashMap<Resource, Set<ResourceType>>();
@@ -85,6 +86,14 @@ public class ResourceUpgradeDelegate {
/**
* Asks the resource's discovery component to upgrade the resource.
+ * The resource will be updated with the data from the upgrade. I.e. when the resource
+ * is activated after it was queued for upgrade, it will actually start with the upgraded
+ * data.
+ * <p>
+ * If later on the upgrade fails to finish due to communication error with server or the
+ * server doesn't approve some upgrades for whatever reason, the resources will be restarted
+ * with the original data.
+ *
* @param resourceContainer
* @return true if the resource was queued for upgrade with no problems,
* false if there was some problem upgrading and the resource container was deactivated as
@@ -135,7 +144,62 @@ public class ResourceUpgradeDelegate {
public void sendRequests() throws Throwable {
if (enabled && requests.size() > 0) {
try {
+ //check the validity of the upgrades now that we have a complete picture
+ //about the changes and the inventory looks like it was already upgraded.
+ for(ResourceUpgradeRequest request : requests) {
+ ResourceContainer container = inventoryManager.getResourceContainer(request.getResourceId());
+ if (container != null) {
+ Resource resource = container.getResource();
+ String upgradeErrors = null;
+ if ((upgradeErrors = checkUpgradeValid(resource, request)) != null) {
+ String errorString = "Upgrading the resource [" + resource + "] using these updates [" + request
+ + "] would render the inventory invalid because of the following reasons: " + upgradeErrors;
+
+ log.error(errorString);
+
+ IllegalStateException ex = new IllegalStateException(errorString);
+ ex.fillInStackTrace();
+
+ //set the error and clear out everything else, so that we send the error
+ //to the server and locally roll back to the previous state.
+ request.setErrorProperties(ex);
+ request.clearUpgradeData();
+
+ if (request.getUpgradeErrorMessage() != null) {
+ rememberFailure(resource);
+ inventoryManager.deactivateResource(resource);
+ }
+
+ }
+ }
+ }
+
+ //now before we talk to server and sync up the upgraded data,
+ //reset the resources to their original values so that any changes
+ //the server makes to the upgrade data are applied to the "vanilla" state
+ //of the resources. i.e we only want to make changes the server approves.
+ for (ResourceUpgradeRequest request : originalResourceData) {
+ ResourceContainer container = inventoryManager.getResourceContainer(request.getResourceId());
+ if (container != null) {
+ Resource resource = container.getResource();
+ request.updateResource(resource);
+ }
+ }
+
+ //merge the resources with the data as received from the server
+ //(this can differ from what the upgrade "wants" because the server is
+ //free to disallow some changes, e.g. resource name change)
inventoryManager.mergeResourcesFromUpgrade(requests);
+
+ //and now restart all the "touched" resources with the true intended
+ //data
+ for (ResourceUpgradeRequest request : requests) {
+ ResourceContainer container = inventoryManager.getResourceContainer(request.getResourceId());
+ if (container != null) {
+ Resource resource = container.getResource();
+ inventoryManager.activateResource(resource, container, true);
+ }
+ }
} catch (Throwable t) {
mergeFailed = true;
@@ -168,7 +232,7 @@ public class ResourceUpgradeDelegate {
ResourceContext<?> parentResourceContext = parentResourceContainer == null ? null : parentResourceContainer.getResourceContext();
Resource resource = resourceContainer.getResource();
-
+
ResourceDiscoveryComponent<ResourceComponent<T>> discoveryComponent = PluginContainer.getInstance()
.getPluginComponentFactory().getDiscoveryComponent(resource.getResourceType(), parentResourceContainer);
@@ -194,44 +258,32 @@ public class ResourceUpgradeDelegate {
}
if (upgradeReport != null && upgradeReport.hasSomethingToUpgrade()) {
- String upgradeErrors = null;
- if ((upgradeErrors = checkUpgradeValid(resource, upgradeReport)) != null) {
- String errorString = "Upgrading the resource [" + resource + "] using these updates [" + upgradeReport
- + "] would render the inventory invalid because of the following reasons: " + upgradeErrors;
-
- log.error(errorString);
-
- IllegalStateException ex = new IllegalStateException(errorString);
- ex.fillInStackTrace();
-
- request.setErrorProperties(ex);
- } else {
- request.fillInFromReport(upgradeReport);
- }
-
+ request.fillInFromReport(upgradeReport);
}
- //everything went ok, let's queue a upgrade request that will be sent to the server
if (request.hasSomethingToUpgrade()) {
requests.add(request);
}
if (request.getUpgradeErrorMessage() != null) {
- failedResources.add(resource);
-
- Set<ResourceType> failedResourceTypesInParent = failedResourceTypesPerParent.get(parentResource);
- if (failedResourceTypesInParent == null) {
- failedResourceTypesInParent = new HashSet<ResourceType>();
- failedResourceTypesPerParent.put(parentResource, failedResourceTypesInParent);
- }
-
- failedResourceTypesInParent.add(resource.getResourceType());
-
- inventoryManager.deactivateResource(resource);
-
+ rememberFailure(resource);
return false;
}
-
+
+ //alright, everything went fine with the upgrade. Let's update the data of the resource
+ //right now so that it starts up as if it was already upgraded. This is to ensure that
+ //its children will use a parent component that behaves like the upgraded one.
+ //We are going to roll back the upgraded data if the upgrade fails to sync with the server
+ //later on.
+
+ //remember the original values
+ ResourceUpgradeRequest original = new ResourceUpgradeRequest(resource.getId());
+ original.fillInFromResource(resource);
+ originalResourceData.add(original);
+
+ //update the resource
+ request.updateResource(resource);
+
return true;
}
@@ -248,6 +300,7 @@ public class ResourceUpgradeDelegate {
private boolean checkResourceKeyUniqueAmongSiblings(Resource resource, ResourceUpgradeReport upgradeReport) {
Resource parent = resource.getParentResource();
if (parent == null) {
+ //there is only a single platform resource on an agent
return true;
}
@@ -267,4 +320,17 @@ public class ResourceUpgradeDelegate {
return true;
}
+
+ private void rememberFailure(Resource resource) {
+ failedResources.add(resource);
+ Resource parentResource = resource.getParentResource();
+
+ Set<ResourceType> failedResourceTypesInParent = failedResourceTypesPerParent.get(parentResource);
+ if (failedResourceTypesInParent == null) {
+ failedResourceTypesInParent = new HashSet<ResourceType>();
+ failedResourceTypesPerParent.put(parentResource, failedResourceTypesInParent);
+ }
+
+ failedResourceTypesInParent.add(resource.getResourceType());
+ }
}
13 years
[rhq] Branch 'master-resource-upgrade-fixes' - 2 commits - modules/core
by lkrejci
modules/core/plugin-container/pom.xml | 20 +++
modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java | 3
modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java | 14 +-
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java | 15 ++
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeFailureHandlingTest.java | 61 ++++++++-
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeProgressHandlingTest.java | 66 ++++++++--
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/duplicate/v1/rhq-plugin.xml | 31 ++++
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/duplicate/v2/rhq-plugin.xml | 30 ++++
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v1/rhq-plugin.xml | 4
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v2/rhq-plugin.xml | 2
10 files changed, 224 insertions(+), 22 deletions(-)
New commits:
commit 3ff7587af61a2ee37ad28226f44102528d509f9f
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Wed May 18 15:30:04 2011 +0200
Adding tests for resource upgrade revert to original state after failed upgrade and duplicate resource key handling.
diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml
index 7a264f8..fd14685 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -315,6 +315,26 @@
<fileset dir="${project.build.testOutputDirectory}/tmp/progress/v2" includes="**/*.class,**/rhq-plugin.xml" />
</jar>
+ <copy toDir="${project.build.testOutputDirectory}/tmp/duplicate/v1/META-INF">
+ <fileset file="${project.build.testSourceDirectory}/org/rhq/core/pc/upgrade/plugins/duplicate/v1/rhq-plugin.xml" />
+ </copy>
+ <!-- <copy toDir="${project.build.testOutputDirectory}/tmp/duplicate/v1/org/rhq/core/pc/upgrade/plugins/duplicate/v1">
+ <fileset file="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/plugins/duplicate/v1/*.class" />
+ </copy> -->
+ <jar destfile="${project.build.testOutputDirectory}/resource-upgrade-test-plugin-duplicate-test-1.0.0.jar">
+ <fileset dir="${project.build.testOutputDirectory}/tmp/duplicate/v1" includes="**/*.class,**/rhq-plugin.xml" />
+ </jar>
+
+ <copy toDir="${project.build.testOutputDirectory}/tmp/duplicate/v2/META-INF">
+ <fileset file="${project.build.testSourceDirectory}/org/rhq/core/pc/upgrade/plugins/duplicate/v2/rhq-plugin.xml" />
+ </copy>
+ <!-- <copy toDir="${project.build.testOutputDirectory}/tmp/duplicate/v2/org/rhq/core/pc/upgrade/plugins/duplicate/v2">
+ <fileset file="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/plugins/duplicate/v2/*.class" />
+ </copy> -->
+ <jar destfile="${project.build.testOutputDirectory}/resource-upgrade-test-plugin-duplicate-test-2.0.0.jar">
+ <fileset dir="${project.build.testOutputDirectory}/tmp/duplicate/v2" includes="**/*.class,**/rhq-plugin.xml" />
+ </jar>
+
<delete dir="${project.build.testOutputDirectory}/tmp" />
</tasks>
</configuration>
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java
index 793c0f6..d3b54aa 100644
--- a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java
@@ -59,7 +59,8 @@ public class FakeServerInventory {
private Map<String, Resource> resourceStore = new HashMap<String, Resource>();
private int counter;
private boolean failing;
-
+ private boolean failUpgrade;
+
private static final Comparator<Resource> ID_COMPARATOR = new Comparator<Resource>() {
public int compare(Resource o1, Resource o2) {
return o1.getId() - o2.getId();
@@ -122,6 +123,10 @@ public class FakeServerInventory {
synchronized(FakeServerInventory.this) {
throwIfFailing();
+ if (failUpgrade) {
+ throw new RuntimeException("Failing the upgrade purposefully.");
+ }
+
Set<ResourceUpgradeRequest> requests = (Set<ResourceUpgradeRequest>) invocation.getParameter(0);
Set<ResourceUpgradeResponse> responses = new HashSet<ResourceUpgradeResponse>();
@@ -188,6 +193,14 @@ public class FakeServerInventory {
this.failing = failing;
}
+ public synchronized boolean isFailUpgrade() {
+ return failUpgrade;
+ }
+
+ public synchronized void setFailUpgrade(boolean failUpgrade) {
+ this.failUpgrade = failUpgrade;
+ }
+
@SuppressWarnings("serial")
public synchronized Set<Resource> findResourcesByType(final ResourceType type) {
Set<Resource> result = new HashSet<Resource>();
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeFailureHandlingTest.java b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeFailureHandlingTest.java
index f68ee01..5f493c9 100644
--- a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeFailureHandlingTest.java
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeFailureHandlingTest.java
@@ -331,6 +331,55 @@ public class ResourceUpgradeFailureHandlingTest extends ResourceUpgradeTestBase
});
}
+ @Test
+ public void testResourcesRevertedToOriginalStateAfterFailedUpgrade() throws Exception {
+ setCurrentServerSideInventory(new FakeServerInventory());
+
+ //let it all run in v1
+ executeTestWithPlugins(getAllDepsFor(TEST_V1_PLUGIN_NAME, PARENT_SIBLING_V1_PLUGIN_NAME),
+ new AbstractTestPayload(true, Collections.<ResType> emptyList()) {
+ public void test(Map<ResType, Set<Resource>> resourceUpgradeTestResources) {
+ }
+
+ public Expectations getExpectations(Mockery context) throws Exception {
+ return new Expectations() {
+ {
+ defineDefaultExpectations(this);
+ }
+ };
+ }
+ });
+
+ getCurrentServerSideInventory().setFailUpgrade(true);
+
+ //now let's run with v2 plugins and check the layout of the inventory
+ executeTestWithPlugins(getAllDepsFor(TEST_V2_PLUGIN_NAME, PARENT_SIBLING_V2_PLUGIN_NAME),
+ new AbstractTestPayload(false, ALL_TYPES) {
+
+ public void test(Map<ResType, Set<Resource>> resources) {
+ checkPresenceOfResourceTypes(resources, getExpectedResourceTypes());
+
+ checkNumberOfResources(resources, ROOT_TYPE, 1);
+ checkNumberOfResources(resources, PARENT_DEP_TYPE, 1);
+
+ //check that the resources are upgraded
+ checkResourcesNotUpgraded(resources.get(PARENT_DEP_SIBLING_TYPE), 1);
+ checkResourcesNotUpgraded(resources.get(PARENT_TYPE), 2);
+ checkResourcesNotUpgraded(resources.get(SIBLING_TYPE), 20);
+ checkResourcesNotUpgraded(resources.get(TEST_TYPE), 20);
+ }
+
+ public Expectations getExpectations(Mockery context) throws Exception {
+ return new Expectations() {
+ {
+ defineDefaultExpectations(this);
+ }
+ };
+ }
+ });
+ }
+
+
@SuppressWarnings("unchecked")
@Override
protected void defineDefaultExpectations(Expectations expectations) {
@@ -358,13 +407,13 @@ public class ResourceUpgradeFailureHandlingTest extends ResourceUpgradeTestBase
return deps;
}
- private static void checkPresenceOfResourceTypes(Map<ResType, Set<Resource>> resources, Set<ResType> expectedTypes) {
+ protected static void checkPresenceOfResourceTypes(Map<ResType, Set<Resource>> resources, Set<ResType> expectedTypes) {
for (ResType resType : expectedTypes) {
assertNotNull(resources.get(resType), "Expecting some resources of type " + resType);
}
}
- private static void checkNumberOfResources(Map<ResType, Set<Resource>> resources, ResType type, int count) {
+ protected static void checkNumberOfResources(Map<ResType, Set<Resource>> resources, ResType type, int count) {
assertEquals(resources.get(type).size(), count, "Unexpected number of " + type + " discovered.");
}
@@ -381,7 +430,7 @@ public class ResourceUpgradeFailureHandlingTest extends ResourceUpgradeTestBase
}
}
- private static void checkResourcesNotUpgraded(Set<Resource> resources, int expectedSize) {
+ protected static void checkResourcesNotUpgraded(Set<Resource> resources, int expectedSize) {
assertEquals(resources.size(), expectedSize, "The set of resources has unexpected size.");
for(Resource res : resources) {
assertFalse(res.getResourceKey().startsWith(UPGRADED_RESOURCE_KEY_PREFIX), "Resource " + res
@@ -397,7 +446,7 @@ public class ResourceUpgradeFailureHandlingTest extends ResourceUpgradeTestBase
}
}
- private static void checkResourceFailedUpgrade(Resource resource) {
+ protected static void checkResourceFailedUpgrade(Resource resource) {
assertFalse(resource.getResourceKey().startsWith(UPGRADED_RESOURCE_KEY_PREFIX), "Resource " + resource
+ " seems to be upgraded even though it shouldn't.");
assertTrue(resource.getResourceErrors(ResourceErrorType.UPGRADE).size() == 1,
@@ -409,13 +458,13 @@ public class ResourceUpgradeFailureHandlingTest extends ResourceUpgradeTestBase
"A resource that failed to upgrade should be stopped.");
}
- private static void checkOthersUpgraded(Set<Resource> resources, Resource... failedResource) {
+ protected static void checkOthersUpgraded(Set<Resource> resources, Resource... failedResource) {
Set<Resource> others = new HashSet<Resource>(resources);
others.removeAll(Arrays.asList(failedResource));
checkResourcesUpgraded(others, others.size());
}
- private void addChildrenToFail(Resource parent, ResType childResType, int... childrenOrdinals) {
+ protected void addChildrenToFail(Resource parent, ResType childResType, int... childrenOrdinals) {
InventoryManager inventoryManager = PluginContainer.getInstance().getInventoryManager();
ResourceContainer parentContainer = inventoryManager.getResourceContainer(parent);
BaseResourceComponentInterface parentComponent = (BaseResourceComponentInterface) parentContainer
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeProgressHandlingTest.java b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeProgressHandlingTest.java
index 0e3bd35..3234c30 100644
--- a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeProgressHandlingTest.java
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeProgressHandlingTest.java
@@ -20,6 +20,7 @@
package org.rhq.core.pc.upgrade;
import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertEquals;
import java.util.Arrays;
import java.util.Collection;
@@ -50,6 +51,8 @@ public class ResourceUpgradeProgressHandlingTest extends ResourceUpgradeFailureH
private static final String ROOT_PLUGIN_NAME = "/resource-upgrade-test-plugin-multi-root-1.0.0.jar";
private static final String UPGRADE_PROGRESS_PLUGIN_V1_FILENAME = "/resource-upgrade-test-plugin-progress-test-1.0.0.jar";
private static final String UPGRADE_PROGRESS_PLUGIN_V2_FILENAME = "/resource-upgrade-test-plugin-progress-test-2.0.0.jar";
+ private static final String UPGRADE_DUPLICATE_PLUGIN_V1_FILENAME = "/resource-upgrade-test-plugin-duplicate-test-1.0.0.jar";
+ private static final String UPGRADE_DUPLICATE_PLUGIN_V2_FILENAME = "/resource-upgrade-test-plugin-duplicate-test-2.0.0.jar";
private static final ResType TEST_TYPE = new ResType("TestResource", "test");
private static final ResType PARENT_DEP_TYPE = new ResType("ParentDependency", "parentdep");
@@ -66,6 +69,8 @@ public class ResourceUpgradeProgressHandlingTest extends ResourceUpgradeFailureH
DEPS.put(ROOT_PLUGIN_NAME, Arrays.asList(BASE_PLUGIN_NAME));
DEPS.put(UPGRADE_PROGRESS_PLUGIN_V1_FILENAME, Arrays.asList(BASE_PLUGIN_NAME, ROOT_PLUGIN_NAME, PARENT_DEP_V1_PLUGIN_NAME));
DEPS.put(UPGRADE_PROGRESS_PLUGIN_V2_FILENAME, Arrays.asList(BASE_PLUGIN_NAME, ROOT_PLUGIN_NAME, PARENT_DEP_V2_PLUGIN_NAME));
+ DEPS.put(UPGRADE_DUPLICATE_PLUGIN_V1_FILENAME, Arrays.asList(BASE_PLUGIN_NAME, ROOT_PLUGIN_NAME, PARENT_DEP_V1_PLUGIN_NAME));
+ DEPS.put(UPGRADE_DUPLICATE_PLUGIN_V2_FILENAME, Arrays.asList(BASE_PLUGIN_NAME, ROOT_PLUGIN_NAME, PARENT_DEP_V2_PLUGIN_NAME));
}
private Set<String> getAllDepsFor(String... plugins) {
@@ -81,13 +86,14 @@ public class ResourceUpgradeProgressHandlingTest extends ResourceUpgradeFailureH
@Override
protected Collection<String> getRequiredPlugins() {
return Arrays.asList(BASE_PLUGIN_NAME, ROOT_PLUGIN_NAME, PARENT_DEP_V1_PLUGIN_NAME, PARENT_DEP_V2_PLUGIN_NAME,
- UPGRADE_PROGRESS_PLUGIN_V1_FILENAME, UPGRADE_PROGRESS_PLUGIN_V2_FILENAME);
+ UPGRADE_PROGRESS_PLUGIN_V1_FILENAME, UPGRADE_PROGRESS_PLUGIN_V2_FILENAME, UPGRADE_DUPLICATE_PLUGIN_V1_FILENAME,
+ UPGRADE_DUPLICATE_PLUGIN_V2_FILENAME);
}
@Test
public void testParentResourceStartedUpgradedWhenChildResourceBeingUpgraded() throws Exception {
setCurrentServerSideInventory(new FakeServerInventory());
-
+
executeTestWithPlugins(getAllDepsFor(UPGRADE_PROGRESS_PLUGIN_V1_FILENAME),
new AbstractTestPayload(true, Collections.<ResType> emptyList()) {
public void test(Map<ResType, Set<Resource>> resourceUpgradeTestResources) {
@@ -107,6 +113,10 @@ public class ResourceUpgradeProgressHandlingTest extends ResourceUpgradeFailureH
}
});
+ //the upgrade progress plugin is set to check that the parent resource key
+ //has been upgraded during its upgrade method, so we just need to check here
+ //that everything got upgraded. If it was not, it'd mean that the the progress
+ //plugin failed the upgrade because it didn't see its parent upgraded.
executeTestWithPlugins(getAllDepsFor(UPGRADE_PROGRESS_PLUGIN_V2_FILENAME),
new AbstractTestPayload(false, Arrays.asList(TEST_TYPE, PARENT_DEP_TYPE)) {
public void test(Map<ResType, Set<Resource>> resourceUpgradeTestResources) {
@@ -125,13 +135,49 @@ public class ResourceUpgradeProgressHandlingTest extends ResourceUpgradeFailureH
}
@Test
- public void testDuplicitResourceKeysHandledCorrectly() {
- //TODO implement
- }
-
- @Test
- public void testResourcesRevertedToOriginalStateAfterFailedUpgrade() {
- //TODO implement
- }
+ public void testDuplicitResourceKeysHandledCorrectly() throws Exception {
+ setCurrentServerSideInventory(new FakeServerInventory());
+
+ executeTestWithPlugins(getAllDepsFor(UPGRADE_DUPLICATE_PLUGIN_V1_FILENAME),
+ new AbstractTestPayload(true, Arrays.asList(PARENT_DEP_TYPE, TEST_TYPE)) {
+
+ public void test(Map<ResType, Set<Resource>> resourceUpgradeTestResources) {
+ //there's not much to check with the v1 plugins. let's just check all the
+ //resources have been discovered
+ assertEquals(resourceUpgradeTestResources.get(PARENT_DEP_TYPE).size(), 1, "The V1 inventory should have 1 parent.");
+ assertEquals(resourceUpgradeTestResources.get(TEST_TYPE).size(), 2, "The V1 inventory should have 2 test resources.");
+ }
+
+ public Expectations getExpectations(Mockery context) throws Exception {
+ return new Expectations() {
+ {
+ defineDefaultExpectations(this);
+ }
+ };
+ }
+ });
+ //now the V2 test resource is set to create 2 resources with the same resource keys.
+ //the upgrade should therefore fail.
+ executeTestWithPlugins(getAllDepsFor(UPGRADE_DUPLICATE_PLUGIN_V2_FILENAME),
+ new AbstractTestPayload(false, Arrays.asList(PARENT_DEP_TYPE, TEST_TYPE)) {
+ public void test(Map<ResType, Set<Resource>> resourceUpgradeTestResources) {
+ checkResourcesUpgraded(resourceUpgradeTestResources.get(PARENT_DEP_TYPE), 1);
+
+ checkResourcesNotUpgraded(resourceUpgradeTestResources.get(TEST_TYPE), 2);
+
+ for(Resource r : resourceUpgradeTestResources.get(TEST_TYPE)) {
+ checkResourceFailedUpgrade(r);
+ }
+ }
+
+ public Expectations getExpectations(Mockery context) throws Exception {
+ return new Expectations() {
+ {
+ defineDefaultExpectations(this);
+ }
+ };
+ }
+ });
+ }
}
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/duplicate/v1/rhq-plugin.xml b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/duplicate/v1/rhq-plugin.xml
new file mode 100644
index 0000000..58db405
--- /dev/null
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/duplicate/v1/rhq-plugin.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<plugin name="test"
+ displayName="Resource Upgrade Multi Test"
+ description="Resource Upgrade Multi Test"
+ package="org.rhq.core.pc.upgrade.plugins.multi.base"
+ version="1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:xmlns:rhq-plugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
+
+ <depends plugin="base" useClasses="true"/>
+ <depends plugin="parentdep"/>
+
+ <server name="TestResource"
+ discovery="BaseDiscoveryComponent"
+ class="BaseResourceComponent">
+
+ <runs-inside>
+ <parent-resource-type name="ParentDependency" plugin="parentdep"/>
+ </runs-inside>
+
+ <plugin-configuration>
+ <c:simple-property name="count" default="2" />
+ <c:simple-property name="key" default="test-resource-%n,parent-%p" />
+ <c:simple-property name="upgradedKey" default="UPGRADED-test-resource-duplicate,parent-%p" />
+ </plugin-configuration>
+ </server>
+
+</plugin>
+
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/duplicate/v2/rhq-plugin.xml b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/duplicate/v2/rhq-plugin.xml
new file mode 100644
index 0000000..81240d9
--- /dev/null
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/duplicate/v2/rhq-plugin.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<plugin name="test"
+ displayName="Resource Upgrade Multi Test"
+ description="Resource Upgrade Multi Test"
+ package="org.rhq.core.pc.upgrade.plugins.multi.base"
+ version="1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:xmlns:rhq-plugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
+
+ <depends plugin="base" useClasses="true"/>
+ <depends plugin="parentdep"/>
+
+ <server name="TestResource"
+ discovery="BaseUpgradingDiscoveryComponent"
+ class="BaseResourceComponent">
+
+ <runs-inside>
+ <parent-resource-type name="ParentDependency" plugin="parentdep"/>
+ </runs-inside>
+
+ <plugin-configuration>
+ <c:simple-property name="count" default="2" />
+ <c:simple-property name="key" default="UPGRADED-test-resource-duplicate,parent-%p" />
+ </plugin-configuration>
+ </server>
+
+</plugin>
+
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v1/rhq-plugin.xml b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v1/rhq-plugin.xml
index 57c9010..9649422 100644
--- a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v1/rhq-plugin.xml
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v1/rhq-plugin.xml
@@ -22,8 +22,8 @@
<plugin-configuration>
<c:simple-property name="count" default="1" />
- <c:simple-property name="key" default="test-resource-parent-%n,parent-%p" />
- <c:simple-property name="upgradedKey" default="UPGRADED-test-resource-parent-%n,parent-%p" />
+ <c:simple-property name="key" default="test-resource-%n,parent-%p" />
+ <c:simple-property name="upgradedKey" default="UPGRADED-test-resource-%n,parent-%p" />
<c:simple-property name="checkParentUpgraded" default="true" />
</plugin-configuration>
</server>
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v2/rhq-plugin.xml b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v2/rhq-plugin.xml
index b4691ba..b909026 100644
--- a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v2/rhq-plugin.xml
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/progress/v2/rhq-plugin.xml
@@ -22,7 +22,7 @@
<plugin-configuration>
<c:simple-property name="count" default="2" />
- <c:simple-property name="key" default="UPGRADED-test-resource-parent-%n,parent-%p" />
+ <c:simple-property name="key" default="UPGRADED-test-resource-%n,parent-%p" />
</plugin-configuration>
</server>
commit 0be47f7781ad9be02d583ee42517ed91a268e2c7
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Wed May 18 15:24:07 2011 +0200
BZ 704028 - Rethrow the exception after failed upgrade merge with
the server so that stuff gets properly rolledback. Also slightly improved
logging.
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
index 9a98f81..d29cd56 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
@@ -1236,7 +1236,7 @@ public class InventoryManager extends AgentService implements ContainerService,
return resourceContainer.updateAvailability(availabilityType);
}
- public void mergeResourcesFromUpgrade(Set<ResourceUpgradeRequest> upgradeRequests) throws PluginContainerException {
+ public void mergeResourcesFromUpgrade(Set<ResourceUpgradeRequest> upgradeRequests) throws Exception {
Set<ResourceUpgradeResponse> serverUpdates = null;
try {
ServerServices serverServices = this.configuration.getServerServices();
@@ -1247,6 +1247,7 @@ public class InventoryManager extends AgentService implements ContainerService,
}
} catch (Exception e) {
log.error("Failed to process resource upgrades on the server.", e);
+ throw e;
}
if (serverUpdates != null) {
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java
index e8ca94e..cee582e 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java
@@ -152,9 +152,21 @@ public class ResourceUpgradeDelegate {
Resource resource = container.getResource();
String upgradeErrors = null;
if ((upgradeErrors = checkUpgradeValid(resource, request)) != null) {
+ //the resource is in its upgraded state but it's going to get reverted back to the original state
+ //in the code below. Let's use the original resource for the error message so that we don't confuse
+ //the user.
+ for(ResourceUpgradeRequest orig : originalResourceData) {
+ if (orig.equals(request)) {
+ orig.updateResource(resource);
+ break;
+ }
+ }
String errorString = "Upgrading the resource [" + resource + "] using these updates [" + request
+ "] would render the inventory invalid because of the following reasons: " + upgradeErrors;
+ //now switch the resource back to the upgraded state for the rest of the code below again
+ request.updateResource(resource);
+
log.error(errorString);
IllegalStateException ex = new IllegalStateException(errorString);
@@ -291,7 +303,7 @@ public class ResourceUpgradeDelegate {
StringBuilder s = new StringBuilder();
if (!checkResourceKeyUniqueAmongSiblings(resource, upgradeReport)) {
- s.append("\nAnother inventoried sibling resource of the same type already has the proposed resource key.");
+ s.append("\nAnother inventoried sibling resource of the same type already has the proposed resource key or would have it after the upgrade.");
}
return s.length() > 0 ? s.toString() : null;
13 years
[rhq] Branch 'release-4.0.0' - modules/plugins
by lkrejci
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit d4edbc99bed2e836f91d50745207844970f52b6d
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Wed May 18 13:55:51 2011 +0200
BZ 694476 - fixing the handling of loaded modules.
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java
index 3e11ff3..1f00aec 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java
@@ -364,7 +364,7 @@ public class RuntimeApacheConfiguration {
boolean recurseFurther = true;
if (walker.getName(node).equalsIgnoreCase("LoadModule")) {
- state.loadedModules.add(walker.getValue(node));
+ state.loadedModules.add(walker.getValues(node).get(0));
walker.visitOrdinaryNode(node);
} else if (walker.getName(node).equalsIgnoreCase("<IfModule")) {
String moduleFile = walker.getValue(node);
@@ -391,6 +391,7 @@ public class RuntimeApacheConfiguration {
+ moduleFile + ". If you are using Apache 2.1 or later, you can try changing the module identifier from the source file to "
+ "the actual module name as used in the LoadModule directive to get rid of this warning.");
}
+ LOGGED_UNKNOWN_MODULES.add(moduleFile);
continue;
}
13 years