[jboss-cvs] JBossAS SVN: r67327 - projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/main/test.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Nov 21 05:32:05 EST 2007


Author: alesj
Date: 2007-11-21 05:32:05 -0500 (Wed, 21 Nov 2007)
New Revision: 67327

Modified:
   projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/main/test/DeployerSingleDeploymentTestCase.java
Log:
SingleDeployment thread tests - move deployment creation into condition.

Modified: projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/main/test/DeployerSingleDeploymentTestCase.java
===================================================================
--- projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/main/test/DeployerSingleDeploymentTestCase.java	2007-11-21 10:29:22 UTC (rev 67326)
+++ projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/main/test/DeployerSingleDeploymentTestCase.java	2007-11-21 10:32:05 UTC (rev 67327)
@@ -239,21 +239,26 @@
    {
       DeployerClient main = getMainDeployer();
       int n = 30;
+      // let the shutdown be in first half of started threads
       int shutdown = new Random().nextInt(n / 2);
       log.info("Shutdown order: " + shutdown);
       DeployerTestRunnable[] runnables = new DeployerTestRunnable[n];
       Set<String> names = new HashSet<String>();
       for(int i = 0; i < n; i++)
       {
-         Deployment deployment = new TestDeployment("td" + i, names);
          if (i == shutdown)
             runnables[i] = new ShutdownRunnable(main);
-         else if (i % 3 == 0)
-            runnables[i] = new DeployRunnable(main, deployment);
-         else if (i % 3 == 1)
-            runnables[i] = new AddDeploymentRunnable(main, deployment);
          else
-            runnables[i] = new UndeployRunnable(main, deployment);
+         {
+            Deployment deployment = new TestDeployment("td" + i, names);
+
+            if (i % 3 == 0)
+               runnables[i] = new DeployRunnable(main, deployment);
+            else if (i % 3 == 1)
+               runnables[i] = new AddDeploymentRunnable(main, deployment);
+            else
+               runnables[i] = new UndeployRunnable(main, deployment);
+         }
       }
       Thread[] threads = new Thread[n];
       for(int i = 0; i < n; i++)




More information about the jboss-cvs-commits mailing list