[jboss-cvs] JBossAS SVN: r85584 - branches/Branch_5_x/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Mar 6 21:09:03 EST 2009
Author: bstansberry at jboss.com
Date: 2009-03-06 21:09:03 -0500 (Fri, 06 Mar 2009)
New Revision: 85584
Modified:
branches/Branch_5_x/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/ClusterPartitionManagedObjectsTestCase.java
Log:
[JBAS-6583] Test the DRM as part of the HAPartition managed object
Modified: branches/Branch_5_x/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/ClusterPartitionManagedObjectsTestCase.java
===================================================================
--- branches/Branch_5_x/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/ClusterPartitionManagedObjectsTestCase.java 2009-03-06 23:20:22 UTC (rev 85583)
+++ branches/Branch_5_x/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/ClusterPartitionManagedObjectsTestCase.java 2009-03-07 02:09:03 UTC (rev 85584)
@@ -21,8 +21,10 @@
*/
package org.jboss.test.cluster.defaultcfg.test;
+import java.util.HashSet;
import java.util.Map;
import java.util.Properties;
+import java.util.Set;
import javax.naming.Context;
import javax.naming.InitialContext;
@@ -79,9 +81,26 @@
assertEquals("HAPartition", mc.getNameType());
assertEquals("DefaultPartition", mc.getName());
+ Set<String> operationNames = new HashSet<String>();
+ getLog().debug(mc);
for (ManagedOperation mo : mc.getOperations())
- getLog().debug(mo);
+ {
+ getLog().debug("name="+mo.getName()+",description="+mo.getDescription()+",impact="+mo.getImpact());
+ operationNames.add(mo.getName());
+ }
+ assertTrue("HAPartition has showHistoryAsXML", operationNames.contains("showHistoryAsXML"));
+ assertTrue("HAPartition has showHistory", operationNames.contains("showHistory"));
+ // FIXME test for service lifecycle
+ // FIXME test for DRM operations pseudo-name defined via @ManagementProperty.name
+// assertTrue("HAPartition has getAllDRMServices", operationNames.contains("getAllDRMServices"));
+// assertTrue("HAPartition has listDRMContentAsXml", operationNames.contains("listDRMContentAsXml"));
+// assertTrue("HAPartition has getDRMServiceViewId", operationNames.contains("getDRMServiceViewId"));
+// assertTrue("HAPartition has lookupDRMNodeNames", operationNames.contains("lookupDRMNodeNames"));
+// assertTrue("HAPartition has listDRMContent", operationNames.contains("listDRMContent"));
+// assertTrue("HAPartition has isDRMMasterForService", operationNames.contains("isDRMMasterForService"));
+ assertEquals("Correct number of operations", 8, operationNames.size());
+
for (Map.Entry<String, ManagedProperty> entry : mc.getProperties().entrySet())
{
getLog().debug(entry.getKey() + " == " + entry.getValue());
@@ -91,27 +110,10 @@
getLog().debug(entry.getKey() + " -- ManagedObject == " + mo);
}
}
+ // FIXME validate the properties
}
/**
- * Look at the DistributedReplicantManager ManagedComponent
- * @throws Exception
- */
- public void testDistributedReplicantManager()
- throws Exception
- {
- ManagementView mgtView = getManagementView();
-// ComponentType type = new ComponentType("MCBean", "Clustering");
-// Set<ManagedComponent> mcs = mgtView.getMatchingComponents(this.partitionName, type,
-// new NameTypeQualifiedNameMatcher("DistributedReplicantManager"));
-// assertEquals("There is just one DistributedReplicantManager component", 1, mcs.size());
-// ManagedComponent mc = mcs.iterator().next();
- ComponentType type = new ComponentType("MCBean", "DistributedReplicantManager");
- ManagedComponent mc = mgtView.getComponent(this.partitionName, type);
- validateDRMManagedComponent(mc);
- }
-
- /**
* Obtain the ProfileService.ManagementView
* @return
* @throws Exception
@@ -140,13 +142,6 @@
return activeView;
}
- private void validateDRMManagedComponent(ManagedComponent mc)
- {
- assertNotNull(mc);
- assertEquals("DistributedReplicantManager", mc.getNameType());
- assertEquals("DefaultPartition", mc.getName());
- }
-
protected String getProfileName()
{
return "cluster-udp-0";
More information about the jboss-cvs-commits
mailing list