modules/core/arquillian-integration/container/src/main/java/org/rhq/test/arquillian/FakeServerInventory.java
| 8 -
modules/core/plugin-test-util/src/main/java/org/rhq/core/plugin/testutil/AbstractAgentPluginTest.java
| 73 +++++++++-
modules/plugins/jboss-as-7/pom.xml
| 47 ++++--
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractJBossAS7PluginTest.java
| 1
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/domain/SecurityModuleOptionsTest.java
| 41 +++--
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentRuntimeResourcesTest.java
| 2
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentTest.java
| 3
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java
| 57 ++++---
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/TemplatedResourcesTest.java
| 6
9 files changed, 173 insertions(+), 65 deletions(-)
New commits:
commit 746acfd0473f74a33f47b734f036a76659f1ee65
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Jan 31 19:50:23 2014 -0500
AS7 i-test work, continued...
- break up the test runs into a few different executions, deployment tests
seem to benefit from running independently
- add new waitForAsyncDiscoveryToStabilize() mechanism which is based on
tree size stabilizing as opposed to tree depth being reached. For large
discoveries (like an AS-7) tree depth is reached well before the whole
tree is discovered. Started using this as needed.
- fix various tests in various ways, see diffs
diff --git
a/modules/core/arquillian-integration/container/src/main/java/org/rhq/test/arquillian/FakeServerInventory.java
b/modules/core/arquillian-integration/container/src/main/java/org/rhq/test/arquillian/FakeServerInventory.java
index a553a5d..36fb392 100644
---
a/modules/core/arquillian-integration/container/src/main/java/org/rhq/test/arquillian/FakeServerInventory.java
+++
b/modules/core/arquillian-integration/container/src/main/java/org/rhq/test/arquillian/FakeServerInventory.java
@@ -99,12 +99,12 @@ public class FakeServerInventory {
synchronized (sync) {
if (!depthReached) {
if (LOG.isDebugEnabled()) {
- LOG.debug("Waiting for the discovery to complete on " +
this);
+ LOG.debug("Waiting for the discovery depth to be reached on
" + this);
}
sync.wait(timeoutMillis);
} else {
if (LOG.isDebugEnabled()) {
- LOG.debug("Discovery already complete... no need to wait on
" + this);
+ LOG.debug("Discovery depth already reached... no need to
wait on " + this);
}
}
@@ -112,6 +112,10 @@ public class FakeServerInventory {
}
}
+ public int getExpectedDepth() {
+ return expectedDepth;
+ }
+
private void setDepth(int resourceTreeDepth) {
synchronized (sync) {
if (LOG.isDebugEnabled()) {
diff --git
a/modules/core/plugin-test-util/src/main/java/org/rhq/core/plugin/testutil/AbstractAgentPluginTest.java
b/modules/core/plugin-test-util/src/main/java/org/rhq/core/plugin/testutil/AbstractAgentPluginTest.java
index c7a2333..e904c56 100644
---
a/modules/core/plugin-test-util/src/main/java/org/rhq/core/plugin/testutil/AbstractAgentPluginTest.java
+++
b/modules/core/plugin-test-util/src/main/java/org/rhq/core/plugin/testutil/AbstractAgentPluginTest.java
@@ -194,20 +194,89 @@ public abstract class AbstractAgentPluginTest extends Arquillian {
protected abstract int getTypeHierarchyDepth();
+ /**
+ * Note - this is still a bit weak. Waiting for a discovery depth to be reached does
not mean that discovery
+ * is actually complete. For many simple test hierarchies it is sufficient, but for
a large scale integration
+ * test, requiring full discovery of an AS-7 server (for example), it can reach the
target depth well before
+ * the entire tree is discovered and populated. In cases where you want to better
ensure complete discovery,
+ * try making a call to {@link #waitForAsyncDiscoveryToStabilize(Resource)}.
+ *
+ * @throws Exception
+ */
@AfterDiscovery
protected void waitForAsyncDiscoveries() throws Exception {
try {
+ System.out.println("\n====== Waiting for Discovery Depth [" +
discoveryCompleteChecker.getExpectedDepth()
+ + "] to be Reached...");
discoveryCompleteChecker.waitForDiscoveryComplete(12000);
- System.out.println("\n====== Discovery completed.");
+ System.out.println("\n====== Discovery Depth Reached.");
} catch (InterruptedException e) {
- throw new RuntimeException("Discovery did not complete within 12
seconds.");
+ throw new RuntimeException("Discovery depth not reached within 12
seconds.");
}
+
// Wait a while longer to give all Resource components a chance to start.
// TODO: Do this more intelligently so we don't sleep longer than needed.
Thread.sleep(10000);
}
/**
+ * Note - this is stronger than {@link #waitForAsyncDiscoveries()} but can be slower.
It waits until the
+ * discovered tree size stabilizes, which may take longer than hitting a target tree
depth.
+ * Tree depth may be sufficient for many simple test hierarchies but for a large
scale integration
+ * test, requiring full discovery of an AS-7 server (for example), it can reach the
target depth well before
+ * the entire tree is discovered and populated.
+ * </p>
+ * This is equivalent to {{waitForAsyncDiscoveryToStabilize(root, 5000L, 5)}}.
+ *
+ * @throws Exception
+ */
+ protected void waitForAsyncDiscoveryToStabilize(Resource root) throws Exception {
+ waitForAsyncDiscoveryToStabilize(root, 5000L, 5);
+ }
+
+ /**
+ * @param root
+ * @param checkInterval how long between checks of the tree size
+ * @param stableCount how many checks must be the same before we're convinced
we're stable
+ * @throws Exception
+ */
+ protected void waitForAsyncDiscoveryToStabilize(Resource root, long checkInterval,
int stableCount)
+ throws Exception {
+ int startResCount = 0;
+ int endResCount = getResCount(root);
+ int numStableChecks = 0;
+ log.info("waitForAsyncDiscoveryToStabilize: ResourceCount Start=" +
endResCount);
+ do {
+ startResCount = endResCount;
+ try {
+ Thread.sleep(checkInterval);
+ } catch (InterruptedException e) {
+ //
+ }
+ endResCount = getResCount(root);
+
+ if (startResCount == endResCount) {
+ ++numStableChecks;
+ } else {
+ numStableChecks = 0;
+ }
+ } while (startResCount < endResCount || numStableChecks < stableCount);
+ log.info("waitForAsyncDiscoveryToStabilize: ResourceCount Stable at=" +
endResCount);
+ }
+
+ private int getResCount(Resource resource) {
+ int size = 1;
+ Set<Resource> children = resource.getChildResources();
+ if (null != children && !children.isEmpty()) {
+ HashSet<Resource> safeChildren = new
HashSet<Resource>(children);
+ for (Resource r : safeChildren) {
+ size += getResCount(r);
+ }
+ }
+ return size;
+ }
+
+ /**
* Get availability for a Resource synchronously, with a 5 second timeout.
*
* @param resource the Resource
diff --git a/modules/plugins/jboss-as-7/pom.xml b/modules/plugins/jboss-as-7/pom.xml
index 7827000..401f21c 100644
--- a/modules/plugins/jboss-as-7/pom.xml
+++ b/modules/plugins/jboss-as-7/pom.xml
@@ -625,19 +625,6 @@
<configuration>
<skipTests>false</skipTests>
<skipITs>false</skipITs>
- <includes>
- <!-- only include integration tests; normal unit tests are handled
above by surefire plugin -->
-
<include>org/rhq/modules/plugins/jbossas7/itest/**/*Test.java</include>
-
<!--<include>org/rhq/modules/plugins/jbossas7/itest/standalone/StandaloneServerComponentTest.java</include>-->
-
<!--<include>org/rhq/modules/plugins/jbossas7/itest/standalone/InterruptibleOperationsTest.java</include>-->
-
<!--<include>org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentTest.java</include>-->
-
<!--<include>org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentRuntimeResourcesTest.java</include>-->
-
<!--<include>org/rhq/modules/plugins/jbossas7/itest/standalone/WebConnectorComponentTest.java</include>-->
-
<!--<include>org/rhq/modules/plugins/jbossas7/itest/domain/DomainServerComponentTest.java</include>-->
-
<!--<include>org/rhq/modules/plugins/jbossas7/itest/domain/ManagedServerTest.java</include>-->
-
<!--<include>org/rhq/modules/plugins/jbossas7/itest/domain/SecurityModuleOptionsTest.java</include>-->
-
<!--<include>org/rhq/modules/plugins/jbossas7/itest/nonpc/ManagementConnectionPersistenceTest.java</include>-->
- </includes>
<properties>
<property>
<name>listener</name>
@@ -658,7 +645,41 @@
</systemPropertyVariables>
</configuration>
<executions>
+ <!-- Some of these test classes seem to do better when run by
themseleves. So, use different executions... -->
<execution>
+ <id>DeploymentRuntimeResourcesTest</id>
+ <configuration>
+ <includes>
+
<include>org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentRuntimeResourcesTest.java</include>
+ </includes>
+ </configuration>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>DeploymentTest</id>
+ <configuration>
+ <includes>
+
<include>org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentTest.java</include>
+ </includes>
+ </configuration>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>everything-else</id>
+ <configuration>
+ <includes>
+
<include>org/rhq/modules/plugins/jbossas7/itest/**/*Test.java</include>
+ </includes>
+ <excludes>
+
<exclude>org/rhq/modules/plugins/jbossas7/itest/standalone/Deployment*Test.java</exclude>
+ </excludes>
+ </configuration>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
diff --git
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractJBossAS7PluginTest.java
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractJBossAS7PluginTest.java
index 780d398..db7e35a 100644
---
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractJBossAS7PluginTest.java
+++
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractJBossAS7PluginTest.java
@@ -72,7 +72,6 @@ public abstract class AbstractJBossAS7PluginTest extends
AbstractAgentPluginTest
protected void installManagementUsers() throws PluginContainerException, Exception {
waitForAsyncDiscoveries();
- System.out.println("\n=== Discovery scan completed.");
if (!createdManagementUsers) {
System.out.println("====== Installing management users...");
diff --git
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/domain/SecurityModuleOptionsTest.java
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/domain/SecurityModuleOptionsTest.java
index 182ef36..ead0224 100644
---
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/domain/SecurityModuleOptionsTest.java
+++
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/domain/SecurityModuleOptionsTest.java
@@ -79,6 +79,9 @@ public class SecurityModuleOptionsTest extends
AbstractJBossAS7PluginTest {
private static String SECURITY_RESOURCE_TYPE = "Security";
private static String SECURITY_RESOURCE_KEY = "subsystem=security";
private static String SECURITY_DOMAIN_RESOURCE_KEY = "security-domain";
+ // Out of box:
+ // The full-ha profile is associated with other-server-group
+ // server-three is in other-server-group and not started
private static String PROFILE = "profile=full-ha";
private static String SECURITY_DOMAIN_RESOURCE_TYPE = "Security Domain";
private static String AUTH_CLASSIC_RESOURCE_TYPE = "Authentication
(Classic)";
@@ -119,9 +122,10 @@ public class SecurityModuleOptionsTest extends
AbstractJBossAS7PluginTest {
"[{\"code\":\"Test\",
\"type\":\"attribute\",
\"module-options\":{\"mapping\":\"module\",
\"mapping1\":\"module1\"}}]");
jsonMap.put("provider-modules",
"[{\"code\":\"Providers\",
\"module-options\":{\"provider\":\"module\",
\"provider1\":\"module1\"}}]");
- jsonMap
- .put("acl-modules",
- "[{\"flag\":\"sufficient\",
\"code\":\"ACL\",
\"module-options\":{\"acl\":\"module\",
\"acl1\":\"module1\"}}]");
+ // (jshaughn) commenting out, this caused an NPE (EAP 6.0.1), not sure why...
+ //jsonMap
+ // .put("acl-modules",
+ // "[{\"flag\":\"sufficient\",
\"code\":\"ACL\",
\"module-options\":{\"acl\":\"module\",
\"acl1\":\"module1\"}}]");
jsonMap
.put("trust-modules",
"[{\"flag\":\"optional\",
\"code\":\"TRUST\",
\"module-options\":{\"trust\":\"module\",
\"trust1\":\"module1\"}}]");
@@ -156,9 +160,6 @@ public class SecurityModuleOptionsTest extends
AbstractJBossAS7PluginTest {
mapper = new ObjectMapper();
mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES,
false);
- //Adjust discovery depth to support deeper hierarchy depth of Module Option
elements
- setMaxDiscoveryDepthOverride(12);
-
//create new Security Domain
Address destination = new Address(PROFILE);
destination.addSegment(SECURITY_RESOURCE_KEY);
@@ -200,6 +201,7 @@ public class SecurityModuleOptionsTest extends
AbstractJBossAS7PluginTest {
assert false : "An unknown attribute '" + attribute
+ "' was found. Is there a new type to be supported?";
}
+
//build the operation to add the component
////Load json map into ModuleOptionType
List<Value> moduleTypeValue = new ArrayList<Value>();
@@ -222,6 +224,8 @@ public class SecurityModuleOptionsTest extends
AbstractJBossAS7PluginTest {
moduleTypeValue);
//submit the command
result = connection.execute(op);
+ assert result.getOutcome().equals("success") : "Add
ModuleOptionType has failed: "
+ + result.getFailureDescription();
}
}
@@ -236,9 +240,8 @@ public class SecurityModuleOptionsTest extends
AbstractJBossAS7PluginTest {
assertNotNull(platform);
assertEquals(platform.getInventoryStatus(), InventoryStatus.COMMITTED);
- //Have thread sleep longer to discover deeper resource types.
- //spinder 6/29/12: up this number if the resources are not being discovered.
- Thread.sleep(240 * 1000L); // delay so that PC gets a chance to scan for
resources
+ // ensure the entire EAP inventory is discovered before continuing, we need deep
resources in inventory
+ waitForAsyncDiscoveryToStabilize(platform);
}
/** This test method exercises a number of things:
@@ -273,8 +276,7 @@ public class SecurityModuleOptionsTest extends
AbstractJBossAS7PluginTest {
//check the configuration for the Module Option Type Ex. 'Acl
(Profile)' Resource. Should be able to verify components
Resource moduleOptionsTypeResource = getModuleOptionTypeResource(attribute);
//assert non-zero id returned
- assert moduleOptionsTypeResource.getId() > 0 : "The resource was not
properly initialized. Expected id >0 but got:"
- + moduleOptionsTypeResource.getId();
+ assert moduleOptionsTypeResource.getId() != 0 : "The resource was not
properly initialized. Expected id != 0";
//Now request the resource complete with resource config
Configuration loadedConfiguration = testConfigurationManager
@@ -331,8 +333,7 @@ public class SecurityModuleOptionsTest extends
AbstractJBossAS7PluginTest {
//Ex. Module Options for (Acl Modules - Profile)
Resource moduleOptionsResource =
getModuleOptionsResource(moduleOptionsTypeResource, attribute);
//assert non-zero id returned
- assert moduleOptionsResource.getId() > 0 : "The resource was not
properly initialized. Expected id > 0 but got:"
- + moduleOptionsResource.getId();
+ assert moduleOptionsResource.getId() != 0 : "The resource was not
properly initialized. Expected id != 0";
//fetch configuration for module options
//Now request the resource complete with resource config
Configuration loadedOptionsConfiguration = testConfigurationManager
@@ -487,19 +488,28 @@ public class SecurityModuleOptionsTest extends
AbstractJBossAS7PluginTest {
if (testSecurityDomain == null) {
InventoryManager im = pluginContainer.getInventoryManager();
Resource platform = im.getPlatform();
+ if (platform != null)
+ System.out.println("*** Found Platform [" +
platform.getResourceKey() + "]");
//host controller
Resource hostController = getResourceByTypeAndKey(platform,
DomainServerComponentTest.RESOURCE_TYPE,
DomainServerComponentTest.RESOURCE_KEY);
+ if (hostController != null)
+ System.out.println("*** Found Host Controller [" +
hostController.getResourceKey() + "]");
+
//profile=full-ha
ResourceType profileType = new ResourceType("Profile", PLUGIN_NAME,
ResourceCategory.SERVICE, null);
String key = PROFILE;
Resource profile = getResourceByTypeAndKey(hostController, profileType,
key);
+ if (profile != null)
+ System.out.println("*** Found Profile [" +
platform.getResourceKey() + "]");
//Security (Profile)
ResourceType securityType = new ResourceType("Security (Profile)",
PLUGIN_NAME, ResourceCategory.SERVICE,
null);
key += "," + SECURITY_RESOURCE_KEY;
Resource security = getResourceByTypeAndKey(profile, securityType, key);
+ if (security != null)
+ System.out.println("*** Found Security [" +
security.getResourceKey() + "]");
//Security Domain (Profile)
ResourceType domainType = new ResourceType("Security Domain
(Profile)", PLUGIN_NAME,
@@ -507,6 +517,8 @@ public class SecurityModuleOptionsTest extends
AbstractJBossAS7PluginTest {
key += "," + securityDomainId;
testSecurityDomainKey = key;
testSecurityDomain = getResourceByTypeAndKey(security, domainType, key);
+ if (testSecurityDomain != null)
+ System.out.println("*** Found Domain [" +
testSecurityDomain.getResourceKey() + "]");
}
//acl=classic
@@ -546,8 +558,11 @@ public class SecurityModuleOptionsTest extends
AbstractJBossAS7PluginTest {
}
moduleOptionResource = getResourceByTypeAndKey(testSecurityDomain,
moduleOptionType, moduleOptionTypeKey);
+ if (moduleOptionResource != null)
+ System.out.println("*** Found ModuleOption [" +
moduleOptionResource.getResourceKey() + "]");
return moduleOptionResource;
+
}
/** Automates hierarchy creation for Module Option type resources and their parents
diff --git
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentRuntimeResourcesTest.java
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentRuntimeResourcesTest.java
index 3747821..1f915d5 100644
---
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentRuntimeResourcesTest.java
+++
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentRuntimeResourcesTest.java
@@ -65,7 +65,7 @@ import org.rhq.test.arquillian.RunDiscovery;
*
* @author Thomas Segismont
*/
-@Test
+@Test(groups = { "integration", "pc", "standalone" },
singleThreaded = true)
public class DeploymentRuntimeResourcesTest extends AbstractJBossAS7PluginTest {
private static final Log LOG =
LogFactory.getLog(DeploymentRuntimeResourcesTest.class);
diff --git
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentTest.java
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentTest.java
index fbdc02b..c3a8ec4 100644
---
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentTest.java
+++
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentTest.java
@@ -127,7 +127,6 @@ public class DeploymentTest extends AbstractJBossAS7PluginTest {
serverResource = standaloneResources.iterator().next();
}
- //(dependsOnMethods = "assignServerResource")
@Test(priority = 11)
public void testDeploy() throws Exception {
ResourcePackageDetails packageDetails =
getTestDeploymentPackageDetails(TestDeployments.DEPLOYMENT_1);
@@ -215,7 +214,6 @@ public class DeploymentTest extends AbstractJBossAS7PluginTest {
}
@Test(priority = 15)
- @RunDiscovery
public void testWebRuntimeMetricsHaveNonNullValues() throws Exception {
assertTrue(webRuntimeResources != null &&
!webRuntimeResources.isEmpty(),
"Web Runtime resource should have been discovered");
@@ -237,7 +235,6 @@ public class DeploymentTest extends AbstractJBossAS7PluginTest {
}
@Test(priority = 16)
- @RunDiscovery
public void testUndeploy() throws Exception {
Resource deployment = deploymentResources.iterator().next();
DeleteResourceRequest request = new DeleteResourceRequest(0,
deployment.getId());
diff --git
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java
index 8d391a1..e918d50 100644
---
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java
+++
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java
@@ -55,16 +55,35 @@ public class ResourcesStandaloneServerTest extends
AbstractJBossAS7PluginTest {
assertNotNull(platform);
assertEquals(platform.getInventoryStatus(), InventoryStatus.COMMITTED);
- Thread.sleep(20 * 1000L);
-
ResourceContainer platformContainer =
inventoryManager.getResourceContainer(platform);
Resource server = getResourceByTypeAndKey(platform,
StandaloneServerComponentTest.RESOURCE_TYPE,
StandaloneServerComponentTest.RESOURCE_KEY);
inventoryManager.activateResource(server, platformContainer, false);
-
- Thread.sleep(40 * 1000L);
}
+ @Test(priority = 11)
+ public void standaloneExecuteNoArgOperations() throws Exception {
+ List<String> ignoredSubsystems = new ArrayList<String>();
+
+ //ignored because mod_cluster is not setup in default server configuration
+ //to be more specific, there is no server to fail-over to
+ ignoredSubsystems.add("ModCluster Standalone Service");
+
+ List<String> ignoredOperations = new ArrayList<String>();
+ //ignored because there is no other server to fail-over to
+ ignoredOperations.add("subsystem:force-failover");
+ //ignored because this is not a true operation, it is handled
+ //internally by a configuration property change
+ ignoredOperations.add("enable");
+ //ignored because the Osgi subsystem not configured out of box
+ ignoredOperations.add("subsystem:activate");
+
+ Resource platform = this.pluginContainer.getInventoryManager().getPlatform();
+ Resource server = getResourceByTypeAndKey(platform,
StandaloneServerComponentTest.RESOURCE_TYPE,
+ StandaloneServerComponentTest.RESOURCE_KEY);
+
+ executeNoArgOperations(server, ignoredSubsystems, ignoredOperations);
+ }
@Test(priority = 12)
public void loadUpdateResourceConfiguration() throws Exception {
@@ -89,6 +108,13 @@ public class ResourcesStandaloneServerTest extends
AbstractJBossAS7PluginTest {
ignoredResources.add("Memory Pool");
ignoredResources.add("Periodic Rotating File Handler");
+ //created BZ 1059882 for failures related to:
+ // attribute discovery-group-name (mutually exclusive issue?)
+ ignoredResources.add("Pooled Connection Factory");
+ ignoredResources.add("Connection Factory");
+ // attribute static-connectors (nullable list issue?)
+ ignoredResources.add("Cluster Connection");
+
Resource platform = this.pluginContainer.getInventoryManager().getPlatform();
Resource server = getResourceByTypeAndKey(platform,
StandaloneServerComponentTest.RESOURCE_TYPE,
StandaloneServerComponentTest.RESOURCE_KEY);
@@ -97,28 +123,5 @@ public class ResourcesStandaloneServerTest extends
AbstractJBossAS7PluginTest {
Assert.assertEquals(errorCount, 0);
}
- @Test(priority = 11)
- public void standaloneExecuteNoArgOperations() throws Exception {
- List<String> ignoredSubsystems = new ArrayList<String>();
-
- //ignored because mod_cluster is not setup in default server configuration
- //to be more specific, there is no server to fail-over to
- ignoredSubsystems.add("ModCluster Standalone Service");
-
- List<String> ignoredOperations = new ArrayList<String>();
- //ignored because there is no other server to fail-over to
- ignoredOperations.add("subsystem:force-failover");
- //ignored because this is not a true operation, it is handled
- //internally by a configuration property change
- ignoredOperations.add("enable");
- //ignored because the Osgi subsystem not configured out of box
- ignoredOperations.add("subsystem:activate");
-
- Resource platform = this.pluginContainer.getInventoryManager().getPlatform();
- Resource server = getResourceByTypeAndKey(platform,
StandaloneServerComponentTest.RESOURCE_TYPE,
- StandaloneServerComponentTest.RESOURCE_KEY);
-
- executeNoArgOperations(server, ignoredSubsystems, ignoredOperations);
- }
}
diff --git
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/TemplatedResourcesTest.java
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/TemplatedResourcesTest.java
index 908faff..cbd5ef8 100644
---
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/TemplatedResourcesTest.java
+++
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/TemplatedResourcesTest.java
@@ -58,7 +58,7 @@ public class TemplatedResourcesTest extends AbstractJBossAS7PluginTest
{
assertNotNull(platform);
assertEquals(platform.getInventoryStatus(), InventoryStatus.COMMITTED);
- Thread.sleep(40 * 1000L);
+ //Thread.sleep(40 * 1000L);
}
@Test(priority = 11)
@@ -73,7 +73,7 @@ public class TemplatedResourcesTest extends AbstractJBossAS7PluginTest
{
StandaloneServerComponentTest.RESOURCE_KEY);
inventoryManager.activateResource(server, platformContainer, false);
- Thread.sleep(30 * 1000L);
+ //Thread.sleep(30 * 1000L);
for (ResourceData resourceData : testResourceData) {
ResourceType resourceType = new ResourceType(resourceData.resourceTypeName,
PLUGIN_NAME,
@@ -100,7 +100,7 @@ public class TemplatedResourcesTest extends AbstractJBossAS7PluginTest
{
for (Resource resourceUnderTest : foundResources) {
log.info(foundResources);
- assert resourceUnderTest.getId() > 0 : "Resource not properly
initialized. Id = 0. Try extending sleep after discovery.";
+ assert resourceUnderTest.getId() != 0 : "Resource not properly
initialized. Id = 0. Try extending sleep after discovery.";
Configuration resourceUnderTestConfig = configurationManager
.loadResourceConfiguration(resourceUnderTest.getId());