modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/avail/AvailTest.java | 14 +++++-----
modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/DiscoveryTest.java | 2 -
modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/InventoryManagerTest.java | 10 +++++--
modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/getnativeprocess/NativeProcessRetrievalTest.java | 7 ++---
pom.xml | 2 -
5 files changed, 20 insertions(+), 15 deletions(-)
New commits:
commit 4990d3896d4197e56274541d49902346abe97e22
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri May 25 12:54:04 2012 -0400
ensure tests run in a predictable order
diff --git a/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/avail/AvailTest.java b/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/avail/AvailTest.java
index 9322b2d..005e900 100644
--- a/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/avail/AvailTest.java
+++ b/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/avail/AvailTest.java
@@ -148,7 +148,7 @@ public class AvailTest extends Arquillian {
}
}
- @Test(groups = "pc.itest.avail")
+ @Test(groups = "pc.itest.avail", priority = 20)
public void testDiscovery() throws Exception {
Assert.assertNotNull(pluginContainer);
Assert.assertTrue(pluginContainer.isStarted());
@@ -170,7 +170,7 @@ public class AvailTest extends Arquillian {
Assert.assertEquals(grandchildComponents2.size(), 8, "missing grandchild2");
}
- @Test(groups = "pc.itest.avail", dependsOnMethods = "testDiscovery")
+ @Test(groups = "pc.itest.avail", priority = 21)
public void testAvailReport() throws Exception {
AvailabilityExecutor executor = new ForceAvailabilityExecutor(this.pluginContainer.getInventoryManager());
dumpContainers("testAvailReport() Start");
@@ -213,7 +213,7 @@ public class AvailTest extends Arquillian {
assertScan(scan, true, false, 29, 7, 23, 28, 0, 6);
}
- @Test(groups = "pc.itest.avail", dependsOnMethods = "testDiscovery")
+ @Test(groups = "pc.itest.avail", priority = 21)
public void testScheduling() throws Exception {
AvailabilityExecutor executor = new ForceAvailabilityExecutor(this.pluginContainer.getInventoryManager());
AvailabilityReport report = executor.call();
@@ -266,7 +266,7 @@ public class AvailTest extends Arquillian {
Assert.assertTrue(numBuckets >= 3, "Random distribution seems wrong, buckets hit= " + numBuckets);
}
- @Test(groups = "pc.itest.avail", dependsOnMethods = "testDiscovery")
+ @Test(groups = "pc.itest.avail", priority = 21)
// If a parent changes to UP, its children must all be checked as they could legitimately be something
// other than UP.
public void testForceChildrenOfParentUp() throws Exception {
@@ -330,7 +330,7 @@ public class AvailTest extends Arquillian {
assertScan(scan, false, false, 29, 14, 15, 12, 2, 0);
}
- @Test(groups = "pc.itest.avail", dependsOnMethods = "testDiscovery")
+ @Test(groups = "pc.itest.avail", priority = 21)
// If a parent changes to DOWN, its children should all defer to being DOWN as well.
public void testDeferToParentDown() throws Exception {
// don't use a ForceAvailabilityExecutor for this test, we want to manipulate what gets checked
@@ -401,7 +401,7 @@ public class AvailTest extends Arquillian {
assertScan(scan, false, false, 29, 14, 3, 0, 2, 12);
}
- @Test(groups = "pc.itest.avail", dependsOnMethods = "testDiscovery")
+ @Test(groups = "pc.itest.avail", priority = 21)
public void testCheckOnlyEligible() throws Exception {
// Force all the avails to UP to start so we can avoid the scenario in testForceChildrenOfParentUp()
AvailabilityExecutor executor = new ForceAvailabilityExecutor(this.pluginContainer.getInventoryManager());
@@ -466,7 +466,7 @@ public class AvailTest extends Arquillian {
assertScan(scan, false, false, 29, 0, 1, 0, 0, 0);
}
- @Test(groups = "pc.itest.avail", dependsOnMethods = "testDiscovery")
+ @Test(groups = "pc.itest.avail", priority = 21)
public void testDeferToParent() throws Exception {
AvailabilityExecutor executor = new ForceAvailabilityExecutor(this.pluginContainer.getInventoryManager());
AvailabilityReport report = executor.call();
diff --git a/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/DiscoveryTest.java b/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/DiscoveryTest.java
index 95379b9..474c5c9 100644
--- a/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/DiscoveryTest.java
+++ b/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/DiscoveryTest.java
@@ -97,7 +97,7 @@ public class DiscoveryTest extends Arquillian {
* @throws Exception if an error occurs
*/
@RunDiscovery
- @Test(groups = "pc.itest.discovery")
+ @Test(groups = "pc.itest.discovery", priority = 10)
public void testDiscoveryRunsOnlyOncePerType() throws Exception {
// make sure our inventory is as we expect it to be
validatePluginContainerInventory();
diff --git a/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/InventoryManagerTest.java b/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/InventoryManagerTest.java
index e9305fc..dcacd01 100644
--- a/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/InventoryManagerTest.java
+++ b/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/InventoryManagerTest.java
@@ -52,6 +52,7 @@ import org.rhq.test.shrinkwrap.RhqAgentPluginArchive;
*
* @author Ian Springer
*/
+@RunDiscovery
public class InventoryManagerTest extends Arquillian {
@Deployment(name = "test")
@@ -99,8 +100,7 @@ public class InventoryManagerTest extends Arquillian {
*
* @throws Exception if an error occurs
*/
- @Test(groups = "pc.itest.inventorymanager")
- @RunDiscovery
+ @Test(groups = "pc.itest.inventorymanager", priority = 1)
public void testSyncUnknownResources() throws Exception {
validatePluginContainerInventory();
@@ -130,7 +130,7 @@ public class InventoryManagerTest extends Arquillian {
*
* @throws Exception if an error occurs
*/
- @Test(groups = "pc.itest.inventorymanager", dependsOnMethods = "testSyncUnknownResources")
+ @Test(groups = "pc.itest.inventorymanager", priority = 1)
public void testUninventoryResources() throws Exception {
validatePluginContainerInventory();
@@ -164,10 +164,14 @@ public class InventoryManagerTest extends Arquillian {
Assert.assertNotNull(platform);
Assert.assertEquals(platform.getInventoryStatus(), InventoryStatus.COMMITTED);
+ Assert.assertEquals(platform.getChildResources().size(), 1,
+ "platform child Resources: " + platform.getChildResources());
Resource server = platform.getChildResources().iterator().next();
Assert.assertNotNull(server);
Assert.assertEquals(server.getInventoryStatus(), InventoryStatus.COMMITTED);
+ Assert.assertEquals(server.getChildResources().size(), 1,
+ "server child Resources: " + server.getChildResources());
Resource service = server.getChildResources().iterator().next();
Assert.assertNotNull(service);
Assert.assertEquals(service.getInventoryStatus(), InventoryStatus.COMMITTED);
diff --git a/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/getnativeprocess/NativeProcessRetrievalTest.java b/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/getnativeprocess/NativeProcessRetrievalTest.java
index 7df75d0..4170115 100644
--- a/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/getnativeprocess/NativeProcessRetrievalTest.java
+++ b/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/getnativeprocess/NativeProcessRetrievalTest.java
@@ -84,7 +84,7 @@ public class NativeProcessRetrievalTest extends Arquillian {
}
}
- @Test(groups = "pc.itest.native")
+ @Test(groups = "pc.itest.native", priority = 30)
public void testProcessInfoAccurateAfterProcessRestart() throws Exception {
Assert.assertEquals(components.size(), 1, "There should be exactly 1 resource discovered");
@@ -107,7 +107,7 @@ public class NativeProcessRetrievalTest extends Arquillian {
Assert.assertNotEquals(beforePid, afterPid, "The process info should have refreshed");
}
- @Test(groups = "pc.itest.native")
+ @Test(groups = "pc.itest.native", priority = 30)
public void testProcessInfoAccurateWhenProcessStopped() throws Exception {
Assert.assertEquals(components.size(), 1, "There should be exactly 1 resource discovered");
@@ -131,7 +131,7 @@ public class NativeProcessRetrievalTest extends Arquillian {
startTestProcess();
}
- @Test(groups = "pc.itest.native")
+ @Test(groups = "pc.itest.native", priority = 30)
public void testProcessInfoAccurateAfterProcessStarted() throws Exception {
Assert.assertEquals(components.size(), 1, "There should be exactly 1 resource discovered");
@@ -161,4 +161,5 @@ public class NativeProcessRetrievalTest extends Arquillian {
Assert.assertEquals(afterDiscoveryCallCount, beforeDiscoveryCallCount + 1, "Exactly 1 discovery call should have been made to refresh the process info after the process started again.");
Assert.assertNotEquals(afterPid, 0, "The process info should have refreshed");
}
+
}
commit 81711fb7e1a77e5717cdb4296157c2f3ef835ac5
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri May 25 12:53:23 2012 -0400
upgrade TestNG from 6.4 to 6.5.2
diff --git a/pom.xml b/pom.xml
index de04570..a660fa2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -99,7 +99,7 @@
<jna.version>3.2.5</jna.version>
<twitter4j.version>2.2.4</twitter4j.version>
<commons-codec.version>1.4</commons-codec.version>
- <testng.version>6.4</testng.version>
+ <testng.version>6.5.2</testng.version>
<cobertura.version>1.9.4.1</cobertura.version>
<augeas.version>0.9.0</augeas.version>
<augeas.classifier>el5</augeas.classifier>