[jbpm-commits] JBoss JBPM SVN: r6474 - in jbpm4/trunk/modules: pvm/src/main/java/org/jbpm/pvm/internal/id and 15 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Jul 9 03:38:14 EDT 2010


Author: alex.guizar at jboss.com
Date: 2010-07-09 03:38:13 -0400 (Fri, 09 Jul 2010)
New Revision: 6474

Removed:
   jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveTestCommand.java
   jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/JobExecutorTestCase.java
   jbpm4/trunk/modules/test-load/src/test/resources/jbpm.load.hbm.xml
Modified:
   jbpm4/trunk/modules/distro/src/main/files/install/build.xml
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/id/AcquireDbidBlockCmd.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/CommandMessage.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobParcel.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListener.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/ProcessDeployer.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Type.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java
   jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
   jbpm4/trunk/modules/test-load/pom.xml
   jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/LoadTestCase.java
   jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ContinuationTest.java
   jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveMessagesTest.java
   jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceMessageTest.java
   jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceTestCommand.java
   jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingMessageTest.java
   jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingTestCommand.java
   jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageCommand.java
   jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageTest.java
   jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/executions/ProcessExecutionTest.java
   jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/AddCommentCmd.java
   jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/MessageProcessingTest.java
   jbpm4/trunk/modules/test-load/src/test/resources/jbpm.cfg.xml
   jbpm4/trunk/modules/test-load/src/test/resources/jbpm.hibernate.cfg.xml
   jbpm4/trunk/modules/test-load/src/test/resources/logging.properties
   jbpm4/trunk/modules/test-load/src/test/resources/org/jbpm/test/load/executions/process.jpdl.xml
Log:
JBPM-1453: revive test load module

Modified: jbpm4/trunk/modules/distro/src/main/files/install/build.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/install/build.xml	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/distro/src/main/files/install/build.xml	2010-07-09 07:38:13 UTC (rev 6474)
@@ -163,7 +163,7 @@
     <mkdir dir="${cfg.dest.dir}" />
     <copy tofile="${cfg.dest.dir}/jbpm.cfg.xml"
           file="${install.src.dir}/cfg/jbpm/${tx}.jbpm.cfg.xml"
-          overwrite="true" />
+          overwrite="true" failonerror="false"  />
     <copy tofile="${cfg.dest.dir}/jbpm.hibernate.cfg.xml"
           file="${install.src.dir}/cfg/hibernate/${hibernate.connection.type}/${database}.hibernate.cfg.xml"
           overwrite="true">

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/id/AcquireDbidBlockCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/id/AcquireDbidBlockCmd.java	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/id/AcquireDbidBlockCmd.java	2010-07-09 07:38:13 UTC (rev 6474)
@@ -1,6 +1,8 @@
 package org.jbpm.pvm.internal.id;
 
 import org.hibernate.Session;
+import org.hibernate.criterion.Restrictions;
+
 import org.jbpm.api.cmd.Command;
 import org.jbpm.api.cmd.Environment;
 
@@ -10,28 +12,23 @@
 public class AcquireDbidBlockCmd implements Command<Long> {
 
   private static final long serialVersionUID = 1L;
-  
+
   long blocksize;
-  
+
   public AcquireDbidBlockCmd(long blocksize) {
     this.blocksize = blocksize;
   }
 
   public Long execute(Environment environment) throws Exception {
     Session session = environment.get(Session.class);
-    
-    PropertyImpl property = (PropertyImpl) session.createQuery(
-        "select property " +
-        "from "+PropertyImpl.class.getName()+" as property " +
-        "where property.key = '"+PropertyImpl.NEXT_DBID_KEY+"'"
-    ).uniqueResult();
-    
-    String nextIdText = property.getValue();
-    Long nextId = new Long(nextIdText);
-    
-    property.setValue(Long.toString(nextId.longValue()+blocksize));
-    
-    session.update(property);
+
+    PropertyImpl property = (PropertyImpl) session.createCriteria(PropertyImpl.class)
+      .add(Restrictions.eq("key", PropertyImpl.NEXT_DBID_KEY))
+      .uniqueResult();
+
+    long nextId = Long.parseLong(property.getValue());
+    property.setValue(Long.toString(nextId + blocksize));
+
     session.flush();
 
     return nextId;

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/CommandMessage.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/CommandMessage.java	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/CommandMessage.java	2010-07-09 07:38:13 UTC (rev 6474)
@@ -24,6 +24,7 @@
 import org.jbpm.api.JbpmException;
 import org.jbpm.api.cmd.Command;
 import org.jbpm.api.cmd.Environment;
+import org.jbpm.pvm.internal.id.DbidGenerator;
 import org.jbpm.pvm.internal.wire.Descriptor;
 
 /**
@@ -36,11 +37,13 @@
   public CommandMessage() {
   }
 
+  @Deprecated
   public CommandMessage(Descriptor commandDescriptor) {
     throw new JbpmException("obsolete");
   }
 
   public CommandMessage(Command<?> command) {
+    this.dbid = DbidGenerator.getDbidGenerator().getNextId();
     setConfiguration(command);
   }
 

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobParcel.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobParcel.java	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobParcel.java	2010-07-09 07:38:13 UTC (rev 6474)
@@ -43,12 +43,12 @@
   }
 
   public void run() {
-    try {
-      for (Long jobDbid : jobDbids) {
+    for (Long jobDbid : jobDbids) {
+      try {
         commandService.execute(new ExecuteJobCmd(jobDbid));
+      } catch (RuntimeException e) {
+        log.error("failed to execute job: " + jobDbid, e);
       }
-    } catch (RuntimeException e) {
-      log.error("exception in job block", e);
     }
   }
 

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListener.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListener.java	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListener.java	2010-07-09 07:38:13 UTC (rev 6474)
@@ -26,6 +26,7 @@
 import org.jbpm.api.listener.EventListener;
 import org.jbpm.internal.log.Log;
 import org.jbpm.pvm.internal.job.MessageImpl;
+import org.jbpm.pvm.internal.model.Continuation;
 import org.jbpm.pvm.internal.model.EventImpl;
 import org.jbpm.pvm.internal.model.EventListenerReference;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
@@ -126,7 +127,11 @@
   }
 
   public MessageImpl createAsyncMessage(ExecutionImpl execution) {
-    return new ExecuteEventListenerMessage(execution);
+    ExecuteEventListenerMessage message = new ExecuteEventListenerMessage(execution);
+    if (execution.getEvent().getContinuation() == Continuation.EXCLUSIVE) {
+      message.setExclusive(true);
+    }
+    return message;
   }
 
   public String toString() {

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java	2010-07-09 07:38:13 UTC (rev 6474)
@@ -173,9 +173,11 @@
    * Note: when using a database, this method must be called within an environment block!
    */
   public void initResourceLobDbids() {
-    for (Lob resource : resources.values()) {
-      long resourceDbid = DbidGenerator.getDbidGenerator().getNextId();
-      resource.setDbid(resourceDbid);
+    if (resources != null) {
+      for (Lob resource : resources.values()) {
+        long resourceDbid = DbidGenerator.getDbidGenerator().getNextId();
+        resource.setDbid(resourceDbid);
+      }
     }
   }
 

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/ProcessDeployer.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/ProcessDeployer.java	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/ProcessDeployer.java	2010-07-09 07:38:13 UTC (rev 6474)
@@ -70,8 +70,6 @@
         if (processDefinitions!=null) {
           for (ProcessDefinitionImpl processDefinition : processDefinitions) {
             if ((processDefinition != null) && (processDefinition.getName() != null)) {
-              String processDefinitionName = processDefinition.getName();
-
               processDefinition.setSuspended(deployment.isSuspended());
 
               String imageResourceName = resourceName.substring(0, resourceName.lastIndexOf(extension)) + ".png";
@@ -81,6 +79,7 @@
 
               processDefinition.setDeploymentDbid(deployment.getDbid());
 
+              String processDefinitionName = processDefinition.getName();
               if (deployment.hasObjectProperties(processDefinitionName)) {
                 String key = deployment.getProcessDefinitionKey(processDefinitionName);
                 String id = deployment.getProcessDefinitionId(processDefinitionName);

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Type.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Type.java	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Type.java	2010-07-09 07:38:13 UTC (rev 6474)
@@ -47,7 +47,7 @@
       text.append("-->");
     }
     if (variableClass!=null) {
-      text.append(ReflectUtil.getUnqualifiedClassName(variableClass));
+      text.append(variableClass.getSimpleName());
     } else {
       text.append("undefined");
     }

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java	2010-07-09 07:38:13 UTC (rev 6474)
@@ -381,24 +381,6 @@
     return signature;
   }
 
-  public static String getUnqualifiedClassName(Class<?> clazz) {
-    if (clazz==null) {
-      return null;
-    }
-    return getUnqualifiedClassName(clazz.getSimpleName());
-  }
-
-  public static String getUnqualifiedClassName(String className) {
-    if (className==null) {
-      return null;
-    }
-    int dotIndex = className.lastIndexOf('.');
-    if (dotIndex!=-1) {
-      className = className.substring(dotIndex+1);
-    }
-    return className;
-  }
-
   public static ClassLoader installDeploymentClassLoader(ProcessDefinitionImpl processDefinition) {
     String deploymentId = processDefinition.getDeploymentId();
     if (deploymentId==null) {

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java	2010-07-09 07:38:13 UTC (rev 6474)
@@ -81,12 +81,12 @@
  * @author Guillaume Porcher (documentation)
  *
  */
-public class ObjectDescriptor extends AbstractDescriptor implements Descriptor {
+public class ObjectDescriptor extends AbstractDescriptor {
 
   private static final long serialVersionUID = 1L;
   private static Log log = Log.getLog(ObjectDescriptor.class.getName());
 
-  protected String className = null;
+  protected String className;
 
   /** specifies the object reference on which the method will be invoked.
    * Either className, objectName or a descriptor has to be specified.
@@ -94,23 +94,23 @@
    * TODO check if this member can be replaced by a RefDescriptor in the factoryDescriptor member.
    *
    * */
-  String factoryObjectName = null;
+  String factoryObjectName;
 
   protected Expression expression;
 
   /** specifies the object on which to invoke the method.
    * Either className, objectName or a descriptor has to be specified. */
-  protected Descriptor factoryDescriptor = null;
+  protected Descriptor factoryDescriptor;
 
-  protected String methodName = null;
+  protected String methodName;
 
   /** map to db as a component */
-  protected List<ArgDescriptor> argDescriptors = null;
+  protected List<ArgDescriptor> argDescriptors;
   /** list of operations to perform during initialization. */
-  protected List<Operation> operations = null;
+  protected List<Operation> operations;
 
   /** True if autowiring is enabled.  */
-  protected boolean isAutoWireEnabled = false;
+  protected boolean isAutoWireEnabled;
 
   public ObjectDescriptor() {
   }

Modified: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java	2010-07-09 07:38:13 UTC (rev 6474)
@@ -79,14 +79,14 @@
 
   /** registered deployments.  registered deployments will be deleted automatically
    * in the tearDown. This is a convenience function as each test is expected to clean up the DB. */
-  protected List<String> registeredDeployments = new ArrayList<String>();
+  protected List<String> registeredDeployments;
 
   @Override
   protected void setUp() throws Exception {
     super.setUp();
     processEngine = buildProcessEngine();
 
-    repositoryService = processEngine.get(RepositoryService.class);
+    repositoryService = processEngine.getRepositoryService();
     executionService = processEngine.getExecutionService();
     historyService = processEngine.getHistoryService();
     managementService = processEngine.getManagementService();
@@ -166,8 +166,10 @@
   }
 
   protected void deleteRegisteredDeployments() {
-    for (String deploymentId : registeredDeployments) {
-      repositoryService.deleteDeploymentCascade(deploymentId);
+    if (registeredDeployments != null) {
+      for (String deploymentId : registeredDeployments) {
+        repositoryService.deleteDeploymentCascade(deploymentId);
+      }
     }
   }
 
@@ -209,6 +211,7 @@
 
   /** registered deployments will be deleted in the tearDown */
   protected void registerDeployment(String deploymentId) {
+    if (registeredDeployments == null) registeredDeployments = new ArrayList<String>();
     registeredDeployments.add(deploymentId);
   }
 

Modified: jbpm4/trunk/modules/test-load/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-load/pom.xml	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/test-load/pom.xml	2010-07-09 07:38:13 UTC (rev 6474)
@@ -1,16 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
 <!-- ====================================================================== -->
+<!--  jBPM: Workflow in Java                                                -->
 <!--                                                                        -->
-<!--  JBoss, the OpenSource J2EE webOS                                      -->
-<!--                                                                        -->
 <!--  Distributable under LGPL license.                                     -->
 <!--  See terms of license at http://www.gnu.org.                           -->
-<!--                                                                        -->
 <!-- ====================================================================== -->
 
 <!-- $Id$ -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <name>jBPM 4 - Test Load</name>
   <groupId>org.jbpm.jbpm4</groupId>
@@ -30,88 +30,68 @@
     <dependency>
       <groupId>org.jbpm.jbpm4</groupId>
       <artifactId>jbpm-api</artifactId>
-      <version>${project.version}</version>
     </dependency>
-
     <dependency>
       <groupId>org.jbpm.jbpm4</groupId>
       <artifactId>jbpm-test-base</artifactId>
-      <version>${project.version}</version>
     </dependency>
-    
     <dependency>
       <groupId>org.jbpm.jbpm4</groupId>
       <artifactId>jbpm-jpdl</artifactId>
-      <version>${project.version}</version>
     </dependency>
-    
-    <!-- TODO remove PVM dependency for compilation (keep it for test)-->
-    <dependency>
-      <groupId>org.jbpm.jbpm4</groupId>
-      <artifactId>jbpm-pvm</artifactId>
-      <version>${project.version}</version>
-      <scope>test</scope>
-    </dependency>
-    
   </dependencies>
-  
-    <!-- Plugins -->
-  <build>
-    <plugins>
-      <plugin>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <configuration>
-          <excludes>
-            <exclude>**/*TestCase.java</exclude>
-          </excludes>
-        </configuration>
-      </plugin>
 
-      <plugin>                                                   
-        <artifactId>maven-dependency-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>unpack.jbpm.db</id>
-            <phase>generate-test-resources</phase>
-            <goals>
-              <goal>unpack</goal>
-            </goals>
-            <configuration>
-              <artifactItems>
-                <artifactItem>
-                  <groupId>org.jbpm.jbpm4</groupId>
-                  <artifactId>jbpm-jpdl</artifactId>
-                  <classifier>config</classifier>
-                  <overWrite>true</overWrite>
-                </artifactItem>
-              </artifactItems>
-              <excludeTransitive>true</excludeTransitive>
-              <outputDirectory>target/jpdl-config</outputDirectory>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
+  <!-- Profiles -->
+  <profiles>
 
-      <plugin>
-        <artifactId>maven-antrun-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>install.hibernate.database.properties</id>
-            <phase>generate-test-resources</phase>
-            <goals>
-              <goal>run</goal>
-            </goals>
-            <configuration>
-              <tasks>
-                <copy file="target/jpdl-config/hibernate.cfg.${database}.xml"
-                      tofile="target/test-classes/hibernate.cfg.xml"
-                      overwrite="true" />
-              </tasks>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-  
+    <!-- -Ddatabase= -->
+    <profile>
+      <id>run.database.testsuite</id>
+      <activation>
+        <property>
+          <name>database</name>
+        </property>
+      </activation>
+
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-antrun-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>database-test-cfg-customization</id>
+                <phase>test-compile</phase>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+                <configuration>
+                  <tasks>
+                    <echo message="database: ${database}" />
+                    <mkdir dir="target/jdbc.properties" />
+                    <copy todir="target/jdbc.properties" overwrite="true">
+                      <fileset dir="../../qa/jdbc" />
+                    </copy>
+                    <copy todir="target/jdbc.properties" overwrite="true" failonerror="false">
+                      <fileset dir="${user.home}/.jbpm4/jdbc" />
+                    </copy>
+                    <ant antfile="../distro/src/main/files/install/build.xml" target="create.cfg">
+                      <!-- use jbpm.cfg.xml from the resources of this project -->
+                      <property name="tx" value="none" />
+                      <property name="mail.cfg" value="testsuite" />
+                      <property name="database" value="${database}" />
+                      <property name="cfg.dest.dir" value="target/test-classes" />
+                      <property name="install.src.dir" value="../distro/src/main/files/install/src" />
+                      <property name="jdbc.properties.dir" value="target/jdbc.properties" />
+                      <!-- use logging.properties from the resources of this project -->
+                      <property name="logging" value="none" />
+                    </ant>
+                  </tasks>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
 </project>

Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/LoadTestCase.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/LoadTestCase.java	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/LoadTestCase.java	2010-07-09 07:38:13 UTC (rev 6474)
@@ -21,21 +21,10 @@
  */
 package org.jbpm.test.load;
 
-import java.io.File;
 import java.io.PrintWriter;
-import java.util.Date;
 
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.jbpm.api.cmd.Command;
-import org.jbpm.api.cmd.Environment;
-import org.jbpm.pvm.internal.cmd.CommandService;
-import org.jbpm.pvm.internal.job.JobImpl;
-import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
-import org.jbpm.pvm.internal.util.ReflectUtil;
 import org.jbpm.test.JbpmTestCase;
 
-
 /**
  * @author Tom Baeyens
  */
@@ -47,30 +36,18 @@
 
   protected static long checkInterval = 2000;
 
-  protected static String jobsAvailableQueryText =
-      "select count(*) "+
-      "from "+JobImpl.class.getName()+" as job "+
-      "where ( (job.dueDate is null) or (job.dueDate <= :now) ) "+ 
-      "  and ( job.retries > 0 )";
-
   protected static boolean measureMemory = true;
 
-  protected CommandService commandService;
-  protected JobExecutor jobExecutor;
   protected long startTime = -1;
   protected long stopTime = -1;
   protected PrintWriter logFileWriter;
-  
 
-  public void setUp() throws Exception {
+  protected void setUp() throws Exception {
     super.setUp();
-    
+
     if (measureMemory) {
       openMemoryLogFile();
     }
-    
-    commandService = processEngine.get(CommandService.class);
-    jobExecutor = processEngine.get(JobExecutor.class);
   }
   
   protected void tearDown() throws Exception {
@@ -95,8 +72,8 @@
   }
 
   protected void openMemoryLogFile() throws Exception {
-    String testClass = ReflectUtil.getUnqualifiedClassName(getClass());
-    logFileWriter = new PrintWriter(new File("target/"+testClass +".txt"));
+    String testClass = getClass().getSimpleName();
+    logFileWriter = new PrintWriter("target/"+testClass +".txt");
     logColumnTitles();
   }
 
@@ -120,39 +97,6 @@
     return used;
   }
 
-  protected void waitTillNoMoreMessages(JobExecutor jobExecutor) throws Exception {
-    boolean jobsAvailable = true;
-    while (jobsAvailable) {
-      log.debug("going to sleep for " + checkInterval + " millis, waiting for the job executor to process more jobs");
-      Thread.sleep(checkInterval);
-      jobsAvailable = areJobsAvailable();
-      logStatus();
-    }
-  }
-
-  public boolean areJobsAvailable() {
-    return commandService.execute(new Command<Boolean>() {
-      private static final long serialVersionUID = 1L;
-
-      public Boolean execute(Environment environment) {
-        Session session = environment.get(Session.class);
-
-        Query query = session.createQuery(jobsAvailableQueryText);
-        query.setDate("now", new Date());
-        
-        Long jobs = (Long) query.uniqueResult();
-
-        if (jobs.longValue()>0) {
-          log.debug("found "+jobs+" more jobs to process");
-          return true;
-        }
-        log.debug("no more jobs to process");
-        
-        return false;
-      }
-    });
-  }
-  
   public String getMeasuredTime() {
     long stop = stopTime!=-1 ? stopTime : System.currentTimeMillis();
     long diff = stop - startTime;

Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ContinuationTest.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ContinuationTest.java	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ContinuationTest.java	2010-07-09 07:38:13 UTC (rev 6474)
@@ -21,88 +21,58 @@
  */
 package org.jbpm.test.load.async;
 
-import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
-import org.hibernate.Session;
+import org.jbpm.test.JbpmTestCase;
 
-import org.jbpm.api.cmd.Environment;
-import org.jbpm.api.cmd.VoidCommand;
-import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
-import org.jbpm.pvm.internal.model.OpenProcessDefinition;
-
 /**
  * @author Tom Baeyens
  */
-public class ContinuationTest extends JobExecutorTestCase {
+public class ContinuationTest extends JbpmTestCase {
 
-  // private static final Log log = Log.getLog(ContinuationTest.class.getName());
+  static final Recorder recorder = new Recorder();
+  static final int nbrOfExecutions = 100;
 
-  static Recorder recorder = new Recorder();
-
-  int nbrOfExecutions = 100;
-
   public void testContinuations() {
-    
-    try {
-      deployProcess();
-      startExecutions();
-      jobExecutor.start();
-      waitTillNoMoreMessages();
+    deployProcess();
+    startExecutions();
+    waitTillNoMoreMessages();
 
-    } finally {
-      jobExecutor.stop(true);
-    }
-
-    List<String> expectedLogs = new ArrayList<String>();
-    expectedLogs.add("execute(start)");
-    expectedLogs.add("execute(a)");
-    expectedLogs.add("execute(b)");
-    expectedLogs.add("execute(c)");
-    expectedLogs.add("execute(end)");
-    
     assertEquals(nbrOfExecutions, recorder.executionEvents.size());
+    List<String> expectedLogs = Arrays.asList("execute(a)", "execute(b)", "execute(c)", "execute(end)");
     for (List<String> executionLogs : recorder.executionEvents.values()) {
       assertEquals(expectedLogs, executionLogs);
     }
   }
 
-  public void deployProcess() {
-    commandService.execute(new VoidCommand() {
-      private static final long serialVersionUID = 1L;
-
-      @Override
-      protected void executeVoid(Environment environment) throws Exception {
-        OpenProcessDefinition processDefinition = ProcessDefinitionBuilder.startProcess("continuations")
-          .key("continuations")
-          .startActivity("start", AutomaticActivity.class)
-            .initial()
-            .asyncExecute()
-            .transition("a")
-          .endActivity()
-          .startActivity("a", AutomaticActivity.class)
-            .asyncExecute()
-            .transition("b")
-          .endActivity()
-          .startActivity("b", AutomaticActivity.class)
-            .asyncExecute()
-            .transition("c")
-          .endActivity()
-          .startActivity("c", AutomaticActivity.class)
-            .asyncExecute()
-            .transition("end")
-          .endActivity()
-          .startActivity("end", WaitState.class)
-          .endActivity()
-        .endProcess();
-        
-        Session session = environment.get(Session.class);
-        session.save(processDefinition);
-      }
-    });
+  void deployProcess() {
+    deployJpdlXmlString("<process name='continuations'>"
+      + "<start>"
+      + "  <transition to='a'/>"
+      + "</start>"
+      + "<custom name='a' class='"
+      + AutomaticActivity.class.getName()
+      + "' continue='async'>"
+      + "  <transition to='b'/>"
+      + "</custom>"
+      + "<custom name='b' class='"
+      + AutomaticActivity.class.getName()
+      + "' continue='async'>"
+      + "  <transition to='c'/>"
+      + "</custom>"
+      + "<custom name='c' class='"
+      + AutomaticActivity.class.getName()
+      + "' continue='async'>"
+      + "  <transition to='end'/>"
+      + "</custom>"
+      + "<custom name='end' class='"
+      + WaitState.class.getName()
+      + "'/>"
+      + "</process>");
   }
 
-  public void startExecutions() {
+  void startExecutions() {
     for (int i = 0; i < nbrOfExecutions; i++) {
       executionService.startProcessInstanceByKey("continuations");
     }

Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveMessagesTest.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveMessagesTest.java	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveMessagesTest.java	2010-07-09 07:38:13 UTC (rev 6474)
@@ -22,114 +22,105 @@
 package org.jbpm.test.load.async;
 
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 
-import org.hibernate.Session;
-import org.jbpm.api.Execution;
 import org.jbpm.api.activity.ActivityExecution;
 import org.jbpm.api.activity.ExternalActivityBehaviour;
 import org.jbpm.api.cmd.Environment;
 import org.jbpm.api.cmd.VoidCommand;
-import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
-import org.jbpm.pvm.internal.cmd.StartProcessInstanceCmd;
-import org.jbpm.pvm.internal.job.CommandMessage;
-import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
-import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
-import org.jbpm.pvm.internal.session.MessageSession;
+import org.jbpm.test.JbpmTestCase;
 
 /**
  * @author Tom Baeyens
+ * @author Alejandro Guizar
  */
-public class ExclusiveMessagesTest extends JobExecutorTestCase {
+public class ExclusiveMessagesTest extends JbpmTestCase {
 
-  static Map<String, Set<Long>> exclusiveThreadIds;
+  // exclusiveThreads maps process instance keys to a set of thread names.
+  // the idea is that for each execution, all the exclusive jobs will
+  // be executed by one thread sequentially.
+  static final Map<String, Set<String>> exclusiveThreads = new HashMap<String, Set<String>>();
 
-  static int nbrOfTestMessagesPerExecution = 5;
-  static int nbrOfTestExecutions = 20;
+  static final int nbrOfTestExecutions = 20;
 
-  public void setUp() throws Exception {
-    super.setUp();
+  public void testExclusiveMessageProcessing() {
+    insertExclusiveTestMessages();
+    waitTillNoMoreMessages();
 
-    exclusiveThreadIds = new HashMap<String, Set<Long>>();
-  }
+    processEngine.execute(new VoidCommand() {
 
-  public void testDecisionMessageProcessing() {
-    insertDecisionTestMessages();
-
-    JobExecutor jobExecutor = processEngine.get(JobExecutor.class);
-    jobExecutor.start();
-    try {
-
-      waitTillNoMoreMessages();
-
-    } finally {
-      jobExecutor.stop(true);
-    }
-
-    commandService.execute(new VoidCommand() {
       private static final long serialVersionUID = 1L;
 
       protected void executeVoid(Environment environment) {
-        // exclusiveMessageIds maps execution keys to a set of thread ids.
-        // the idea is that for each execution, all the exclusive jobs will
-        // be executed by 1 thread sequentially.
-
         for (int i = 0; i < nbrOfTestExecutions; i++) {
-          String executionKey = "execution-" + i;
-          Set<Long> threadIds = exclusiveThreadIds.get(executionKey);
-          assertNotNull("no thread id set for " + executionKey + " in: " + exclusiveThreadIds, threadIds);
-          assertEquals("exclusive messages for " + executionKey + " have been executed by multiple threads: " + threadIds, 1, threadIds.size());
+          String processInstanceKey = Integer.toString(i);
+          Set<String> threadNames = exclusiveThreads.get(processInstanceKey);
+          assertNotNull("no thread name set for "
+            + processInstanceKey
+            + " in: "
+            + exclusiveThreads, threadNames);
+          assertEquals("exclusive messages for "
+            + processInstanceKey
+            + " have been executed by multiple threads: "
+            + threadNames, 1, threadNames.size());
         }
       }
     });
   }
 
-  public static class WaitState implements ExternalActivityBehaviour {
+  private void insertExclusiveTestMessages() {
+    deployJpdlXmlString("<process name='excl'>"
+      + "  <start>"
+      + "    <transition to='f'/>"
+      + "  </start>"
+      + "  <fork name='f'>"
+      + "    <on event='end' continue='exclusive' />"
+      + "    <transition to='a'/>"
+      + "    <transition to='b'/>"
+      + "    <transition to='c'/>"
+      + "    <transition to='d'/>"
+      + "    <transition to='e'/>"
+      + "  </fork>"
+      + "  <custom name='a' class='"
+      + ExclusiveActivity.class.getName()
+      + "'/>"
+      + "  <custom name='b' class='"
+      + ExclusiveActivity.class.getName()
+      + "'/>"
+      + "  <custom name='c' class='"
+      + ExclusiveActivity.class.getName()
+      + "'/>"
+      + "  <custom name='d' class='"
+      + ExclusiveActivity.class.getName()
+      + "'/>"
+      + "  <custom name='e' class='"
+      + ExclusiveActivity.class.getName()
+      + "'/>"
+      + "</process>");
 
-    private static final long serialVersionUID = 1L;
-
-    public void execute(ActivityExecution execution) throws Exception {
-      execution.waitForSignal();
+    for (int i = 0; i < nbrOfTestExecutions; i++) {
+      executionService.startProcessInstanceByKey("excl", Integer.toString(i));
     }
-    public void signal(ActivityExecution execution, String signalName, Map<String, ?> parameters) throws Exception {
-      execution.take(signalName);
-    }
   }
 
-  public void insertDecisionTestMessages() {
-    commandService.execute(new VoidCommand() {
-      private static final long serialVersionUID = 1L;
+  public static class ExclusiveActivity implements ExternalActivityBehaviour {
 
-      protected void executeVoid(Environment environment) {
-        ProcessDefinitionImpl processDefinition = ProcessDefinitionBuilder
-        .startProcess("excl")
-          .startActivity("wait", WaitState.class)
-            .initial()
-          .endActivity()
-        .endProcess();
-        processDefinition.setId("excl:1");
-        
-        Session session = environment.get(Session.class);
-        session.save(processDefinition);
-      }
-    });
+    private static final long serialVersionUID = 1L;
 
-    commandService.execute(new VoidCommand() {
-      private static final long serialVersionUID = 1L;
-
-      protected void executeVoid(Environment environment) throws Exception {
-        MessageSession messageSession = environment.get(MessageSession.class);
-        for (int i = 0; i < nbrOfTestExecutions; i++) {
-          Execution execution = new StartProcessInstanceCmd("excl:1", null, "execution-" + i).execute(environment);
-
-          for (int j = 0; j < nbrOfTestMessagesPerExecution; j++) {
-            CommandMessage exclusiveTestMessage = ExclusiveTestCommand.createMessage(execution);
-            messageSession.send(exclusiveTestMessage);
-          }
-        }
+    public void execute(ActivityExecution execution) throws Exception {
+      String processInstanceKey = execution.getProcessInstance().getKey();
+      Set<String> threadNames = ExclusiveMessagesTest.exclusiveThreads.get(processInstanceKey);
+      if (threadNames == null) {
+        threadNames = new HashSet<String>();
+        ExclusiveMessagesTest.exclusiveThreads.put(processInstanceKey, threadNames);
       }
-    });
-  }
+      threadNames.add(Thread.currentThread().getName());
+    }
 
+    public void signal(ActivityExecution execution, String signalName, Map<String, ?> parameters)
+      throws Exception {
+    }
+  }
 }

Deleted: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveTestCommand.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveTestCommand.java	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveTestCommand.java	2010-07-09 07:38:13 UTC (rev 6474)
@@ -1,95 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, 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.jbpm.test.load.async;
-
-import java.util.HashSet;
-import java.util.Random;
-import java.util.Set;
-
-import org.hibernate.Session;
-
-import org.jbpm.api.Execution;
-import org.jbpm.api.cmd.Environment;
-import org.jbpm.api.cmd.VoidCommand;
-import org.jbpm.pvm.internal.job.CommandMessage;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.StringDescriptor;
-
-/**
- * @author Tom Baeyens
- */
-public class ExclusiveTestCommand extends VoidCommand {
-
-  private static final long serialVersionUID = 1L;
-  static Random random = new Random();
-  
-  String executionId;
-  
-  public ExclusiveTestCommand() {
-  }
-
-  public static CommandMessage createMessage(Execution execution) {
-    CommandMessage commandMessage = new CommandMessage();
-    commandMessage.setExecution((ExecutionImpl) execution);
-    commandMessage.setExclusive(true);
-    
-    ObjectDescriptor commandDescriptor = new ObjectDescriptor(ExclusiveTestCommand.class);
-    commandDescriptor.addInjection("executionId", new StringDescriptor(execution.getId()));
-    commandMessage.setCommandDescriptor(commandDescriptor);
-    return commandMessage;
-  }
-
-  protected void executeVoid(Environment environment) throws Exception {
-    Long threadId = Thread.currentThread().getId();
-    
-    Session session = environment.get(Session.class);
-    ExecutionImpl execution = (ExecutionImpl) session.get(ExecutionImpl.class, executionId);
-    
-    String executionKey = execution.getKey();
-
-    // exclusiveMessageIds maps execution keys to a set of thread ids.
-    // the idea is that for each execution, all the exclusive jobs will 
-    // be executed by 1 thread sequentially.  
-    
-    // in the end, each set should contain exactly 1 element
-    
-    Set<Long> groupMessages = ExclusiveMessagesTest.exclusiveThreadIds.get(executionKey);
-    if (groupMessages==null) {
-      groupMessages = new HashSet<Long>();
-      ExclusiveMessagesTest.exclusiveThreadIds.put(executionKey, groupMessages);
-    }
-    groupMessages.add(threadId);
-    
-    /*
-    // let's assume that an average jobImpl takes between 0 and 150 millis to complete.
-    int workTime = random.nextInt(150);
-    log.debug("executing exclusive message for "+execution+".  this is going to take "+workTime+"ms");
-    try {
-      Thread.sleep(workTime);
-    } catch (RuntimeException e) {
-      log.debug("sleeping was interrupted");
-    }
-    */
-  }
-
-}

Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceMessageTest.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceMessageTest.java	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceMessageTest.java	2010-07-09 07:38:13 UTC (rev 6474)
@@ -26,59 +26,53 @@
 import java.util.List;
 
 import org.hibernate.Session;
-import org.jbpm.api.cmd.Command;
+
 import org.jbpm.api.cmd.Environment;
 import org.jbpm.api.cmd.VoidCommand;
 import org.jbpm.api.history.HistoryComment;
 import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
+import org.jbpm.pvm.internal.history.model.HistoryCommentImpl;
 import org.jbpm.pvm.internal.job.CommandMessage;
 import org.jbpm.pvm.internal.session.MessageSession;
 import org.jbpm.pvm.internal.util.CollectionUtil;
+import org.jbpm.test.JbpmTestCase;
 
 /**
  * @author Tom Baeyens
  */
-public class FailOnceMessageTest extends JobExecutorTestCase {
+public class FailOnceMessageTest extends JbpmTestCase {
 
   private static final Log log = Log.getLog(FailOnceMessageTest.class.getName());
-    
-  static long nbrOfTestMessages = 50;
-  
-  static List<Integer> failOnceMessageIds = Collections.synchronizedList(new ArrayList<Integer>());
-  
-  public void testFailOnceMessages() {
-    failOnceMessageIds.clear();
 
-    jobExecutor.start();
-    try {
-      insertFailOnceTestMessages();
-      waitTillNoMoreMessages();
+  static final long nbrOfTestMessages = 50;
+  static final List<Integer> failOnceMessageIds = Collections.synchronizedList(new ArrayList<Integer>());
 
-    } finally {
-      log.debug("stopping job executor");
-      jobExecutor.stop(true);
-    }
+  public void testFailOnceMessages() {
+    insertFailOnceTestMessages();
+    waitTillNoMoreMessages();
 
     for (int i = 0; i < nbrOfTestMessages; i++) {
       assertTrue("message " + i + " is not failed once: " + failOnceMessageIds, failOnceMessageIds.contains(i));
     }
     assertEquals(nbrOfTestMessages, failOnceMessageIds.size());
-    
+
     log.debug("==== all messages processed, now checking if all messages have arrived exactly once ====");
 
-    commandService.execute(new VoidCommand() {
+    processEngine.execute(new VoidCommand() {
+
       private static final long serialVersionUID = 1L;
 
       @Override
       protected void executeVoid(Environment environment) throws Exception {
         Session session = environment.get(Session.class);
-        List<?> comments = session.createCriteria(HistoryDetailImpl.class).list();
-        
+        List<?> comments = session.createCriteria(HistoryCommentImpl.class).list();
+
         for (HistoryComment comment : CollectionUtil.checkList(comments, HistoryComment.class)) {
-          log.debug("retrieved message: "+comment.getMessage());
+          log.debug("retrieved message: " + comment.getMessage());
           Integer messageId = new Integer(comment.getMessage());
           assertTrue("message " + messageId + " committed twice", failOnceMessageIds.remove(messageId));
+          // make sure the db stays clean
+          session.delete(comment);
         }
 
         assertTrue("not all messages made a successful commit: " + failOnceMessageIds, failOnceMessageIds.isEmpty());
@@ -86,24 +80,23 @@
     });
   }
 
-  public static class InsertFailOnceTestMsgCmd implements Command<Object> {
+  private static class InsertFailOnceTestMsgCmd extends VoidCommand {
+
+    final int messageId;
     private static final long serialVersionUID = 1L;
-    int i;
-    public InsertFailOnceTestMsgCmd(int i) {
-      this.i = i;
+
+    InsertFailOnceTestMsgCmd(int messageId) {
+      this.messageId = messageId;
     }
-    public Object execute(Environment environment) throws Exception {
-      MessageSession messageSession = environment.get(MessageSession.class);
-      CommandMessage commandMessage = FailOnceTestCommand.createMessage(i);
-      messageSession.send(commandMessage);
-      return null;
+    public void executeVoid(Environment environment) throws Exception {
+      CommandMessage commandMessage = FailOnceTestCommand.createMessage(messageId);
+      environment.get(MessageSession.class).send(commandMessage);
     }
   }
 
   void insertFailOnceTestMessages() {
     for (int i = 0; i < nbrOfTestMessages; i++) {
-      commandService.execute(new InsertFailOnceTestMsgCmd(i));
+      processEngine.execute(new InsertFailOnceTestMsgCmd(i));
     }
   }
-
 }

Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceTestCommand.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceTestCommand.java	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceTestCommand.java	2010-07-09 07:38:13 UTC (rev 6474)
@@ -28,10 +28,7 @@
 import org.jbpm.pvm.internal.history.model.HistoryCommentImpl;
 import org.jbpm.pvm.internal.job.CommandMessage;
 import org.jbpm.pvm.internal.session.DbSession;
-import org.jbpm.pvm.internal.wire.descriptor.IntegerDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
 
-
 /**
  * @author Tom Baeyens
  */
@@ -46,11 +43,9 @@
   }
 
   public static CommandMessage createMessage(int messageId) {
-    CommandMessage commandMessage = new CommandMessage();
-    ObjectDescriptor commandDescriptor = new ObjectDescriptor(FailOnceTestCommand.class);
-    commandDescriptor.addInjection("messageId", new IntegerDescriptor(messageId));
-    commandMessage.setCommandDescriptor(commandDescriptor);
-    return commandMessage;
+    FailOnceTestCommand command = new FailOnceTestCommand();
+    command.messageId = messageId;
+    return new CommandMessage(command);
   }
 
   public Object execute(Environment environment) throws Exception {

Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingMessageTest.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingMessageTest.java	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingMessageTest.java	2010-07-09 07:38:13 UTC (rev 6474)
@@ -23,50 +23,50 @@
 
 import java.util.List;
 
-import org.jbpm.api.JbpmException;
+import org.hibernate.Session;
+
 import org.jbpm.api.cmd.Environment;
 import org.jbpm.api.cmd.VoidCommand;
-import org.jbpm.api.job.Job;
+import org.jbpm.pvm.internal.history.model.HistoryCommentImpl;
 import org.jbpm.pvm.internal.job.CommandMessage;
+import org.jbpm.pvm.internal.job.JobImpl;
 import org.jbpm.pvm.internal.session.MessageSession;
+import org.jbpm.test.JbpmTestCase;
 
 /**
  * @author Tom Baeyens
  */
-public class FailingMessageTest extends JobExecutorTestCase {
+public class FailingMessageTest extends JbpmTestCase {
 
-  
   public void testFailedMessageProcessing() {
-    jobExecutor.start();
-    try {
-      commandService.execute(new VoidCommand() {
-        private static final long serialVersionUID = 1L;
+    processEngine.execute(new VoidCommand() {
 
-        @Override
-        protected void executeVoid(Environment environment) throws Exception {
-          MessageSession messageSession = environment.get(MessageSession.class);
-          CommandMessage commandMessage = FailingTestCommand.createMessage();
-          messageSession.send(commandMessage);
-        }
-      });
+      private static final long serialVersionUID = 1L;
 
-      waitTillNoMoreMessages();
+      @Override
+      protected void executeVoid(Environment environment) throws Exception {
+        MessageSession messageSession = environment.get(MessageSession.class);
+        CommandMessage commandMessage = FailingTestCommand.createMessage();
+        messageSession.send(commandMessage);
+      }
+    });
 
-    } finally {
-      jobExecutor.stop(true);
-    }
+    waitTillNoMoreMessages();
 
-    commandService.execute(new VoidCommand() {
+    processEngine.execute(new VoidCommand() {
+
       private static final long serialVersionUID = 1L;
 
       @Override
       public void executeVoid(Environment environment) throws Exception {
-        List<Job> deadJobs = null;
-        throw new JbpmException("todo get the jobs with exception");
+        Session session = environment.get(Session.class);
 
-//        Session session = environment.get(Session.class);
-//        List commands = session.createQuery("from " + HistoryCommentImpl.class.getName()).list();
-//        assertTrue("command insertion should have been rolled back", commands.isEmpty());
+        List<?> deadJobs = session.createCriteria(JobImpl.class).list();
+        assertEquals(1, deadJobs.size());
+        session.delete(deadJobs.get(0));
+
+        List<?> comments = session.createCriteria(HistoryCommentImpl.class).list();
+        assertEquals("command insertion should have been rolled back", 0, comments.size());
       }
     });
   }

Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingTestCommand.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingTestCommand.java	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingTestCommand.java	2010-07-09 07:38:13 UTC (rev 6474)
@@ -21,34 +21,33 @@
  */
 package org.jbpm.test.load.async;
 
-import org.jbpm.api.cmd.Command;
 import org.jbpm.api.cmd.Environment;
+import org.jbpm.api.cmd.VoidCommand;
+import org.jbpm.pvm.internal.history.model.HistoryCommentImpl;
 import org.jbpm.pvm.internal.job.CommandMessage;
 import org.jbpm.pvm.internal.session.DbSession;
-import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
 
 /**
  * @author Tom Baeyens
  */
-public class FailingTestCommand implements Command<Object> {
+public class FailingTestCommand extends VoidCommand {
 
   private static final long serialVersionUID = 1L;
 
-  public Object execute(Environment environment) throws Exception {
+  @Override
+  protected void executeVoid(Environment environment) throws Exception {
     DbSession dbSession = environment.get(DbSession.class);
-    
+
     // this message execution should be rolled back
-//    HistoryComment comment = new HistoryDetailImpl("failing update");
-//    dbSession.save(comment);
-    
-    throw new RuntimeException("ooops"); 
+    HistoryCommentImpl comment = new HistoryCommentImpl("failing update");
+    dbSession.save(comment);
+
+    throw new RuntimeException("ooops");
   }
 
   public static CommandMessage createMessage() {
-    CommandMessage commandMessage = new CommandMessage();
-    ObjectDescriptor commandDescriptor = new ObjectDescriptor(FailingTestCommand.class);
-    commandMessage.setCommandDescriptor(commandDescriptor);
-    return commandMessage;
+    FailingTestCommand command = new FailingTestCommand();
+    return new CommandMessage(command);
   }
 
 }

Deleted: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/JobExecutorTestCase.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/JobExecutorTestCase.java	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/JobExecutorTestCase.java	2010-07-09 07:38:13 UTC (rev 6474)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, 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.jbpm.test.load.async;
-
-import org.jbpm.pvm.internal.cmd.CommandService;
-import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
-import org.jbpm.test.JbpmTestCase;
-
-/**
- * @author Tom Baeyens
- */
-public class JobExecutorTestCase extends JbpmTestCase {
-
-  protected CommandService commandService;
-  protected JobExecutor jobExecutor;
-
-  protected void setUp() throws Exception {
-    super.setUp();
-
-    commandService = processEngine.get(CommandService.class);
-    jobExecutor = processEngine.get(JobExecutor.class);
-  }
-}

Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageCommand.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageCommand.java	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageCommand.java	2010-07-09 07:38:13 UTC (rev 6474)
@@ -21,46 +21,32 @@
  */
 package org.jbpm.test.load.async;
 
-import java.util.Random;
-
 import org.hibernate.Session;
-import org.jbpm.api.cmd.Command;
+
 import org.jbpm.api.cmd.Environment;
+import org.jbpm.api.cmd.VoidCommand;
 import org.jbpm.pvm.internal.history.model.HistoryCommentImpl;
 import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
 import org.jbpm.pvm.internal.job.CommandMessage;
-import org.jbpm.pvm.internal.wire.descriptor.IntegerDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
 
 /**
  * @author Tom Baeyens
  */
-public class NormalMessageCommand implements Command<Void>  {
-  
+public class NormalMessageCommand extends VoidCommand {
+
   private static final long serialVersionUID = 1L;
-  static Random random = new Random();
-  
+
   int messageId;
-  
-  public NormalMessageCommand() {
-  }
-  
-  public NormalMessageCommand(int messageId) {
-    this.messageId = messageId;
-  }
 
   public static CommandMessage createMessage(int messageId) {
-    CommandMessage commandMessage = new CommandMessage();
-    ObjectDescriptor commandDescriptor = new ObjectDescriptor(NormalMessageCommand.class);
-    commandDescriptor.addInjection("messageId", new IntegerDescriptor(messageId));
-    commandMessage.setCommandDescriptor(commandDescriptor);
-    return commandMessage;
+    NormalMessageCommand command = new NormalMessageCommand();
+    command.messageId = messageId;
+    return new CommandMessage(command);
   }
 
-  public Void execute(Environment environment) throws Exception {
+  protected void executeVoid(Environment environment) throws Exception {
     HistoryDetailImpl comment = new HistoryCommentImpl(Integer.toString(messageId));
     Session session = environment.get(Session.class);
     session.save(comment);
-    return null;
   }
 }

Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageTest.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageTest.java	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageTest.java	2010-07-09 07:38:13 UTC (rev 6474)
@@ -21,82 +21,71 @@
  */
 package org.jbpm.test.load.async;
 
-import java.util.ArrayList;
+import java.util.BitSet;
 import java.util.List;
 
 import org.hibernate.Session;
+
 import org.jbpm.api.cmd.Command;
 import org.jbpm.api.cmd.Environment;
+import org.jbpm.api.cmd.VoidCommand;
 import org.jbpm.api.history.HistoryComment;
 import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
 import org.jbpm.pvm.internal.job.CommandMessage;
-import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
 import org.jbpm.pvm.internal.session.MessageSession;
 import org.jbpm.pvm.internal.util.CollectionUtil;
-import org.jbpm.test.Db;
+import org.jbpm.test.JbpmTestCase;
 
 /**
  * @author Tom Baeyens
  */
-public class NormalMessageTest extends JobExecutorTestCase {
+public class NormalMessageTest extends JbpmTestCase {
 
-  static long nbrOfTestMessages = 100;   
+  static long nbrOfTestMessages = 100;
 
-  protected void setUp() throws Exception {
-    super.setUp();
-    Db.clean(processEngine);
-  }
-
   public void testNormalMessageProcessing() {
-    JobExecutor jobExecutor = processEngine.get(JobExecutor.class);
-    jobExecutor.start();
+    // insert ${nbrOfTestMessages} messages...
+    for (int i = 0; i < nbrOfTestMessages; i++) {
+      processEngine.execute(new InsertNormalMessageCmd(i));
+    }
+    // wait till all messages are processed
+    waitTillNoMoreMessages();
 
-    try {
-      // insert ${nbrOfTestMessages} messages... 
-      for (int i = 0; i < nbrOfTestMessages; i++) {
-        commandService.execute(new InsertNormalMessageCmd(i));
-      }
+    BitSet processedMessageNumbers = processEngine.execute(new Command<BitSet>() {
 
-      // wait till all messages are processed
-      waitTillNoMoreMessages();
-
-    } finally {
-      jobExecutor.stop(true);
-    }
-    
-    List<Integer> processedMessageNumbers = commandService.execute(new Command<List<Integer>>() {
       private static final long serialVersionUID = 1L;
 
-      public List<Integer> execute(Environment environment) {
-        List<Integer> processedMessageNumbers = new ArrayList<Integer>();
+      public BitSet execute(Environment environment) {
+        BitSet processedMessageNumbers = new BitSet();
         Session session = environment.get(Session.class);
         List<?> comments = session.createCriteria(HistoryDetailImpl.class).list();
-        for (HistoryComment comment: CollectionUtil.checkList(comments, HistoryComment.class)) {
+        for (HistoryComment comment : CollectionUtil.checkList(comments, HistoryComment.class)) {
           int processedMessageNumber = Integer.parseInt(comment.getMessage());
-          processedMessageNumbers.add(processedMessageNumber);
+          processedMessageNumbers.set(processedMessageNumber);
           // make sure the db stays clean
           session.delete(comment);
         }
         return processedMessageNumbers;
       }
     });
-    
+
     for (int i = 0; i < nbrOfTestMessages; i++) {
-      assertTrue("message " + i + " is not processed: " + processedMessageNumbers, processedMessageNumbers.contains(i));
+      assertTrue("message " + i + " is not processed: " + processedMessageNumbers, processedMessageNumbers.get(i));
     }
   }
-  
-  public static class InsertNormalMessageCmd implements Command<Object> {
+
+  public static class InsertNormalMessageCmd extends VoidCommand {
+
+    final int messageId;
     private static final long serialVersionUID = 1L;
-    int i;
-    public InsertNormalMessageCmd(int i) {
-      this.i = i;
+
+    public InsertNormalMessageCmd(int messageId) {
+      this.messageId = messageId;
     }
-    public Object execute(Environment environment) throws Exception {
+    protected void executeVoid(Environment environment) throws Exception {
       MessageSession messageSession = environment.get(MessageSession.class);
-      CommandMessage commandMessage = NormalMessageCommand.createMessage(i);
+      CommandMessage commandMessage = NormalMessageCommand.createMessage(messageId);
       messageSession.send(commandMessage);
-      return null;
     }
   }
 

Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/executions/ProcessExecutionTest.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/executions/ProcessExecutionTest.java	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/executions/ProcessExecutionTest.java	2010-07-09 07:38:13 UTC (rev 6474)
@@ -28,7 +28,6 @@
 import org.jbpm.internal.log.Log;
 import org.jbpm.test.load.LoadTestCase;
 
-
 /**
  * @author Tom Baeyens
  */
@@ -55,7 +54,7 @@
   }
 
   public void testExecuteProcesses() throws Exception {
-    // deployJpdlResource("org/jbpm/test/load/executions/process.jpdl.xml");
+    deployFromClasspath("org/jbpm/test/load/executions/process.jpdl.xml");
     
     startMeasuringTime();
     
@@ -66,7 +65,6 @@
       threadList.add(thread);
     }
     
-    
     for (Thread thread: threadList) {
       while (thread.isAlive()) {
         try {

Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/AddCommentCmd.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/AddCommentCmd.java	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/AddCommentCmd.java	2010-07-09 07:38:13 UTC (rev 6474)
@@ -24,21 +24,25 @@
 import org.hibernate.Session;
 import org.jbpm.api.cmd.Environment;
 import org.jbpm.api.cmd.VoidCommand;
-import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
+import org.jbpm.pvm.internal.history.model.HistoryCommentImpl;
 
 /**
  * @author Tom Baeyens
  */
-public class AddCommentCmd extends VoidCommand  {
-  
+public class AddCommentCmd extends VoidCommand {
+
   private static final long serialVersionUID = 1L;
-  
+
   protected String message;
 
+  public AddCommentCmd(String message) {
+    this.message = message;
+  }
+
   public void executeVoid(Environment environment) throws Exception {
-//    HistoryDetailImpl comment = new HistoryDetailImpl(message);
-//    Session session = environment.get(Session.class);
-//    session.save(comment);
-//    MessageProcessingTest.commentAdded();
+    HistoryCommentImpl comment = new HistoryCommentImpl(message);
+    Session session = environment.get(Session.class);
+    session.save(comment);
+    MessageProcessingTest.commentAdded();
   }
 }

Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/MessageProcessingTest.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/MessageProcessingTest.java	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/MessageProcessingTest.java	2010-07-09 07:38:13 UTC (rev 6474)
@@ -21,22 +21,20 @@
  */
 package org.jbpm.test.load.messages;
 
-import java.util.ArrayList;
+import java.util.BitSet;
 import java.util.List;
 
 import org.hibernate.Session;
+
 import org.jbpm.api.cmd.Command;
 import org.jbpm.api.cmd.Environment;
 import org.jbpm.api.history.HistoryComment;
 import org.jbpm.internal.log.Log;
 import org.jbpm.pvm.internal.cmd.CompositeCmd;
 import org.jbpm.pvm.internal.cmd.SendMessageCmd;
-import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
+import org.jbpm.pvm.internal.history.model.HistoryCommentImpl;
 import org.jbpm.pvm.internal.job.CommandMessage;
-import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
 import org.jbpm.pvm.internal.util.CollectionUtil;
-import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.StringDescriptor;
 import org.jbpm.test.load.LoadTestCase;
 
 /**
@@ -47,95 +45,70 @@
 
   private static final Log log = Log.getLog(MessageProcessingTest.class.getName());
 
-  static long nbrOfTestMessages = 1000; // nbrOfTestMessages must be dividable by insertGroupSize  
-  static long insertGroupSize = 100;
-
+  // nbrOfTestMessages must be divisible by insertGroupSize
+  static final long insertGroupSize = 100;
+  static final long nbrOfTestMessages = insertGroupSize * 10;
   static int commentsAdded = 0;
-  
+
   public static synchronized void commentAdded() {
     commentsAdded++;
   }
 
-  public void setUp() throws Exception {
-    super.setUp();
-    
-    if ( (nbrOfTestMessages % insertGroupSize) != 0 ) {
-      fail("nbrOfTestMessages ("+nbrOfTestMessages+") is not dividable by insertGroupSize ("+insertGroupSize+")");
-    }
-  }
-  
   protected void logColumnTitles() {
     logFileWriter.println("Used Memory\tProcessed Messages\tTime");
   }
 
   public void logStatus() {
     String measuredTime = getMeasuredTime();
-    logFileWriter.println(getUsedMemory()+"\t"+commentsAdded+"\t"+measuredTime);
+    logFileWriter.println(getUsedMemory() + "\t" + commentsAdded + "\t" + measuredTime);
     logFileWriter.flush();
-    log.info(commentsAdded+" msgs in "+measuredTime);
+    log.info(commentsAdded + " msgs in " + measuredTime);
   }
-  
+
   public void testMessageProcessing() throws Exception {
-    JobExecutor jobExecutor = processEngine.get(JobExecutor.class);
-    
-    try {
-      int messageIndex = 0;
-      // insert ${nbrOfTestMessages} messages... 
-      for (int i = 0; i < nbrOfTestMessages; i+=insertGroupSize) {
-        CompositeCmd compositeCmd = new CompositeCmd();
-        // ...in groups of ${insertGroupSize}
-        for (int j = 0; j <insertGroupSize ; j++) {
-          String messageText = Integer.toString(messageIndex);
-          
-          ObjectDescriptor cmdDescriptor = new ObjectDescriptor(AddCommentCmd.class);
-          cmdDescriptor.addInjection("message", new StringDescriptor(messageText));
-          CommandMessage commandMessage = new CommandMessage(cmdDescriptor);
-          SendMessageCmd sendMessageCmd = new SendMessageCmd(commandMessage);
-          
-          compositeCmd.addCommand(sendMessageCmd);
-          
-          messageIndex++;
-        }
-        commandService.execute(compositeCmd);
-        
-        log.info("added "+messageIndex+" messages");
+    int messageIndex = 0;
+    // insert ${nbrOfTestMessages} messages...
+    for (int i = 0; i < nbrOfTestMessages; i += insertGroupSize) {
+      CompositeCmd compositeCmd = new CompositeCmd();
+      // ...in groups of ${insertGroupSize}
+      for (int j = 0; j < insertGroupSize; j++) {
+        String messageText = Integer.toString(messageIndex++);
+        CommandMessage commandMessage = new CommandMessage(new AddCommentCmd(messageText));
+        SendMessageCmd sendMessageCmd = new SendMessageCmd(commandMessage);
+        compositeCmd.addCommand(sendMessageCmd);
       }
+      processEngine.execute(compositeCmd);
+      log.info("added " + messageIndex + " messages");
+    }
 
-      startMeasuringTime();
-      
-      jobExecutor.start();
+    startMeasuringTime();
+    // wait till all messages are processed
+    waitTillNoMoreMessages();
+    stopMeasuringTime();
 
-      // wait till all messages are processed
-      waitTillNoMoreMessages(jobExecutor);
+    log.info("processing " + nbrOfTestMessages + " messages took " + getMeasuredTime());
 
-    } finally {
-      stopMeasuringTime();
-      
-      jobExecutor.stop(true);
-    }
-    
-    log.info("processing "+nbrOfTestMessages+" messages took "+getMeasuredTime());
+    BitSet processedMessageNumbers = processEngine.execute(new Command<BitSet>() {
 
-    List<Integer> processedMessageNumbers = commandService.execute(new Command<List<Integer>>() {
       private static final long serialVersionUID = 1L;
 
-      public List<Integer> execute(Environment environment) {
-        List<Integer> processedMessageNumbers = new ArrayList<Integer>();
+      public BitSet execute(Environment environment) {
+        BitSet processedMessageNumbers = new BitSet();
         Session session = environment.get(Session.class);
-        List<?> comments = session.createCriteria(HistoryDetailImpl.class).list();
-        for (HistoryComment comment: CollectionUtil.checkList(comments, HistoryComment.class)) {
+        List<?> comments = session.createCriteria(HistoryCommentImpl.class).list();
+        for (HistoryComment comment : CollectionUtil.checkList(comments, HistoryComment.class)) {
           int processedMessageNumber = Integer.parseInt(comment.getMessage());
-          processedMessageNumbers.add(processedMessageNumber);
+          processedMessageNumbers.set(processedMessageNumber);
           // make sure the db stays clean
           session.delete(comment);
         }
         return processedMessageNumbers;
       }
     });
-    
+
     for (int i = 0; i < nbrOfTestMessages; i++) {
-      assertTrue("message " + i + " is not processed: " + processedMessageNumbers, processedMessageNumbers.contains(i));
+      assertTrue("message " + i + " is not processed: " + processedMessageNumbers, processedMessageNumbers.get(i));
     }
   }
-  
+
 }

Modified: jbpm4/trunk/modules/test-load/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/resources/jbpm.cfg.xml	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/test-load/src/test/resources/jbpm.cfg.xml	2010-07-09 07:38:13 UTC (rev 6474)
@@ -3,9 +3,10 @@
 <jbpm-configuration>
 
   <import resource="jbpm.default.cfg.xml" />
-  <import resource="jbpm.businesscalendar.cfg.xml" />
   <import resource="jbpm.tx.hibernate.cfg.xml" />
   <import resource="jbpm.jpdl.cfg.xml" />
   <import resource="jbpm.identity.cfg.xml" />
+  <import resource="jbpm.businesscalendar.cfg.xml" />
+  <import resource="jbpm.jobexecutor.cfg.xml" />
 
 </jbpm-configuration>

Modified: jbpm4/trunk/modules/test-load/src/test/resources/jbpm.hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/resources/jbpm.hibernate.cfg.xml	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/test-load/src/test/resources/jbpm.hibernate.cfg.xml	2010-07-09 07:38:13 UTC (rev 6474)
@@ -1,27 +1,23 @@
 <?xml version="1.0" encoding="utf-8"?>
 
 <!DOCTYPE hibernate-configuration PUBLIC
-          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
-          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+  "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+  "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
 
 <hibernate-configuration>
   <session-factory>
-  
-     <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
-     <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
-     <property name="hibernate.connection.url">jdbc:hsqldb:mem:.</property>
-     <property name="hibernate.connection.username">sa</property>
-     <property name="hibernate.connection.password"></property>
-     <property name="hibernate.hbm2ddl.auto">create-drop</property>
-     <property name="hibernate.format_sql">true</property>
-     
-     <mapping resource="jbpm.repository.hbm.xml" />
-     <mapping resource="jbpm.execution.hbm.xml" />
-     <mapping resource="jbpm.history.hbm.xml" />
-     <mapping resource="jbpm.task.hbm.xml" />
-     <mapping resource="jbpm.identity.hbm.xml" />
+    <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
+    <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
+    <property name="hibernate.connection.url">jdbc:hsqldb:mem:.</property>
+    <property name="hibernate.connection.username">sa</property>
+    <property name="hibernate.connection.password" />
+    <property name="hibernate.hbm2ddl.auto">create-drop</property>
+    <property name="hibernate.format_sql">true</property>
 
-     <mapping resource="jbpm.load.hbm.xml" />
-     
+    <mapping resource="jbpm.repository.hbm.xml" />
+    <mapping resource="jbpm.execution.hbm.xml" />
+    <mapping resource="jbpm.history.hbm.xml" />
+    <mapping resource="jbpm.task.hbm.xml" />
+    <mapping resource="jbpm.identity.hbm.xml" />
   </session-factory>
 </hibernate-configuration>

Deleted: jbpm4/trunk/modules/test-load/src/test/resources/jbpm.load.hbm.xml
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/resources/jbpm.load.hbm.xml	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/test-load/src/test/resources/jbpm.load.hbm.xml	2010-07-09 07:38:13 UTC (rev 6474)
@@ -1,14 +0,0 @@
-<?xml version="1.0"?>
-
-<!DOCTYPE hibernate-mapping PUBLIC
-      "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
-      "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-
-<hibernate-mapping default-access="field">
-
-	<subclass name="org.jbpm.test.load.AddCommentMessage" 
-         extends="org.jbpm.pvm.internal.job.MessageImpl" 
-         discriminator-value="AddMsg">
-  </subclass>
-  
-</hibernate-mapping>
\ No newline at end of file

Modified: jbpm4/trunk/modules/test-load/src/test/resources/logging.properties
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/resources/logging.properties	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/test-load/src/test/resources/logging.properties	2010-07-09 07:38:13 UTC (rev 6474)
@@ -26,7 +26,7 @@
 org.hibernate.cfg.HbmBinder.level=SEVERE
 org.hibernate.cfg.SettingsFactory.level=SEVERE
 # org.hibernate.level=FINE
-# org.hibernate.SQL.level=FINEST
+org.hibernate.SQL.level=FINEST
 # org.hibernate.transaction.level=FINEST
 # org.hibernate.type.level=FINEST
 # org.hibernate.tool.hbm2ddl.SchemaExport.level=FINEST

Modified: jbpm4/trunk/modules/test-load/src/test/resources/org/jbpm/test/load/executions/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/resources/org/jbpm/test/load/executions/process.jpdl.xml	2010-07-08 11:33:58 UTC (rev 6473)
+++ jbpm4/trunk/modules/test-load/src/test/resources/org/jbpm/test/load/executions/process.jpdl.xml	2010-07-09 07:38:13 UTC (rev 6474)
@@ -2,38 +2,34 @@
 
 <process name="Process">
 
-  <start>
+  <start g="16,16,80,40">
     <transition to="a" />
   </start>
 
-  <java name="a" 
-        class="org.jbpm.test.load.executions.Automatic"
-        method="doNothing">
+  <java class="org.jbpm.test.load.executions.Automatic" method="doNothing" name="a"
+    g="16,88,80,40">
     <transition to="b" />
   </java>
-  
-  <java name="b" 
-        class="org.jbpm.test.load.executions.Automatic"
-        method="doNothing">
+
+  <java class="org.jbpm.test.load.executions.Automatic" method="doNothing" name="b"
+    g="16,160,80,40">
     <transition to="c" />
   </java>
-  
-  <state name="c">
+
+  <state name="c" g="16,232,80,40">
     <transition to="d" />
   </state>
 
-  <java name="d" 
-        class="org.jbpm.test.load.executions.Automatic"
-        method="doNothing">
+  <java class="org.jbpm.test.load.executions.Automatic" method="doNothing" name="d"
+    g="16,304,80,40">
     <transition to="e" />
   </java>
-  
-  <java name="e" 
-        class="org.jbpm.test.load.executions.Automatic"
-        method="doNothing">
+
+  <java class="org.jbpm.test.load.executions.Automatic" method="doNothing" name="e"
+    g="16,376,80,40">
     <transition to="end" />
   </java>
-  
-  <end name="end" />
-  
-</process>
+
+  <end name="end" g="16,448,80,40" />
+
+</process>
\ No newline at end of file



More information about the jbpm-commits mailing list