[jboss-cvs] JBossAS SVN: r81780 - trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Nov 28 11:36:55 EST 2008
Author: bstansberry at jboss.com
Date: 2008-11-28 11:36:55 -0500 (Fri, 28 Nov 2008)
New Revision: 81780
Modified:
trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/ClusterPartitionManagedObjectsTestCase.java
Log:
[JBAS-6523] Test case should use JBossClusteredTestCase facilities
Modified: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/ClusterPartitionManagedObjectsTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/ClusterPartitionManagedObjectsTestCase.java 2008-11-28 16:22:22 UTC (rev 81779)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/ClusterPartitionManagedObjectsTestCase.java 2008-11-28 16:36:55 UTC (rev 81780)
@@ -22,8 +22,11 @@
package org.jboss.test.cluster.defaultcfg.test;
import java.util.Map;
-import java.util.Set;
+import java.util.Properties;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
import org.jboss.deployers.spi.management.ManagementView;
import org.jboss.deployers.spi.management.NameMatcher;
import org.jboss.managed.api.ComponentType;
@@ -31,7 +34,10 @@
import org.jboss.managed.api.ManagedObject;
import org.jboss.managed.api.ManagedOperation;
import org.jboss.managed.api.ManagedProperty;
-import org.jboss.test.profileservice.test.AbstractProfileServiceTest;
+import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.ProfileService;
+import org.jboss.test.JBossClusteredTestCase;
+import org.jboss.virtual.VFS;
/**
* Validates the expected HAPartition-related ManagedObjects are there
@@ -40,7 +46,7 @@
* @version $Revision:$
*/
public class ClusterPartitionManagedObjectsTestCase
- extends AbstractProfileServiceTest
+ extends JBossClusteredTestCase
{
protected ManagementView activeView;
private String partitionName = System.getProperty("jbosstest.partitionName", "DefaultPartition");
@@ -105,6 +111,35 @@
validateDRMManagedComponent(mc);
}
+ /**
+ * Obtain the ProfileService.ManagementView
+ * @return
+ * @throws Exception
+ */
+ protected ManagementView getManagementView()
+ throws Exception
+ {
+ if( activeView == null )
+ {
+ String profileName = getProfileName();
+
+ String[] urls = getNamingURLs();
+ Properties env = new Properties();
+ env.setProperty(Context.INITIAL_CONTEXT_FACTORY,
+ "org.jnp.interfaces.NamingContextFactory");
+ env.setProperty(Context.PROVIDER_URL, urls[0]);
+ Context ctx = new InitialContext(env);
+
+ ProfileService ps = (ProfileService) ctx.lookup("ProfileService");
+ activeView = ps.getViewManager();
+ ProfileKey defaultKey = new ProfileKey(profileName);
+ activeView.loadProfile(defaultKey);
+ // Init the VFS to setup the vfs* protocol handlers
+ VFS.init();
+ }
+ return activeView;
+ }
+
private void validateDRMManagedComponent(ManagedComponent mc)
{
assertNotNull(mc);
@@ -112,7 +147,6 @@
assertEquals("DefaultPartition", mc.getName());
}
- @Override
protected String getProfileName()
{
return "cluster-udp-0";
@@ -130,9 +164,7 @@
public boolean matches(ManagedComponent comp, String name)
{
return name.equals(comp.getName()) && nameType.equals(comp.getNameType());
- }
-
-
+ }
}
}
More information about the jboss-cvs-commits
mailing list