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

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Mar 6 18:11:32 EST 2007


Author: bstansberry at jboss.com
Date: 2007-03-06 18:11:32 -0500 (Tue, 06 Mar 2007)
New Revision: 61168

Modified:
   trunk/testsuite/src/main/org/jboss/test/JBossClusteredTestCase.java
   trunk/testsuite/src/main/org/jboss/test/JBossTestClusteredSetup.java
Log:
Support multiple deployments

Modified: trunk/testsuite/src/main/org/jboss/test/JBossClusteredTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/JBossClusteredTestCase.java	2007-03-06 23:07:06 UTC (rev 61167)
+++ trunk/testsuite/src/main/org/jboss/test/JBossClusteredTestCase.java	2007-03-06 23:11:32 UTC (rev 61168)
@@ -111,18 +111,18 @@
       clusterServices.undeploy(server, name);
    }
 
-   public static Test getDeploySetup(final Test test, final String jarName)
+   public static Test getDeploySetup(final Test test, final String jarNames)
       throws Exception
    {
-      return new JBossTestClusteredSetup(test, jarName);
+      return new JBossTestClusteredSetup(test, jarNames);
    }
 
-   public static Test getDeploySetup(final Class clazz, final String jarName)
+   public static Test getDeploySetup(final Class clazz, final String jarNames)
       throws Exception
    {
       TestSuite suite = new TestSuite();
       suite.addTest(new TestSuite(clazz));
-      return getDeploySetup(suite, jarName);
+      return getDeploySetup(suite, jarNames);
    }
 
    /**

Modified: trunk/testsuite/src/main/org/jboss/test/JBossTestClusteredSetup.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/JBossTestClusteredSetup.java	2007-03-06 23:07:06 UTC (rev 61167)
+++ trunk/testsuite/src/main/org/jboss/test/JBossTestClusteredSetup.java	2007-03-06 23:11:32 UTC (rev 61168)
@@ -21,6 +21,8 @@
   */
 package org.jboss.test;
 
+import java.util.StringTokenizer;
+
 import junit.framework.Test;
 
 /**
@@ -46,15 +48,15 @@
    
    // Attributes ----------------------------------------------------
    
-   private String jarName;
+   private String jarNames;
    // Static --------------------------------------------------------
    
    // Constructors --------------------------------------------------
    
-   public JBossTestClusteredSetup(Test test, String jar) throws Exception
+   public JBossTestClusteredSetup(Test test, String jarNames) throws Exception
    {
       super(JBossClusteredTestCase.class, test);
-      jarName = jar;
+      this.jarNames = jarNames;
    }
    
    
@@ -77,12 +79,18 @@
    {      
       super.setUp();
       
-      if (jarName == null) return;
+      if (jarNames == null) return;
       JBossTestCase.deploymentException = null;
       try
       {
-         this.deploy(jarName);
-         this.getLog().debug("deployed package: " + jarName);
+         // deploy the comma seperated list of jars
+         StringTokenizer st = new StringTokenizer(jarNames, ", ");
+         while (st != null && st.hasMoreTokens())
+         {
+            String jarName = st.nextToken();
+            this.redeploy(jarName);
+            this.getLog().debug("deployed package: " + jarName);
+         }
       }
       catch (Exception ex)
       {
@@ -101,11 +109,20 @@
    {
       try
       {
-         if (jarName != null)
+         if (jarNames != null)
          {
-            this.getLog().debug("Attempt undeploy of " + jarName);
-            this.undeploy(jarName);
-            this.getLog().debug("undeployed package: " + jarName);
+            // deploy the comma seperated list of jars
+            StringTokenizer st = new StringTokenizer(jarNames, ", ");
+            String[] depoyments = new String[st.countTokens()];
+            for (int i = depoyments.length - 1; i >= 0; i--)
+               depoyments[i] = st.nextToken();
+            for (int i = 0; i < depoyments.length; i++)
+            {
+               String jarName = depoyments[i];
+               this.getLog().debug("Attempt undeploy of " + jarName);
+               this.undeploy(jarName);
+               this.getLog().debug("undeployed package: " + jarName);
+            }            
          }
          super.tearDown();
       }




More information about the jboss-cvs-commits mailing list