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

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Mar 1 15:32:23 EST 2007


Author: scott.stark at jboss.org
Date: 2007-03-01 15:32:23 -0500 (Thu, 01 Mar 2007)
New Revision: 61032

Modified:
   trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
Log:
Update the test for the current changes and impose the correct run order

Modified: trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java	2007-03-01 17:12:25 UTC (rev 61031)
+++ trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java	2007-03-01 20:32:23 UTC (rev 61032)
@@ -27,6 +27,9 @@
 
 import javax.naming.InitialContext;
 
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
 import org.jboss.deployers.spi.management.ComponentType;
 import org.jboss.deployers.spi.management.DeploymentTemplateInfo;
 import org.jboss.deployers.spi.management.ManagedComponent;
@@ -48,6 +51,34 @@
 {
    ManagementView activeView;
 
+   /**
+    * We need to define the order in which tests runs
+    * @return
+    * @throws Exception
+    */
+   public static Test suite() throws Exception
+   {
+      TestSuite suite = new TestSuite();
+
+      suite.addTest(new ProfileServiceUnitTestCase("testProfileKeys"));
+      suite.addTest(new ProfileServiceUnitTestCase("testDeploymentNames"));
+      suite.addTest(new ProfileServiceUnitTestCase("testNoSuchProfileException"));
+      // JMS
+      suite.addTest(new ProfileServiceUnitTestCase("testJmsDestinationComponents"));
+      // DataSource
+      suite.addTest(new ProfileServiceUnitTestCase("testDataSourceDeploymentType"));
+      suite.addTest(new ProfileServiceUnitTestCase("testListDataSourceComponents"));
+      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;
+   }
+
    public ProfileServiceUnitTestCase(String name)
    {
       super(name);
@@ -73,6 +104,7 @@
       ManagementView mgtView = getManagementView();
       Set<String> names = mgtView.getDeploymentNames();
       log.info("getDeploymentNames, "+names);
+      // Validate some well known deployments
    }
 
    /**
@@ -239,6 +271,18 @@
       mgtView.process();
    }
 
+   public void testRemoveDataSource()
+      throws Exception
+   {
+      ManagementView mgtView = getManagementView();
+      Set<String> names = mgtView.getMatchingDeploymentName("testHqldbDS-ds.xml");
+      assertEquals("1 matching name", 1, names.size());
+      String deploymentName = names.iterator().next();
+      mgtView.removeDeployment(deploymentName,
+            DeploymentPhase.APPLICATION);      
+      mgtView.process();
+   }
+
    /**
     * Test adding a new FakeDataSource deployment
     * @throws Exception
@@ -271,7 +315,7 @@
       throws Exception
    {
       ManagementView mgtView = getManagementView();
-      ComponentType type = new ComponentType("DataSource", "LocalTx");
+      ComponentType type = new ComponentType("FakeDataSource", "LocalTx");
       ManagedComponent testAddDataSource = getManagedComponent(mgtView, type, "testAddDataSource-dsf.xml");
       Map<String,ManagedProperty> props = testAddDataSource.getProperties();
       log.info("testAddDataSource.props: "+props);
@@ -302,7 +346,7 @@
    {
       ManagementView mgtView = getManagementView();
       
-      ComponentType type = new ComponentType("DataSource", "LocalTx");
+      ComponentType type = new ComponentType("FakeDataSource", "LocalTx");
       ManagedComponent ds = getManagedComponent(mgtView, type, "testAddDataSource-dsf.xml");
       assertNotNull("testAddDataSource-dsf.xml ManagedComponent", ds);
       Map<String,ManagedProperty> props = ds.getProperties();
@@ -337,6 +381,7 @@
       String deploymentName = names.iterator().next();
       mgtView.removeDeployment(deploymentName,
             DeploymentPhase.APPLICATION);      
+      mgtView.process();
    }
 
    /**




More information about the jboss-cvs-commits mailing list