[jboss-cvs] JBossAS SVN: r65076 - trunk/testsuite/src/main/org/jboss/test/profileservice/test.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Sep 5 01:52:34 EDT 2007
Author: scott.stark at jboss.org
Date: 2007-09-05 01:52:34 -0400 (Wed, 05 Sep 2007)
New Revision: 65076
Modified:
trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
Log:
JBAS-4672, Add a testDefaultDSOps
Modified: trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java 2007-09-05 05:51:40 UTC (rev 65075)
+++ trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java 2007-09-05 05:52:34 UTC (rev 65076)
@@ -37,6 +37,7 @@
import org.jboss.managed.api.ManagedComponent;
import org.jboss.managed.api.ManagedDeployment;
import org.jboss.managed.api.ManagedObject;
+import org.jboss.managed.api.ManagedOperation;
import org.jboss.managed.api.ManagedProperty;
import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
import org.jboss.metatype.api.types.CompositeMetaType;
@@ -70,6 +71,7 @@
suite.addTest(new ProfileServiceUnitTestCase("testProfileKeys"));
suite.addTest(new ProfileServiceUnitTestCase("testDeploymentNames"));
+ suite.addTest(new ProfileServiceUnitTestCase("testTemplateNames"));
suite.addTest(new ProfileServiceUnitTestCase("testNoSuchProfileException"));
// JMS
suite.addTest(new ProfileServiceUnitTestCase("testJmsDestinationComponents"));
@@ -79,11 +81,6 @@
suite.addTest(new ProfileServiceUnitTestCase("testUpdateDefaultDS"));
suite.addTest(new ProfileServiceUnitTestCase("testAddDataSource"));
suite.addTest(new ProfileServiceUnitTestCase("testRemoveDataSource"));
- // FakeDataSource
- suite.addTest(new ProfileServiceUnitTestCase("testAddFakeDataSource"));
- suite.addTest(new ProfileServiceUnitTestCase("testUpdateFakeDataSource"));
- suite.addTest(new ProfileServiceUnitTestCase("testListFakeDataSourceComponents"));
- suite.addTest(new ProfileServiceUnitTestCase("testRemoveFakeDataSource"));
return suite;
}
@@ -154,6 +151,15 @@
assertTrue(name, simpleNames.contains(name));
}
+ public void testTemplateNames()
+ throws Exception
+ {
+ ManagementView mgtView = getManagementView();
+ Set<String> names = mgtView.getTemplateNames();
+ log.info("getTemplateNames, "+names);
+ assertTrue("DsDataSourceTemplate exists", names.contains("DsDataSourceTemplate"));
+ }
+
/**
* Basic test to validate NoSuchProfileException is thrown for
* a ProfileKey that does not map to a profile.
@@ -178,6 +184,7 @@
* Test that one can query for deployments of type jca-ds to
* obtain data source deployments.
* TODO: don't know if we should keep this
+ */
public void testDataSourceDeploymentType()
throws Exception
{
@@ -185,8 +192,15 @@
Set<String> names = mgtView.getDeploymentNamesForType("jca-ds");
log.info("jca-ds names: "+names);
assertTrue("names.size > 0 ", names.size() > 0);
+ boolean sawHsqldbDS = false;
+ for (String name : names)
+ {
+ sawHsqldbDS = name.endsWith("hsqldb-ds.xml");
+ if (sawHsqldbDS)
+ break;
+ }
+ assertTrue("Saw hsqldb-ds.xml in names", sawHsqldbDS);
}
- */
/**
* test api usage only
@@ -305,18 +319,33 @@
// TODO: Query the mbeans to validate the change
// TODO: Query the profile service repository for the overriden data
-
}
/**
+ * Validate that the DefaultDS management ops work
+ * @throws Exception
+ */
+ public void testDefaultDSOps()
+ throws Exception
+ {
+ ManagementView mgtView = getManagementView();
+ ComponentType type = new ComponentType("DataSource", "LocalTx");
+ ManagedComponent hsqldb = getManagedComponent(mgtView, type, "DefaultDS");
+ Set<ManagedOperation> ops = hsqldb.getOperations();
+ assertNotNull("Set<ManagedOperation>", ops);
+ assertTrue("Set<ManagedOperation> > 0", ops.size() > 0);
+ }
+
+ /**
* Test adding a new hsql DataSource deployment
+ * TODO: JBAS-4671
* @throws Exception
*/
public void testAddDataSource() throws Exception
{
ManagementView mgtView = getManagementView();
log.info("Templates: "+mgtView.getTemplateNames());
- DeploymentTemplateInfo dsInfo = mgtView.getTemplate("DsXmlDataSourceTemplate");
+ DeploymentTemplateInfo dsInfo = mgtView.getTemplate("DsDataSourceTemplate");
Map<String, ManagedProperty> props = dsInfo.getProperties();
log.info("ManagedPropertys: "+props);
More information about the jboss-cvs-commits
mailing list