[jbpm-commits] JBoss JBPM SVN: r6760 - in jbpm3/branches/jbpm-3.2-soa/core/src/test: java/org/jbpm/jbpm2959 and 3 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Oct 14 14:09:32 EDT 2010


Author: alex.guizar at jboss.com
Date: 2010-10-14 14:09:32 -0400 (Thu, 14 Oct 2010)
New Revision: 6760

Added:
   jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/jbpm2959/
   jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/jbpm2959/JBPM2959Test.java
   jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm2959/
   jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm2959/gpd.xml
   jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm2959/processdefinition.xml
Modified:
   jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/log4j.xml
Log:
JBPM-2959 check in provided test process

Added: jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/jbpm2959/JBPM2959Test.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/jbpm2959/JBPM2959Test.java	                        (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/jbpm2959/JBPM2959Test.java	2010-10-14 18:09:32 UTC (rev 6760)
@@ -0,0 +1,64 @@
+/*
+ * 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.jbpm2959;
+
+import org.jbpm.db.AbstractDbTestCase;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ProcessInstance;
+
+/**
+ * Backport the dispatcher thread from jBPM 4 to avoid race conditions with multiple JobExecutor
+ * threads.
+ * 
+ * @see <a href="https://jira.jboss.org/browse/JBPM-2959">JBPM-2959</a>
+ * @author Alejandro Guizar
+ */
+public class JBPM2959Test extends AbstractDbTestCase {
+
+  protected void setUp() throws Exception {
+    super.setUp();
+
+    // [JBPM-2115] multiple threads not supported on DB2 < 9.7
+    // multiple threads not be supported on HSQL
+    String dialect = getHibernateDialect();
+    if (dialect.indexOf("DB2") == -1 && dialect.indexOf("HSQL") == -1) {
+      jbpmConfiguration.getJobExecutor().setNbrOfThreads(4);
+    }
+
+    ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("org/jbpm/jbpm2959/processdefinition.xml");
+    deployProcessDefinition(processDefinition);
+  }
+
+  protected void tearDown() throws Exception {
+    jbpmConfiguration.getJobExecutor().setNbrOfThreads(1);
+    super.tearDown();
+  }
+
+  public void testDeadlockAtJobInsert() {
+    ProcessInstance processInstance = jbpmContext.newProcessInstanceForUpdate("jbpm2959");
+    processInstance.signal();
+
+    processJobs();
+    processInstance = jbpmContext.loadProcessInstance(processInstance.getId());
+    assert processInstance.hasEnded() : "expected " + processInstance + " to have ended";
+  }
+}


Property changes on: jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/jbpm2959/JBPM2959Test.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/log4j.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/log4j.xml	2010-10-13 05:11:34 UTC (rev 6759)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/log4j.xml	2010-10-14 18:09:32 UTC (rev 6760)
@@ -34,7 +34,7 @@
   <!-- ================ -->
 
   <category name="org.jbpm">
-    <priority value="INFO" />
+    <priority value="DEBUG" />
   </category>
 
   <category name="org.hibernate">

Added: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm2959/gpd.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm2959/gpd.xml	                        (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm2959/gpd.xml	2010-10-14 18:09:32 UTC (rev 6760)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root-container name="jbpm2959" width="756" height="575">
+  <node name="Start" x="84" y="48" width="132" height="36">
+    <edge>
+      <label x="5" y="-10"/>
+    </edge>
+  </node>
+  <node name="Sleep" x="84" y="192" width="132" height="36">
+    <edge>
+      <label x="5" y="-10"/>
+      <bendpoint w1="-114" h1="-1" w2="-114" h2="71"/>
+      <bendpoint w1="-114" h1="-73" w2="-114" h2="-1"/>
+    </edge>
+  </node>
+  <node name="Keep Going?" x="84" y="120" width="132" height="36">
+    <edge>
+      <label x="5" y="-10"/>
+    </edge>
+    <edge>
+      <label x="-8" y="-22"/>
+    </edge>
+  </node>
+  <node name="End" x="288" y="120" width="132" height="36"/>
+  <deployment serverName="localhost" serverPort="8180" serverDeployer="/jbpm-console/app/upload">
+    <classesAndResources/>
+    <filesAndFolders/>
+  </deployment>
+</root-container>


Property changes on: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm2959/gpd.xml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm2959/processdefinition.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm2959/processdefinition.xml	                        (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm2959/processdefinition.xml	2010-10-14 18:09:32 UTC (rev 6760)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="jbpm2959">
+
+  <start-state name="Start">
+    <transition to="Keep Going?" >
+			<script>
+				executionContext.setVariable(&quot;count&quot;, 0);
+			</script>
+		</transition>
+  </start-state>
+
+  <state name="Sleep">
+    <timer duedate="1 second" name="sleep_timer_1" transition="Done" />
+    <transition to="Keep Going?" name="Done" />
+  </state>
+
+  <decision name="Keep Going?">
+    <transition to="Sleep" name="Yes">
+			<condition expression="${count &lt; 10}" />
+			<script>
+				executionContext.setVariable(&quot;count&quot;, count + 1);
+			</script>
+		</transition>
+		<transition to="End" name="No" />
+  </decision>
+
+	<end-state name="End" />
+
+</process-definition>
\ No newline at end of file


Property changes on: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm2959/processdefinition.xml
___________________________________________________________________
Name: svn:eol-style
   + native



More information about the jbpm-commits mailing list