[jbpm-commits] JBoss JBPM SVN: r3973 - jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/perf.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Feb 20 05:56:27 EST 2009


Author: thomas.diesler at jboss.com
Date: 2009-02-20 05:56:27 -0500 (Fri, 20 Feb 2009)
New Revision: 3973

Added:
   jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/perf/SimplePerformanceTest.java
Removed:
   jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/perf/AsyncCallTest.java
Log:
[JBPM-2043] Cleanup performance test

Deleted: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/perf/AsyncCallTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/perf/AsyncCallTest.java	2009-02-20 10:27:03 UTC (rev 3972)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/perf/AsyncCallTest.java	2009-02-20 10:56:27 UTC (rev 3973)
@@ -1,111 +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.perf;
-
-// $Id$
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jbpm.command.CommandService;
-import org.jbpm.command.StartProcessInstanceCommand;
-import org.jbpm.command.impl.CommandServiceImpl;
-import org.jbpm.db.AbstractDbTestCase;
-import org.jbpm.graph.def.ActionHandler;
-import org.jbpm.graph.def.ProcessDefinition;
-import org.jbpm.graph.exe.ExecutionContext;
-import org.jbpm.graph.exe.ProcessInstance;
-
-/**
- * This tests creates 10000 process instances. Every instance has an async call
- * to the test class. See JIRA bugs SOA-1175 and JBPM-2043.
- *
- * @author mvecera at redhat.com
- * @author pmacik at redhat.com
- * @author thomas.diesler at jboss.com
- * @since 18-Feb-2009
- */
-public class AsyncCallTest extends AbstractDbTestCase
-{
-  private static final Log log = LogFactory.getLog(AsyncCallTest.class);
-  
-  private CommandService commandService = new CommandServiceImpl(getJbpmConfiguration());
-  private static final int INSTANCES = 1000;
-  private static int count;
-  
-  ProcessDefinition processDefinition;
-
-  public void setUp() throws Exception
-  {
-    super.setUp();
-    
-    processDefinition = ProcessDefinition.parseXmlString(
-        "<process-definition xmlns='urn:jbpm.org:jpdl-3.1' name='processDefinition1'>" + 
-        "  <start-state name='start'>" + 
-        "    <transition name='to_state' to='end'>" + 
-        "      <action class='" + PerfActionHandler.class.getName() + "'/>" + 
-        "    </transition>" + 
-        "  </start-state>" + 
-        "  <end-state name='end'/>" + 
-        "</process-definition>");
-    
-    saveAndReload(processDefinition);
-  }
-
-  public void tearDown() throws Exception
-  {
-    beginSessionTransaction();
-    jbpmContext.getGraphSession().deleteProcessDefinition(processDefinition.getId());
-    super.tearDown();
-  }
-
-  public void testAsyncCall()
-  {
-    long start = System.currentTimeMillis();
-
-    commitAndCloseSession();
-    startJobExecutor();
-
-    for (count = 0; count < INSTANCES; count++)
-    {
-      beginSessionTransaction();
-      StartProcessInstanceCommand startCommand = new StartProcessInstanceCommand();
-      startCommand.setProcessId(processDefinition.getId());
-      startCommand.setProcessName("processDefinition1");
-      ProcessInstance pi = (ProcessInstance)commandService.execute(startCommand);
-      commitAndCloseSession();
-    }
-
-    stopJobExecutor();
-
-    long stop = System.currentTimeMillis();
-    System.out.println("=== Test finished processing " + INSTANCES + " instances in " + (stop - start) + "ms ===");
-    System.out.println("=== This is " + Math.round(1000 * INSTANCES / (stop - start)) + " instances per second ===");
-  }
-
-  public static class PerfActionHandler implements ActionHandler
-  {
-    public void execute(ExecutionContext executionContext) throws Exception
-    {
-      //System.out.println(count);
-    }
-  }
-}

Copied: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/perf/SimplePerformanceTest.java (from rev 3969, jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/perf/AsyncCallTest.java)
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/perf/SimplePerformanceTest.java	                        (rev 0)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/perf/SimplePerformanceTest.java	2009-02-20 10:56:27 UTC (rev 3973)
@@ -0,0 +1,110 @@
+/*
+ * 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.perf;
+
+// $Id$
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jbpm.command.CommandService;
+import org.jbpm.command.StartProcessInstanceCommand;
+import org.jbpm.command.impl.CommandServiceImpl;
+import org.jbpm.db.AbstractDbTestCase;
+import org.jbpm.graph.def.ActionHandler;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ExecutionContext;
+import org.jbpm.graph.exe.ProcessInstance;
+
+/**
+ * This tests creates a number of process instances. 
+ * Every instance has a call to an ActionHandler. 
+ * 
+ * https://jira.jboss.org/jira/browse/JBPM-2043
+ *
+ * @author mvecera at redhat.com
+ * @author pmacik at redhat.com
+ * @author thomas.diesler at jboss.com
+ * @since 18-Feb-2009
+ */
+public class SimplePerformanceTest extends AbstractDbTestCase
+{
+  private static final Log log = LogFactory.getLog(SimplePerformanceTest.class);
+  
+  private CommandService commandService = new CommandServiceImpl(getJbpmConfiguration());
+  private static final int INSTANCES = 1000;
+  private static int count;
+  
+  ProcessDefinition processDefinition;
+
+  public void setUp() throws Exception
+  {
+    super.setUp();
+    
+    processDefinition = ProcessDefinition.parseXmlString(
+        "<process-definition xmlns='urn:jbpm.org:jpdl-3.1' name='processDefinition1'>" + 
+        "  <start-state name='start'>" + 
+        "    <transition name='to_state' to='end'>" + 
+        "      <action class='" + PerfActionHandler.class.getName() + "'/>" + 
+        "    </transition>" + 
+        "  </start-state>" + 
+        "  <end-state name='end'/>" + 
+        "</process-definition>");
+    
+    saveAndReload(processDefinition);
+  }
+
+  public void tearDown() throws Exception
+  {
+    beginSessionTransaction();
+    jbpmContext.getGraphSession().deleteProcessDefinition(processDefinition.getId());
+    super.tearDown();
+  }
+
+  public void testAsyncCall()
+  {
+    long start = System.currentTimeMillis();
+
+    commitAndCloseSession();
+
+    for (count = 0; count < INSTANCES; count++)
+    {
+      beginSessionTransaction();
+      StartProcessInstanceCommand startCommand = new StartProcessInstanceCommand();
+      startCommand.setProcessId(processDefinition.getId());
+      startCommand.setProcessName("processDefinition1");
+      ProcessInstance pi = (ProcessInstance)commandService.execute(startCommand);
+      commitAndCloseSession();
+    }
+
+    long stop = System.currentTimeMillis();
+    System.out.println("=== Test finished processing " + INSTANCES + " instances in " + (stop - start) + "ms ===");
+    System.out.println("=== This is " + Math.round(1000 * INSTANCES / (stop - start)) + " instances per second ===");
+  }
+
+  public static class PerfActionHandler implements ActionHandler
+  {
+    public void execute(ExecutionContext executionContext) throws Exception
+    {
+      //System.out.println(count);
+    }
+  }
+}




More information about the jbpm-commits mailing list