[jboss-cvs] JBossAS SVN: r59867 - trunk/testsuite/src/main/org/jboss/test/profileservice/test.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Jan 19 18:40:15 EST 2007


Author: scott.stark at jboss.org
Date: 2007-01-19 18:40:15 -0500 (Fri, 19 Jan 2007)
New Revision: 59867

Modified:
   trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
Log:
Add testRemoveDataSource and testUpdateDataSource stub

Modified: trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java	2007-01-19 23:38:07 UTC (rev 59866)
+++ trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java	2007-01-19 23:40:15 UTC (rev 59867)
@@ -29,13 +29,14 @@
 
 import org.jboss.deployers.spi.management.DeploymentTemplateInfo;
 import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.managed.api.ManagedObject;
 import org.jboss.managed.api.ManagedProperty;
 import org.jboss.profileservice.spi.NoSuchProfileException;
-import org.jboss.profileservice.spi.Profile;
 import org.jboss.profileservice.spi.ProfileKey;
 import org.jboss.profileservice.spi.ProfileService;
 import org.jboss.profileservice.spi.Profile.DeploymentPhase;
 import org.jboss.test.JBossTestCase;
+import org.jboss.util.graph.Graph;
 
 /** Test of using ProfileService
 
@@ -114,6 +115,8 @@
       jndiName.setValue("TestDS");
       ManagedProperty connURL = props.get("connection-url");
       connURL.setValue("jdbc:hsqldb:.");
+      ManagedProperty driverClass = props.get("driver-class");
+      driverClass.setValue("org.hsqldb.jdbcDriver");
       ManagedProperty username = props.get("user-name");
       username.setValue("sa");
       ManagedProperty password = props.get("password");
@@ -123,6 +126,28 @@
             "testAddDataSource", dsInfo);
    }
 
+   public void testUpdateDataSource()
+      throws Exception
+   {
+      ManagementView mgtView = getManagementView();
+      ProfileKey defaultKey = new ProfileKey("default");
+      Graph<Map<String, ManagedObject>> view = mgtView.getView(defaultKey, "testAddDataSource-dsf.xml", DeploymentPhase.APPLICATION);
+      log.info("MO View: "+view);
+      
+   }
+
+   public void testRemoveDataSource()
+      throws Exception
+   {
+      ManagementView mgtView = getManagementView();
+      ProfileKey defaultKey = new ProfileKey("default");
+      Set<String> names = mgtView.getMatchingDeploymentName(defaultKey, "testAddDataSource-dsf.xml");
+      assertEquals("1 matching name", 1, names.size());
+      String deploymentName = names.iterator().next();
+      mgtView.removeDeployment(defaultKey, deploymentName,
+            DeploymentPhase.APPLICATION);      
+   }
+
    /**
     * Obtain the ProfileService.ManagementView
     * @return




More information about the jboss-cvs-commits mailing list