[jboss-cvs] JBossAS SVN: r67328 - in projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/main: test and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Nov 21 05:51:28 EST 2007
Author: alesj
Date: 2007-11-21 05:51:27 -0500 (Wed, 21 Nov 2007)
New Revision: 67328
Added:
projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/main/support/ProcessRunnable.java
Modified:
projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/main/test/DeployerSingleDeploymentTestCase.java
Log:
Add DeployerClient.process to thread tests.
Added: projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/main/support/ProcessRunnable.java
===================================================================
--- projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/main/support/ProcessRunnable.java (rev 0)
+++ projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/main/support/ProcessRunnable.java 2007-11-21 10:51:27 UTC (rev 67328)
@@ -0,0 +1,49 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.deployers.main.support;
+
+import java.util.Random;
+
+import org.jboss.deployers.client.spi.DeployerClient;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ProcessRunnable extends DeployShutdownTestRunnable
+{
+ public ProcessRunnable(DeployerClient main)
+ {
+ super(main, null);
+ }
+
+ protected void internalRun() throws Throwable
+ {
+ Thread.sleep(new Random().nextInt(75));
+ main.process();
+ }
+
+ public boolean isValid()
+ {
+ Throwable p = getProblem();
+ return p == null || main.getTopLevel().isEmpty();
+ }
+}
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:32:05 UTC (rev 67327)
+++ projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/main/test/DeployerSingleDeploymentTestCase.java 2007-11-21 10:51:27 UTC (rev 67328)
@@ -42,6 +42,7 @@
import org.jboss.test.deployers.main.support.ShutdownRunnable;
import org.jboss.test.deployers.main.support.TestDeployment;
import org.jboss.test.deployers.main.support.UndeployRunnable;
+import org.jboss.test.deployers.main.support.ProcessRunnable;
/**
* Single deployment API test case.
@@ -248,15 +249,17 @@
{
if (i == shutdown)
runnables[i] = new ShutdownRunnable(main);
+ else if (i % 4 == 3)
+ runnables[i] = new ProcessRunnable(main);
else
{
Deployment deployment = new TestDeployment("td" + i, names);
- if (i % 3 == 0)
+ if (i % 4 == 0)
runnables[i] = new DeployRunnable(main, deployment);
- else if (i % 3 == 1)
+ else if (i % 4 == 1)
runnables[i] = new AddDeploymentRunnable(main, deployment);
- else
+ else if (i % 4 == 2)
runnables[i] = new UndeployRunnable(main, deployment);
}
}
More information about the jboss-cvs-commits
mailing list