modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/AbstractResourceUpgradeHandlingTest.java | 15 ++++++---- modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeTestBase.java | 2 + 2 files changed, 11 insertions(+), 6 deletions(-)
New commits: commit a01bc1b1fa16b21872ae99242d14d18a7fc29b6a Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 24 11:45:54 2012 -0400
[823942] Update test code related to fixes for this issue. (cherry picked from commit 5c91b4659d17ec66c01260dfa3339d182558702b)
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/AbstractResourceUpgradeHandlingTest.java b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/AbstractResourceUpgradeHandlingTest.java index 8228226..572fc54 100644 --- a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/AbstractResourceUpgradeHandlingTest.java +++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/AbstractResourceUpgradeHandlingTest.java @@ -18,9 +18,14 @@ */ package org.rhq.core.pc.upgrade;
+import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertTrue; + import java.util.Set;
import org.jmock.Expectations; + import org.rhq.core.clientapi.server.discovery.InvalidInventoryReportException; import org.rhq.core.clientapi.server.discovery.InventoryReport; import org.rhq.core.domain.configuration.Configuration; @@ -33,10 +38,6 @@ import org.rhq.core.pc.ServerServices; import org.rhq.core.pc.inventory.InventoryManager; import org.rhq.core.pc.inventory.ResourceContainer;
-import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertTrue; - /** * An abstract base class for Resource upgrade handling tests. * @@ -105,13 +106,15 @@ public abstract class AbstractResourceUpgradeHandlingTest extends ResourceUpgrad assertFalse(res.getResourceKey().startsWith(UPGRADED_RESOURCE_KEY_PREFIX), "Resource " + res + " seems to be upgraded even though it shouldn't.");
- ResourceContainer rc = PluginContainer.getInstance().getInventoryManager().getResourceContainer(res); + InventoryManager im = PluginContainer.getInstance().getInventoryManager(); + ResourceContainer rc = im.getResourceContainer(res);
assertEquals(rc.getResourceComponentState(), ResourceContainer.ResourceComponentState.STOPPED, "A resource that has not been upgraded due to upgrade error in parent should be stopped.");
//recurse, since the whole subtree under the failed resource should be not upgraded and stopped. - checkResourcesNotUpgraded(res.getChildResources(), res.getChildResources().size()); + Set<Resource> children = im.getContainerChildren(rc); + checkResourcesNotUpgraded(children, children.size()); } }
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 3035fef..5bdc2d6 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 @@ -23,6 +23,7 @@ package org.rhq.core.pc.upgrade; import java.util.Set;
import org.jmock.Expectations; + import org.rhq.core.domain.discovery.AvailabilityReport; import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.ResourceType; @@ -44,6 +45,7 @@ public abstract class ResourceUpgradeTestBase extends PluginContainerTest { expectations.ignoring(ss.getConfigurationServerService()); expectations.ignoring(ss.getContentServerService()); expectations.ignoring(ss.getCoreServerService()); + expectations.ignoring(ss.getDriftServerService()); expectations.ignoring(ss.getEventServerService()); expectations.ignoring(ss.getMeasurementServerService()); expectations.ignoring(ss.getOperationServerService());
rhq-commits@lists.fedorahosted.org