JBoss JBPM SVN: r4946 - in projects/gwt-console/trunk/gui/war/src/main: java/org/jboss/bpm/console/client/process and 4 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-05-29 06:53:02 -0400 (Fri, 29 May 2009)
New Revision: 4946
Added:
projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/play_red_big.png
Modified:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ActivityDiagramView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDetailView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/SearchDefinitionView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/SearchWindow.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskDetailView.java
projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/console.css
Log:
Improve graph view
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java 2009-05-29 10:21:28 UTC (rev 4945)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java 2009-05-29 10:53:02 UTC (rev 4946)
@@ -103,6 +103,7 @@
window.setSize("320px", "180px");
LayoutPanel panel = new LayoutPanel();
+
createLayoutContent(panel);
window.setWidget(panel);
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ActivityDiagramView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ActivityDiagramView.java 2009-05-29 10:21:28 UTC (rev 4945)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ActivityDiagramView.java 2009-05-29 10:53:02 UTC (rev 4946)
@@ -69,7 +69,7 @@
this.clear();
// add overlay
- HTML html = new HTML(
+ /*HTML html = new HTML(
"<div style='width:1024px; height:768px; background-color:#ffffff;'><div id=\"imageContainer\" style=\"position:relative;top:-1;left:-1;height:"+activeNodeInfo.getHeight()+"px;width:"+activeNodeInfo.getWidth()+"px\">" +
"<img src=\""+imageUrl+"\" style=\"position:absolute;top:0;left:0\" />" +
"" +
@@ -79,9 +79,19 @@
" <div class=\"activeNode-header-link\"><a href=\"javascript:alert('Not implemented!')\">Running</a></div>" +
"</div>" +
"</div></div>"
+ );*/
+
+
+ HTML html = new HTML(
+ "<div style='width:1024px; height:768px; background-color:#ffffff;'>" +
+ "<div id=\"imageContainer\" style=\"position:relative;top:-1;left:-1;height:"+activeNodeInfo.getHeight()+"px;width:"+activeNodeInfo.getWidth()+"px;\">" +
+ "<img src=\""+imageUrl+"\" style=\"position:absolute;top:0;left:0\" />" +
+ "<div class=\"bpm-graphView-activityImage\" style=\"position:absolute;top:"+ (activeNode.getY()-8) +"px;left:"+(activeNode.getX()-8)+"px;width:50px;height:50px; z-index:1000;\"></div>" +
+ "</div>" +
+ "</div>"
);
- this.add(html);
+ this.add(html);
invalidate();
}
}
\ No newline at end of file
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDetailView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDetailView.java 2009-05-29 10:21:28 UTC (rev 4945)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDetailView.java 2009-05-29 10:53:02 UTC (rev 4946)
@@ -31,8 +31,10 @@
import org.gwt.mosaic.ui.client.CaptionLayoutPanel;
import org.gwt.mosaic.ui.client.WindowPanel;
import org.gwt.mosaic.ui.client.Caption;
+import org.gwt.mosaic.ui.client.Label;
import org.gwt.mosaic.ui.client.layout.BoxLayout;
import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
import org.jboss.bpm.console.client.common.PropertyGrid;
import org.jboss.bpm.console.client.model.ProcessInstanceRef;
import org.jboss.bpm.console.client.util.WindowUtil;
@@ -103,10 +105,18 @@
private void createActivityWindow(ProcessInstanceRef inst)
{
- windowPanel = new WindowPanel(inst.getId());
+ windowPanel = new WindowPanel("Process Instance Activity");
windowPanel.setAnimationEnabled(true);
windowPanel.setSize("320px", "240px");
+ LayoutPanel layout = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ layout.setStyleName("bpm-window-layout");
+ layout.setPadding(5);
+
+ Label header = new Label("Instance: "+inst.getId());
+ header.setStyleName("bpm-label-header");
+ layout.add(header, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
windowPanel.addWindowCloseListener(new WindowCloseListener() {
public void onWindowClosed() {
windowPanel = null;
@@ -119,7 +129,8 @@
});
- windowPanel.setWidget(diagramView);
+ layout.add(diagramView, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+ windowPanel.setWidget(layout);
WindowUtil.addMaximizeButton(windowPanel, Caption.CaptionRegion.RIGHT);
WindowUtil.addMinimizeButton(windowPanel, Caption.CaptionRegion.RIGHT);
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/SearchDefinitionView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/SearchDefinitionView.java 2009-05-29 10:21:28 UTC (rev 4945)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/SearchDefinitionView.java 2009-05-29 10:53:02 UTC (rev 4946)
@@ -52,10 +52,10 @@
public SearchDefinitionView(ApplicationContext appContext, SearchDelegate delegate)
{
super(new BoxLayout(BoxLayout.Orientation.VERTICAL));
-
+
this.appContext = appContext;
this.delegate = delegate;
- this.setPadding(10);
+ this.setPadding(5);
}
@@ -81,7 +81,8 @@
this.clear();
this.selection = null;
- HTML desc = new HTML("Please enter a process definition ID.");
+ Label desc = new Label("Please enter a process definition ID");
+ //desc.setStyleName("bpm-label-header");
this.add(desc, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
suggestBox = new SuggestBox(
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/SearchWindow.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/SearchWindow.java 2009-05-29 10:21:28 UTC (rev 4945)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/SearchWindow.java 2009-05-29 10:53:02 UTC (rev 4946)
@@ -44,7 +44,7 @@
private void createLayoutWindowPanel(String title, SearchDefinitionView view) {
window = new WindowPanel(title);
window.setAnimationEnabled(true);
- window.setSize("320px", "180px");
+ window.setSize("235px", "145px");
window.setWidget(view);
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java 2009-05-29 10:21:28 UTC (rev 4945)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java 2009-05-29 10:53:02 UTC (rev 4946)
@@ -86,7 +86,7 @@
listBox =
new ListBox<TaskRef>(
new String[] {
- "Priority", "Name", "Due Date"
+ "Priority", "Process", "Task Name", "Due Date"
}
);
@@ -99,9 +99,12 @@
listBox.setText(row, column, String.valueOf(item.getPriority()));
break;
case 1:
+ listBox.setText(row, column, item.getProcessId());
+ break;
+ case 2:
listBox.setText(row, column, item.getName());
break;
- case 2:
+ case 3:
String d = item.getDueDate() != null ? dateFormat.format(item.getDueDate()):"";
listBox.setText(row, column, d);
break;
@@ -221,10 +224,20 @@
private void createTaskFormWindow(TaskRef task)
{
- windowPanel = new WindowPanel(task.getName());
+ windowPanel = new WindowPanel("Task Interface");
windowPanel.setAnimationEnabled(true);
windowPanel.setSize("320px", "240px");
+ LayoutPanel layout = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ layout.setStyleName("bpm-window-layout");
+ layout.setPadding(5);
+ // info
+ Label header = new Label("Process: "+task.getProcessId()+", Task: "+task.getName());
+ header.setStyleName("bpm-label-header");
+ layout.add(header, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ // task form iframe
+
windowPanel.addWindowCloseListener(new WindowCloseListener() {
public void onWindowClosed() {
controller.handleEvent(
@@ -253,7 +266,8 @@
ConsoleLog.debug(frame.getElement().toString());
frame.setUrl(task.getUrl());
- windowPanel.setWidget(frame);
+ layout.add(frame, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+ windowPanel.setWidget(layout);
WindowUtil.addMaximizeButton(windowPanel, Caption.CaptionRegion.RIGHT);
WindowUtil.addMinimizeButton(windowPanel, Caption.CaptionRegion.RIGHT);
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java 2009-05-29 10:21:28 UTC (rev 4945)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java 2009-05-29 10:53:02 UTC (rev 4946)
@@ -74,7 +74,7 @@
listBox =
new ListBox<TaskRef>(
new String[] {
- "Priority", "Name", "Status", "Due Date"}
+ "Priority", "Process", "Task Name", "Status", "Due Date"}
);
@@ -86,12 +86,15 @@
listBox.setText(row, column, String.valueOf(item.getPriority()));
break;
case 1:
+ listBox.setText(row, column, item.getProcessId());
+ break;
+ case 2:
listBox.setText(row, column, item.getName());
break;
- case 2:
+ case 3:
listBox.setText(row, column, String.valueOf(item.getCurrentState()));
break;
- case 3:
+ case 4:
String d = item.getDueDate() != null ? dateFormat.format(item.getDueDate()):"";
listBox.setText(row, column, d);
break;
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskDetailView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskDetailView.java 2009-05-29 10:21:28 UTC (rev 4945)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskDetailView.java 2009-05-29 10:53:02 UTC (rev 4946)
@@ -77,7 +77,7 @@
{
grid = new PropertyGrid(
- new String[] {"ID:", "Name:", "Assignee:", "Description:"}
+ new String[] {"ID:", "Process:", "Name:", "Assignee:", "Description:"}
);
if(openView)
@@ -131,6 +131,7 @@
String[] values = new String[] {
String.valueOf(task.getId()),
+ task.getProcessId(),
task.getName(),
task.getAssignee(),
description
Modified: projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/console.css
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/console.css 2009-05-29 10:21:28 UTC (rev 4945)
+++ projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/console.css 2009-05-29 10:53:02 UTC (rev 4946)
@@ -268,7 +268,18 @@
/* end - custom widgets */
-.gwt-SuggestBoxPopup { z-index:100000; border: 1px solid #C3D9FF;}
+.gwt-SuggestBoxPopup { z-index:100000; border: 1px solid #ffffff;}
.gwt-SuggestBoxPopup .item { padding: 2px;}
-.gwt-SuggestBoxPopup .item-selected { background-color: #C3D9FF; padding: 2px;}
+.gwt-SuggestBoxPopup .item-selected { background-color: #C3D9FF; padding: 1px;}
+.bpm-graphView-activityImage {
+ background-image: url(images/icons/play_red_big.png);
+ background-repeat:no-repeat;
+ width:16px;
+ height:16px;
+}
+
+.bpm-window-layout {
+ //background-color:#F8F8F8;
+ margin: 1px;
+}
\ No newline at end of file
Added: projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/play_red_big.png
===================================================================
(Binary files differ)
Property changes on: projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/play_red_big.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years
JBoss JBPM SVN: r4944 - jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-05-29 05:47:16 -0400 (Fri, 29 May 2009)
New Revision: 4944
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java
Log:
JBPM-2284 fixed process definition search by name
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java 2009-05-29 09:26:09 UTC (rev 4943)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java 2009-05-29 09:47:16 UTC (rev 4944)
@@ -124,7 +124,7 @@
}
if (name!=null) {
- appendWhereClause("idProperty.objectName = '"+nameLike+"' ", hql);
+ appendWhereClause("idProperty.objectName = '"+name+"' ", hql);
}
if (key!=null) {
15 years
JBoss JBPM SVN: r4943 - jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-05-29 05:26:09 -0400 (Fri, 29 May 2009)
New Revision: 4943
Added:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkToTaskTest.java
Log:
JBPM-2287 added fork to task test
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkToTaskTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkToTaskTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkToTaskTest.java 2009-05-29 09:26:09 UTC (rev 4943)
@@ -0,0 +1,60 @@
+/*
+ * 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.activities;
+
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ForkToTaskTest extends JbpmTestCase {
+
+ public void testForkToTasks() {
+
+ // test for JBPM-2287
+
+ deployJpdlXmlString(
+ "<process name='ForkToTasks'>" +
+ " <start>" +
+ " <transition to='f' />" +
+ " </start>" +
+ " <fork name='f'>" +
+ " <transition to='assemble product' />" +
+ " <transition to='print documents' />" +
+ " </fork>" +
+ " <task name='assemble product' assignee='johndoe'>" +
+ " <transition to='j' />" +
+ " </task>" +
+ " <task name='print documents' assignee='johndoe'>" +
+ " <transition to='j' />" +
+ " </task>" +
+ " <join name='j'>" +
+ " <transition to='end' />" +
+ " </join>" +
+ " <end name='end' />" +
+ "</process>"
+ );
+
+ executionService.startProcessInstanceByKey("ForkToTasks");
+ }
+}
Property changes on: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkToTaskTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years
JBoss JBPM SVN: r4941 - in jbpm3/branches/jbpm-3.2.5-soa: modules/core/src/test/java/org/jbpm/db and 1 other directory.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-05-29 00:53:38 -0400 (Fri, 29 May 2009)
New Revision: 4941
Modified:
jbpm3/branches/jbpm-3.2.5-soa/hudson/profiles.xml.redhat.qa
jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/db/JbpmSchemaDbTest.java
Log:
JBPM-2292: Move jBPM3-SOA continuous integration to QA lab (CODING IN PROGRESS)
more database connection parameter changes * minor improvement to schema drop test
Modified: jbpm3/branches/jbpm-3.2.5-soa/hudson/profiles.xml.redhat.qa
===================================================================
--- jbpm3/branches/jbpm-3.2.5-soa/hudson/profiles.xml.redhat.qa 2009-05-28 19:20:28 UTC (rev 4940)
+++ jbpm3/branches/jbpm-3.2.5-soa/hudson/profiles.xml.redhat.qa 2009-05-29 04:53:38 UTC (rev 4941)
@@ -22,7 +22,7 @@
<jdbc.sybase.server>dev77.qa.atl2.redhat.com</jdbc.sybase.server>
<jdbc.sybase.port>4100</jdbc.sybase.port>
- <jdbc.sybase.database>jbpm3xa</jdbc.sybase.database>
+ <jdbc.sybase.database>jbpm3</jdbc.sybase.database>
<jdbc.sybase.url>jdbc:sybase:Tds:${jdbc.sybase.server}:${jdbc.sybase.port}/${jdbc.sybase.database}</jdbc.sybase.url>
<jdbc.sybase.username>jbpm3</jdbc.sybase.username>
<jdbc.sybase.password>jbpm3jbpm3</jdbc.sybase.password>
Modified: jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/db/JbpmSchemaDbTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/db/JbpmSchemaDbTest.java 2009-05-28 19:20:28 UTC (rev 4940)
+++ jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/db/JbpmSchemaDbTest.java 2009-05-29 04:53:38 UTC (rev 4941)
@@ -53,10 +53,7 @@
public void testDropSchema() {
jbpmSchema.dropSchema();
Set existingTables = jbpmSchema.getExistingTables();
- for (Iterator i = jbpmSchema.getJbpmTables().iterator(); i.hasNext();) {
- String jbpmTable = (String) i.next();
- assert !existingTables.contains(jbpmTable) : existingTables;
- }
+ assert existingTables.removeAll(jbpmSchema.getJbpmTables()) == false : existingTables;
}
public void testCleanSchema() {
15 years
JBoss JBPM SVN: r4940 - jbpm3/branches/jbpm-3.2.5-soa/modules/distribution/src/main/etc.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-05-28 15:20:28 -0400 (Thu, 28 May 2009)
New Revision: 4940
Modified:
jbpm3/branches/jbpm-3.2.5-soa/modules/distribution/src/main/etc/version.info.xml
Log:
JBPM-2291: Process project wizard fails to create a complete sample project (CODING IN PROGRESS)
Remove extraneous lib/activation.jar entry in version.info, review other entries for accuracy
Modified: jbpm3/branches/jbpm-3.2.5-soa/modules/distribution/src/main/etc/version.info.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5-soa/modules/distribution/src/main/etc/version.info.xml 2009-05-28 18:37:19 UTC (rev 4939)
+++ jbpm3/branches/jbpm-3.2.5-soa/modules/distribution/src/main/etc/version.info.xml 2009-05-28 19:20:28 UTC (rev 4940)
@@ -3,7 +3,6 @@
<classpathentry path="lib/jbpm-jpdl.jar" src="src/jbpm-jpdl-sources.jar" />
<classpathentry path="lib/jbpm-identity.jar" src="src/jbpm-identity-sources.jar" />
- <classpathentry path="lib/activation.jar" />
<classpathentry path="lib/antlr.jar" />
<classpathentry path="lib/asm.jar"/>
<classpathentry path="lib/bsh.jar"/>
@@ -13,12 +12,8 @@
<classpathentry path="lib/dom4j.jar"/>
<classpathentry path="lib/hibernate.jar"/>
<classpathentry path="lib/hsqldb.jar"/>
- <!-- classpathentry path="lib/jboss-j2ee.jar"/-->
- <!-- classpathentry path="lib/jcr-1.0.jar"/ -->
<classpathentry path="lib/junit.jar"/>
<classpathentry path="lib/log4j.jar"/>
- <!-- classpathentry path="lib/mail.jar"/ -->
- <!-- classpathentry path="lib/servlet-api.jar"/ -->
<config path="config"/>
<examples path="examples" />
15 years
JBoss JBPM SVN: r4939 - jbpm3/branches/jbpm-3.2.5-soa/hudson.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-05-28 14:37:19 -0400 (Thu, 28 May 2009)
New Revision: 4939
Modified:
jbpm3/branches/jbpm-3.2.5-soa/hudson/profiles.xml.redhat.qa
Log:
JBPM-2292: Move jBPM3-SOA continuous integration to QA lab (CODING IN PROGRESS)
Update database connection parameters in profiles.redhat.xml
Modified: jbpm3/branches/jbpm-3.2.5-soa/hudson/profiles.xml.redhat.qa
===================================================================
--- jbpm3/branches/jbpm-3.2.5-soa/hudson/profiles.xml.redhat.qa 2009-05-28 16:51:42 UTC (rev 4938)
+++ jbpm3/branches/jbpm-3.2.5-soa/hudson/profiles.xml.redhat.qa 2009-05-28 18:37:19 UTC (rev 4939)
@@ -36,12 +36,12 @@
<jdbc.postgresql.username>jbpm3</jdbc.postgresql.username>
<jdbc.postgresql.password>jbpm3</jdbc.postgresql.password>
- <jdbc.oracle.server>dev68.qa.atl2.redhat.com</jdbc.oracle.server>
+ <jdbc.oracle.server>dev01.qa.atl2.redhat.com</jdbc.oracle.server>
<jdbc.oracle.port>1521</jdbc.oracle.port>
- <jdbc.oracle.database>qadb01</jdbc.oracle.database>
+ <jdbc.oracle.database>QADB01</jdbc.oracle.database>
<jdbc.oracle.url>jdbc:oracle:thin:@${jdbc.oracle.server}:${jdbc.oracle.port}:${jdbc.oracle.database}</jdbc.oracle.url>
- <jdbc.oracle.username>jbpm3</jdbc.oracle.username>
- <jdbc.oracle.password>jbpm3</jdbc.oracle.password>
+ <jdbc.oracle.username>JBPM</jdbc.oracle.username>
+ <jdbc.oracle.password>JBPM</jdbc.oracle.password>
</properties>
</profile>
15 years
JBoss JBPM SVN: r4938 - jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/context/exe.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-05-28 12:51:42 -0400 (Thu, 28 May 2009)
New Revision: 4938
Modified:
jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/context/exe/CustomVariableLongIdDbTest.java
jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/context/exe/CustomVariableStringIdDbTest.java
Log:
JBPM-1812: Fix tests that don't cleanup the database (RESOLVED)
Merge r3699 from trunk
Modified: jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/context/exe/CustomVariableLongIdDbTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/context/exe/CustomVariableLongIdDbTest.java 2009-05-28 15:28:14 UTC (rev 4937)
+++ jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/context/exe/CustomVariableLongIdDbTest.java 2009-05-28 16:51:42 UTC (rev 4938)
@@ -58,28 +58,26 @@
ProcessDefinition processDefinition = new ProcessDefinition();
processDefinition.addDefinition(new ContextDefinition());
graphSession.saveProcessDefinition(processDefinition);
+ CustomLongClass customLongObject = null;
try {
// create the process instance
ProcessInstance processInstance = new ProcessInstance(processDefinition);
- // set the jbpmSession in the context because its used to determine the
- // jbpm-type for the custom object.
ContextInstance contextInstance = processInstance.getContextInstance();
-
// create the custom object
- CustomLongClass customLongObject = new CustomLongClass("customname");
+ customLongObject = new CustomLongClass("customname");
contextInstance.setVariable("custom hibernate object", customLongObject);
processInstance = saveAndReload(processInstance);
contextInstance = processInstance.getContextInstance();
- // get the custom hibernatable object from the variableInstances
+ // get the custom hibernatable object from the variables
customLongObject = (CustomLongClass) contextInstance.getVariable("custom hibernate object");
assertNotNull(customLongObject);
assertEquals("customname", customLongObject.getName());
}
finally {
jbpmContext.getGraphSession().deleteProcessDefinition(processDefinition.getId());
+ if (customLongObject != null) session.delete(customLongObject);
}
-
}
}
Modified: jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/context/exe/CustomVariableStringIdDbTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/context/exe/CustomVariableStringIdDbTest.java 2009-05-28 15:28:14 UTC (rev 4937)
+++ jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/context/exe/CustomVariableStringIdDbTest.java 2009-05-28 16:51:42 UTC (rev 4938)
@@ -58,27 +58,26 @@
ProcessDefinition processDefinition = new ProcessDefinition();
processDefinition.addDefinition(new ContextDefinition());
graphSession.saveProcessDefinition(processDefinition);
+ CustomStringClass customStringObject = null;
try {
// create the process instance
ProcessInstance processInstance = new ProcessInstance(processDefinition);
- // set the jbpmSession in the context because its used to determine the
- // jbpm-type for the custom object.
ContextInstance contextInstance = processInstance.getContextInstance();
-
// create the custom object
- CustomStringClass customStringObject = new CustomStringClass("customname");
+ customStringObject = new CustomStringClass("customname");
contextInstance.setVariable("custom hibernate object", customStringObject);
processInstance = saveAndReload(processInstance);
contextInstance = processInstance.getContextInstance();
- // get the custom hibernatable object from the variableInstances
+ // get the custom hibernatable object from the variables
customStringObject = (CustomStringClass) contextInstance.getVariable("custom hibernate object");
assertNotNull(customStringObject);
assertEquals("customname", customStringObject.getName());
}
finally {
jbpmContext.getGraphSession().deleteProcessDefinition(processDefinition.getId());
+ if (customStringObject != null) session.delete(customStringObject);
}
}
}
15 years
JBoss JBPM SVN: r4937 - jbpm3/branches/jbpm-3.2.5-soa/hudson.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-05-28 11:28:14 -0400 (Thu, 28 May 2009)
New Revision: 4937
Modified:
jbpm3/branches/jbpm-3.2.5-soa/hudson/profiles.xml.redhat.qa
Log:
JBPM-2292: Move jBPM3-SOA continuous integration to QA lab (CODING IN PROGRESS)
Update database connection parameters in profiles.redhat.xml
Modified: jbpm3/branches/jbpm-3.2.5-soa/hudson/profiles.xml.redhat.qa
===================================================================
--- jbpm3/branches/jbpm-3.2.5-soa/hudson/profiles.xml.redhat.qa 2009-05-28 15:17:35 UTC (rev 4936)
+++ jbpm3/branches/jbpm-3.2.5-soa/hudson/profiles.xml.redhat.qa 2009-05-28 15:28:14 UTC (rev 4937)
@@ -13,35 +13,35 @@
</activation>
<properties>
- <jdbc.mysql.server>dev02.qa.atl.jboss.com</jdbc.mysql.server>
+ <jdbc.mysql.server>dev02.qa.atl2.redhat.com</jdbc.mysql.server>
<jdbc.mysql.port>3306</jdbc.mysql.port>
<jdbc.mysql.database>jbpm3</jdbc.mysql.database>
<jdbc.mysql.url>jdbc:mysql://${jdbc.mysql.server}:${jdbc.mysql.port}/${jdbc.mysql.database}</jdbc.mysql.url>
<jdbc.mysql.username>jbpm3</jdbc.mysql.username>
- <jdbc.mysql.password></jdbc.mysql.password>
+ <jdbc.mysql.password>jbpm3</jdbc.mysql.password>
- <jdbc.sybase.server>jdbc:sybase:Tds:dev77.qa.atl2.redhat.com</jdbc.sybase.server>
+ <jdbc.sybase.server>dev77.qa.atl2.redhat.com</jdbc.sybase.server>
<jdbc.sybase.port>4100</jdbc.sybase.port>
<jdbc.sybase.database>jbpm3xa</jdbc.sybase.database>
<jdbc.sybase.url>jdbc:sybase:Tds:${jdbc.sybase.server}:${jdbc.sybase.port}/${jdbc.sybase.database}</jdbc.sybase.url>
- <jdbc.sybase.username>jbpm3xa</jdbc.sybase.username>
- <jdbc.sybase.password></jdbc.sybase.password>
+ <jdbc.sybase.username>jbpm3</jdbc.sybase.username>
+ <jdbc.sybase.password>jbpm3jbpm3</jdbc.sybase.password>
<jdbc.sybase.driver>com.sybase.jdbc3.jdbc.SybDriver</jdbc.sybase.driver>
<jdbc.sybase.datasource>com.sybase.jdbc3.jdbc.SybXADataSource</jdbc.sybase.datasource>
- <jdbc.postgresql.server>dev01.qa.atl.jboss.com</jdbc.postgresql.server>
+ <jdbc.postgresql.server>dev01.qa.atl2.redhat.com</jdbc.postgresql.server>
<jdbc.postgresql.port>5432</jdbc.postgresql.port>
<jdbc.postgresql.database>jbpm3</jdbc.postgresql.database>
<jdbc.postgresql.url>jdbc:postgresql://${jdbc.postgresql.server}:${jdbc.postgresql.port}/${jdbc.postgresql.database}</jdbc.postgresql.url>
<jdbc.postgresql.username>jbpm3</jdbc.postgresql.username>
- <jdbc.postgresql.password></jdbc.postgresql.password>
+ <jdbc.postgresql.password>jbpm3</jdbc.postgresql.password>
<jdbc.oracle.server>dev68.qa.atl2.redhat.com</jdbc.oracle.server>
<jdbc.oracle.port>1521</jdbc.oracle.port>
<jdbc.oracle.database>qadb01</jdbc.oracle.database>
<jdbc.oracle.url>jdbc:oracle:thin:@${jdbc.oracle.server}:${jdbc.oracle.port}:${jdbc.oracle.database}</jdbc.oracle.url>
<jdbc.oracle.username>jbpm3</jdbc.oracle.username>
- <jdbc.oracle.password></jdbc.oracle.password>
+ <jdbc.oracle.password>jbpm3</jdbc.oracle.password>
</properties>
</profile>
15 years
JBoss JBPM SVN: r4936 - in jbpm3/branches/jbpm-3.2.5-soa/modules/core/src: main/java/org/jbpm/job/executor and 8 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-05-28 11:17:35 -0400 (Thu, 28 May 2009)
New Revision: 4936
Removed:
jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/seam/AsyncAction.java
Modified:
jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/main/java/org/jbpm/db/AbstractDbTestCase.java
jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/main/java/org/jbpm/job/executor/JobExecutor.java
jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java
jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/main/resources/org/jbpm/context/log/VariableDeleteLog.hbm.xml
jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/main/resources/org/jbpm/context/log/VariableLog.hbm.xml
jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/bytes/ByteArrayDbTest.java
jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/job/executor/JobExecutorDbTest.java
jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/logging/exe/LoggingConfigDbTest.java
jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/perf/TasklistEagerLoadingTest.java
jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/seam/JobExecutorCustomizationTest.java
jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/taskmgmt/exe/TaskInstanceDbTest.java
jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/taskmgmt/log/TaskLogDbTest.java
Log:
JBPM-1812: Fix tests that don't cleanup the database (RESOLVED)
Merge r3689 from branch aguizar and r3909 from trunk
Modified: jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/main/java/org/jbpm/db/AbstractDbTestCase.java
===================================================================
--- jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/main/java/org/jbpm/db/AbstractDbTestCase.java 2009-05-28 12:59:30 UTC (rev 4935)
+++ jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/main/java/org/jbpm/db/AbstractDbTestCase.java 2009-05-28 15:17:35 UTC (rev 4936)
@@ -32,7 +32,6 @@
import org.hibernate.Session;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
-import org.hibernate.tool.hbm2ddl.SchemaExport;
import org.jbpm.AbstractJbpmTestCase;
import org.jbpm.JbpmConfiguration;
@@ -48,9 +47,7 @@
public abstract class AbstractDbTestCase extends AbstractJbpmTestCase {
protected JbpmConfiguration jbpmConfiguration;
-
protected JbpmContext jbpmContext;
- protected SchemaExport schemaExport;
protected Session session;
protected GraphSession graphSession;
@@ -86,7 +83,6 @@
Map rowsPerTable = jbpmSchema.getRowsPerTable();
for (Iterator i = rowsPerTable.entrySet().iterator(); i.hasNext();) {
Map.Entry entry = (Entry) i.next();
- String tableName = (String) entry.getKey();
Long count = (Long) entry.getValue();
if (count.intValue() != 0) {
hasLeftOvers = true;
@@ -97,7 +93,7 @@
" left " +
count +
" records in " +
- tableName);
+ entry.getKey());
}
}
@@ -107,8 +103,8 @@
}
protected String getHibernateDialect() {
- DbPersistenceServiceFactory factory = (DbPersistenceServiceFactory) jbpmContext.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
- return factory.getConfiguration().getProperty(Environment.DIALECT);
+ DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) jbpmContext.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
+ return persistenceServiceFactory.getConfiguration().getProperty(Environment.DIALECT);
}
protected void beginSessionTransaction() {
@@ -196,12 +192,12 @@
if (System.currentTimeMillis() - startTime > timeout) {
fail("test execution exceeded treshold of " + timeout + " milliseconds");
}
- log.debug("waiting for the job executor to process more jobs");
+ log.debug("waiting for job executor to process more jobs");
try {
Thread.sleep(500);
}
catch (InterruptedException e) {
- // keep going
+ fail("wait for job executor to process more jobs got interrupted");
}
}
}
@@ -257,7 +253,7 @@
jobExecutor.stopAndJoin();
}
catch (InterruptedException e) {
- throw new RuntimeException("waiting for job executor to stop and join got interrupted", e);
+ log.debug("wait for job executor to stop and join got interrupted", e);
}
}
}
Modified: jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/main/java/org/jbpm/job/executor/JobExecutor.java
===================================================================
--- jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/main/java/org/jbpm/job/executor/JobExecutor.java 2009-05-28 12:59:30 UTC (rev 4935)
+++ jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/main/java/org/jbpm/job/executor/JobExecutor.java 2009-05-28 15:17:35 UTC (rev 4936)
@@ -7,6 +7,7 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -14,10 +15,10 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.jbpm.JbpmConfiguration;
-public class JobExecutor implements Serializable
-{
+public class JobExecutor implements Serializable {
private static final long serialVersionUID = 1L;
@@ -26,6 +27,7 @@
protected int nbrOfThreads;
protected int idleInterval;
protected int maxIdleInterval;
+ /** @deprecated this field was never used */
protected int historyMaxSize;
protected int maxLockTime;
@@ -34,261 +36,246 @@
protected Map threads = new HashMap();
protected LockMonitorThread lockMonitorThread;
- protected Map monitoredJobIds = Collections.synchronizedMap(new HashMap());
+ protected Map monitoredJobIds = new Hashtable();
protected boolean isStarted = false;
protected static String hostName;
- public synchronized void start()
- {
- if (!isStarted)
- {
+ public synchronized void start() {
+ if (!isStarted) {
log.debug("starting thread group '" + name + "'...");
- for (int i = 0; i < nbrOfThreads; i++)
- {
+ for (int i = 0; i < nbrOfThreads; i++) {
startThread();
}
lockMonitorThread = new LockMonitorThread(jbpmConfiguration, lockMonitorInterval, maxLockTime, lockBufferTime);
isStarted = true;
}
- else
- {
+ else {
log.debug("ignoring start: thread group '" + name + "' is already started'");
}
}
- /*
- * signals to all threads in this job executor to stop. It may be that threads are in the middle of something and they will finish that firts. Use {@link
- * #stopAndJoin()} in case you want a method that blocks until all the threads are actually finished.
- * @return a list of all the stopped threads. In case no threads were stopped an empty list will be returned.
+ /**
+ * signals to all threads in this job executor to stop. Threads may be in the middle of processing
+ * a job and they will finish that first. Use {@link #stopAndJoin()} in case you want a method
+ * that blocks until all the threads are actually finished.
+ *
+ * @return a list of the stopped threads. In case no threads were stopped an empty list will be
+ * returned.
*/
- public synchronized List stop()
- {
- List stoppedThreads = new ArrayList(threads.size());
- if (isStarted)
- {
+ public synchronized List stop() {
+ List stoppedThreads;
+ if (isStarted) {
log.debug("stopping thread group '" + name + "'...");
- for (int i = 0; i < nbrOfThreads; i++)
- {
+ isStarted = false;
+
+ stoppedThreads = new ArrayList(threads.size());
+ for (int i = 0; i < nbrOfThreads; i++) {
stoppedThreads.add(stopThread());
}
- if (lockMonitorThread != null)
- lockMonitorThread.deactivate();
- isStarted = false;
+
+ if (lockMonitorThread != null) lockMonitorThread.deactivate();
}
- else
- {
+ else {
log.debug("ignoring stop: thread group '" + name + "' not started");
+ stoppedThreads = Collections.EMPTY_LIST;
}
return stoppedThreads;
}
- public void stopAndJoin() throws InterruptedException
- {
- Iterator iter = stop().iterator();
- while (iter.hasNext())
- {
- Thread thread = (Thread)iter.next();
+ public void stopAndJoin() throws InterruptedException {
+ for (Iterator i = stop().iterator(); i.hasNext();) {
+ Thread thread = (Thread) i.next();
thread.join();
}
- if (lockMonitorThread != null)
- lockMonitorThread.join();
+
+ if (lockMonitorThread != null) lockMonitorThread.join();
}
- protected synchronized void startThread()
- {
+ protected synchronized void startThread() {
String threadName = getNextThreadName();
Thread thread = createThread(threadName);
threads.put(threadName, thread);
+
log.debug("starting new job executor thread '" + threadName + "'");
thread.start();
}
- protected Thread createThread(String threadName)
- {
- return new JobExecutorThread(threadName, this, jbpmConfiguration, idleInterval, maxIdleInterval, maxLockTime, historyMaxSize);
+ protected Thread createThread(String threadName) {
+ return new JobExecutorThread(threadName, this);
}
- protected String getNextThreadName()
- {
+ protected String getNextThreadName() {
return getThreadName(threads.size() + 1);
}
- protected String getLastThreadName()
- {
+ protected String getLastThreadName() {
return getThreadName(threads.size());
}
- private String getThreadName(int index)
- {
- return name + ":" + getHostName() + ":" + index;
+ private String getThreadName(int index) {
+ return name + ":" + getHostAddress() + ":" + index;
}
- private static String getHostName()
- {
- if (hostName == null)
- {
- try
- {
+ private static String getHostAddress() {
+ if (hostName == null) {
+ try {
hostName = InetAddress.getLocalHost().getHostAddress();
}
- catch (UnknownHostException e)
- {
+ catch (UnknownHostException e) {
hostName = "127.0.0.1";
}
}
return hostName;
}
- protected synchronized Thread stopThread()
- {
+ protected synchronized Thread stopThread() {
String threadName = getLastThreadName();
- JobExecutorThread thread = (JobExecutorThread)threads.remove(threadName);
log.debug("removing job executor thread '" + threadName + "'");
- thread.deactivate();
+
+ Thread thread = (Thread) threads.remove(threadName);
+ if (thread instanceof JobExecutorThread) {
+ JobExecutorThread jobThread = (JobExecutorThread) thread;
+ jobThread.deactivate();
+ }
return thread;
}
- public void setMonitoredJobIds(Map monitoredJobIds)
- {
- this.monitoredJobIds = monitoredJobIds;
- }
-
- public Set getMonitoredJobIds()
- {
+ public Set getMonitoredJobIds() {
return new HashSet(monitoredJobIds.values());
}
- public void addMonitoredJobId(String threadName, long jobId)
- {
+ public void addMonitoredJobId(String threadName, long jobId) {
monitoredJobIds.put(threadName, new Long(jobId));
}
- public void removeMonitoredJobId(String threadName)
- {
+ public void removeMonitoredJobId(String threadName) {
monitoredJobIds.remove(threadName);
}
- public void setHistoryMaxSize(int historyMaxSize)
- {
- this.historyMaxSize = historyMaxSize;
+ /**
+ * @throws UnsupportedOperationException to prevent invocation
+ * @deprecated <code>monitoredJobIds</code> is an internal control field
+ */
+ public void setMonitoredJobIds(Map monitoredJobIds) {
+ throw new UnsupportedOperationException();
}
- public int getHistoryMaxSize()
- {
+ /** @deprecated this property was never used */
+ public int getHistoryMaxSize() {
return historyMaxSize;
}
- public void setIdleInterval(int idleInterval)
- {
- this.idleInterval = idleInterval;
+ /** @deprecated this property was never used */
+ public void setHistoryMaxSize(int historyMaxSize) {
+ this.historyMaxSize = historyMaxSize;
}
- public int getIdleInterval()
- {
+ public int getIdleInterval() {
return idleInterval;
}
- public void setStarted(boolean isStarted)
- {
- this.isStarted = isStarted;
+ public void setIdleInterval(int idleInterval) {
+ this.idleInterval = idleInterval;
}
- public boolean isStarted()
- {
+ /**
+ * Tells whether this job executor has been {@linkplain #start() started}.
+ */
+ public boolean isStarted() {
return isStarted;
}
- public void setJbpmConfiguration(JbpmConfiguration jbpmConfiguration)
- {
- this.jbpmConfiguration = jbpmConfiguration;
+ /**
+ * @throws UnsupportedOperationException to prevent invocation
+ * @deprecated <code>isStarted</code> is an internal control field
+ */
+ public void setStarted(boolean isStarted) {
+ throw new UnsupportedOperationException();
}
- public JbpmConfiguration getJbpmConfiguration()
- {
+ public JbpmConfiguration getJbpmConfiguration() {
return jbpmConfiguration;
}
- public void setMaxIdleInterval(int maxIdleInterval)
- {
- this.maxIdleInterval = maxIdleInterval;
+ public void setJbpmConfiguration(JbpmConfiguration jbpmConfiguration) {
+ this.jbpmConfiguration = jbpmConfiguration;
}
- public int getMaxIdleInterval()
- {
+ public int getMaxIdleInterval() {
return maxIdleInterval;
}
- public void setName(String name)
- {
- this.name = name;
+ public void setMaxIdleInterval(int maxIdleInterval) {
+ this.maxIdleInterval = maxIdleInterval;
}
- public String getName()
- {
+ public String getName() {
return name;
}
- public void setSize(int nbrOfThreads)
- {
- this.nbrOfThreads = nbrOfThreads;
+ public void setName(String name) {
+ this.name = name;
}
- public int getSize()
- {
+ /**
+ * @deprecated Replaced by {@link #getNbrOfThreads()}
+ */
+ public int getSize() {
return nbrOfThreads;
}
- public void setThreads(Map threads)
- {
- this.threads = threads;
+ /**
+ * @deprecated Replaced by {@link #setNbrOfThreads(int)}
+ */
+ public void setSize(int nbrOfThreads) {
+ this.nbrOfThreads = nbrOfThreads;
}
- public Map getThreads()
- {
+ public Map getThreads() {
return threads;
}
- public void setMaxLockTime(int maxLockTime)
- {
- this.maxLockTime = maxLockTime;
+ /**
+ * @throws UnsupportedOperationException to prevent invocation
+ * @deprecated <code>threads</code> is an internal control field
+ */
+ public void setThreads(Map threads) {
+ throw new UnsupportedOperationException();
}
- public int getMaxLockTime()
- {
+ public int getMaxLockTime() {
return maxLockTime;
}
- public void setLockBufferTime(int lockBufferTime)
- {
- this.lockBufferTime = lockBufferTime;
+ public void setMaxLockTime(int maxLockTime) {
+ this.maxLockTime = maxLockTime;
}
- public int getLockBufferTime()
- {
+ public int getLockBufferTime() {
return lockBufferTime;
}
- public void setLockMonitorInterval(int lockMonitorInterval)
- {
- this.lockMonitorInterval = lockMonitorInterval;
+ public void setLockBufferTime(int lockBufferTime) {
+ this.lockBufferTime = lockBufferTime;
}
- public int getLockMonitorInterval()
- {
+ public int getLockMonitorInterval() {
return lockMonitorInterval;
}
- public void setNbrOfThreads(int nbrOfThreads)
- {
- this.nbrOfThreads = nbrOfThreads;
+ public void setLockMonitorInterval(int lockMonitorInterval) {
+ this.lockMonitorInterval = lockMonitorInterval;
}
- public int getNbrOfThreads()
- {
+ public int getNbrOfThreads() {
return nbrOfThreads;
}
+ public void setNbrOfThreads(int nbrOfThreads) {
+ this.nbrOfThreads = nbrOfThreads;
+ }
+
private static Log log = LogFactory.getLog(JobExecutor.class);
}
Modified: jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java
===================================================================
--- jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java 2009-05-28 12:59:30 UTC (rev 4935)
+++ jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java 2009-05-28 15:17:35 UTC (rev 4936)
@@ -22,6 +22,28 @@
public class JobExecutorThread extends Thread {
+ final JobExecutor jobExecutor;
+ final JbpmConfiguration jbpmConfiguration;
+ final int idleInterval;
+ final int maxIdleInterval;
+ final long maxLockTime;
+
+ int currentIdleInterval;
+ volatile boolean isActive = true;
+
+ public JobExecutorThread(String name, JobExecutor jobExecutor) {
+ super(name);
+ this.jobExecutor = jobExecutor;
+
+ jbpmConfiguration = jobExecutor.getJbpmConfiguration();
+ idleInterval = jobExecutor.getIdleInterval();
+ maxIdleInterval = jobExecutor.getMaxIdleInterval();
+ maxLockTime = jobExecutor.getMaxLockTime();
+ }
+
+ /**
+ * @deprecated use {@link #JobExecutorThread(String, JobExecutor)} instead
+ */
public JobExecutorThread(String name, JobExecutor jobExecutor,
JbpmConfiguration jbpmConfiguration, int idleInterval, int maxIdleInterval, long maxLockTime,
int maxHistory) {
@@ -33,15 +55,6 @@
this.maxLockTime = maxLockTime;
}
- final JobExecutor jobExecutor;
- final JbpmConfiguration jbpmConfiguration;
- final int idleInterval;
- final int maxIdleInterval;
- final long maxLockTime;
-
- int currentIdleInterval;
- volatile boolean isActive = true;
-
public void run() {
currentIdleInterval = idleInterval;
while (isActive) {
@@ -65,9 +78,9 @@
currentIdleInterval = idleInterval;
}
catch (RuntimeException e) {
- log.error("exception in job executor thread. waiting "
- + currentIdleInterval
- + " milliseconds", e);
+ log.error("exception in job executor thread. waiting " +
+ currentIdleInterval +
+ " milliseconds", e);
try {
synchronized (jobExecutor) {
jobExecutor.wait(currentIdleInterval);
@@ -76,7 +89,7 @@
catch (InterruptedException ie) {
log.debug("delay after exception got interrupted", ie);
}
- // after an exception, the current idle interval is doubled to prevent
+ // after an exception, the current idle interval is doubled to prevent
// continuous exception generation when e.g. the db is unreachable
currentIdleInterval <<= 1;
if (currentIdleInterval > maxIdleInterval || currentIdleInterval < 0) {
@@ -107,10 +120,10 @@
ProcessInstance processInstance = job.getProcessInstance();
log.debug("finding other exclusive jobs for " + processInstance);
jobsToLock = jobSession.findExclusiveJobs(lockOwner, processInstance);
- log.debug("trying to obtain exclusive locks on "
- + jobsToLock
- + " for "
- + processInstance);
+ log.debug("trying to obtain exclusive locks on " +
+ jobsToLock +
+ " for " +
+ processInstance);
}
else {
log.debug("trying to obtain lock on " + job);
@@ -141,8 +154,8 @@
catch (JbpmPersistenceException e) {
// if this is a stale state exception, keep it quiet
if (DbPersistenceService.isStaleStateException(e)) {
- StaleObjectLogConfigurer.getStaleObjectExceptionsLog().error(
- "failed to acquire lock on jobs " + jobsToLock);
+ StaleObjectLogConfigurer.getStaleObjectExceptionsLog()
+ .error("failed to acquire lock on jobs " + jobsToLock);
acquiredJobs = Collections.EMPTY_LIST;
}
else {
@@ -197,8 +210,8 @@
catch (JbpmPersistenceException e) {
// if this is a stale state exception, keep it quiet
if (DbPersistenceService.isStaleStateException(e)) {
- StaleObjectLogConfigurer.getStaleObjectExceptionsLog().error(
- "failed to complete job " + job);
+ StaleObjectLogConfigurer.getStaleObjectExceptionsLog().error("failed to complete job " +
+ job);
}
else {
throw e;
@@ -231,8 +244,8 @@
catch (JbpmPersistenceException e) {
// if this is a stale state exception, keep it quiet
if (DbPersistenceService.isStaleStateException(e)) {
- StaleObjectLogConfigurer.getStaleObjectExceptionsLog().error(
- "failed to determine next due date for job executor thread " + threadName);
+ StaleObjectLogConfigurer.getStaleObjectExceptionsLog()
+ .error("failed to determine next due date for job executor thread " + threadName);
nextDueDate = null;
}
else {
Modified: jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/main/resources/org/jbpm/context/log/VariableDeleteLog.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/main/resources/org/jbpm/context/log/VariableDeleteLog.hbm.xml 2009-05-28 12:59:30 UTC (rev 4935)
+++ jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/main/resources/org/jbpm/context/log/VariableDeleteLog.hbm.xml 2009-05-28 15:17:35 UTC (rev 4936)
@@ -1,5 +1,4 @@
<?xml version="1.0"?>
-
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
@@ -9,6 +8,13 @@
<subclass name="org.jbpm.context.log.VariableDeleteLog"
extends="org.jbpm.context.log.VariableLog"
discriminator-value="D">
+
+ <many-to-one name="variableInstance"
+ column="VARIABLEINSTANCE_"
+ cascade="all"
+ insert="false"
+ update="false" />
+
</subclass>
</hibernate-mapping>
Modified: jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/main/resources/org/jbpm/context/log/VariableLog.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/main/resources/org/jbpm/context/log/VariableLog.hbm.xml 2009-05-28 12:59:30 UTC (rev 4935)
+++ jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/main/resources/org/jbpm/context/log/VariableLog.hbm.xml 2009-05-28 15:17:35 UTC (rev 4936)
@@ -12,7 +12,6 @@
<many-to-one name="variableInstance"
column="VARIABLEINSTANCE_"
- cascade="save-update"
foreign-key="FK_LOG_VARINST"
index="IDX_LOG_VARINST" />
Modified: jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/bytes/ByteArrayDbTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/bytes/ByteArrayDbTest.java 2009-05-28 12:59:30 UTC (rev 4935)
+++ jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/bytes/ByteArrayDbTest.java 2009-05-28 15:17:35 UTC (rev 4936)
@@ -31,54 +31,78 @@
byte[] bytes = getMultipleBlockBytes();
ByteArray byteArray = new ByteArray(bytes);
session.save(byteArray);
+
newTransaction();
- ByteArray retrievedByteArray = (ByteArray) session.load(ByteArray.class, new Long(byteArray.getId()));
+ ByteArray retrievedByteArray = (ByteArray) session.load(ByteArray.class, new Long(
+ byteArray.getId()));
assertEquals(byteArray.byteBlocks.size(), retrievedByteArray.getByteBlocks().size());
assertTrue(Arrays.equals(byteArray.getBytes(), retrievedByteArray.getBytes()));
+
+ session.delete(retrievedByteArray);
}
public void testEmptyByteArray() {
byte[] bytes = new byte[0];
ByteArray byteArray = new ByteArray(bytes);
session.save(byteArray);
+
newTransaction();
- ByteArray retrievedByteArray = (ByteArray) session.load(ByteArray.class, new Long(byteArray.getId()));
+ ByteArray retrievedByteArray = (ByteArray) session.load(ByteArray.class, new Long(
+ byteArray.getId()));
assertNull(retrievedByteArray.getBytes());
+
+ session.delete(retrievedByteArray);
}
public void testByteArrayCopy() {
byte[] bytes = getMultipleBlockBytes();
ByteArray byteArray = new ByteArray(bytes);
session.save(byteArray);
+
newTransaction();
- ByteArray retrievedByteArray = (ByteArray) session.load(ByteArray.class, new Long(byteArray.getId()));
+ ByteArray retrievedByteArray = (ByteArray) session.load(ByteArray.class, new Long(
+ byteArray.getId()));
ByteArray copiedByteArray = new ByteArray(retrievedByteArray);
session.save(copiedByteArray);
+
newTransaction();
- retrievedByteArray = (ByteArray) session.load(ByteArray.class, new Long(retrievedByteArray.getId()));
+ retrievedByteArray = (ByteArray) session.load(ByteArray.class, new Long(
+ retrievedByteArray.getId()));
copiedByteArray = (ByteArray) session.load(ByteArray.class, new Long(copiedByteArray.getId()));
assertNotSame(retrievedByteArray.getByteBlocks(), copiedByteArray.getByteBlocks());
- for (int i=0; i<retrievedByteArray.getByteBlocks().size(); i++) {
+
+ for (int i = 0; i < retrievedByteArray.getByteBlocks().size(); i++) {
byte[] retrievedBytes = (byte[]) retrievedByteArray.getByteBlocks().get(i);
byte[] copiedBytes = (byte[]) copiedByteArray.getByteBlocks().get(i);
+
assertNotSame(retrievedBytes, copiedBytes);
assertTrue(Arrays.equals(retrievedBytes, copiedBytes));
}
+
+ session.delete(copiedByteArray);
+ session.delete(retrievedByteArray);
}
public void testNullByteArray() {
byte[] bytes = null;
ByteArray byteArray = new ByteArray(bytes);
session.save(byteArray);
+
newTransaction();
- ByteArray retrievedByteArray = (ByteArray) session.load(ByteArray.class, new Long(byteArray.getId()));
+ ByteArray retrievedByteArray = (ByteArray) session.load(ByteArray.class, new Long(
+ byteArray.getId()));
assertNull(retrievedByteArray.getBytes());
+
+ session.delete(retrievedByteArray);
}
private static byte[] getMultipleBlockBytes() {
- String text = "muchos bytes"; // (10 bytes)
- for (int i=0; i<8; i++) text+=text;
- // now text should be 2560 bytes
- return text.getBytes();
+ byte[] bytes = new byte[2560];
+ Arrays.fill(bytes, 0, 512, (byte) 67);
+ Arrays.fill(bytes, 512, 1024, (byte) 65);
+ Arrays.fill(bytes, 1024, 1536, (byte) 71);
+ Arrays.fill(bytes, 1536, 2048, (byte) 70);
+ Arrays.fill(bytes, 2048, 2560, (byte) 66);
+ return bytes;
}
}
Modified: jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/job/executor/JobExecutorDbTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/job/executor/JobExecutorDbTest.java 2009-05-28 12:59:30 UTC (rev 4935)
+++ jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/job/executor/JobExecutorDbTest.java 2009-05-28 15:17:35 UTC (rev 4936)
@@ -23,79 +23,83 @@
protected void setUp() throws Exception {
super.setUp();
- deployProcess();
getJbpmConfiguration().getJobExecutor().setNbrOfThreads(4);
}
protected void tearDown() throws Exception {
getJbpmConfiguration().getJobExecutor().setNbrOfThreads(1);
- deleteProcess();
super.tearDown();
}
public void testJobExecutor() {
- launchProcesses();
- processJobs(timeout);
- assertEquals(createExpectedResults(), collectedResults);
+ deployProcessDefinition();
+ try {
+ startProcessInstances();
+ processJobs(timeout);
+ assertEquals(createExpectedResults(), collectedResults);
+ }
+ finally {
+ deleteProcessDefinition();
+ }
}
- void deployProcess() {
+ void deployProcessDefinition() {
ProcessDefinition processDefinition = ProcessDefinition.parseXmlString("<process-definition name='bulk messages'>"
+ " <start-state>"
+ " <transition to='a' />"
+ " </start-state>"
+ " <node name='a' async='true'>"
- + " <action class='"
- + AutomaticActivity.class.getName()
- + "' />"
- + " <transition to='b' />"
- + " </node>"
- + " <node name='b' async='true'>"
- + " <event type='node-enter'>"
- + " <action name='X' async='true' class='"
- + AsyncAction.class.getName()
- + "' />"
- + " </event>"
- + " <action class='"
- + AutomaticActivity.class.getName()
- + "' />"
- + " <transition to='c' />"
- + " </node>"
- + " <node name='c' async='true'>"
- + " <action class='"
- + AutomaticActivity.class.getName()
- + "' />"
- + " <transition to='d'>"
- + " <action name='Y' async='true' class='"
- + AsyncAction.class.getName()
- + "' />"
- + " </transition>"
- + " </node>"
- + " <node name='d' async='true'>"
- + " <action class='"
- + AutomaticActivity.class.getName()
- + "' />"
- + " <transition to='e' />"
- + " <event type='node-leave'>"
- + " <action name='Z' async='true' class='"
- + AsyncAction.class.getName()
- + "' />"
- + " </event>"
- + " </node>"
- + " <node name='e' async='true'>"
- + " <action class='"
- + AutomaticActivity.class.getName()
- + "' />"
- + " <transition to='end' />"
- + " </node>"
- + " <end-state name='end'/>"
- + "</process-definition>");
+ + " <action class='" +
+ AutomaticActivity.class.getName() +
+ "' />" +
+ " <transition to='b' />" +
+ " </node>" +
+ " <node name='b' async='true'>" +
+ " <event type='node-enter'>" +
+ " <action name='X' async='true' class='" +
+ AsyncAction.class.getName() +
+ "' />" +
+ " </event>" +
+ " <action class='" +
+ AutomaticActivity.class.getName() +
+ "' />" +
+ " <transition to='c' />" +
+ " </node>" +
+ " <node name='c' async='true'>" +
+ " <action class='" +
+ AutomaticActivity.class.getName() +
+ "' />" +
+ " <transition to='d'>" +
+ " <action name='Y' async='true' class='" +
+ AsyncAction.class.getName() +
+ "' />" +
+ " </transition>" +
+ " </node>" +
+ " <node name='d' async='true'>" +
+ " <action class='" +
+ AutomaticActivity.class.getName() +
+ "' />" +
+ " <transition to='e' />" +
+ " <event type='node-leave'>" +
+ " <action name='Z' async='true' class='" +
+ AsyncAction.class.getName() +
+ "' />" +
+ " </event>" +
+ " </node>" +
+ " <node name='e' async='true'>" +
+ " <action class='" +
+ AutomaticActivity.class.getName() +
+ "' />" +
+ " <transition to='end' />" +
+ " </node>" +
+ " <end-state name='end'/>" +
+ "</process-definition>");
jbpmContext.deployProcessDefinition(processDefinition);
newTransaction();
}
- void launchProcesses() {
+ void startProcessInstances() {
for (int i = 0; i < nbrOfConcurrentProcessExecutions; i++) {
ProcessInstance processInstance = jbpmContext.newProcessInstanceForUpdate("bulk messages");
processInstance.signal();
@@ -120,7 +124,7 @@
return expectedResults;
}
- void deleteProcess() {
+ void deleteProcessDefinition() {
ProcessDefinition processDefinition = graphSession.findLatestProcessDefinition("bulk messages");
graphSession.deleteProcessDefinition(processDefinition);
}
Modified: jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/logging/exe/LoggingConfigDbTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/logging/exe/LoggingConfigDbTest.java 2009-05-28 12:59:30 UTC (rev 4935)
+++ jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/logging/exe/LoggingConfigDbTest.java 2009-05-28 15:17:35 UTC (rev 4936)
@@ -1,11 +1,13 @@
package org.jbpm.logging.exe;
-import org.hibernate.Query;
+import java.util.List;
+
import org.jbpm.JbpmConfiguration;
import org.jbpm.db.AbstractDbTestCase;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;
+import org.jbpm.logging.log.ProcessLog;
public class LoggingConfigDbTest extends AbstractDbTestCase {
@@ -22,12 +24,15 @@
}
public void testLoggingconfiguration() {
- jbpmContext.deployProcessDefinition(new ProcessDefinition("logging"));
+ ProcessDefinition processDefinition = new ProcessDefinition("logging");
+ jbpmContext.deployProcessDefinition(processDefinition);
ProcessInstance processInstance = jbpmContext.newProcessInstance("logging");
processInstance.getContextInstance().setVariable("a", "1");
+
newTransaction();
+ List logs = session.createCriteria(ProcessLog.class).list();
+ assertEquals(0, logs.size());
- Query query = session.createQuery("from org.jbpm.logging.log.ProcessLog");
- assertEquals(0, query.list().size());
+ graphSession.deleteProcessDefinition(processDefinition.getId());
}
}
Modified: jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/perf/TasklistEagerLoadingTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/perf/TasklistEagerLoadingTest.java 2009-05-28 12:59:30 UTC (rev 4935)
+++ jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/perf/TasklistEagerLoadingTest.java 2009-05-28 15:17:35 UTC (rev 4936)
@@ -1,6 +1,9 @@
package org.jbpm.perf;
+import java.io.Serializable;
import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
import java.util.List;
import org.jbpm.db.AbstractDbTestCase;
@@ -8,32 +11,54 @@
public class TasklistEagerLoadingTest extends AbstractDbTestCase {
+ private List taskInstanceIds = new ArrayList();
+
public void testTasklistEagerLoading() {
- for (int i=0; i<20; i++) {
- TaskInstance taskInstance = new TaskInstance("task "+i);
+ for (int i = 0; i < 20; i++) {
+ TaskInstance taskInstance = new TaskInstance("task " + i);
taskInstance.setActorId("johndoe");
- session.save(taskInstance);
+ save(taskInstance);
}
newTransaction();
-
- assertEquals(20, jbpmContext.getTaskList("johndoe").size());
+ try {
+ assertEquals(20, jbpmContext.getTaskList("johndoe").size());
+ }
+ finally {
+ deleteTaskInstances();
+ }
}
public void testPooledTasklistEagerLoading() {
- for (int i=0; i<20; i++) {
- TaskInstance taskInstance = new TaskInstance("group task "+i);
- taskInstance.setPooledActors(new String[]{"group"+i});
- session.save(taskInstance);
+ for (int i = 0; i < 20; i++) {
+ TaskInstance taskInstance = new TaskInstance("group task " + i);
+ taskInstance.setPooledActors(new String[] { "group" + i });
+ save(taskInstance);
}
- for (int i=0; i<20; i++) {
- TaskInstance taskInstance = new TaskInstance("task "+i);
- taskInstance.setPooledActors(new String[]{"johndoe", "bachelors", "partyanimals", "wildwomen"});
- session.save(taskInstance);
+ for (int i = 0; i < 20; i++) {
+ TaskInstance taskInstance = new TaskInstance("task " + i);
+ taskInstance.setPooledActors(new String[] { "johndoe", "bachelors", "partyanimals",
+ "wildwomen" });
+ save(taskInstance);
}
newTransaction();
-
- List actorIds = new ArrayList();
- actorIds.add("johndoe");
- assertEquals(20, jbpmContext.getGroupTaskList(actorIds).size());
+ try {
+ assertEquals(20, jbpmContext.getGroupTaskList(Collections.singletonList("johndoe")).size());
+ }
+ finally {
+ deleteTaskInstances();
+ }
}
+
+ private void save(TaskInstance taskInstance) {
+ Serializable id = session.save(taskInstance);
+ taskInstanceIds.add(id);
+ }
+
+ private void deleteTaskInstances() {
+ for (Iterator i = taskInstanceIds.iterator(); i.hasNext();) {
+ Serializable id = (Serializable) i.next();
+ Object taskInstance = session.load(TaskInstance.class, id);
+ session.delete(taskInstance);
+ }
+ }
}
Deleted: jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/seam/AsyncAction.java
===================================================================
--- jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/seam/AsyncAction.java 2009-05-28 12:59:30 UTC (rev 4935)
+++ jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/seam/AsyncAction.java 2009-05-28 15:17:35 UTC (rev 4936)
@@ -1,31 +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.seam;
-
-import org.jbpm.graph.def.ActionHandler;
-import org.jbpm.graph.exe.ExecutionContext;
-
-public class AsyncAction implements ActionHandler {
- public void execute(ExecutionContext executionContext) throws Exception {
- JobExecutorCustomizationTest.jobEvents.add("execute action");
- }
-}
\ No newline at end of file
Modified: jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/seam/JobExecutorCustomizationTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/seam/JobExecutorCustomizationTest.java 2009-05-28 12:59:30 UTC (rev 4935)
+++ jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/seam/JobExecutorCustomizationTest.java 2009-05-28 15:17:35 UTC (rev 4936)
@@ -1,15 +1,18 @@
package org.jbpm.seam;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
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.job.executor.JobExecutor;
public class JobExecutorCustomizationTest extends AbstractDbTestCase {
- public static List jobEvents = new ArrayList();
+ static List jobEvents = new ArrayList();
protected String getJbpmTestConfig() {
return "org/jbpm/seam/custom.job.executor.jbpm.cfg.xml";
@@ -24,46 +27,36 @@
JobExecutor jobExecutor = getJbpmConfiguration().getJobExecutor();
assertEquals(CustomJobExecutor.class, jobExecutor.getClass());
- ProcessDefinition processDefinition = ProcessDefinition.parseXmlString("<process-definition name='customjobexecution' initial='start'>"
- + " <node name='start'>"
- + " <transition to='end'>"
- + " <action async='true' class='"
- + AsyncAction.class.getName()
- + "' />"
- + " </transition>"
- + " </node>"
- + " <state name='end' />"
- + "</process-definition>");
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlString("<process-definition name='customjobexecution' initial='start'>" +
+ " <node name='start'>" +
+ " <transition to='end'>" +
+ " <action async='true' class='" +
+ AsyncAction.class.getName() +
+ "' />" +
+ " </transition>" +
+ " </node>" +
+ " <state name='end' />" +
+ "</process-definition>");
jbpmContext.deployProcessDefinition(processDefinition);
- long processDefinitionId = processDefinition.getId();
- try {
- newTransaction();
-
+ newTransaction();
+ try {
jbpmContext.newProcessInstanceForUpdate("customjobexecution");
- newTransaction();
-
- jobExecutor.start();
- try {
- waitForJobs(20000);
- }
- finally {
- jobExecutor.stop();
- }
-
+ processJobs(20 * 1000);
+ List expectedJobEvents = Arrays.asList(new String[] { "before", "execute action", "after" });
+ assertEquals(expectedJobEvents, jobEvents);
}
finally {
- newTransaction();
-
- graphSession.deleteProcessDefinition(processDefinitionId);
+ graphSession.deleteProcessDefinition(processDefinition.getId());
}
+ }
- List expectedJobEvents = new ArrayList();
- expectedJobEvents.add("before");
- expectedJobEvents.add("execute action");
- expectedJobEvents.add("after");
+ public static class AsyncAction implements ActionHandler {
+ private static final long serialVersionUID = 1L;
- assertEquals(expectedJobEvents, jobEvents);
+ public void execute(ExecutionContext executionContext) throws Exception {
+ jobEvents.add("execute action");
+ }
}
}
Modified: jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/taskmgmt/exe/TaskInstanceDbTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/taskmgmt/exe/TaskInstanceDbTest.java 2009-05-28 12:59:30 UTC (rev 4935)
+++ jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/taskmgmt/exe/TaskInstanceDbTest.java 2009-05-28 15:17:35 UTC (rev 4936)
@@ -36,286 +36,252 @@
public class TaskInstanceDbTest extends AbstractDbTestCase {
- public void testTaskInstanceUnrelatedToAProcess()
- {
+ public void testTaskInstanceUnrelatedToAProcess() {
TaskInstance taskInstance = new TaskInstance("do laundry", "someoneelse");
- session.save(taskInstance);
- long id = taskInstance.getId();
-
+ Serializable id = session.save(taskInstance);
newTransaction();
- taskInstance = (TaskInstance)session.load(TaskInstance.class, new Long(id));
+ taskInstance = (TaskInstance) session.load(TaskInstance.class, id);
assertNotNull(taskInstance);
assertEquals("do laundry", taskInstance.getName());
assertEquals("someoneelse", taskInstance.getActorId());
+
+ session.delete(taskInstance);
}
public void testTaskInstanceBasicLifeCycle() {
- ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
- "<process-definition>" +
- " <start-state>" +
- " <transition to='a' />" +
- " </start-state>" +
- " <task-node name='a'>" +
- " <task name='clean ceiling' />" +
- " <transition to='end' />" +
- " </task-node>" +
- " <end-state name='end' />" +
- "</process-definition>"
- );
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlString("<process-definition>"
+ + " <start-state>"
+ + " <transition to='a' />"
+ + " </start-state>"
+ + " <task-node name='a'>"
+ + " <task name='clean ceiling' />"
+ + " <transition to='end' />"
+ + " </task-node>"
+ + " <end-state name='end' />"
+ + "</process-definition>");
processDefinition = saveAndReload(processDefinition);
- try
- {
+ try {
ProcessInstance processInstance = new ProcessInstance(processDefinition);
processInstance.signal();
-
+
processInstance = saveAndReload(processInstance);
long tokenId = processInstance.getRootToken().getId();
List taskInstances = taskMgmtSession.findTaskInstancesByToken(tokenId);
assertEquals(1, taskInstances.size());
+
TaskInstance taskInstance = (TaskInstance) taskInstances.get(0);
assertFalse(taskInstance.hasEnded());
assertEquals(tokenId, taskInstance.getToken().getId());
// do some updates
taskInstance.end();
-
+
processInstance = saveAndReload(processInstance);
-
taskInstance = taskMgmtSession.loadTaskInstance(taskInstance.getId());
assertTrue(taskInstance.hasEnded());
}
- finally
- {
+ finally {
jbpmContext.getGraphSession().deleteProcessDefinition(processDefinition.getId());
}
-
+
}
public void testTaskName() {
- ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
- "<process-definition>" +
- " <start-state>" +
- " <transition to='a' />" +
- " </start-state>" +
- " <task-node name='a'>" +
- " <task name='clean ceiling' />" +
- " <transition to='end' />" +
- " </task-node>" +
- " <end-state name='end' />" +
- "</process-definition>"
- );
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlString("<process-definition>"
+ + " <start-state>"
+ + " <transition to='a' />"
+ + " </start-state>"
+ + " <task-node name='a'>"
+ + " <task name='clean ceiling' />"
+ + " <transition to='end' />"
+ + " </task-node>"
+ + " <end-state name='end' />"
+ + "</process-definition>");
processDefinition = saveAndReload(processDefinition);
- try
- {
+ try {
ProcessInstance processInstance = new ProcessInstance(processDefinition);
processInstance.signal();
-
- processInstance = saveAndReload(processInstance);
- long tokenId = processInstance.getRootToken().getId();
- List taskInstances = taskMgmtSession.findTaskInstancesByToken(tokenId);
+ processInstance = saveAndReload(processInstance);
+ List taskInstances = taskMgmtSession.findTaskInstancesByToken(processInstance.getRootToken()
+ .getId());
assertEquals(1, taskInstances.size());
+
TaskInstance taskInstance = (TaskInstance) taskInstances.get(0);
assertFalse(taskInstance.hasEnded());
assertEquals("clean ceiling", taskInstance.getName());
assertEquals("clean ceiling", taskInstance.getTask().getName());
// do some updates
taskInstance.setName("clean ceiling thoroughly");
-
+
processInstance = saveAndReload(processInstance);
taskInstance = taskMgmtSession.loadTaskInstance(taskInstance.getId());
-
assertEquals("clean ceiling thoroughly", taskInstance.getName());
assertEquals("clean ceiling", taskInstance.getTask().getName());
}
- finally
- {
+ finally {
jbpmContext.getGraphSession().deleteProcessDefinition(processDefinition.getId());
}
}
-
+
public void testTaskComments() {
- ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
- "<process-definition>" +
- " <start-state>" +
- " <transition to='a' />" +
- " </start-state>" +
- " <task-node name='a'>" +
- " <task name='clean ceiling' />" +
- " <transition to='end' />" +
- " </task-node>" +
- " <end-state name='end' />" +
- "</process-definition>"
- );
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlString("<process-definition>"
+ + " <start-state>"
+ + " <transition to='a' />"
+ + " </start-state>"
+ + " <task-node name='a'>"
+ + " <task name='clean ceiling' />"
+ + " <transition to='end' />"
+ + " </task-node>"
+ + " <end-state name='end' />"
+ + "</process-definition>");
processDefinition = saveAndReload(processDefinition);
- try
- {
+ try {
ProcessInstance processInstance = new ProcessInstance(processDefinition);
processInstance.signal();
-
- processInstance = saveAndReload(processInstance);
- long tokenId = processInstance.getRootToken().getId();
- List taskInstances = taskMgmtSession.findTaskInstancesByToken(tokenId);
+ processInstance = saveAndReload(processInstance);
+ List taskInstances = taskMgmtSession.findTaskInstancesByToken(processInstance.getRootToken()
+ .getId());
assertEquals(1, taskInstances.size());
TaskInstance taskInstance = (TaskInstance) taskInstances.get(0);
taskInstance.addComment("please hurry!");
-
+
processInstance = saveAndReload(processInstance);
taskInstance = taskMgmtSession.loadTaskInstance(taskInstance.getId());
-
+
List comments = taskInstance.getComments();
assertEquals(1, comments.size());
-
- Comment comment = (Comment) comments.get(0);
+
+ Comment comment = (Comment) comments.get(0);
assertEquals("please hurry!", comment.getMessage());
assertSame(taskInstance, comment.getTaskInstance());
}
- finally
- {
+ finally {
jbpmContext.getGraphSession().deleteProcessDefinition(processDefinition.getId());
}
}
-
+
public void testBlockingTask() {
- ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
- "<process-definition>" +
- " <start-state>" +
- " <transition to='a' />" +
- " </start-state>" +
- " <task-node name='a'>" +
- " <task name='laundry' blocking='true' />" +
- " <transition to='b' />" +
- " </task-node>" +
- " <state name='b' />" +
- "</process-definition>"
- );
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlString("<process-definition>"
+ + " <start-state>"
+ + " <transition to='a' />"
+ + " </start-state>"
+ + " <task-node name='a'>"
+ + " <task name='laundry' blocking='true' />"
+ + " <transition to='b' />"
+ + " </task-node>"
+ + " <state name='b' />"
+ + "</process-definition>");
processDefinition = saveAndReload(processDefinition);
- try
- {
+ try {
ProcessInstance processInstance = new ProcessInstance(processDefinition);
Token token = processInstance.getRootToken();
- processInstance.signal();
+ token.signal();
assertEquals("a", token.getNode().getName());
+
processInstance = saveAndReload(processInstance);
try {
processInstance.signal();
fail("expected exception");
- } catch (IllegalStateException e) {
+ }
+ catch (IllegalStateException e) {
// OK
}
}
- finally
- {
+ finally {
jbpmContext.getGraphSession().deleteProcessDefinition(processDefinition.getId());
}
}
public void testConditionalTasksOne() {
- ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
- "<process-definition>" +
- " <start-state>" +
- " <transition to='release' />" +
- " </start-state>" +
- " <task-node name='release'>" +
- " <task name='updateWebsite' condition='#{user.admin}' />" +
- " <task name='addNewsItem' />" +
- " <task name='publishRelease' condition='#{user.releaseManager}' />" +
- " </task-node>" +
- "</process-definition>"
- );
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlString("<process-definition>"
+ + " <start-state>"
+ + " <transition to='release' />"
+ + " </start-state>"
+ + " <task-node name='release'>"
+ + " <task name='updateWebsite' condition='#{user.admin}' />"
+ + " <task name='addNewsItem' />"
+ + " <task name='publishRelease' condition='#{user.releaseManager}' />"
+ + " </task-node>"
+ + "</process-definition>");
processDefinition = saveAndReload(processDefinition);
- try
- {
+ try {
ProcessInstance processInstance = new ProcessInstance(processDefinition);
processInstance.getContextInstance().setVariable("user", new User(true, false));
processInstance.signal();
processInstance = saveAndReload(processInstance);
Collection taskInstances = processInstance.getTaskMgmtInstance().getTaskInstances();
- Set createdTasks = new HashSet();
- Iterator iter = taskInstances.iterator();
- while (iter.hasNext()) {
- TaskInstance taskInstance = (TaskInstance) iter.next();
- createdTasks.add(taskInstance.getName());
- }
- Set expectedTasks = new HashSet();
- expectedTasks.add("updateWebsite");
- expectedTasks.add("addNewsItem");
-
- assertEquals(expectedTasks, createdTasks);
+ Set taskNames = new HashSet();
+ for (Iterator i = taskInstances.iterator(); i.hasNext();) {
+ TaskInstance taskInstance = (TaskInstance) i.next();
+ taskNames.add(taskInstance.getName());
+ }
+ assertEquals(2, taskNames.size());
+ assert taskNames.contains("updateWebsite") : taskNames;
+ assert taskNames.contains("addNewsItem") : taskNames;
}
- finally
- {
+ finally {
jbpmContext.getGraphSession().deleteProcessDefinition(processDefinition.getId());
}
}
public void testConditionalTasksTwo() {
- ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
- "<process-definition>" +
- " <start-state>" +
- " <transition to='release' />" +
- " </start-state>" +
- " <task-node name='release'>" +
- " <task name='updateWebsite' condition='#{user.admin}' />" +
- " <task name='addNewsItem' />" +
- " <task name='publishRelease' condition='#{user.releaseManager}' />" +
- " </task-node>" +
- "</process-definition>"
- );
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlString("<process-definition>"
+ + " <start-state>"
+ + " <transition to='release' />"
+ + " </start-state>"
+ + " <task-node name='release'>"
+ + " <task name='updateWebsite' condition='#{user.admin}' />"
+ + " <task name='addNewsItem' />"
+ + " <task name='publishRelease' condition='#{user.releaseManager}' />"
+ + " </task-node>"
+ + "</process-definition>");
processDefinition = saveAndReload(processDefinition);
- try
- {
+ try {
ProcessInstance processInstance = new ProcessInstance(processDefinition);
processInstance.getContextInstance().setVariable("user", new User(false, true));
processInstance.signal();
processInstance = saveAndReload(processInstance);
Collection taskInstances = processInstance.getTaskMgmtInstance().getTaskInstances();
- Set createdTasks = new HashSet();
- Iterator iter = taskInstances.iterator();
- while (iter.hasNext()) {
- TaskInstance taskInstance = (TaskInstance) iter.next();
- createdTasks.add(taskInstance.getName());
+ Set taskNames = new HashSet();
+ for (Iterator i = taskInstances.iterator(); i.hasNext();) {
+ TaskInstance taskInstance = (TaskInstance) i.next();
+ taskNames.add(taskInstance.getName());
}
- Set expectedTasks = new HashSet();
- expectedTasks.add("addNewsItem");
- expectedTasks.add("publishRelease");
-
- assertEquals(expectedTasks, createdTasks);
+ assertEquals(2, taskNames.size());
+ assert taskNames.contains("addNewsItem") : taskNames;
+ assert taskNames.contains("publishRelease") : taskNames;
}
- finally
- {
+ finally {
jbpmContext.getGraphSession().deleteProcessDefinition(processDefinition.getId());
}
}
- public static class User implements Serializable
- {
- private static final long serialVersionUID = 1L;
+ public static class User implements Serializable {
boolean isAdmin;
boolean isReleaseManager;
- public User(boolean isAdmin, boolean isReleaseManager)
- {
+ private static final long serialVersionUID = 1L;
+
+ public User(boolean isAdmin, boolean isReleaseManager) {
this.isAdmin = isAdmin;
this.isReleaseManager = isReleaseManager;
}
- public boolean isAdmin()
- {
+ public boolean isAdmin() {
return isAdmin;
}
- public boolean isReleaseManager()
- {
+ public boolean isReleaseManager() {
return isReleaseManager;
}
}
Modified: jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/taskmgmt/log/TaskLogDbTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/taskmgmt/log/TaskLogDbTest.java 2009-05-28 12:59:30 UTC (rev 4935)
+++ jbpm3/branches/jbpm-3.2.5-soa/modules/core/src/test/java/org/jbpm/taskmgmt/log/TaskLogDbTest.java 2009-05-28 15:17:35 UTC (rev 4936)
@@ -24,66 +24,54 @@
import org.jbpm.db.AbstractDbTestCase;
import org.jbpm.taskmgmt.exe.TaskInstance;
-public class TaskLogDbTest extends AbstractDbTestCase
-{
+public class TaskLogDbTest extends AbstractDbTestCase {
- TaskInstance taskInstance = null;
+ TaskInstance taskInstance;
- protected void setUp() throws Exception
- {
+ protected void setUp() throws Exception {
super.setUp();
taskInstance = new TaskInstance();
session.save(taskInstance);
}
- protected void tearDown() throws Exception
- {
- taskInstance = null;
+ protected void tearDown() throws Exception {
+ session.delete(taskInstance);
super.tearDown();
}
- public void testTaskCreateLog()
- {
+ public void testTaskCreateLog() {
TaskCreateLog taskLog = new TaskCreateLog(taskInstance, "someone else");
session.save(taskLog);
newTransaction();
+ taskLog = (TaskCreateLog) session.load(TaskCreateLog.class, new Long(taskLog.getId()));
+ assertEquals(taskInstance.getId(), (taskInstance = taskLog.getTaskInstance()).getId());
+ assertEquals("someone else", taskLog.getTaskActorId());
- taskLog = (TaskCreateLog)session.load(TaskCreateLog.class, new Long(taskLog.getId()));
- assertNotNull(taskLog);
- assertNotNull(taskLog.getTaskInstance());
- assertEquals("someone else", (taskLog.getTaskActorId()));
-
session.delete(taskLog);
}
- public void testTaskAssignLog()
- {
+ public void testTaskAssignLog() {
TaskAssignLog taskLog = new TaskAssignLog(taskInstance, "me", "toyou");
session.save(taskLog);
newTransaction();
+ taskLog = (TaskAssignLog) session.load(TaskAssignLog.class, new Long(taskLog.getId()));
+ assertEquals(taskInstance.getId(), (taskInstance = taskLog.getTaskInstance()).getId());
+ assertEquals("me", taskLog.getTaskOldActorId());
+ assertEquals("toyou", taskLog.getTaskNewActorId());
- taskLog = (TaskAssignLog)session.load(TaskAssignLog.class, new Long(taskLog.getId()));
- assertNotNull(taskLog);
- assertNotNull(taskLog.getTaskInstance());
- assertEquals("me", (taskLog.getTaskOldActorId()));
- assertEquals("toyou", (taskLog.getTaskNewActorId()));
-
session.delete(taskLog);
-}
+ }
- public void testTaskEndLog()
- {
+ public void testTaskEndLog() {
TaskEndLog taskLog = new TaskEndLog(taskInstance);
session.save(taskLog);
newTransaction();
+ taskLog = (TaskEndLog) session.load(TaskEndLog.class, new Long(taskLog.getId()));
+ assertEquals(taskInstance.getId(), (taskInstance = taskLog.getTaskInstance()).getId());
- taskLog = (TaskEndLog)session.load(TaskEndLog.class, new Long(taskLog.getId()));
- assertNotNull(taskLog);
- assertNotNull(taskLog.getTaskInstance());
-
session.delete(taskLog);
}
}
15 years