[jbpm-commits] JBoss JBPM SVN: r4758 - in jbpm4/trunk/modules: test-db/src/test/java/org/jbpm/test/history and 1 other directory.
do-not-reply at jboss.org
do-not-reply at jboss.org
Thu May 7 06:14:22 EDT 2009
Author: tom.baeyens at jboss.com
Date: 2009-05-07 06:14:21 -0400 (Thu, 07 May 2009)
New Revision: 4758
Added:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/HistoryActivityInstanceQeuryTest.java
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryActivityInstanceQueryImpl.java
Log:
JBPM-2222 fixed stack overflow bug
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryActivityInstanceQueryImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryActivityInstanceQueryImpl.java 2009-05-07 09:52:13 UTC (rev 4757)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryActivityInstanceQueryImpl.java 2009-05-07 10:14:21 UTC (rev 4758)
@@ -86,7 +86,7 @@
appendWhereClause(" hai.activityName = '"+activityName+"'", hql);
}
- return hql().toString();
+ return hql.toString();
}
protected void applyParameters(Query query) {
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/HistoryActivityInstanceQeuryTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/HistoryActivityInstanceQeuryTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/HistoryActivityInstanceQeuryTest.java 2009-05-07 10:14:21 UTC (rev 4758)
@@ -0,0 +1,87 @@
+/*
+ * 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.history;
+
+import java.util.List;
+
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.history.HistoryActivityInstance;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HistoryActivityInstanceQeuryTest extends JbpmTestCase {
+
+ public void testSimpleQuery() {
+ deployJpdlXmlString(
+ "<process name='abc'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a'>" +
+ " <transition to ='b' />" +
+ " </state>" +
+ " <state name='b'>" +
+ " <transition to ='c' />" +
+ " </state>" +
+ " <state name='c'>" +
+ " <transition to ='end' />" +
+ " </state>" +
+ " <end name='end' />" +
+ "</process>"
+ );
+
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("abc");
+ executionService.signalExecutionById(processInstance.getId());
+ executionService.signalExecutionById(processInstance.getId());
+ executionService.signalExecutionById(processInstance.getId());
+
+ processInstance = executionService.startProcessInstanceByKey("abc");
+ executionService.signalExecutionById(processInstance.getId());
+ executionService.signalExecutionById(processInstance.getId());
+
+ processInstance = executionService.startProcessInstanceByKey("abc");
+ executionService.signalExecutionById(processInstance.getId());
+
+ executionService.startProcessInstanceByKey("abc");
+
+ List<HistoryActivityInstance> histActInsts = historyService.createHistoryActivityInstanceQuery()
+ .activityName("a")
+ .list();
+
+ assertEquals(4, histActInsts.size());
+
+ histActInsts = historyService.createHistoryActivityInstanceQuery()
+ .activityName("b")
+ .list();
+
+ assertEquals(3, histActInsts.size());
+
+ histActInsts = historyService.createHistoryActivityInstanceQuery()
+ .activityName("c")
+ .list();
+
+ assertEquals(2, histActInsts.size());
+ }
+}
Property changes on: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/HistoryActivityInstanceQeuryTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
More information about the jbpm-commits
mailing list