[jboss-cvs] JBossAS SVN: r93977 - branches/Branch_5_x/testsuite/src/main/org/jboss/test/deployers/test.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Sep 24 04:48:32 EDT 2009


Author: emuckenhuber
Date: 2009-09-24 04:48:32 -0400 (Thu, 24 Sep 2009)
New Revision: 93977

Modified:
   branches/Branch_5_x/testsuite/src/main/org/jboss/test/deployers/test/LegacyDeploymentScannerUnitTestCase.java
Log:
JBAS-7286 testcase

Modified: branches/Branch_5_x/testsuite/src/main/org/jboss/test/deployers/test/LegacyDeploymentScannerUnitTestCase.java
===================================================================
--- branches/Branch_5_x/testsuite/src/main/org/jboss/test/deployers/test/LegacyDeploymentScannerUnitTestCase.java	2009-09-24 08:47:58 UTC (rev 93976)
+++ branches/Branch_5_x/testsuite/src/main/org/jboss/test/deployers/test/LegacyDeploymentScannerUnitTestCase.java	2009-09-24 08:48:32 UTC (rev 93977)
@@ -25,6 +25,10 @@
 
 import javax.management.ObjectName;
 
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.deployers.spi.management.deploy.DeploymentManager;
 import org.jboss.managed.api.ManagedDeployment;
 import org.jboss.profileservice.spi.NoSuchDeploymentException;
 import org.jboss.profileservice.spi.ProfileKey;
@@ -44,6 +48,18 @@
    /** The scanner profile. */
    private static final ProfileKey scannerProfile = new ProfileKey("deployment-scanner-profile");
    
+   public static Test suite() throws Exception
+   {
+      TestSuite suite = new TestSuite();
+      
+      suite.addTest(new LegacyDeploymentScannerUnitTestCase("testDeploy"));
+      suite.addTest(new LegacyDeploymentScannerUnitTestCase("testlistDeployedURLs"));      
+      suite.addTest(new LegacyDeploymentScannerUnitTestCase("testDeploymentMgrRedeploy"));     
+      suite.addTest(new LegacyDeploymentScannerUnitTestCase("testUndeploy"));
+      
+      return suite;
+   }
+   
    public LegacyDeploymentScannerUnitTestCase(String name)
    {
       super(name);
@@ -51,7 +67,7 @@
 
    public void testDeploy() throws Exception
    {
-      final ObjectName scanner = new ObjectName(DEPLOYMENT_SCANNER_MBEAN);
+      final ObjectName scanner = new ObjectName(DEPLOYMENT_SCANNER_MBEAN);      
 
       // The deployment
       URL deployment = getDeployURL(EMTPY_DEPLOYMENT);
@@ -75,6 +91,16 @@
       
       ManagedDeployment managedDeployment = getManagementView().getDeployment(EMTPY_DEPLOYMENT);
       assertNotNull(managedDeployment);
+
+   }
+   
+   public void testUndeploy() throws Exception
+   {
+      final ObjectName scanner = new ObjectName(DEPLOYMENT_SCANNER_MBEAN); 
+
+      // The deployment
+      URL deployment = getDeployURL(EMTPY_DEPLOYMENT);
+      assertNotNull(EMTPY_DEPLOYMENT, deployment);
       
       // Suspend
       invoke(scanner, "stop" , new Object[0], new String[0]);
@@ -94,15 +120,39 @@
       
       try
       {
-         managedDeployment = getManagementView().getDeployment(EMTPY_DEPLOYMENT);
+         ManagedDeployment managedDeployment = getManagementView().getDeployment(EMTPY_DEPLOYMENT);
          fail("deployment not undeployed " + managedDeployment);
       }
       catch(NoSuchDeploymentException ok)
       {
          log.debug("saw NoSuchDeploymentException");
       }
+   }
+   
+   public void testlistDeployedURLs() throws Exception
+   {
+      final ObjectName scanner = new ObjectName(DEPLOYMENT_SCANNER_MBEAN);
       
+      String[] deployments = (String[]) invoke(scanner, "listDeployedURLs", new Object[0], new String[0]);
+      
+      assertNotNull(deployments);
+      assertTrue(deployments.length > 1);
    }
+
+   public void testDeploymentMgrRedeploy() throws Exception
+   {
+      // Test redeploy using deploymentManager
+      DeploymentManager deployMgr = getDeploymentManager();
+      deployMgr.loadProfile(scannerProfile);
+      try
+      {
+         redeployCheckComplete(EMTPY_DEPLOYMENT);
+      }
+      finally
+      {
+         deployMgr.releaseProfile();
+      }      
+   }
    
 }
 




More information about the jboss-cvs-commits mailing list