JBoss JBPM SVN: r2590 - jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2008-10-22 20:33:38 -0400 (Wed, 22 Oct 2008)
New Revision: 2590
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/DelegationException.java
Log:
removed cause field from DelegationException - no reason to expose a mutable cause
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/DelegationException.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/DelegationException.java 2008-10-23 00:31:05 UTC (rev 2589)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/DelegationException.java 2008-10-23 00:33:38 UTC (rev 2590)
@@ -25,28 +25,21 @@
import org.jbpm.graph.exe.*;
public class DelegationException extends JbpmException {
-
+
private static final long serialVersionUID = 1L;
- protected Throwable cause = null;
protected transient ExecutionContext executionContext = null;
public DelegationException(Throwable cause, ExecutionContext executionContext) {
- super(cause.getMessage());
- this.cause = cause;
+ super(cause.getMessage(), cause);
this.executionContext = executionContext;
}
-
+
public DelegationException(String message, Throwable cause) {
super(message, cause);
- this.cause = cause;
}
public ExecutionContext getExecutionContext() {
return executionContext;
}
-
- public Throwable getCause() {
- return cause;
- }
}
17 years, 6 months
JBoss JBPM SVN: r2589 - jbpm3/trunk/modules/core/src/test/java/org/jbpm/mail.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2008-10-22 20:31:05 -0400 (Wed, 22 Oct 2008)
New Revision: 2589
Modified:
jbpm3/trunk/modules/core/src/test/java/org/jbpm/mail/MailTest.java
jbpm3/trunk/modules/core/src/test/java/org/jbpm/mail/TaskMailTest.java
Log:
workaround for dumbster hanging during smtp server start under linux (f9) - see http://markmail.org/message/fdw3lwu22qwuuo7d for details
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/mail/MailTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/mail/MailTest.java 2008-10-22 18:56:22 UTC (rev 2588)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/mail/MailTest.java 2008-10-23 00:31:05 UTC (rev 2589)
@@ -37,10 +37,33 @@
protected void setUp() throws Exception
{
super.setUp();
- server = SimpleSmtpServer.start(23583);
+ server = startSmtpServer(23583);
jbpmContext = jbpmConfiguration.createJbpmContext();
}
+ static SimpleSmtpServer startSmtpServer(int port) {
+ /* SimpleSmtpServer.start(int) blocks the calling thread until the server socket is created.
+ * If the socket is created too quickly (seems to happen on Linux and Mac) then the
+ * notification is sent too early and the calling thread blocks forever. */
+ // return SimpleSmtpServer.start(port);
+
+ /* The code below corresponds to SimpleSmtpServer.start(int) except that the
+ * thread start has been moved inside of the synchronized block. */
+ SimpleSmtpServer server = new SimpleSmtpServer(port);
+ Thread serverThread = new Thread(server);
+
+ // Block until the server socket is created
+ synchronized (server) {
+ serverThread.start();
+ try {
+ server.wait(10 * 1000);
+ } catch (InterruptedException e) {
+ // Ignore don't care.
+ }
+ }
+ return server;
+ }
+
protected void tearDown() throws Exception
{
jbpmContext.close();
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/mail/TaskMailTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/mail/TaskMailTest.java 2008-10-22 18:56:22 UTC (rev 2588)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/mail/TaskMailTest.java 2008-10-23 00:31:05 UTC (rev 2589)
@@ -42,7 +42,7 @@
protected void setUp() throws Exception
{
super.setUp();
- server = SimpleSmtpServer.start(23583);
+ server = MailTest.startSmtpServer(23583);
jbpmContext = jbpmConfiguration.createJbpmContext();
}
17 years, 6 months
JBoss JBPM SVN: r2588 - in jbpm3/trunk/modules/distribution: src/main/resources/installer and 1 other directory.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-10-22 14:56:22 -0400 (Wed, 22 Oct 2008)
New Revision: 2588
Modified:
jbpm3/trunk/modules/distribution/pom.xml
jbpm3/trunk/modules/distribution/src/main/resources/installer/install-definition.xml
Log:
JBPM-1780: Make the GWT console an optional installation component
Modified: jbpm3/trunk/modules/distribution/pom.xml
===================================================================
--- jbpm3/trunk/modules/distribution/pom.xml 2008-10-22 15:14:20 UTC (rev 2587)
+++ jbpm3/trunk/modules/distribution/pom.xml 2008-10-22 18:56:22 UTC (rev 2588)
@@ -26,6 +26,10 @@
<relativePath>../../pom.xml</relativePath>
</parent>
+ <properties>
+ <gwt.console.version>1.0.0-SNAPSHOT</gwt.console.version>
+ </properties>
+
<!-- Dependencies -->
<dependencies>
<dependency>
@@ -59,6 +63,18 @@
</dependency>
<dependency>
<groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>gwt-console</artifactId>
+ <version>${gwt.console.version}</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>gwt-console-server</artifactId>
+ <version>${gwt.console.version}</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm-identity</artifactId>
<version>${version}</version>
</dependency>
Modified: jbpm3/trunk/modules/distribution/src/main/resources/installer/install-definition.xml
===================================================================
--- jbpm3/trunk/modules/distribution/src/main/resources/installer/install-definition.xml 2008-10-22 15:14:20 UTC (rev 2587)
+++ jbpm3/trunk/modules/distribution/src/main/resources/installer/install-definition.xml 2008-10-22 18:56:22 UTC (rev 2588)
@@ -139,25 +139,35 @@
</pack>
<!-- Optional Downloads -->
- <pack name="Optional Downloads" required="no" preselected="no">
+ <pack name="Optional Components" required="no" preselected="no">
<description>Optional jBPM3 Downloads</description>
</pack>
<!-- JBoss-4.2.2 -->
- <pack name="Download JBoss-4.2.2" required="no" parent="Optional Downloads" preselected="no">
+ <pack name="Download JBoss-4.2.2" required="no" parent="Optional Components" preselected="no">
<description>Download and Install JBoss-4.2.2</description>
<!-- http://jira.codehaus.org/browse/IZPACK-158 -->
<file src="@{resources.dir}/installer/download-helper.xml" targetdir="$INSTALL_PATH/Uninstaller"/>
</pack>
<!-- Eclipse-3.4.0 -->
- <pack name="Download Eclipse-3.4.0" required="no" parent="Optional Downloads" preselected="no">
+ <pack name="Download Eclipse-3.4.0" required="no" parent="Optional Components" preselected="no">
<description>Download and Install Eclipse-3.4.0</description>
<!-- http://jira.codehaus.org/browse/IZPACK-158 -->
<file src="@{resources.dir}/installer/download-helper.xml" targetdir="$INSTALL_PATH/Uninstaller"/>
</pack>
- <!-- jBPM3 Server Components -->
+ <pack name="GWT-Console" required="no" parent="Optional Components" preselected="no">
+ <description>GWT-Console (Preview, use at your own risk)</description>
+ <!-- jbpm/gwt-console.war -->
+ <file src="@{deploy.artifacts.dir}/lib/gwt-console.war"
+ targetdir="${installPath}/server/${jbossTargetServer}/deploy/jbpm/" unpack="false" override="true" />
+
+ <file src="@{deploy.artifacts.dir}/lib/gwt-console-server.war"
+ targetdir="${installPath}/server/${jbossTargetServer}/deploy/jbpm" unpack="true" override="true" />
+ </pack>
+
+ <!-- jBPM3 Server Components -->
<pack name="jBPM3 Server Components" required="yes" preselected="yes">
<description>The jBPM3 Server Components</description>
17 years, 6 months
JBoss JBPM SVN: r2587 - jbpm3/trunk/modules/core/src/test/java/org/jbpm/job/executor.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-10-22 11:14:20 -0400 (Wed, 22 Oct 2008)
New Revision: 2587
Removed:
jbpm3/trunk/modules/core/src/test/java/org/jbpm/job/executor/JobLoadJoinTest.java
Log:
[JBPM-1721] Remove JobLoadJoinTest
Deleted: jbpm3/trunk/modules/core/src/test/java/org/jbpm/job/executor/JobLoadJoinTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/job/executor/JobLoadJoinTest.java 2008-10-22 15:12:35 UTC (rev 2586)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/job/executor/JobLoadJoinTest.java 2008-10-22 15:14:20 UTC (rev 2587)
@@ -1,148 +0,0 @@
-package org.jbpm.job.executor;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jbpm.JbpmConfiguration;
-import org.jbpm.JbpmContext;
-import org.jbpm.db.AbstractDbTestCase;
-import org.jbpm.graph.def.ActionHandler;
-import org.jbpm.graph.def.ProcessDefinition;
-import org.jbpm.graph.exe.ExecutionContext;
-import org.jbpm.graph.exe.ProcessInstance;
-
-public class JobLoadJoinTest extends AbstractDbTestCase
-{
-
- private static Log log = LogFactory.getLog(JobLoadJoinTest.class);
-
- static Set finishedProcesses = Collections.synchronizedSet(new HashSet());
- long start;
-
- @Override
- protected String getJbpmTestConfig()
- {
- return "org/jbpm/job/executor/loadtests.jbpm.cfg.xml";
- }
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- start = System.currentTimeMillis();
- }
-
- private boolean timeout(int maxWait)
- {
- return System.currentTimeMillis() - start > maxWait;
- }
-
- public void testJobLoadWithJoin() throws Exception
- {
- int processes = 20;
- int maxWait = 20000;
-
- ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
- "<process-definition name='asyncjoin' initial='yenom'>" +
- " <node name='yenom' async='true'>" +
- " <transition to='rof' />" +
- " </node>" +
- " <fork name='rof'>" +
- " <transition to='gnihton' />" +
- " <transition to='skihc' />" +
- " </fork>" +
- " <node name='gnihton' async='true'>" +
- " <transition to='eerf' />" +
- " </node>" +
- " <node name='skihc' async='true'>" +
- " <transition to='eerf' />" +
- " </node>" +
- " <join name='eerf'>" +
- " <transition to='ymtnawi' />" +
- " </join>" +
- " <node name='ymtnawi' async='true'>" +
- " <transition to='vtm' />" +
- " </node>" +
- " <end-state name='vtm' />" +
- " <event type='process-end'>" +
- " <action class='"+ProcessFinished.class.getName()+"' />" +
- " </event>" +
- "</process-definition>"
- );
-
- jbpmContext.deployProcessDefinition(processDefinition);
- long processDefinitionId = processDefinition.getId();
-
- commitAndCloseSession();
-
- try {
- getJbpmConfiguration().startJobExecutor();
-
- Set expectedProcesses = new HashSet();
- for (int i = 0; i < processes; i++)
- {
- Integer number = new Integer(i);
- expectedProcesses.add(number);
- Thread thread = new StartNewExecutionThread(getJbpmConfiguration(), number);
- thread.start();
- }
-
- while (!expectedProcesses.equals(finishedProcesses) && !timeout(maxWait))
- {
- Thread.sleep(200);
- }
- log.info("number of finished processes: " + finishedProcesses);
- log.info("number of expected processes: " + expectedProcesses);
- assertEquals(expectedProcesses, finishedProcesses);
-
- } catch (Exception e) {
- e.printStackTrace();
-
- } finally {
- beginSessionTransaction();
- graphSession.deleteProcessDefinition(processDefinitionId);
- }
- }
-
- public static class StartNewExecutionThread extends Thread
- {
- Integer number;
- JbpmConfiguration jbpmConfiguration;
-
- public StartNewExecutionThread(JbpmConfiguration jbpmConfiguration, Integer number)
- {
- this.jbpmConfiguration = jbpmConfiguration;
- this.number = number;
- }
-
- public void run()
- {
- JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
- try
- {
- ProcessInstance processInstance = jbpmContext.newProcessInstance("asyncjoin");
- processInstance.getContextInstance().setVariable("number", number);
- jbpmContext.save(processInstance);
- }
- finally
- {
- jbpmContext.close();
- }
- }
- }
-
- public static class ProcessFinished implements ActionHandler
- {
- private static final long serialVersionUID = 1L;
-
- public void execute(ExecutionContext executionContext) throws Exception
- {
- Integer number = (Integer)executionContext.getVariable("number");
- log.info("process " + number + " finished");
- finishedProcesses.add(number);
- }
- }
-}
17 years, 6 months
JBoss JBPM SVN: r2586 - in jbpm3/trunk/modules/core/src: test/java/org/jboss/seam/pageflow and 3 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-10-22 11:12:35 -0400 (Wed, 22 Oct 2008)
New Revision: 2586
Removed:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/Page.java
jbpm3/trunk/modules/core/src/test/java/org/jboss/seam/pageflow/Page.java
jbpm3/trunk/modules/core/src/test/java/org/jbpm/seam/SeamPageFlowTest.java
jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testPageflowWithNamespace.xml
jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testPageflowWithSchemaLocation.xml
jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testPageflowWithoutNamespace.xml
Modified:
jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/xml/XmlSchemaTest.java
Log:
[JBPM-1724] removed pageflow
Deleted: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/Page.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/Page.java 2008-10-22 14:09:27 UTC (rev 2585)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/Page.java 2008-10-22 15:12:35 UTC (rev 2586)
@@ -1,74 +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.graph.node;
-
-import org.dom4j.Element;
-import org.jbpm.context.exe.ContextInstance;
-import org.jbpm.graph.def.Node;
-import org.jbpm.graph.exe.ExecutionContext;
-import org.jbpm.jpdl.xml.JpdlXmlReader;
-import org.jbpm.jpdl.xml.Parsable;
-import org.jbpm.taskmgmt.exe.TaskInstance;
-
-public class Page extends Node implements Parsable {
-
- private static final long serialVersionUID = 1L;
-
- String url;
- boolean isConversationEnd = false;
- String outcome;
-
- public void read(Element nodeElement, JpdlXmlReader jpdlXmlReader) {
- url = nodeElement.attributeValue("url");
- Element conversationEndElement = nodeElement.element("conversation-end");
- if (conversationEndElement!=null) {
- isConversationEnd = true;
- outcome = conversationEndElement.attributeValue("outcome");
- }
- }
-
- public void execute(ExecutionContext executionContext) {
- if (isConversationEnd) {
- // get the outer business process task instance
- ContextInstance contextInstance = executionContext.getContextInstance();
- String variableName = "taskInstance";
- TaskInstance taskInstance = (TaskInstance) contextInstance.getVariable(variableName);
-
- // complete the task
- if (outcome==null) {
- taskInstance.end();
- } else {
- taskInstance.end(outcome);
- }
- }
- }
-
- public boolean isConversationEnd() {
- return isConversationEnd;
- }
- public String getOutcome() {
- return outcome;
- }
- public String getUrl() {
- return url;
- }
-}
Deleted: jbpm3/trunk/modules/core/src/test/java/org/jboss/seam/pageflow/Page.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jboss/seam/pageflow/Page.java 2008-10-22 14:09:27 UTC (rev 2585)
+++ jbpm3/trunk/modules/core/src/test/java/org/jboss/seam/pageflow/Page.java 2008-10-22 15:12:35 UTC (rev 2586)
@@ -1,163 +0,0 @@
-package org.jboss.seam.pageflow;
-
-import org.dom4j.Element;
-import org.jbpm.graph.def.Node;
-import org.jbpm.graph.exe.ExecutionContext;
-import org.jbpm.jpdl.xml.JpdlXmlReader;
-import org.jbpm.jpdl.xml.Parsable;
-
-/**
- * A page node in a jPDL pageflow
- *
- * @author Tom Baeyens
- * @author Gavin King
- */
-public class Page extends Node implements Parsable {
-
- // This classname is configured in the jbpm configuration
- // file : org/jbpm/graph/node/node.types.xml inside
- // the jbpm-{version}.jar
-
- // In case it would be necessary, that file, can be customized
- // by updating the reference to it in the central jbpm configuration
- // file 'jbpm.cfg.xml'
-
- private static final long serialVersionUID = 1L;
-
- private String viewId;
- private boolean isConversationEnd = false;
- private boolean isConversationEndBeforeRedirect = false;
- private boolean isTaskEnd = false;
- private String transition;
- private String processToCreate;
- private boolean redirect;
- private String description;
- private Integer timeout;
- private boolean backEnabled;
- private boolean switchEnabled;
- private String noConversationViewId;
-
- /**
- * parses the dom4j element that corresponds to this page.
- */
- public void read(Element pageElement, JpdlXmlReader jpdlXmlReader) {
- super.read(pageElement, jpdlXmlReader);
- viewId = pageElement.attributeValue("view-id");
- if (viewId == null) {
- throw new IllegalStateException("must specify view-id for <page/> node: "
- + pageElement.attributeValue("name"));
- }
- noConversationViewId = pageElement.attributeValue("no-conversation-view-id");
- backEnabled = "enabled".equals(pageElement.attributeValue("back"));
- switchEnabled = !"disabled".equals(pageElement.attributeValue("switch"));
- Element endConversationElement = pageElement.element("end-conversation");
- if (endConversationElement != null) {
- isConversationEnd = true;
- isConversationEndBeforeRedirect = "true".equals(endConversationElement.attributeValue("before-redirect"));
- processToCreate = endConversationElement.attributeValue("create-process");
- }
- Element endTaskElement = pageElement.element("end-task");
- if (endTaskElement != null) {
- isTaskEnd = true;
- transition = endTaskElement.attributeValue("transition");
- }
- redirect = "true".equals(pageElement.attributeValue("redirect"));
- if (pageElement.element("redirect") != null) {
- redirect = true;
- }
- Element descriptionElement = pageElement.element("description");
- if (descriptionElement != null) {
- description = descriptionElement.getTextTrim();
- }
- String timeoutString = pageElement.attributeValue("timeout");
- if (timeoutString != null) {
- timeout = Integer.valueOf(timeoutString);
- }
- }
-
- /**
- * is executed when execution arrives in this page at runtime.
- */
- public void execute(ExecutionContext executionContext) {
- /*
- if (isConversationEnd && processToCreate != null) {
- BusinessProcess.instance().createProcess(processToCreate);
- }
-
- if (isTaskEnd) {
- BusinessProcess.instance().endTask(transition);
- }
-
- if (isConversationEnd || isTaskEnd) {
- if (isConversationEndBeforeRedirect) {
- Conversation.instance().endBeforeRedirect();
- }
- else {
- Conversation.instance().end();
- }
- }
- */
- if (getAction() != null) {
- try {
- getAction().execute(executionContext);
- }
- catch (Exception e) {
- raiseException(e, executionContext);
- }
- }
- }
-
- public boolean isConversationEnd() {
- return isConversationEnd;
- }
-
- public String getTransition() {
- return transition;
- }
-
- public String getViewId() {
- // return Interpolator.instance().interpolate(viewId);
- return null;
- }
-
- public boolean isRedirect() {
- return redirect;
- }
-
- public boolean hasDescription() {
- return description != null;
- }
-
- public String getDescription() {
- // return Interpolator.instance().interpolate(description);
- return null;
- }
-
- public Integer getTimeout() {
- return timeout;
- }
-
- public boolean isBackEnabled() {
- return backEnabled;
- }
-
- public boolean isSwitchEnabled() {
- return switchEnabled;
- }
-
- public String getNoConversationViewId() {
- return noConversationViewId;
- }
-
- protected boolean isTaskEnd() {
- return isTaskEnd;
- }
-
- protected String getProcessToCreate() {
- return processToCreate;
- }
-
- public boolean isConversationEndBeforeRedirect() {
- return isConversationEndBeforeRedirect;
- }
-}
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/xml/XmlSchemaTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/xml/XmlSchemaTest.java 2008-10-22 14:09:27 UTC (rev 2585)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/xml/XmlSchemaTest.java 2008-10-22 15:12:35 UTC (rev 2586)
@@ -116,22 +116,4 @@
public void testExceptionHandler() {parseXmlForThisMethod();}
public void testEndState() {parseXmlForThisMethod();}
public void testScript() {parseXmlForThisMethod();}
-
- public void testPageflowWithoutNamespace() { parseXmlForThisMethod(); }
-
- public void testPageflowWithNamespace() {
- try {
- parseXmlForThisMethod();
- fail("expected exception");
- }
- catch (JpdlException e) {
- List problems = e.getProblems();
- assertEquals(1, problems.size());
- Problem problem = (Problem) problems.get(0);
- assertEquals(Problem.LEVEL_ERROR, problem.getLevel());
- assertEquals(3, problem.getLine().intValue());
- }
- }
-
- public void testPageflowWithSchemaLocation() { parseXmlForThisMethod(); }
}
Deleted: jbpm3/trunk/modules/core/src/test/java/org/jbpm/seam/SeamPageFlowTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/seam/SeamPageFlowTest.java 2008-10-22 14:09:27 UTC (rev 2585)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/seam/SeamPageFlowTest.java 2008-10-22 15:12:35 UTC (rev 2586)
@@ -1,163 +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 java.io.Serializable;
-import java.util.Collection;
-
-import org.jbpm.AbstractJbpmTestCase;
-import org.jbpm.context.exe.ContextInstance;
-import org.jbpm.graph.def.ProcessDefinition;
-import org.jbpm.graph.exe.ProcessInstance;
-import org.jbpm.graph.exe.Token;
-import org.jbpm.graph.node.Page;
-import org.jbpm.taskmgmt.exe.TaskInstance;
-
-public class SeamPageFlowTest extends AbstractJbpmTestCase {
-
- public static class Document implements Serializable {
- private static final long serialVersionUID = 1L;
- String text;
- public Document(String text) {
- this.text = text;
- }
- public String getText() {
- return text;
- }
- }
-
- public void testPageFlow() {
- // Here's a simple business process with one task
- ProcessDefinition businessProcessDefinition = ProcessDefinition.parseXmlString(
- "<process-definition name='business process'>" +
- " <start-state name='start biz proc'>" +
- " <transition to='review document' />" +
- " </start-state>" +
- " <task-node name='review document'>" +
- " <task name='business process review task'>" +
- // the task instance must have access to the
- // document process variable
- " <controller>" +
- " <variable name='document' />" +
- " </controller>" +
- " </task>" +
- " <transition name='approveDocument' to='file horizontally' />" +
- " <transition name='rejectDocument' to='put in shredder' />" +
- " </task-node>" +
- " <state name='file horizontally' />" +
- " <state name='put in shredder' />" +
- "</process-definition>"
- );
-
- // let's start a new process instance
- ProcessInstance businessProcessInstance = new ProcessInstance(businessProcessDefinition);
- // the root token is the main path of execution
- Token businessToken = businessProcessInstance.getRootToken();
- assertEquals("start biz proc", businessToken.getNode().getName());
-
- // we put the document somewhere in the process variables
- Document document = new Document("blablabla");
- ContextInstance contextInstance = businessProcessInstance.getContextInstance();
- contextInstance.setVariable("document", document);
-
- // let's kick the execution of the business process
- businessProcessInstance.signal();
-
- // so the execution should have arrived in the review document node
- assertEquals("review document", businessToken.getNode().getName());
-
- // there should be 1 task instance created in the business process
- Collection allTaskInstances = businessProcessInstance.getTaskMgmtInstance().getTaskInstances();
- assertNotNull(allTaskInstances);
- assertEquals(1, allTaskInstances.size());
- TaskInstance taskInstance = (TaskInstance) allTaskInstances.iterator().next();
- document = (Document) taskInstance.getVariable("document");
- assertEquals("blablabla", document.getText());
-
-
- // Now SEAM will handle the page flow that is specified here:
- ProcessDefinition pageFlowDefinition = ProcessDefinition.parseXmlString(
- "<process-definition name='approve document task'>" +
- " <start-state name='start page flow'>" +
- " <transition to='review' />" +
- " </start-state>" +
- " <page name='review' url='review.jsp'>" +
- " <transition name='approve' to='approved' />" +
- " <transition name='reject' to='rejected' />" +
- " </page>" +
- " <page name='approved' url='approved.jsp'>" +
- " <conversation-end outcome='approveDocument' />" +
- " </page>" +
- " <page name='rejected' url='rejected.jsp'>" +
- " <conversation-end outcome='rejectDocument' />" +
- " </page>" +
- "</process-definition>"
- );
-
- // A new page flow process is started
- ProcessInstance pageFlowInstance = new ProcessInstance(pageFlowDefinition);
- Token pageFlowToken = pageFlowInstance.getRootToken();
-
- // This page flow is in the context of a specific user that
- // clicked an entry in his task list. The task instance is
- // injected as a process context variable
- contextInstance = pageFlowInstance.getContextInstance();
- contextInstance.setVariable("taskInstance", taskInstance);
-
- // With the task instance information, the page flow process is started
- // and can now decide which is the first page to show the user
- pageFlowInstance.signal();
-
- // SEAM can expect that when a wait state is entered, the main
- // path of execution is positioned in a page. That page
- // contains the url that SEAM should render.
- // In this simple page flow process, we always start with the
- // review page.
- Page page = (Page) pageFlowToken.getNode();
- assertNotNull(page);
- assertEquals("review", page.getName());
- assertEquals("review.jsp", page.getUrl());
-
- // so now, the SEAM page flow renders the review page.
- // in review.jsp, the EL expression "taskInstance[document].text" should resolve
- // to 'blablabla'
- taskInstance = (TaskInstance) contextInstance.getVariable("taskInstance");
- document = (Document) taskInstance.getVariable("document");
- assertEquals("blablabla", document.getText());
- assertEquals("business process review task", taskInstance.getName());
-
- // suppose the user presses the approve button
- pageFlowToken.signal("approve");
-
- // now the page flow process should have moved to the
- // approved page with the approved.jsp
- page = (Page) pageFlowToken.getNode();
- assertNotNull(page);
- assertEquals("approved", page.getName());
- assertEquals("approved.jsp", page.getUrl());
-
- // ...and, the business process task instance should have ended.
- assertTrue(taskInstance.hasEnded());
- // causing the business process to move to the next state
- assertEquals("file horizontally", businessToken.getNode().getName());
- }
-}
Deleted: jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testPageflowWithNamespace.xml
===================================================================
--- jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testPageflowWithNamespace.xml 2008-10-22 14:09:27 UTC (rev 2585)
+++ jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testPageflowWithNamespace.xml 2008-10-22 15:12:35 UTC (rev 2586)
@@ -1,35 +0,0 @@
-<pageflow-definition name="numberGuess" xmlns="http://jboss.com/products/seam/pageflow">
-
- <i-do-not-belong-here>
- <the-parser-will-complain />
- </i-do-not-belong-here>
-
- <start-page name="displayGuess" view-id="/numberGuess.jsp">
- <redirect />
- <transition name="guess" to="evaluateGuess">
- <action expression="#{numberGuess.guess}" />
- </transition>
- </start-page>
-
- <decision name="evaluateGuess" expression="#{numberGuess.correctGuess}">
- <transition name="true" to="win" />
- <transition name="false" to="evaluateRemainingGuesses" />
- </decision>
-
- <decision name="evaluateRemainingGuesses"
- expression="#{numberGuess.lastGuess}">
- <transition name="true" to="lose" />
- <transition name="false" to="displayGuess" />
- </decision>
-
- <page name="win" view-id="/win.jsp">
- <end-conversation />
- <redirect />
- </page>
-
- <page name="lose" view-id="/lose.jsp">
- <end-conversation />
- <redirect />
- </page>
-
-</pageflow-definition>
\ No newline at end of file
Deleted: jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testPageflowWithSchemaLocation.xml
===================================================================
--- jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testPageflowWithSchemaLocation.xml 2008-10-22 14:09:27 UTC (rev 2585)
+++ jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testPageflowWithSchemaLocation.xml 2008-10-22 15:12:35 UTC (rev 2586)
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<pageflow-definition name="numberGuess"
- xsi:schemaLocation="http://jboss.com/products/seam/pageflow
- http://jboss.com/products/seam/pageflow-2.0.xsd"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://jboss.com/products/seam/pageflow">
-
- <start-page name="displayGuess" view-id="/numberGuess.jsp">
- <redirect />
- <transition name="guess" to="evaluateGuess">
- <action expression="#{numberGuess.guess}" />
- </transition>
- </start-page>
-
- <decision name="evaluateGuess" expression="#{numberGuess.correctGuess}">
- <transition name="true" to="win" />
- <transition name="false" to="evaluateRemainingGuesses" />
- </decision>
-
- <decision name="evaluateRemainingGuesses"
- expression="#{numberGuess.lastGuess}">
- <transition name="true" to="lose" />
- <transition name="false" to="displayGuess" />
- </decision>
-
- <page name="win" view-id="/win.jsp">
- <end-conversation />
- <redirect />
- </page>
-
- <page name="lose" view-id="/lose.jsp">
- <end-conversation />
- <redirect />
- </page>
-
-</pageflow-definition>
\ No newline at end of file
Deleted: jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testPageflowWithoutNamespace.xml
===================================================================
--- jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testPageflowWithoutNamespace.xml 2008-10-22 14:09:27 UTC (rev 2585)
+++ jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testPageflowWithoutNamespace.xml 2008-10-22 15:12:35 UTC (rev 2586)
@@ -1,35 +0,0 @@
-<pageflow-definition name="numberGuess">
-
- <i-do-not-belong-here>
- <the-parser-will-not-complain />
- </i-do-not-belong-here>
-
- <start-page name="displayGuess" view-id="/numberGuess.jsp">
- <redirect />
- <transition name="guess" to="evaluateGuess">
- <action expression="#{numberGuess.guess}" />
- </transition>
- </start-page>
-
- <decision name="evaluateGuess" expression="#{numberGuess.correctGuess}">
- <transition name="true" to="win" />
- <transition name="false" to="evaluateRemainingGuesses" />
- </decision>
-
- <decision name="evaluateRemainingGuesses"
- expression="#{numberGuess.lastGuess}">
- <transition name="true" to="lose" />
- <transition name="false" to="displayGuess" />
- </decision>
-
- <page name="win" view-id="/win.jsp">
- <end-conversation />
- <redirect />
- </page>
-
- <page name="lose" view-id="/lose.jsp">
- <end-conversation />
- <redirect />
- </page>
-
-</pageflow-definition>
\ No newline at end of file
17 years, 6 months
JBoss JBPM SVN: r2585 - in jbpm3/trunk: modules/core and 1 other directory.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-10-22 10:09:27 -0400 (Wed, 22 Oct 2008)
New Revision: 2585
Modified:
jbpm3/trunk/modules/core/pom.xml
jbpm3/trunk/pom.xml
Log:
[JBPM-1720] update to sl4j-1.5.5
Modified: jbpm3/trunk/modules/core/pom.xml
===================================================================
--- jbpm3/trunk/modules/core/pom.xml 2008-10-22 13:45:22 UTC (rev 2584)
+++ jbpm3/trunk/modules/core/pom.xml 2008-10-22 14:09:27 UTC (rev 2585)
@@ -79,11 +79,19 @@
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-core</artifactId>
+ <exclusions>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
<!-- Test Dependencies -->
<dependency>
@@ -96,17 +104,18 @@
<artifactId>jaxen</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
+
<!-- Remove this static dependency -->
<dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
<!-- Plugins -->
Modified: jbpm3/trunk/pom.xml
===================================================================
--- jbpm3/trunk/pom.xml 2008-10-22 13:45:22 UTC (rev 2584)
+++ jbpm3/trunk/pom.xml 2008-10-22 14:09:27 UTC (rev 2585)
@@ -75,7 +75,7 @@
<oscache.version>2.4</oscache.version>
<poi.version>3.0.2-FINAL</poi.version>
<richfaces.ui.version>3.2.1.GA</richfaces.ui.version>
- <slf4j.version>1.5.3</slf4j.version>
+ <slf4j.version>1.5.5</slf4j.version>
<sun.facelets.version>1.1.14</sun.facelets.version>
<!-- Database Driver Versions -->
@@ -319,6 +319,11 @@
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${slf4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
17 years, 6 months
JBoss JBPM SVN: r2584 - in jbpm3/trunk/modules: distribution and 1 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-10-22 09:45:22 -0400 (Wed, 22 Oct 2008)
New Revision: 2584
Modified:
jbpm3/trunk/modules/core/.classpath
jbpm3/trunk/modules/distribution/.classpath
jbpm3/trunk/modules/examples/.classpath
Log:
Update eclipse classpath
Modified: jbpm3/trunk/modules/core/.classpath
===================================================================
--- jbpm3/trunk/modules/core/.classpath 2008-10-22 13:45:12 UTC (rev 2583)
+++ jbpm3/trunk/modules/core/.classpath 2008-10-22 13:45:22 UTC (rev 2584)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
Modified: jbpm3/trunk/modules/distribution/.classpath
===================================================================
--- jbpm3/trunk/modules/distribution/.classpath 2008-10-22 13:45:12 UTC (rev 2583)
+++ jbpm3/trunk/modules/distribution/.classpath 2008-10-22 13:45:22 UTC (rev 2584)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Modified: jbpm3/trunk/modules/examples/.classpath
===================================================================
--- jbpm3/trunk/modules/examples/.classpath 2008-10-22 13:45:12 UTC (rev 2583)
+++ jbpm3/trunk/modules/examples/.classpath 2008-10-22 13:45:22 UTC (rev 2584)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/test/java"/>
- <classpathentry excluding="**" kind="src" path="src/test/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="output" path="target/test-classes"/>
+ <classpathentry kind="output" path="target/classes"/>
</classpath>
17 years, 6 months
JBoss JBPM SVN: r2583 - in jbpm3/trunk/modules/gwt-console: rpc and 2 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-10-22 09:45:12 -0400 (Wed, 22 Oct 2008)
New Revision: 2583
Modified:
jbpm3/trunk/modules/gwt-console/pom.xml
jbpm3/trunk/modules/gwt-console/rpc/pom.xml
jbpm3/trunk/modules/gwt-console/server/pom.xml
jbpm3/trunk/modules/gwt-console/war/pom.xml
Log:
Cleanup maven artifact names
Modified: jbpm3/trunk/modules/gwt-console/pom.xml
===================================================================
--- jbpm3/trunk/modules/gwt-console/pom.xml 2008-10-22 13:38:18 UTC (rev 2582)
+++ jbpm3/trunk/modules/gwt-console/pom.xml 2008-10-22 13:45:12 UTC (rev 2583)
@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<name>JBoss jBPM3 - GWT Console</name>
<groupId>org.jbpm.jbpm3</groupId>
- <artifactId>gwt-console</artifactId>
+ <artifactId>gwt-console-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
Modified: jbpm3/trunk/modules/gwt-console/rpc/pom.xml
===================================================================
--- jbpm3/trunk/modules/gwt-console/rpc/pom.xml 2008-10-22 13:38:18 UTC (rev 2582)
+++ jbpm3/trunk/modules/gwt-console/rpc/pom.xml 2008-10-22 13:45:12 UTC (rev 2583)
@@ -11,7 +11,7 @@
<!-- Parent -->
<parent>
<groupId>org.jbpm.jbpm3</groupId>
- <artifactId>gwt-console</artifactId>
+ <artifactId>gwt-console-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: jbpm3/trunk/modules/gwt-console/server/pom.xml
===================================================================
--- jbpm3/trunk/modules/gwt-console/server/pom.xml 2008-10-22 13:38:18 UTC (rev 2582)
+++ jbpm3/trunk/modules/gwt-console/server/pom.xml 2008-10-22 13:45:12 UTC (rev 2583)
@@ -6,13 +6,13 @@
<modelVersion>4.0.0</modelVersion>
<name>JBoss jBPM3 - GWT Console (Server)</name>
<groupId>org.jbpm.jbpm3</groupId>
- <artifactId>gwt-console-server-war</artifactId>
+ <artifactId>gwt-console-server</artifactId>
<packaging>war</packaging>
<!-- Parent -->
<parent>
<groupId>org.jbpm.jbpm3</groupId>
- <artifactId>gwt-console</artifactId>
+ <artifactId>gwt-console-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: jbpm3/trunk/modules/gwt-console/war/pom.xml
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/pom.xml 2008-10-22 13:38:18 UTC (rev 2582)
+++ jbpm3/trunk/modules/gwt-console/war/pom.xml 2008-10-22 13:45:12 UTC (rev 2583)
@@ -3,13 +3,13 @@
<modelVersion>4.0.0</modelVersion>
<name>JBoss jBPM3 - GWT Console (WAR)</name>
<groupId>org.jbpm.jbpm3</groupId>
- <artifactId>gwt-console-war</artifactId>
+ <artifactId>gwt-console</artifactId>
<packaging>war</packaging>
<!-- Parent -->
<parent>
<groupId>org.jbpm.jbpm3</groupId>
- <artifactId>gwt-console</artifactId>
+ <artifactId>gwt-console-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
17 years, 6 months
JBoss JBPM SVN: r2582 - in jbpm3/trunk/modules/gwt-console: rpc and 2 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-10-22 09:38:18 -0400 (Wed, 22 Oct 2008)
New Revision: 2582
Modified:
jbpm3/trunk/modules/gwt-console/pom.xml
jbpm3/trunk/modules/gwt-console/rpc/pom.xml
jbpm3/trunk/modules/gwt-console/server/pom.xml
jbpm3/trunk/modules/gwt-console/war/pom.xml
Log:
Clean up dependencies and set version to 1.0.0-SNAPSHOT
Modified: jbpm3/trunk/modules/gwt-console/pom.xml
===================================================================
--- jbpm3/trunk/modules/gwt-console/pom.xml 2008-10-22 13:25:54 UTC (rev 2581)
+++ jbpm3/trunk/modules/gwt-console/pom.xml 2008-10-22 13:38:18 UTC (rev 2582)
@@ -4,6 +4,7 @@
<name>JBoss jBPM3 - GWT Console</name>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>gwt-console</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<!-- Parent -->
@@ -23,6 +24,7 @@
<gson.version>1.2.2</gson.version>
<commons.fileupload.version>1.2.1</commons.fileupload.version>
<commons.io.version>1.3.2</commons.io.version>
+ <jbpm.version>3.3.0-SNAPSHOT</jbpm.version>
</properties>
<modules>
@@ -33,7 +35,23 @@
<dependencyManagement>
<dependencies>
+
+ <!-- JBPM -->
<dependency>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>jbpm-core</artifactId>
+ <scope>provided</scope>
+ <version>${jbpm.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>jbpm-enterprise-beans</artifactId>
+ <scope>provided</scope>
+ <version>${jbpm.version}</version>
+ </dependency>
+
+ <!-- GET related -->
+ <dependency>
<groupId>com.gwtext</groupId>
<artifactId>gwtext</artifactId>
<version>${gwtext.version}</version>
@@ -44,6 +62,13 @@
<version>${gchart.version}</version>
</dependency>
<dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>${gson.version}</version>
+ </dependency>
+
+ <!-- Other -->
+ <dependency>
<groupId>javax.xml.stream</groupId>
<artifactId>stax-api</artifactId>
<version>${stax-api.version}</version>
@@ -58,12 +83,8 @@
<artifactId>resteasy-jaxrs</artifactId>
<version>${resteasy.version}</version>
</dependency>
+
<dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>${gson.version}</version>
- </dependency>
- <dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${commons.fileupload.version}</version>
@@ -73,6 +94,7 @@
<artifactId>commons-io</artifactId>
<version>${commons.io.version}</version>
</dependency>
+
</dependencies>
</dependencyManagement>
</project>
Modified: jbpm3/trunk/modules/gwt-console/rpc/pom.xml
===================================================================
--- jbpm3/trunk/modules/gwt-console/rpc/pom.xml 2008-10-22 13:25:54 UTC (rev 2581)
+++ jbpm3/trunk/modules/gwt-console/rpc/pom.xml 2008-10-22 13:38:18 UTC (rev 2582)
@@ -12,7 +12,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>gwt-console</artifactId>
- <version>3.3.0-SNAPSHOT</version>
+ <version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: jbpm3/trunk/modules/gwt-console/server/pom.xml
===================================================================
--- jbpm3/trunk/modules/gwt-console/server/pom.xml 2008-10-22 13:25:54 UTC (rev 2581)
+++ jbpm3/trunk/modules/gwt-console/server/pom.xml 2008-10-22 13:38:18 UTC (rev 2582)
@@ -6,53 +6,57 @@
<modelVersion>4.0.0</modelVersion>
<name>JBoss jBPM3 - GWT Console (Server)</name>
<groupId>org.jbpm.jbpm3</groupId>
- <artifactId>gwt-console-server-war</artifactId>
+ <artifactId>gwt-console-server-war</artifactId>
<packaging>war</packaging>
<!-- Parent -->
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>gwt-console</artifactId>
- <version>3.3.0-SNAPSHOT</version>
+ <version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<dependencies>
+
+ <!-- Module -->
<dependency>
- <groupId>javax.ejb</groupId>
- <artifactId>ejb-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>org.jbpm.jbpm3</groupId>
- <artifactId>jbpm-enterprise-beans</artifactId>
- <scope>provided</scope>
+ <artifactId>gwt-console-rpc</artifactId>
<version>${version}</version>
</dependency>
+
+ <!-- JBPM -->
<dependency>
<groupId>org.jbpm.jbpm3</groupId>
- <artifactId>gwt-console-rpc</artifactId>
- <version>${version}</version>
+ <artifactId>jbpm-enterprise-beans</artifactId>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm-core</artifactId>
- <scope>provided</scope>
- <version>${version}</version>
+ <scope>provided</scope>
</dependency>
+
+ <!-- GWT related -->
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
- <version>${gwt.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
- <artifactId>gwt-user</artifactId>
- <version>${gwt.version}</version>
+ <artifactId>gwt-user</artifactId>
<scope>provided</scope>
</dependency>
+
+ <!-- Other -->
<dependency>
+ <groupId>javax.ejb</groupId>
+ <artifactId>ejb-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
</dependency>
@@ -66,8 +70,7 @@
</dependency>
<dependency>
<groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>${commons.io.version}</version>
+ <artifactId>commons-io</artifactId>
</dependency>
</dependencies>
Modified: jbpm3/trunk/modules/gwt-console/war/pom.xml
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/pom.xml 2008-10-22 13:25:54 UTC (rev 2581)
+++ jbpm3/trunk/modules/gwt-console/war/pom.xml 2008-10-22 13:38:18 UTC (rev 2582)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>gwt-console</artifactId>
- <version>3.3.0-SNAPSHOT</version>
+ <version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
17 years, 6 months
JBoss JBPM SVN: r2581 - in jbpm3/trunk/modules/core/src: test/java/org/jbpm/jpdl/par and 1 other directory.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-10-22 09:25:54 -0400 (Wed, 22 Oct 2008)
New Revision: 2581
Added:
jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessClassLoaderTest.java
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/instantiation/Delegation.java
Log:
[JBPM-1448] Added a context classloader test
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/instantiation/Delegation.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/instantiation/Delegation.java 2008-10-22 13:08:30 UTC (rev 2580)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/instantiation/Delegation.java 2008-10-22 13:25:54 UTC (rev 2581)
@@ -133,7 +133,7 @@
Object newInstance = null;
// find the classloader to use
- ClassLoader classLoader = JbpmConfiguration.getProcessClassLoader(processDefinition);
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
// load the class that needs to be instantiated
Class clazz = null;
Added: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessClassLoaderTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessClassLoaderTest.java (rev 0)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessClassLoaderTest.java 2008-10-22 13:25:54 UTC (rev 2581)
@@ -0,0 +1,98 @@
+package org.jbpm.jpdl.par;
+
+import org.jbpm.AbstractJbpmTestCase;
+import org.jbpm.JbpmConfiguration;
+import org.jbpm.JbpmContext;
+import org.jbpm.graph.def.ActionHandler;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ExecutionContext;
+import org.jbpm.graph.exe.ProcessInstance;
+import org.jbpm.instantiation.ProcessClassLoader;
+
+
+public class ProcessClassLoaderTest extends AbstractJbpmTestCase {
+
+ public static class TestContextClassLoader extends ClassLoader {
+ public TestContextClassLoader(ClassLoader parent) {
+ super(parent);
+ }
+ protected Class< ? > findClass(String name) throws ClassNotFoundException {
+ if ("TestContextClassLoader-knows-where-to-find-ContextLoadedAction".equals(name)) {
+ return getParent().loadClass(ContextLoadedAction.class.getName());
+ }
+ return null;
+ }
+ }
+
+ public static class ContextLoadedAction implements ActionHandler {
+ public void execute(ExecutionContext executionContext) throws Exception {
+ ClassLoader processClassLoader = Thread.currentThread().getContextClassLoader();
+ assertSame(ProcessClassLoader.class, processClassLoader.getClass());
+ ClassLoader testContextClassLoader = processClassLoader.getParent();
+ assertSame(TestContextClassLoader.class, testContextClassLoader.getClass());
+
+ assertSame(originalClassLoader, testContextClassLoader.getParent());
+
+ contextLoadedActionInvocations++;
+ }
+ }
+
+ static int contextLoadedActionInvocations = 0;
+ static ClassLoader originalClassLoader = null;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ contextLoadedActionInvocations = 0;
+ originalClassLoader = Thread.currentThread().getContextClassLoader();
+ }
+
+ public void testContextClassLoader() {
+ JbpmConfiguration jbpmConfiguration = JbpmConfiguration.parseXmlString(
+ "<jbpm-configuration>" +
+ " <string name='jbpm.classLoader' value='context' />" +
+ "</jbpm-configuration>"
+ );
+
+ JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
+ try {
+ TestContextClassLoader testContextClassLoader = new TestContextClassLoader(originalClassLoader);
+ Thread.currentThread().setContextClassLoader(testContextClassLoader);
+
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
+ "<process-definition>" +
+ " <start-state name='start'>" +
+ " <transition to='state'>" +
+ " <action class='TestContextClassLoader-knows-where-to-find-ContextLoadedAction' />" +
+ " </transition>" +
+ " </start-state>" +
+ " <state name='state'>" +
+ " <transition to='end'/>" +
+ " </state>" +
+ " <end-state name='end'/>" +
+ "</process-definition>"
+ );
+
+ // create the process instance
+ ProcessInstance processInstance = new ProcessInstance(processDefinition);
+ processInstance.signal();
+
+ assertEquals(1, contextLoadedActionInvocations);
+ assertSame(testContextClassLoader, Thread.currentThread().getContextClassLoader());
+
+ } finally {
+ Thread.currentThread().setContextClassLoader(originalClassLoader);
+ jbpmContext.close();
+ }
+ }
+
+ // TODO a second test should use the default configuration and verify the
+ // classloader hierarchy inside of the action. The action class should
+ // be referenced properly. No test context classloader should be installed.
+ // The hierarchy in the action should be:
+ // ProcessClassLoader ---> ClassLoader.getSystemClassLoader()
+
+ // TODO a third test should set the testcontextClassLoader in the test and then
+ // let the action throw an exception. Then it should be verified that the
+ // original classloader is still restored correctly. Easiest is to start
+ // from a copy of the testContextClassLoader
+}
17 years, 6 months