[jboss-cvs] JBossAS SVN: r60704 - branches/Branch_4_2/testsuite/src/main/org/jboss/test.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Feb 20 00:18:06 EST 2007


Author: bstansberry at jboss.com
Date: 2007-02-20 00:18:06 -0500 (Tue, 20 Feb 2007)
New Revision: 60704

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

Modified: branches/Branch_4_2/testsuite/src/main/org/jboss/test/JBossClusteredTestCase.java
===================================================================
--- branches/Branch_4_2/testsuite/src/main/org/jboss/test/JBossClusteredTestCase.java	2007-02-20 05:14:50 UTC (rev 60703)
+++ branches/Branch_4_2/testsuite/src/main/org/jboss/test/JBossClusteredTestCase.java	2007-02-20 05:18:06 UTC (rev 60704)
@@ -21,6 +21,8 @@
  */
 package org.jboss.test;
 
+import java.util.StringTokenizer;
+
 import org.jboss.jmx.adaptor.rmi.RMIAdaptor;
 
 import junit.framework.Test;
@@ -97,7 +99,7 @@
       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
    {
       JBossTestSetup wrapper = new JBossTestClusteredSetup(test)
@@ -105,12 +107,18 @@
 
          protected void setUp() throws Exception
          {
-            if (jarName == null) return;
+            if (jarNames == null) return;
             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)
             {
@@ -127,10 +135,21 @@
 
          protected void tearDown() throws Exception
          {
-            if (jarName == null) return;
-            this.getLog().debug("Attempt undeploy of " + jarName);
-            this.undeploy(jarName);
-            this.getLog().debug("undeployed package: " + jarName);
+            if (jarNames != null)
+            {
+               // 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);
+               }            
+            }
          }
       };
       return wrapper;




More information about the jboss-cvs-commits mailing list