[jbpm-commits] JBoss JBPM SVN: r2661 - in jbpm3/trunk/modules/core: src/test/java/org/jbpm/perf and 1 other directory.
do-not-reply at jboss.org
do-not-reply at jboss.org
Wed Oct 29 10:48:35 EDT 2008
Author: tom.baeyens at jboss.com
Date: 2008-10-29 10:48:35 -0400 (Wed, 29 Oct 2008)
New Revision: 2661
Removed:
jbpm3/trunk/modules/core/src/test/java/org/jbpm/perf/PerfWithoutDbTest.java
jbpm3/trunk/modules/core/src/test/java/org/jbpm/perf/StateUpdateTest.java
Modified:
jbpm3/trunk/modules/core/pom.xml
Log:
[JBPM-1721] removed JobLoadJoinTest and JobLoadSubProcessTest, [JBPM-1723] removed obsolete performance tests
Modified: jbpm3/trunk/modules/core/pom.xml
===================================================================
--- jbpm3/trunk/modules/core/pom.xml 2008-10-29 14:40:28 UTC (rev 2660)
+++ jbpm3/trunk/modules/core/pom.xml 2008-10-29 14:48:35 UTC (rev 2661)
@@ -220,9 +220,6 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
- <!-- https://jira.jboss.org/jira/browse/JBPM-1723 -->
- <exclude>org/jbpm/perf/PerfWithoutDbTest.java</exclude>
- <exclude>org/jbpm/perf/StateUpdateTest.java</exclude>
<!-- https://jira.jboss.org/jira/browse/JBPM-1709 -->
<exclude>org/jbpm/scheduler/exe/TimerDbTest.java</exclude>
<exclude>org/jbpm/taskmgmt/exe/TaskTimerExecutionDbTest.java</exclude>
@@ -253,9 +250,6 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
- <!-- https://jira.jboss.org/jira/browse/JBPM-1723 -->
- <exclude>org/jbpm/perf/PerfWithoutDbTest.java</exclude>
- <exclude>org/jbpm/perf/StateUpdateTest.java</exclude>
</excludes>
</configuration>
</plugin>
@@ -281,9 +275,6 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
- <!-- https://jira.jboss.org/jira/browse/JBPM-1723 -->
- <exclude>org/jbpm/perf/PerfWithoutDbTest.java</exclude>
- <exclude>org/jbpm/perf/StateUpdateTest.java</exclude>
<!-- https://jira.jboss.org/jira/browse/JBPM-1735 -->
<exclude>org/jbpm/graph/node/ProcessStateDbTest.java</exclude>
</excludes>
@@ -311,9 +302,6 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
- <!-- https://jira.jboss.org/jira/browse/JBPM-1723 -->
- <exclude>org/jbpm/perf/PerfWithoutDbTest.java</exclude>
- <exclude>org/jbpm/perf/StateUpdateTest.java</exclude>
<!-- https://jira.jboss.org/jira/browse/JBPM-1772 -->
<exclude>org/jbpm/jpdl/exe/JoinDbTest.java</exclude>
<exclude>org/jbpm/graph/exe/SubProcessPlusConcurrencyDbTest.java</exclude>
@@ -344,9 +332,6 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
- <!-- https://jira.jboss.org/jira/browse/JBPM-1723 -->
- <exclude>org/jbpm/perf/PerfWithoutDbTest.java</exclude>
- <exclude>org/jbpm/perf/StateUpdateTest.java</exclude>
<!-- https://jira.jboss.org/jira/browse/JBPM-1764 -->
<exclude>org/jbpm/job/executor/JobExecutorDbTest</exclude>
</excludes>
Deleted: jbpm3/trunk/modules/core/src/test/java/org/jbpm/perf/PerfWithoutDbTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/perf/PerfWithoutDbTest.java 2008-10-29 14:40:28 UTC (rev 2660)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/perf/PerfWithoutDbTest.java 2008-10-29 14:48:35 UTC (rev 2661)
@@ -1,142 +0,0 @@
-package org.jbpm.perf;
-
-import java.io.FileWriter;
-import java.io.PrintWriter;
-import java.util.Collection;
-
-import org.jbpm.AbstractJbpmTestCase;
-import org.jbpm.JbpmConfiguration;
-import org.jbpm.JbpmContext;
-import org.jbpm.graph.def.ProcessDefinition;
-import org.jbpm.graph.exe.ProcessInstance;
-import org.jbpm.graph.exe.Token;
-import org.jbpm.taskmgmt.exe.TaskInstance;
-
-public class PerfWithoutDbTest extends AbstractJbpmTestCase
-{
-
- JbpmConfiguration jbpmConfiguration = JbpmConfiguration.parseXmlString("<jbpm-configuration><jbpm-context /></jbpm-configuration>");
-
- ProcessDefinition processDefinition = parseWebSale();
-
- /*
- * this test tests/shows the memory consumption
- */
- public void testMemory() throws Exception
- {
- PrintWriter out = new PrintWriter(new FileWriter("mem.txt"));
- int i = 1;
- long total = 0;
- while (true)
- {
- long start = System.currentTimeMillis();
- executeWebSale();
- long stop = System.currentTimeMillis();
- long freeMemory = Runtime.getRuntime().freeMemory();
-
- long millis = stop - start;
-
- String avg;
- if (i > 20)
- {
- total += millis;
- avg = Float.toString((float)total / (float)(i - 20));
- }
- else
- {
- avg = "";
- }
-
- String msg = i + " " + millis + " " + freeMemory + " " + avg;
-
- // System.out.println(msg);
- out.println(msg);
- out.flush();
-
- System.gc();
- i++;
- }
- }
-
- /** this test shows the performance */
- public void testPerformance() throws Exception
- {
-
- int nbrOfExecutions = 1000;
- int i = 0;
- long start = System.currentTimeMillis();
- while (true)
- {
- executeWebSale();
- if (i > nbrOfExecutions)
- {
- long elapsed = System.currentTimeMillis() - start;
- // System.out.println(Float.toString((float)nbrOfExecutions/(float)elapsed));
- i = 0;
- start = System.currentTimeMillis();
- }
- i++;
- }
- }
-
- void executeWebSale()
- {
- ProcessInstance processInstance;
-
- JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
- try
- {
- processInstance = new ProcessInstance(processDefinition);
- TaskInstance taskInstance = processInstance.getTaskMgmtInstance().createStartTaskInstance();
- taskInstance.setVariable("item", "cookies");
- taskInstance.setVariable("quantity", "lots of them");
- taskInstance.setVariable("address", "46 Main St.");
- taskInstance.end();
- }
- finally
- {
- jbpmContext.close();
- }
-
- jbpmContext = jbpmConfiguration.createJbpmContext();
- try
- {
- Token token = processInstance.getRootToken();
- Collection taskInstances = processInstance.getTaskMgmtInstance().getUnfinishedTasks(token);
- TaskInstance taskInstance = (TaskInstance)taskInstances.iterator().next();
- taskInstance.end("OK");
- }
- finally
- {
- jbpmContext.close();
- }
-
- jbpmContext = jbpmConfiguration.createJbpmContext();
- try
- {
- Token token = processInstance.getRootToken();
- Token shipping = token.getChild("payment");
- Collection taskInstances = processInstance.getTaskMgmtInstance().getUnfinishedTasks(shipping);
- TaskInstance taskInstance = (TaskInstance)taskInstances.iterator().next();
- taskInstance.end();
- }
- finally
- {
- jbpmContext.close();
- }
- }
-
- ProcessDefinition parseWebSale()
- {
- JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
- try
- {
- ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("org/jbpm/perf/memleaktest.processdefinition.xml");
- return processDefinition;
- }
- finally
- {
- jbpmContext.close();
- }
- }
-}
Deleted: jbpm3/trunk/modules/core/src/test/java/org/jbpm/perf/StateUpdateTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/perf/StateUpdateTest.java 2008-10-29 14:40:28 UTC (rev 2660)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/perf/StateUpdateTest.java 2008-10-29 14:48:35 UTC (rev 2661)
@@ -1,89 +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;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jbpm.db.AbstractDbTestCase;
-import org.jbpm.graph.def.ProcessDefinition;
-import org.jbpm.graph.exe.ProcessInstance;
-
-public class StateUpdateTest extends AbstractDbTestCase
-{
- private static final Log log = LogFactory.getLog(StateUpdateTest.class);
-
- ProcessDefinition processDefinition;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- processDefinition = ProcessDefinition.parseXmlString(
- "<process-definition name='states'>" +
- " <start-state>" +
- " <transition to='one' />" +
- " </start-state>" +
- " <state name='one'>" +
- " <transition to='two' />" +
- " </state>" +
- " <state name='two'>" +
- " <transition to='end' />" +
- " </state>" +
- " <end-state name='end' />" +
- "</process-definition>"
- );
- processDefinition = saveAndReload(processDefinition);
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- jbpmContext.getGraphSession().deleteProcessDefinition(processDefinition.getId());
- super.tearDown();
- }
-
- public void testStates()
- {
- log.info("");
- log.info("=== CREATING PROCESS INSTANCE =======================================================");
- log.info("");
- ProcessInstance processInstance = jbpmContext.newProcessInstanceForUpdate("states");
- processInstance.signal();
-
- newTransaction();
- long processInstanceId = processInstance.getId();
-
- log.info("");
- log.info("=== STATE CHANGE ONE --> TWO =======================================================");
- log.info("");
- processInstance = jbpmContext.loadProcessInstanceForUpdate(processInstanceId);
- processInstance.signal();
-
- newTransaction();
-
- log.info("");
- log.info("=== STATE CHANGE TWO --> END =======================================================");
- log.info("");
- processInstance = jbpmContext.loadProcessInstanceForUpdate(processInstanceId);
- processInstance.signal();
- }
-}
More information about the jbpm-commits
mailing list