JBoss JBPM SVN: r3769 - in jbpm4/trunk/hudson: hudson-home and 1 other directory.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-02-04 06:19:31 -0500 (Wed, 04 Feb 2009)
New Revision: 3769
Modified:
jbpm4/trunk/hudson/hudson-home/command.sh
jbpm4/trunk/hudson/jbpm4-base.sh
jbpm4/trunk/hudson/jbpm4-load.sh
Log:
module 'distro' opposed to 'distribution'
Modified: jbpm4/trunk/hudson/hudson-home/command.sh
===================================================================
--- jbpm4/trunk/hudson/hudson-home/command.sh 2009-02-04 08:40:26 UTC (rev 3768)
+++ jbpm4/trunk/hudson/hudson-home/command.sh 2009-02-04 11:19:31 UTC (rev 3769)
@@ -7,7 +7,7 @@
WORKSPACE=`pwd`
JBPMDIR=$WORKSPACE/jbpm4
-DISTRODIR=$JBPMDIR/modules/distribution/target
+DISTRODIR=$JBPMDIR/modules/distro/target
case "$CONTAINER" in
jboss422*)
Modified: jbpm4/trunk/hudson/jbpm4-base.sh
===================================================================
--- jbpm4/trunk/hudson/jbpm4-base.sh 2009-02-04 08:40:26 UTC (rev 3768)
+++ jbpm4/trunk/hudson/jbpm4-base.sh 2009-02-04 11:19:31 UTC (rev 3769)
@@ -7,7 +7,7 @@
WORKSPACE=`pwd`
JBPMDIR=$WORKSPACE/jbpm4
-DISTRODIR=$JBPMDIR/modules/distribution/target
+DISTRODIR=$JBPMDIR/modules/distro/target
#
# default environment settings
Modified: jbpm4/trunk/hudson/jbpm4-load.sh
===================================================================
--- jbpm4/trunk/hudson/jbpm4-load.sh 2009-02-04 08:40:26 UTC (rev 3768)
+++ jbpm4/trunk/hudson/jbpm4-load.sh 2009-02-04 11:19:31 UTC (rev 3769)
@@ -7,7 +7,7 @@
WORKSPACE=`pwd`
JBPMDIR=$WORKSPACE/jbpm4
-DISTRODIR=$JBPMDIR/modules/distribution/target
+DISTRODIR=$JBPMDIR/modules/distro/target
#
# default environment settings
15 years, 3 months
JBoss JBPM SVN: r3768 - jbpm4/trunk/modules/test-db.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-02-04 03:40:26 -0500 (Wed, 04 Feb 2009)
New Revision: 3768
Modified:
jbpm4/trunk/modules/test-db/pom.xml
Log:
added explanation on surefire configuration in pom
Modified: jbpm4/trunk/modules/test-db/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-db/pom.xml 2009-02-04 07:56:30 UTC (rev 3767)
+++ jbpm4/trunk/modules/test-db/pom.xml 2009-02-04 08:40:26 UTC (rev 3768)
@@ -46,9 +46,15 @@
<!-- Plugins -->
<build>
<plugins>
- <plugin> <!--TODO: What's this??-->
+ <plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
+ <!-- this tells surefire that the test classes are
+ to be found in the src directory src/main/java.
+ The test classes are in the source directory to make
+ a distinction between the compile time classpath and the
+ runtime test classpath. The compile time classpath only should
+ have the api module in its dependencies. -->
<testSourceDirectory>src/main/java</testSourceDirectory>
<classesDirectory>target/classes</classesDirectory>
<testClassesDirectory>target/classes</testClassesDirectory>
15 years, 3 months
JBoss JBPM SVN: r3766 - projects/docbook-style.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-02-04 02:54:39 -0500 (Wed, 04 Feb 2009)
New Revision: 3766
Modified:
projects/docbook-style/.project
Log:
changed eclipse project name
Modified: projects/docbook-style/.project
===================================================================
--- projects/docbook-style/.project 2009-02-04 07:51:17 UTC (rev 3765)
+++ projects/docbook-style/.project 2009-02-04 07:54:39 UTC (rev 3766)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>docbook-style</name>
+ <name>_docbook-style</name>
<comment></comment>
<projects>
</projects>
15 years, 3 months
JBoss JBPM SVN: r3765 - jbpm4/trunk/modules/log.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-02-04 02:51:17 -0500 (Wed, 04 Feb 2009)
New Revision: 3765
Modified:
jbpm4/trunk/modules/log/
Log:
added target to svnignore
Property changes on: jbpm4/trunk/modules/log
___________________________________________________________________
Name: svn:ignore
- *.iml
+ *.iml
target
15 years, 3 months
JBoss JBPM SVN: r3764 - jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-02-04 02:38:51 -0500 (Wed, 04 Feb 2009)
New Revision: 3764
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityBehaviour.java
Log:
improved javadocs
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityBehaviour.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityBehaviour.java 2009-02-04 07:36:48 UTC (rev 3763)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityBehaviour.java 2009-02-04 07:38:51 UTC (rev 3764)
@@ -34,9 +34,7 @@
* or as a hidden listener to process events.
*
* <p>ActivityBehaviour's can be used to implement the behaviour of activities, in
- * which case this behaviour is associated to a graphical activity in the diagram,
- * or they can be added as events, in that case, they are being hidden from
- * the diagram.
+ * which case this behaviour is associated to a graphical activity in the diagram.
* </p>
*
* <p>An ActivityBehaviour can control the propagation
15 years, 3 months
JBoss JBPM SVN: r3763 - jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-02-04 02:36:48 -0500 (Wed, 04 Feb 2009)
New Revision: 3763
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityBehaviour.java
Log:
improved javadocs
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityBehaviour.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityBehaviour.java 2009-02-04 07:36:06 UTC (rev 3762)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityBehaviour.java 2009-02-04 07:36:48 UTC (rev 3763)
@@ -33,15 +33,16 @@
/** piece of Java code that is to be included in a process as activity behaviour
* or as a hidden listener to process events.
*
- * <p>Activities can be used to implement the behaviour of activities, in
+ * <p>ActivityBehaviour's can be used to implement the behaviour of activities, in
* which case this behaviour is associated to a graphical activity in the diagram,
* or they can be added as events, in that case, they are being hidden from
* the diagram.
* </p>
*
- * <p>If an activity is the activity behaviour, then it can control the propagation
- * of execution. Activity behaviours can be external activities. That means their
- * runtime behaviour is a wait state. In that case, {@link ExternalActivityBehaviour}
+ * <p>An ActivityBehaviour can control the propagation
+ * of execution. ActivityBehaviour's can become external activities when they
+ * invoke {@link ActivityExecution#waitForSignal()}. That means the
+ * activity will become a wait state. In that case, {@link ExternalActivityBehaviour}
* should be implemented to also handle the external triggers.
* </p>
*/
15 years, 3 months
JBoss JBPM SVN: r3762 - in jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise: jms and 1 other directory.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-02-04 02:36:06 -0500 (Wed, 04 Feb 2009)
New Revision: 3762
Modified:
jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/AbstractEnterpriseTestCase.java
jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jms/JmsMessageTest.java
Log:
skip process deletion under sybase, seems to cause particular trouble there
Modified: jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/AbstractEnterpriseTestCase.java
===================================================================
--- jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/AbstractEnterpriseTestCase.java 2009-02-04 00:28:27 UTC (rev 3761)
+++ jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/AbstractEnterpriseTestCase.java 2009-02-04 07:36:06 UTC (rev 3762)
@@ -28,14 +28,18 @@
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.Destination;
+import javax.jms.JMSException;
import javax.jms.Session;
import javax.naming.Context;
import javax.naming.InitialContext;
+import javax.naming.NamingException;
import org.apache.cactus.ServletTestCase;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.hibernate.cfg.Environment;
import org.jbpm.EventCallback;
+import org.jbpm.JbpmContext;
import org.jbpm.command.Command;
import org.jbpm.command.CommandService;
import org.jbpm.command.DeleteProcessDefinitionCommand;
@@ -46,14 +50,20 @@
import org.jbpm.ejb.LocalCommandServiceHome;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;
+import org.jbpm.persistence.db.DbPersistenceServiceFactory;
+import org.jbpm.svc.Services;
public abstract class AbstractEnterpriseTestCase extends ServletTestCase {
protected CommandService commandService;
- private static LocalCommandServiceHome commandServiceHome;
private List<ProcessDefinition> processDefinitions = new ArrayList<ProcessDefinition>();
+ private static Context environment;
+ private static LocalCommandServiceHome commandServiceHome;
+ private static Destination commandQueue;
+ private static ConnectionFactory jmsConnectionFactory;
+
private static final Log log = LogFactory.getLog(AbstractEnterpriseTestCase.class);
protected AbstractEnterpriseTestCase() {
@@ -75,13 +85,7 @@
protected CommandService createCommandService() throws Exception {
if (commandServiceHome == null) {
- Context initialContext = new InitialContext();
- try {
- commandServiceHome = (LocalCommandServiceHome) initialContext.lookup("java:comp/env/ejb/CommandServiceBean");
- }
- finally {
- initialContext.close();
- }
+ commandServiceHome = lookup("ejb/CommandServiceBean", LocalCommandServiceHome.class);
}
return commandServiceHome.create();
}
@@ -117,26 +121,64 @@
return processInstance.hasEnded();
}
+ protected String getHibernateDialect() {
+ return (String) commandService.execute(new Command() {
+ private static final long serialVersionUID = 1L;
+
+ public Object execute(JbpmContext jbpmContext) throws Exception {
+ DbPersistenceServiceFactory factory = (DbPersistenceServiceFactory) jbpmContext.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
+ return factory.getConfiguration().getProperty(Environment.DIALECT);
+ }
+ });
+ }
+
private void deleteProcessDefinition(long processDefinitionId) throws Exception {
+ // deleting process definition seems to cause problems in sybase
+ if (getHibernateDialect().contains("Sybase")) {
+ return;
+ }
+
Command command = new DeleteProcessDefinitionCommand(processDefinitionId);
- // CleanUpProcessJob races against DeleteProcessDefinitionCommand
- // JMS has built-in retry logic
- Context initial = new InitialContext();
+
+ Connection jmsConnection = createJmsConnection();
try {
- ConnectionFactory jmsConnectionfactory = (ConnectionFactory) initial.lookup("java:comp/env/jms/JbpmConnectionFactory");
- Destination commandQueue = (Destination) initial.lookup("java:comp/env/jms/CommandQueue");
+ Session jmsSession = jmsConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ jmsSession.createProducer(getCommandQueue()).send(jmsSession.createObjectMessage(command));
+ }
+ finally {
+ jmsConnection.close();
+ }
+ }
- Connection jmsConnection = jmsConnectionfactory.createConnection();
+ private Destination getCommandQueue() throws NamingException {
+ if (commandQueue == null) {
+ commandQueue = lookup("jms/CommandQueue", Destination.class);
+ }
+ return commandQueue;
+ }
+
+ private Connection createJmsConnection() throws NamingException, JMSException {
+ if (jmsConnectionFactory == null) {
+ jmsConnectionFactory = lookup("jms/JbpmConnectionFactory", ConnectionFactory.class);
+ }
+ return jmsConnectionFactory.createConnection();
+ }
+
+ private static <T> T lookup(String name, Class<T> type) throws NamingException {
+ return type.cast(getEnvironment().lookup(name));
+ }
+
+ private static Context getEnvironment() throws NamingException {
+ if (environment == null) {
+ Context initial = new InitialContext();
try {
- Session jmsSession = jmsConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- jmsSession.createProducer(commandQueue).send(jmsSession.createObjectMessage(command));
+ environment = (Context) initial.lookup("java:comp/env");
}
finally {
- jmsConnection.close();
+ initial.close();
}
}
- finally {
- initial.close();
- }
+ return environment;
}
+
}
\ No newline at end of file
Modified: jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jms/JmsMessageTest.java
===================================================================
--- jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jms/JmsMessageTest.java 2009-02-04 00:28:27 UTC (rev 3761)
+++ jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jms/JmsMessageTest.java 2009-02-04 07:36:06 UTC (rev 3762)
@@ -23,16 +23,11 @@
import junit.framework.Test;
-import org.hibernate.cfg.Environment;
import org.jboss.bpm.api.test.IntegrationTestSetup;
import org.jbpm.EventCallback;
-import org.jbpm.JbpmContext;
-import org.jbpm.command.Command;
import org.jbpm.enterprise.AbstractEnterpriseTestCase;
import org.jbpm.graph.def.Event;
import org.jbpm.msg.jms.JmsMessageService;
-import org.jbpm.persistence.db.DbPersistenceServiceFactory;
-import org.jbpm.svc.Services;
/**
* Exercises for the {@linkplain JmsMessageService JMS message service}.
@@ -129,7 +124,7 @@
public void testAsyncFork() throws Exception {
// [JBPM-1811] JmsMessageTest fails intermittently on HSQLDB
- if (getHibernateDialect().indexOf("HSQL") != -1) {
+ if (getHibernateDialect().contains("HSQL")) {
return;
}
@@ -221,17 +216,6 @@
}
}
- private String getHibernateDialect() {
- return (String) commandService.execute(new Command() {
- private static final long serialVersionUID = 1L;
-
- public Object execute(JbpmContext jbpmContext) throws Exception {
- DbPersistenceServiceFactory factory = (DbPersistenceServiceFactory) jbpmContext.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
- return factory.getConfiguration().getProperty(Environment.DIALECT);
- }
- });
- }
-
private boolean waitForProcessInstanceEnd(long processInstanceId) {
long startTime = System.currentTimeMillis();
do {
15 years, 3 months
JBoss JBPM SVN: r3761 - in jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise: ejbtimer and 3 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-02-03 19:28:27 -0500 (Tue, 03 Feb 2009)
New Revision: 3761
Added:
jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/AbstractEnterpriseTestCase.java
Modified:
jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/ejbtimer/EjbSchedulerTest.java
jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jbpm1903/JBPM1903Test.java
jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jms/JmsMessageTest.java
jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jta/JtaDbPersistenceTest.java
Log:
extract common enterprise test bits into AbstractEnterpriseTestCase
Added: jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/AbstractEnterpriseTestCase.java
===================================================================
--- jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/AbstractEnterpriseTestCase.java (rev 0)
+++ jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/AbstractEnterpriseTestCase.java 2009-02-04 00:28:27 UTC (rev 3761)
@@ -0,0 +1,142 @@
+/*
+ * 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.enterprise;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.Session;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+import org.apache.cactus.ServletTestCase;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jbpm.EventCallback;
+import org.jbpm.command.Command;
+import org.jbpm.command.CommandService;
+import org.jbpm.command.DeleteProcessDefinitionCommand;
+import org.jbpm.command.DeployProcessCommand;
+import org.jbpm.command.GetProcessInstanceCommand;
+import org.jbpm.command.SignalCommand;
+import org.jbpm.command.StartProcessInstanceCommand;
+import org.jbpm.ejb.LocalCommandServiceHome;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ProcessInstance;
+
+public abstract class AbstractEnterpriseTestCase extends ServletTestCase {
+
+ protected CommandService commandService;
+
+ private static LocalCommandServiceHome commandServiceHome;
+ private List<ProcessDefinition> processDefinitions = new ArrayList<ProcessDefinition>();
+
+ private static final Log log = LogFactory.getLog(AbstractEnterpriseTestCase.class);
+
+ protected AbstractEnterpriseTestCase() {
+ }
+
+ protected void setUp() throws Exception {
+ commandService = createCommandService();
+ log.info("### " + getName() + " started ###");
+ }
+
+ protected void tearDown() throws Exception {
+ log.info("### " + getName() + " done ###");
+ for (ProcessDefinition processDefinition : processDefinitions) {
+ deleteProcessDefinition(processDefinition.getId());
+ }
+ commandService = null;
+ EventCallback.clear();
+ }
+
+ protected CommandService createCommandService() throws Exception {
+ if (commandServiceHome == null) {
+ Context initialContext = new InitialContext();
+ try {
+ commandServiceHome = (LocalCommandServiceHome) initialContext.lookup("java:comp/env/ejb/CommandServiceBean");
+ }
+ finally {
+ initialContext.close();
+ }
+ }
+ return commandServiceHome.create();
+ }
+
+ protected ProcessDefinition deployProcessDefinition(String xml) {
+ ProcessDefinition processDefinition = (ProcessDefinition) commandService.execute(new DeployProcessCommand(
+ xml));
+ processDefinitions.add(processDefinition);
+ return processDefinition;
+ }
+
+ protected ProcessDefinition deployProcessDefinition(byte[] processArchive) {
+ ProcessDefinition processDefinition = (ProcessDefinition) commandService.execute(new DeployProcessCommand(
+ processArchive));
+ processDefinitions.add(processDefinition);
+ return processDefinition;
+ }
+
+ protected ProcessInstance startProcessInstance(String processName) {
+ StartProcessInstanceCommand command = new StartProcessInstanceCommand();
+ command.setProcessDefinitionName(processName);
+ command.setVariables(Collections.singletonMap("eventCallback", new EventCallback()));
+ return (ProcessInstance) commandService.execute(command);
+ }
+
+ protected void signalToken(long tokenId) {
+ commandService.execute(new SignalCommand(tokenId, null));
+ }
+
+ protected boolean hasProcessInstanceEnded(final long processInstanceId) {
+ ProcessInstance processInstance = (ProcessInstance) commandService.execute(new GetProcessInstanceCommand(
+ processInstanceId));
+ return processInstance.hasEnded();
+ }
+
+ private void deleteProcessDefinition(long processDefinitionId) throws Exception {
+ Command command = new DeleteProcessDefinitionCommand(processDefinitionId);
+ // CleanUpProcessJob races against DeleteProcessDefinitionCommand
+ // JMS has built-in retry logic
+ Context initial = new InitialContext();
+ try {
+ ConnectionFactory jmsConnectionfactory = (ConnectionFactory) initial.lookup("java:comp/env/jms/JbpmConnectionFactory");
+ Destination commandQueue = (Destination) initial.lookup("java:comp/env/jms/CommandQueue");
+
+ Connection jmsConnection = jmsConnectionfactory.createConnection();
+ try {
+ Session jmsSession = jmsConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ jmsSession.createProducer(commandQueue).send(jmsSession.createObjectMessage(command));
+ }
+ finally {
+ jmsConnection.close();
+ }
+ }
+ finally {
+ initial.close();
+ }
+ }
+}
\ No newline at end of file
Modified: jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/ejbtimer/EjbSchedulerTest.java
===================================================================
--- jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/ejbtimer/EjbSchedulerTest.java 2009-02-03 23:45:28 UTC (rev 3760)
+++ jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/ejbtimer/EjbSchedulerTest.java 2009-02-04 00:28:27 UTC (rev 3761)
@@ -22,28 +22,15 @@
package org.jbpm.enterprise.ejbtimer;
import java.rmi.RemoteException;
-import java.util.Collections;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-
import junit.framework.Test;
-import org.apache.cactus.ServletTestCase;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.jboss.bpm.api.test.IntegrationTestSetup;
import org.jbpm.EventCallback;
import org.jbpm.JbpmContext;
-import org.jboss.bpm.api.test.IntegrationTestSetup;
import org.jbpm.command.Command;
-import org.jbpm.command.DeployProcessCommand;
-import org.jbpm.command.GetProcessInstanceCommand;
-import org.jbpm.command.SignalCommand;
-import org.jbpm.command.StartProcessInstanceCommand;
-import org.jbpm.ejb.LocalCommandService;
-import org.jbpm.ejb.LocalCommandServiceHome;
+import org.jbpm.enterprise.AbstractEnterpriseTestCase;
import org.jbpm.graph.def.Event;
-import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.graph.exe.Token;
import org.jbpm.scheduler.ejbtimer.EntitySchedulerService;
@@ -53,36 +40,12 @@
*
* @author Alejandro Guizar
*/
-public class EjbSchedulerTest extends ServletTestCase {
+public class EjbSchedulerTest extends AbstractEnterpriseTestCase {
- private LocalCommandService commandService;
- private static LocalCommandServiceHome commandServiceHome;
-
- private static final Log log = LogFactory.getLog(EjbSchedulerTest.class);
-
public static Test suite() throws Exception {
return new IntegrationTestSetup(EjbSchedulerTest.class, "enterprise-test.war");
}
- protected void setUp() throws Exception {
- if (commandServiceHome == null) {
- Context initialContext = new InitialContext();
- try {
- commandServiceHome = (LocalCommandServiceHome) initialContext.lookup("java:comp/env/ejb/CommandServiceBean");
- }
- finally {
- initialContext.close();
- }
- }
- commandService = commandServiceHome.create();
- log.info("### " + getName() + " started ###");
- }
-
- protected void tearDown() throws Exception {
- log.info("### " + getName() + " done ###");
- commandService = null;
- }
-
public void testScheduleFuture() throws Exception {
deployProcessDefinition("<process-definition name='future'>"
+ " <event type='process-end'>"
@@ -270,21 +233,6 @@
hasProcessInstanceEnded(processInstanceId));
}
- private ProcessDefinition deployProcessDefinition(String xml) throws RemoteException {
- return (ProcessDefinition) commandService.execute(new DeployProcessCommand(xml));
- }
-
- private ProcessInstance startProcessInstance(String processName) throws RemoteException {
- StartProcessInstanceCommand command = new StartProcessInstanceCommand();
- command.setProcessDefinitionName(processName);
- command.setVariables(Collections.singletonMap("eventCallback", new EventCallback()));
- return (ProcessInstance) commandService.execute(command);
- }
-
- private void signalToken(long tokenId) {
- commandService.execute(new SignalCommand(tokenId, null));
- }
-
private String getProcessInstanceState(final long processInstanceId) throws RemoteException {
return (String) commandService.execute(new Command() {
private static final long serialVersionUID = 1L;
@@ -298,12 +246,6 @@
});
}
- private boolean hasProcessInstanceEnded(final long processInstanceId) throws RemoteException {
- ProcessInstance processInstance = (ProcessInstance) commandService.execute(new GetProcessInstanceCommand(
- processInstanceId));
- return processInstance.hasEnded();
- }
-
private void cancelTimer(final String timerName, final long tokenId) throws RemoteException {
commandService.execute(new Command() {
private static final long serialVersionUID = 1L;
Modified: jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jbpm1903/JBPM1903Test.java
===================================================================
--- jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jbpm1903/JBPM1903Test.java 2009-02-03 23:45:28 UTC (rev 3760)
+++ jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jbpm1903/JBPM1903Test.java 2009-02-04 00:28:27 UTC (rev 3761)
@@ -29,59 +29,29 @@
import javax.jms.JMSException;
import javax.jms.Queue;
-import javax.naming.Context;
-import javax.naming.InitialContext;
import junit.framework.Test;
-import org.apache.cactus.ServletTestCase;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.api.test.IntegrationTestSetup;
import org.jbpm.JbpmContext;
import org.jbpm.command.Command;
-import org.jbpm.command.DeployProcessCommand;
-import org.jbpm.command.StartProcessInstanceCommand;
-import org.jbpm.ejb.LocalCommandService;
-import org.jbpm.ejb.LocalCommandServiceHome;
+import org.jbpm.enterprise.AbstractEnterpriseTestCase;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.util.IoUtil;
/**
+ * ENC is not reachable from within action handlers.
+ *
+ * https://jira.jboss.org/jira/browse/JBPM-1903
+ *
* @author Alejandro Guizar
*/
-public class JBPM1903Test extends ServletTestCase {
+public class JBPM1903Test extends AbstractEnterpriseTestCase {
- private LocalCommandService commandService;
- private static LocalCommandServiceHome commandServiceHome;
-
- private static final Log log = LogFactory.getLog(JBPM1903Test.class);
-
public static Test suite() throws Exception {
return new IntegrationTestSetup(JBPM1903Test.class, "enterprise-test.war");
}
- @Override
- protected void setUp() throws Exception {
- if (commandServiceHome == null) {
- Context initialContext = new InitialContext();
- try {
- commandServiceHome = (LocalCommandServiceHome) initialContext.lookup("java:comp/env/ejb/CommandServiceBean");
- }
- finally {
- initialContext.close();
- }
- }
- commandService = commandServiceHome.create();
- log.info("### " + getName() + " started ###");
- }
-
- @Override
- protected void tearDown() throws Exception {
- log.info("### " + getName() + " done ###");
- commandService = null;
- }
-
public void testENCInActionHandler() throws IOException, JMSException {
byte[] processArchive = createProcessArchive();
deployProcessDefinition(processArchive);
@@ -108,14 +78,6 @@
return memoryOut.toByteArray();
}
- private void deployProcessDefinition(byte[] processArchive) {
- commandService.execute(new DeployProcessCommand(processArchive));
- }
-
- private ProcessInstance startProcessInstance(String processName) {
- return (ProcessInstance) commandService.execute(new StartProcessInstanceCommand().processDefinitionName(processName));
- }
-
private Object getVariable(final long processInstanceId, final String variableName) {
return commandService.execute(new Command() {
private static final long serialVersionUID = 1L;
Modified: jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jms/JmsMessageTest.java
===================================================================
--- jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jms/JmsMessageTest.java 2009-02-03 23:45:28 UTC (rev 3760)
+++ jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jms/JmsMessageTest.java 2009-02-04 00:28:27 UTC (rev 3761)
@@ -21,29 +21,15 @@
*/
package org.jbpm.enterprise.jms;
-import java.util.Collections;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-
import junit.framework.Test;
-import org.apache.cactus.ServletTestCase;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.hibernate.cfg.Environment;
import org.jboss.bpm.api.test.IntegrationTestSetup;
import org.jbpm.EventCallback;
import org.jbpm.JbpmContext;
import org.jbpm.command.Command;
-import org.jbpm.command.DeployProcessCommand;
-import org.jbpm.command.GetProcessInstanceCommand;
-import org.jbpm.command.StartProcessInstanceCommand;
-import org.jbpm.ejb.LocalCommandService;
-import org.jbpm.ejb.LocalCommandServiceHome;
+import org.jbpm.enterprise.AbstractEnterpriseTestCase;
import org.jbpm.graph.def.Event;
-import org.jbpm.graph.def.ProcessDefinition;
-import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.msg.jms.JmsMessageService;
import org.jbpm.persistence.db.DbPersistenceServiceFactory;
import org.jbpm.svc.Services;
@@ -53,40 +39,15 @@
*
* @author Alejandro Guizar
*/
-public class JmsMessageTest extends ServletTestCase {
+public class JmsMessageTest extends AbstractEnterpriseTestCase {
- private LocalCommandService commandService;
- private static LocalCommandServiceHome commandServiceHome;
-
- private static final int processExecutionCount = 5;
private static final int maxWaitTime = 10 * 1000;
+ private static final int processExecutionCount = 5;
- private static final Log log = LogFactory.getLog(JmsMessageTest.class);
-
public static Test suite() throws Exception {
return new IntegrationTestSetup(JmsMessageTest.class, "enterprise-test.war");
}
- protected void setUp() throws Exception {
- if (commandServiceHome == null) {
- Context initialContext = new InitialContext();
- try {
- commandServiceHome = (LocalCommandServiceHome) initialContext.lookup("java:comp/env/ejb/CommandServiceBean");
- }
- finally {
- initialContext.close();
- }
- }
- commandService = commandServiceHome.create();
- log.info("### " + getName() + " started ###");
- }
-
- protected void tearDown() throws Exception {
- log.info("### " + getName() + " done ###");
- commandService = null;
- EventCallback.clear();
- }
-
public void testAsyncNode() {
deployProcessDefinition("<process-definition name='node'>"
+ " <event type='process-end'>"
@@ -209,22 +170,10 @@
long processInstanceId = startProcessInstance("fork").getId();
EventCallback.waitForEvent(Event.EVENTTYPE_PROCESS_END);
- Thread.sleep(1000);
assertTrue("expected process instance " + processInstanceId + " to have ended",
hasProcessInstanceEnded(processInstanceId));
}
- private String getHibernateDialect() {
- return (String) commandService.execute(new Command() {
- private static final long serialVersionUID = 1L;
-
- public Object execute(JbpmContext jbpmContext) throws Exception {
- DbPersistenceServiceFactory factory = (DbPersistenceServiceFactory) jbpmContext.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
- return factory.getConfiguration().getProperty(Environment.DIALECT);
- }
- });
- }
-
public void testAsyncExecutions() {
deployProcessDefinition("<process-definition name='execution'>"
+ " <event type='process-end'>"
@@ -267,37 +216,30 @@
}
for (int i = 0; i < processExecutionCount; i++) {
long processInstanceId = processInstanceIds[i];
- waitForProcessInstanceEnd(processInstanceId);
assertTrue("expected process instance " + processInstanceId + " to have ended",
- hasProcessInstanceEnded(processInstanceId));
+ waitForProcessInstanceEnd(processInstanceId));
}
}
- private ProcessDefinition deployProcessDefinition(String xml) {
- return (ProcessDefinition) commandService.execute(new DeployProcessCommand(xml));
- }
+ private String getHibernateDialect() {
+ return (String) commandService.execute(new Command() {
+ private static final long serialVersionUID = 1L;
- private ProcessInstance startProcessInstance(String processName) {
- StartProcessInstanceCommand command = new StartProcessInstanceCommand();
- command.setProcessDefinitionName(processName);
- command.setVariables(Collections.singletonMap("eventCallback", new EventCallback()));
- return (ProcessInstance) commandService.execute(command);
+ public Object execute(JbpmContext jbpmContext) throws Exception {
+ DbPersistenceServiceFactory factory = (DbPersistenceServiceFactory) jbpmContext.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
+ return factory.getConfiguration().getProperty(Environment.DIALECT);
+ }
+ });
}
- private boolean hasProcessInstanceEnded(final long processInstanceId) {
- ProcessInstance processInstance = (ProcessInstance) commandService.execute(new GetProcessInstanceCommand(
- processInstanceId));
- return processInstance.hasEnded();
- }
-
- private void waitForProcessInstanceEnd(long processId) {
+ private boolean waitForProcessInstanceEnd(long processInstanceId) {
long startTime = System.currentTimeMillis();
do {
EventCallback.waitForEvent(Event.EVENTTYPE_PROCESS_END, 1000);
if (System.currentTimeMillis() - startTime > maxWaitTime) {
- log.warn("process " + processId + " took too long");
- break;
+ return false;
}
- } while (!hasProcessInstanceEnded(processId));
+ } while (!hasProcessInstanceEnded(processInstanceId));
+ return true;
}
}
Modified: jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jta/JtaDbPersistenceTest.java
===================================================================
--- jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jta/JtaDbPersistenceTest.java 2009-02-03 23:45:28 UTC (rev 3760)
+++ jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jta/JtaDbPersistenceTest.java 2009-02-04 00:28:27 UTC (rev 3761)
@@ -21,17 +21,8 @@
*/
package org.jbpm.enterprise.jta;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.Session;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
import junit.framework.Test;
-import org.apache.cactus.ServletTestCase;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.HibernateException;
@@ -40,139 +31,68 @@
import org.jbpm.JbpmContext;
import org.jbpm.command.Command;
import org.jbpm.command.CommandService;
-import org.jbpm.command.DeleteProcessDefinitionCommand;
-import org.jbpm.command.DeployProcessCommand;
-import org.jbpm.command.GetProcessInstanceCommand;
-import org.jbpm.command.StartProcessInstanceCommand;
import org.jbpm.command.impl.CommandServiceImpl;
-import org.jbpm.ejb.LocalCommandServiceHome;
-import org.jbpm.graph.def.ProcessDefinition;
-import org.jbpm.graph.exe.ProcessInstance;
+import org.jbpm.enterprise.AbstractEnterpriseTestCase;
-public class JtaDbPersistenceTest extends ServletTestCase {
+public class JtaDbPersistenceTest extends AbstractEnterpriseTestCase {
- private CommandService commandService;
- private static LocalCommandServiceHome commandServiceHome;
-
private static final Log log = LogFactory.getLog(JtaDbPersistenceTest.class);
public static Test suite() throws Exception {
return new IntegrationTestSetup(JtaDbPersistenceTest.class, "enterprise-test.war");
}
- protected void setUp() throws Exception {
- log.info("### " + getName() + " started ###");
+ protected CommandService createCommandService() throws Exception {
+ return getName().contains("CMT") ? super.createCommandService() : new CommandServiceImpl(
+ JbpmConfiguration.getInstance());
}
- protected void tearDown() throws Exception {
- log.info("### " + getName() + " done ###");
- }
-
public void testCMTSuccess() throws Exception {
- commandService = getCommandServiceHome().create();
playTransaction(false);
}
public void testCMTFailure() throws Exception {
- commandService = getCommandServiceHome().create();
playTransaction(true);
}
public void testBMTSuccess() throws Exception {
- commandService = new CommandServiceImpl(JbpmConfiguration.getInstance());
playTransaction(false);
}
public void testBMTFailure() throws Exception {
- commandService = new CommandServiceImpl(JbpmConfiguration.getInstance());
playTransaction(true);
}
private void playTransaction(boolean fail) throws Exception {
- long definitionId = deployProcess();
- long instanceId = launchProcess(definitionId);
+ deployProcessDefinition("<process-definition name='jta'>"
+ + " <start-state name='start'>"
+ + " <transition to='midway' />"
+ + " </start-state>"
+ + " <state name='midway'>"
+ + " <transition to='end' />"
+ + " </state>"
+ + " <end-state name='end' />"
+ + "</process-definition>");
+ long processInstanceId = startProcessInstance("jta").getId();
try {
- signal(instanceId, fail);
+ signal(processInstanceId, fail);
}
catch (RuntimeException e) {
- log.debug("signal failed on process instance #" + instanceId, e);
+ log.debug("signal failed on process instance #" + processInstanceId, e);
}
- assertEquals(!fail, hasEnded(instanceId));
- // deleting the process causes race conditions that affect the next test
- // deleteProcess(definitionId);
+ assertEquals(!fail, hasProcessInstanceEnded(processInstanceId));
}
- private long deployProcess() throws Exception {
- ProcessDefinition definition = (ProcessDefinition) commandService.execute(new DeployProcessCommand(
- "<process-definition name='tx'>"
- + " <start-state name='start'>"
- + " <transition to='midway' />"
- + " </start-state>"
- + " <state name='midway'>"
- + " <transition to='end' />"
- + " </state>"
- + " <end-state name='end' />"
- + "</process-definition>"));
- return definition.getId();
- }
-
- private long launchProcess(long definitionId) throws Exception {
- ProcessInstance instance = (ProcessInstance) commandService.execute(new StartProcessInstanceCommand().processDefinitionId(definitionId));
- return instance.getId();
- }
-
- private void signal(final long instanceId, final boolean fail) throws Exception {
+ private void signal(final long processInstanceId, final boolean fail) throws Exception {
commandService.execute(new Command() {
private static final long serialVersionUID = 1L;
public Object execute(JbpmContext jbpmContext) throws Exception {
- jbpmContext.loadProcessInstance(instanceId).signal();
- if (fail)
- throw new HibernateException("simulated failure");
+ jbpmContext.loadProcessInstance(processInstanceId).signal();
+ if (fail) throw new HibernateException("simulated failure");
return null;
}
});
}
- private boolean hasEnded(long instanceId) throws Exception {
- ProcessInstance instance = (ProcessInstance) commandService.execute(new GetProcessInstanceCommand(
- instanceId));
- return instance.hasEnded();
- }
-
- private void deleteProcess(long definitionId) throws Exception {
- Command command = new DeleteProcessDefinitionCommand(definitionId);
- // CleanUpProcessJob races against DeleteProcessDefinitionCommand
- // JMS has built-in retry logic
- Context initial = new InitialContext();
- try {
- ConnectionFactory jmsConnectionfactory = (ConnectionFactory) initial.lookup("java:comp/env/jms/JbpmConnectionFactory");
- Destination commandQueue = (Destination) initial.lookup("java:comp/env/jms/CommandQueue");
-
- Connection jmsConnection = jmsConnectionfactory.createConnection();
- try {
- Session jmsSession = jmsConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- jmsSession.createProducer(commandQueue).send(jmsSession.createObjectMessage(command));
- }
- finally {
- jmsConnection.close();
- }
- }
- finally {
- initial.close();
- }
- }
-
- private static LocalCommandServiceHome getCommandServiceHome() throws NamingException {
- if (commandServiceHome == null) {
- Context initial = new InitialContext();
- try {
- return (LocalCommandServiceHome) initial.lookup("java:comp/env/ejb/CommandServiceBean");
- }
- finally {
- initial.close();
- }
- }
- return commandServiceHome;
- }
}
15 years, 3 months
JBoss JBPM SVN: r3760 - in jbpm3/branches/jbpm-3.2.5.SP/modules: enterprise/scripts and 10 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-02-03 18:45:28 -0500 (Tue, 03 Feb 2009)
New Revision: 3760
Added:
jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/java/org/jbpm/enterprise/jbpm1903/
jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/java/org/jbpm/enterprise/jbpm1903/ENCAction.java
jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/java/org/jbpm/enterprise/jbpm1903/JBPM1903Test.java
jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/org/
jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/org/jbpm/
jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/org/jbpm/enterprise/
jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/org/jbpm/enterprise/jbpm1903/
jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/org/jbpm/enterprise/jbpm1903/processdefinition.xml
Removed:
jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/java/org/jbpm/enterprise/jbpm1903/ENCAction.java
jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/java/org/jbpm/enterprise/jbpm1903/JBPM1903Test.java
jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/org/jbpm/
jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/org/jbpm/enterprise/
jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/org/jbpm/enterprise/jbpm1903/
jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/org/jbpm/enterprise/jbpm1903/processdefinition.xml
Modified:
jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/default.jbpm.cfg.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/scripts/antrun-test-jars.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/main/etc/jbpm.cfg.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/main/java/org/jbpm/msg/jms/JmsMessageServiceFactory.java
jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/java/org/jbpm/enterprise/jms/JmsMessageTest.java
Log:
JBPM-1903 make ENC reachable from within action handlers
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/default.jbpm.cfg.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/default.jbpm.cfg.xml 2009-02-03 17:31:15 UTC (rev 3759)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/default.jbpm.cfg.xml 2009-02-03 23:45:28 UTC (rev 3760)
@@ -31,9 +31,11 @@
<string name="resource.mail.templates" value="jbpm.mail.templates.xml" />
<!-- class loading -->
- <!-- <string name="jbpm.classLoader" value="jbpm" />
- <string name="jbpm.customClassLoader.className" value="com...MyClassLoaderUtil" />
- <bean name="jbpm.processClassLoader" class="org.jbpm.instantiation.DefaultProcessClassLoaderFactory" singelton="true" />-->
+ <!--
+ <string name="jbpm.classLoader" value="jbpm" />
+ <string name="jbpm.customClassLoader.className" value="org.example.ClassLoader" />
+ <bean name="jbpm.processClassLoader" class="org.jbpm.instantiation.DefaultProcessClassLoaderFactory" singleton="true" />
+ -->
<!-- make sure the block size matches the length in ByteArray.hbm.xml -->
<int name="jbpm.byte.block.size" value="1024" singleton="true" />
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/scripts/antrun-test-jars.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/scripts/antrun-test-jars.xml 2009-02-03 17:31:15 UTC (rev 3759)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/scripts/antrun-test-jars.xml 2009-02-03 23:45:28 UTC (rev 3760)
@@ -9,50 +9,31 @@
<!-- $Id$ -->
<project>
-
+
<description>jBPM enterprise test archive builder</description>
-
+
<!-- ================================================================== -->
<!-- Building -->
<!-- ================================================================== -->
-
+
<target name="build-test-jars" description="Build the test deployments">
-
- <mkdir dir="${tests.output.dir}/test-libs"/>
-
+
+ <mkdir dir="${tests.output.dir}/test-libs" />
+
<!-- enterprise-test -->
<war warfile="${tests.output.dir}/test-libs/enterprise-test.war" webxml="${tests.resources.dir}/enterprise/WEB-INF/web.xml">
- <classes dir="${tests.output.dir}/classes">
- <include name="org/jbpm/ejb/RemoteCommandServiceHome.class"/>
- <include name="org/jbpm/ejb/RemoteCommandService.class"/>
- <include name="org/jbpm/ejb/TimerEntityHome.class"/>
- <include name="org/jbpm/ejb/TimerEntity.class"/>
- <include name="org/jbpm/msg/jms/JmsMessageServiceFactory.class"/>
- <include name="org/jbpm/scheduler/ejbtimer/EntitySchedulerServiceFactory.class"/>
- </classes>
- <classes dir="${tests.output.dir}/test-classes">
- <include name="org/jbpm/enterprise/config/AppServerConfigurationsTest.class"/>
- <include name="org/jbpm/enterprise/ejbtimer/EjbSchedulerTest*.class"/>
- <include name="org/jbpm/enterprise/jms/JmsMessageTest*.class"/>
- <include name="org/jbpm/enterprise/jta/JtaDbPersistenceTest.class"/>
- </classes>
- <lib dir="${tests.output.dir}/test-dependencies">
- <include name="aspectjrt*.jar"/>
- <include name="cactus*.jar"/>
- <include name="junit*.jar"/>
- </lib>
- <webinf dir="${tests.resources.dir}/enterprise/WEB-INF">
- <exclude name="web.xml"/>
- </webinf>
+ <classes dir="${tests.output.dir}/test-classes" includes="org/jbpm/enterprise/**" />
+ <lib dir="${tests.output.dir}/test-dependencies" includes="*.jar" />
+ <webinf dir="${tests.resources.dir}/enterprise/WEB-INF" excludes="web.xml" />
</war>
<!-- fork-join-example -->
<jar jarfile="${tests.output.dir}/test-libs/fork-join-example.par">
- <fileset dir="${tests.resources.dir}/deployment/fork-join-example"/>
+ <fileset dir="${tests.resources.dir}/deployment/fork-join-example" />
</jar>
-
+
<!-- Please add alphabetically -->
-
+
</target>
-
+
</project>
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/main/etc/jbpm.cfg.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/main/etc/jbpm.cfg.xml 2009-02-03 17:31:15 UTC (rev 3759)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/main/etc/jbpm.cfg.xml 2009-02-03 23:45:28 UTC (rev 3760)
@@ -9,6 +9,9 @@
<service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
</jbpm-context>
+ <!-- use the context class loader -->
+ <string name="jbpm.classLoader" value="context" />
+
<!--
Note, that the default job executor needs to be overwritten with a null value.
In the enterprise configuration there should be no job executor.
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/main/java/org/jbpm/msg/jms/JmsMessageServiceFactory.java
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/main/java/org/jbpm/msg/jms/JmsMessageServiceFactory.java 2009-02-03 17:31:15 UTC (rev 3759)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/main/java/org/jbpm/msg/jms/JmsMessageServiceFactory.java 2009-02-03 23:45:28 UTC (rev 3760)
@@ -58,9 +58,9 @@
{
private static final long serialVersionUID = 1L;
- String connectionFactoryJndiName = "java:JmsXA";
- String destinationJndiName = "queue/JbpmJobQueue";
- String commandDestinationJndiName = "queue/JbpmCommandQueue";
+ String connectionFactoryJndiName = "java:comp/env/jms/JbpmConnectionFactory";
+ String destinationJndiName = "java:comp/env/jms/JobQueue";
+ String commandDestinationJndiName = "java:comp/env/jms/CommandQueue";
boolean isCommitEnabled = false;
private ConnectionFactory connectionFactory;
Copied: jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/java/org/jbpm/enterprise/jbpm1903 (from rev 3733, jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jbpm1903)
Deleted: jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/java/org/jbpm/enterprise/jbpm1903/ENCAction.java
===================================================================
--- jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jbpm1903/ENCAction.java 2009-01-30 08:07:44 UTC (rev 3733)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/java/org/jbpm/enterprise/jbpm1903/ENCAction.java 2009-02-03 23:45:28 UTC (rev 3760)
@@ -1,25 +0,0 @@
-package org.jbpm.enterprise.jbpm1903;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-
-import org.jbpm.graph.def.ActionHandler;
-import org.jbpm.graph.exe.ExecutionContext;
-
-public class ENCAction implements ActionHandler {
-
- private static final long serialVersionUID = 1L;
-
- public void execute(ExecutionContext executionContext) throws Exception {
- Context jndiContext = new InitialContext();
- try {
- Object queue = jndiContext.lookup("java:comp/env/jms/JobQueue");
- executionContext.setVariable("queue", queue);
- }
- finally {
- jndiContext.close();
- }
- executionContext.leaveNode();
- }
-
-}
Copied: jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/java/org/jbpm/enterprise/jbpm1903/ENCAction.java (from rev 3733, jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jbpm1903/ENCAction.java)
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/java/org/jbpm/enterprise/jbpm1903/ENCAction.java (rev 0)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/java/org/jbpm/enterprise/jbpm1903/ENCAction.java 2009-02-03 23:45:28 UTC (rev 3760)
@@ -0,0 +1,25 @@
+package org.jbpm.enterprise.jbpm1903;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+import org.jbpm.graph.def.ActionHandler;
+import org.jbpm.graph.exe.ExecutionContext;
+
+public class ENCAction implements ActionHandler {
+
+ private static final long serialVersionUID = 1L;
+
+ public void execute(ExecutionContext executionContext) throws Exception {
+ Context jndiContext = new InitialContext();
+ try {
+ Object queue = jndiContext.lookup("java:comp/env/jms/JobQueue");
+ executionContext.setVariable("queue", queue);
+ }
+ finally {
+ jndiContext.close();
+ }
+ executionContext.leaveNode();
+ }
+
+}
Deleted: jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/java/org/jbpm/enterprise/jbpm1903/JBPM1903Test.java
===================================================================
--- jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jbpm1903/JBPM1903Test.java 2009-01-30 08:07:44 UTC (rev 3733)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/java/org/jbpm/enterprise/jbpm1903/JBPM1903Test.java 2009-02-03 23:45:28 UTC (rev 3760)
@@ -1,129 +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.enterprise.jbpm1903;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipOutputStream;
-
-import javax.jms.JMSException;
-import javax.jms.Queue;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-
-import junit.framework.Test;
-
-import org.apache.cactus.ServletTestCase;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.bpm.api.test.IntegrationTestSetup;
-import org.jbpm.JbpmContext;
-import org.jbpm.command.Command;
-import org.jbpm.command.DeployProcessCommand;
-import org.jbpm.command.StartProcessInstanceCommand;
-import org.jbpm.ejb.LocalCommandService;
-import org.jbpm.ejb.LocalCommandServiceHome;
-import org.jbpm.graph.exe.ProcessInstance;
-import org.jbpm.util.IoUtil;
-
-/**
- * @author Alejandro Guizar
- */
-public class JBPM1903Test extends ServletTestCase {
-
- private LocalCommandService commandService;
- private static LocalCommandServiceHome commandServiceHome;
-
- private static final Log log = LogFactory.getLog(JBPM1903Test.class);
-
- public static Test suite() throws Exception {
- return new IntegrationTestSetup(JBPM1903Test.class, "enterprise-test.war");
- }
-
- @Override
- protected void setUp() throws Exception {
- if (commandServiceHome == null) {
- Context initialContext = new InitialContext();
- try {
- commandServiceHome = (LocalCommandServiceHome) initialContext.lookup("java:comp/env/ejb/CommandServiceBean");
- }
- finally {
- initialContext.close();
- }
- }
- commandService = commandServiceHome.create();
- log.info("### " + getName() + " started ###");
- }
-
- @Override
- protected void tearDown() throws Exception {
- log.info("### " + getName() + " done ###");
- commandService = null;
- }
-
- public void testENCInActionHandler() throws IOException, JMSException {
- byte[] processArchive = createProcessArchive();
- deployProcessDefinition(processArchive);
- long processInstanceId = startProcessInstance("jbpm-1903").getId();
- Queue queue = (Queue) getVariable(processInstanceId, "queue");
- assertEquals("JbpmJobQueue", queue.getQueueName());
- }
-
- private byte[] createProcessArchive() throws IOException {
- ByteArrayOutputStream memoryOut = new ByteArrayOutputStream();
- ZipOutputStream zipOut = new ZipOutputStream(memoryOut);
-
- zipOut.putNextEntry(new ZipEntry("processdefinition.xml"));
- InputStream resourceIn = getClass().getResourceAsStream("processdefinition.xml");
- IoUtil.transfer(resourceIn, zipOut);
- resourceIn.close();
-
- zipOut.putNextEntry(new ZipEntry("classes/org/jbpm/enterprise/jbpm1903/ENCAction.class"));
- resourceIn = getClass().getResourceAsStream("ENCAction.class");
- IoUtil.transfer(resourceIn, zipOut);
- resourceIn.close();
-
- zipOut.close();
- return memoryOut.toByteArray();
- }
-
- private void deployProcessDefinition(byte[] processArchive) {
- commandService.execute(new DeployProcessCommand(processArchive));
- }
-
- private ProcessInstance startProcessInstance(String processName) {
- return (ProcessInstance) commandService.execute(new StartProcessInstanceCommand().processDefinitionName(processName));
- }
-
- private Object getVariable(final long processInstanceId, final String variableName) {
- return commandService.execute(new Command() {
- private static final long serialVersionUID = 1L;
-
- public Object execute(JbpmContext jbpmContext) throws Exception {
- ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId);
- return processInstance.getContextInstance().getVariable(variableName);
- }
- });
- }
-}
Copied: jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/java/org/jbpm/enterprise/jbpm1903/JBPM1903Test.java (from rev 3733, jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jbpm1903/JBPM1903Test.java)
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/java/org/jbpm/enterprise/jbpm1903/JBPM1903Test.java (rev 0)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/java/org/jbpm/enterprise/jbpm1903/JBPM1903Test.java 2009-02-03 23:45:28 UTC (rev 3760)
@@ -0,0 +1,129 @@
+/*
+ * 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.enterprise.jbpm1903;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+import javax.jms.JMSException;
+import javax.jms.Queue;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+import junit.framework.Test;
+
+import org.apache.cactus.ServletTestCase;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.bpm.api.test.IntegrationTestSetup;
+import org.jbpm.JbpmContext;
+import org.jbpm.command.Command;
+import org.jbpm.command.DeployProcessCommand;
+import org.jbpm.command.StartProcessInstanceCommand;
+import org.jbpm.ejb.LocalCommandService;
+import org.jbpm.ejb.LocalCommandServiceHome;
+import org.jbpm.graph.exe.ProcessInstance;
+import org.jbpm.util.IoUtil;
+
+/**
+ * @author Alejandro Guizar
+ */
+public class JBPM1903Test extends ServletTestCase {
+
+ private LocalCommandService commandService;
+ private static LocalCommandServiceHome commandServiceHome;
+
+ private static final Log log = LogFactory.getLog(JBPM1903Test.class);
+
+ public static Test suite() throws Exception {
+ return new IntegrationTestSetup(JBPM1903Test.class, "enterprise-test.war");
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ if (commandServiceHome == null) {
+ Context initialContext = new InitialContext();
+ try {
+ commandServiceHome = (LocalCommandServiceHome) initialContext.lookup("java:comp/env/ejb/CommandServiceBean");
+ }
+ finally {
+ initialContext.close();
+ }
+ }
+ commandService = commandServiceHome.create();
+ log.info("### " + getName() + " started ###");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ log.info("### " + getName() + " done ###");
+ commandService = null;
+ }
+
+ public void testENCInActionHandler() throws IOException, JMSException {
+ byte[] processArchive = createProcessArchive();
+ deployProcessDefinition(processArchive);
+ long processInstanceId = startProcessInstance("jbpm-1903").getId();
+ Queue queue = (Queue) getVariable(processInstanceId, "queue");
+ assertEquals("JbpmJobQueue", queue.getQueueName());
+ }
+
+ private byte[] createProcessArchive() throws IOException {
+ ByteArrayOutputStream memoryOut = new ByteArrayOutputStream();
+ ZipOutputStream zipOut = new ZipOutputStream(memoryOut);
+
+ zipOut.putNextEntry(new ZipEntry("processdefinition.xml"));
+ InputStream resourceIn = getClass().getResourceAsStream("processdefinition.xml");
+ IoUtil.transfer(resourceIn, zipOut);
+ resourceIn.close();
+
+ zipOut.putNextEntry(new ZipEntry("classes/org/jbpm/enterprise/jbpm1903/ENCAction.class"));
+ resourceIn = getClass().getResourceAsStream("ENCAction.class");
+ IoUtil.transfer(resourceIn, zipOut);
+ resourceIn.close();
+
+ zipOut.close();
+ return memoryOut.toByteArray();
+ }
+
+ private void deployProcessDefinition(byte[] processArchive) {
+ commandService.execute(new DeployProcessCommand(processArchive));
+ }
+
+ private ProcessInstance startProcessInstance(String processName) {
+ return (ProcessInstance) commandService.execute(new StartProcessInstanceCommand().processDefinitionName(processName));
+ }
+
+ private Object getVariable(final long processInstanceId, final String variableName) {
+ return commandService.execute(new Command() {
+ private static final long serialVersionUID = 1L;
+
+ public Object execute(JbpmContext jbpmContext) throws Exception {
+ ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId);
+ return processInstance.getContextInstance().getVariable(variableName);
+ }
+ });
+ }
+}
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/java/org/jbpm/enterprise/jms/JmsMessageTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/java/org/jbpm/enterprise/jms/JmsMessageTest.java 2009-02-03 17:31:15 UTC (rev 3759)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/java/org/jbpm/enterprise/jms/JmsMessageTest.java 2009-02-03 23:45:28 UTC (rev 3760)
@@ -217,7 +217,6 @@
long processId = launchProcess("fork").getId();
EventCallback.waitForEvent(Event.EVENTTYPE_PROCESS_END);
- Thread.sleep(1000);
assertTrue("Process has ended", hasProcessEnded(processId));
}
@@ -287,7 +286,7 @@
private ProcessDefinition deployProcess(String xml)
{
- return (ProcessDefinition)commandService.execute(new DeployProcessCommand(xml));
+ return (ProcessDefinition) commandService.execute(new DeployProcessCommand(xml));
}
private ProcessInstance launchProcess(String processName)
Copied: jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/org (from rev 3733, jbpm3/trunk/modules/enterprise/src/test/resources/org)
Copied: jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/org/jbpm (from rev 3733, jbpm3/trunk/modules/enterprise/src/test/resources/org/jbpm)
Copied: jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/org/jbpm/enterprise (from rev 3733, jbpm3/trunk/modules/enterprise/src/test/resources/org/jbpm/enterprise)
Copied: jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/org/jbpm/enterprise/jbpm1903 (from rev 3733, jbpm3/trunk/modules/enterprise/src/test/resources/org/jbpm/enterprise/jbpm1903)
Deleted: jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/org/jbpm/enterprise/jbpm1903/processdefinition.xml
===================================================================
--- jbpm3/trunk/modules/enterprise/src/test/resources/org/jbpm/enterprise/jbpm1903/processdefinition.xml 2009-01-30 08:07:44 UTC (rev 3733)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/org/jbpm/enterprise/jbpm1903/processdefinition.xml 2009-02-03 23:45:28 UTC (rev 3760)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="jbpm-1903">
-
- <start-state name="start-state1">
- <transition to="node1" />
- </start-state>
-
- <node name="node1">
- <action class="org.jbpm.enterprise.jbpm1903.ENCAction" />
- <transition to="end-state1" />
- </node>
-
- <end-state name="end-state1" />
-
-</process-definition>
\ No newline at end of file
Copied: jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/org/jbpm/enterprise/jbpm1903/processdefinition.xml (from rev 3733, jbpm3/trunk/modules/enterprise/src/test/resources/org/jbpm/enterprise/jbpm1903/processdefinition.xml)
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/org/jbpm/enterprise/jbpm1903/processdefinition.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/org/jbpm/enterprise/jbpm1903/processdefinition.xml 2009-02-03 23:45:28 UTC (rev 3760)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="jbpm-1903">
+
+ <start-state name="start-state1">
+ <transition to="node1" />
+ </start-state>
+
+ <node name="node1">
+ <action class="org.jbpm.enterprise.jbpm1903.ENCAction" />
+ <transition to="end-state1" />
+ </node>
+
+ <end-state name="end-state1" />
+
+</process-definition>
\ No newline at end of file
15 years, 3 months
JBoss JBPM SVN: r3759 - jbpm4/trunk.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-02-03 12:31:15 -0500 (Tue, 03 Feb 2009)
New Revision: 3759
Modified:
jbpm4/trunk/pom.xml
Log:
Set hibnerate-annotation version to 3.3.1.GA
Modified: jbpm4/trunk/pom.xml
===================================================================
--- jbpm4/trunk/pom.xml 2009-02-03 17:25:28 UTC (rev 3758)
+++ jbpm4/trunk/pom.xml 2009-02-03 17:31:15 UTC (rev 3759)
@@ -49,7 +49,7 @@
<apache.ant.version>1.7.0</apache.ant.version>
<cactus.version>13-1.7.1</cactus.version>
<hibernate.version>3.2.6.ga</hibernate.version>
- <hibernate.annotations.version>3.3.1.ga</hibernate.annotations.version>
+ <hibernate.annotations.version>3.3.1.GA</hibernate.annotations.version>
<jboss.identity.version>1.0.0-SNAPSHOT</jboss.identity.version>
<hsqldb.version>1.8.0.7</hsqldb.version>
<izpack.version>4.1.0</izpack.version>
15 years, 3 months