JBoss JBPM SVN: r5802 - in jbpm4/trunk/qa: upgrade and 1 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-10-26 12:40:32 -0400 (Mon, 26 Oct 2009)
New Revision: 5802
Added:
jbpm4/trunk/qa/upgrade/cfg/
jbpm4/trunk/qa/upgrade/cfg/logging.properties
Modified:
jbpm4/trunk/qa/build.xml
jbpm4/trunk/qa/upgrade/pom.xml
Log:
added oracle driver and config customization to upgrade scripts
Modified: jbpm4/trunk/qa/build.xml
===================================================================
--- jbpm4/trunk/qa/build.xml 2009-10-26 15:53:05 UTC (rev 5801)
+++ jbpm4/trunk/qa/build.xml 2009-10-26 16:40:32 UTC (rev 5802)
@@ -28,10 +28,15 @@
<property name="jbpm.distro.dir" value="../modules/distro/target" />
<property name="jbpm.distro.path" value="${jbpm.distro.dir}/jbpm-${jbpm.version}.zip" />
- <condition property="jbpm.identity.idm">
- <equals arg1="${identity.component}" arg2="jboss.idm"/>
- </condition>
+ <condition property="is.hsqldb">
+ <equals arg1="${database}" arg2="hsqldb" />
+ </condition>
+ <condition property="is.oracle">
+ <equals arg1="${database}" arg2="oracle" />
+ </condition>
+
+
<echo message="database.......... ${database}" />
<echo message="jbpm.version...... ${jbpm.version}" />
<echo message="jbpm.home......... ${jbpm.home}" />
@@ -166,6 +171,8 @@
<!-- install old jbpm version -->
<delete dir="${old.jbpm.home}" />
<unzip src="upgrade/target/jbpm-distro-${old.jbpm.version}.jar" dest="${jbpm.parent.dir}" />
+ <!-- copy the oracle driver jar -->
+ <antcall target="copy.oracle.driver" />
<!-- create jdbc properties files for PVM2 based on the originals -->
<delete dir="upgrade/target/jdbc" />
<mkdir dir="upgrade/target/jdbc" />
@@ -189,6 +196,9 @@
<antcall target="create.jbpm.schema.in.jbpm.40" />
<antcall target="create.jbpm.schema.in.jbpm.41plus" />
<!-- start couple of processes using the old jbpm version -->
+ <copy todir="upgrade/target/jbpm-test-upgrade" overwrite="true">
+ <fileset dir="upgrade/cfg" />
+ </copy>
<java classname="org.jbpm.upgrade.BeforeUpgrade" fork="true">
<classpath>
<pathelement location="upgrade/target/jbpm-test-upgrade" />
@@ -210,11 +220,12 @@
<!--property name="logging" value="debug" /-->
</ant>
</target>
-
- <condition property="is.hsqldb">
- <equals arg1="${database}" arg2="hsqldb" />
- </condition>
+ <target name="copy.oracle.driver" if="is.oracle">
+ <copy file="upgrade/target/ojdbc14.jar" todir="${old.jbpm.home}/lib" />
+ <copy file="upgrade/target/ojdbc14.jar" todir="${jbpm.home}/lib" />
+ </target>
+
<target name="start.hsqldb" if="is.hsqldb">
<delete dir="upgrade/target/hsqldb" />
<mkdir dir="upgrade/target/hsqldb" />
Added: jbpm4/trunk/qa/upgrade/cfg/logging.properties
===================================================================
--- jbpm4/trunk/qa/upgrade/cfg/logging.properties (rev 0)
+++ jbpm4/trunk/qa/upgrade/cfg/logging.properties 2009-10-26 16:40:32 UTC (rev 5802)
@@ -0,0 +1,18 @@
+handlers= java.util.logging.ConsoleHandler
+redirect.commons.logging = enabled
+
+java.util.logging.ConsoleHandler.level = FINEST
+java.util.logging.ConsoleHandler.formatter = org.jbpm.internal.log.LogFormatter
+
+org.jbpm.level=FINE
+# org.jbpm.pvm.internal.tx.level=FINE
+# org.jbpm.pvm.internal.wire.level=FINE
+# org.jbpm.pvm.internal.util.level=FINE
+
+org.hibernate.level=FINE
+org.hibernate.cfg.SettingsFactory.level=SEVERE
+org.hibernate.cfg.HbmBinder.level=SEVERE
+org.hibernate.SQL.level=FINEST
+org.hibernate.type.level=FINEST
+# org.hibernate.tool.hbm2ddl.SchemaExport.level=FINEST
+# org.hibernate.transaction.level=FINEST
\ No newline at end of file
Property changes on: jbpm4/trunk/qa/upgrade/cfg/logging.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/qa/upgrade/pom.xml
===================================================================
--- jbpm4/trunk/qa/upgrade/pom.xml 2009-10-26 15:53:05 UTC (rev 5801)
+++ jbpm4/trunk/qa/upgrade/pom.xml 2009-10-26 16:40:32 UTC (rev 5802)
@@ -46,6 +46,12 @@
<outputDirectory>target</outputDirectory>
<destFileName>hsqldb.jar</destFileName>
</artifactItem>
+ <artifactItem>
+ <groupId>com.oracle</groupId>
+ <artifactId>ojdbc14</artifactId>
+ <version>10.2.0.4</version>
+ <destFileName>ojdbc14.jar</destFileName>
+ </artifactItem>
</artifactItems>
</configuration>
</plugin>
16 years, 6 months
JBoss JBPM SVN: r5801 - jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-10-26 11:53:05 -0400 (Mon, 26 Oct 2009)
New Revision: 5801
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/AbstractQuery.java
Log:
elaborated exception reporting
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/AbstractQuery.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/AbstractQuery.java 2009-10-26 14:23:29 UTC (rev 5800)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/AbstractQuery.java 2009-10-26 15:53:05 UTC (rev 5801)
@@ -22,13 +22,16 @@
package org.jbpm.pvm.internal.query;
import java.io.ObjectStreamException;
+import java.sql.SQLException;
import java.util.List;
+import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.jbpm.api.JbpmException;
import org.jbpm.api.cmd.Command;
import org.jbpm.api.cmd.Environment;
+import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.cmd.CommandService;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
@@ -37,6 +40,8 @@
* @author Tom Baeyens
*/
public abstract class AbstractQuery implements Command<Object> {
+
+ private static Log log = Log.getLog(AbstractQuery.class.getName());
private static final long serialVersionUID = 1L;
@@ -83,10 +88,25 @@
public Object execute(Session session) {
String hql = hql();
- Query query = session.createQuery(hql);
- applyParameters(query);
- applyPage(query);
- return query.list();
+ try {
+ Query query = session.createQuery(hql);
+ applyParameters(query);
+ applyPage(query);
+ return query.list();
+ } catch (HibernateException e) {
+ Throwable t = e;
+ while (t!=null) {
+ if (t instanceof SQLException) {
+ SQLException sqlException = (SQLException) t;
+ SQLException nextException = sqlException.getNextException();
+ if (nextException!=null) {
+ log.error("cause of "+nextException+": ", e);
+ }
+ }
+ t = t.getCause();
+ }
+ throw e;
+ }
}
protected void appendWhereClause(String whereClause, StringBuilder hql) {
16 years, 6 months
JBoss JBPM SVN: r5800 - jbpm4/trunk.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-10-26 10:23:29 -0400 (Mon, 26 Oct 2009)
New Revision: 5800
Modified:
jbpm4/trunk/pom.xml
Log:
Temp fix until bpm-console 1.2.0 is uploaded to m2 repo
Modified: jbpm4/trunk/pom.xml
===================================================================
--- jbpm4/trunk/pom.xml 2009-10-26 14:18:13 UTC (rev 5799)
+++ jbpm4/trunk/pom.xml 2009-10-26 14:23:29 UTC (rev 5800)
@@ -49,7 +49,8 @@
<cactus.version>1.8.1</cactus.version>
<aspectjrt.version>1.5.3</aspectjrt.version>
<freemarker.version>2.3.15</freemarker.version>
- <gwt.console.version>1.2.0-SNAPSHOT</gwt.console.version>
+ <gwt.console.version>1.1.2-SNAPSHOT</gwt.console.version>
+ <!-- <gwt.console.version>1.2.0-SNAPSHOT</gwt.console.version>-->
<jbpm.gpd.version>4.1</jbpm.gpd.version>
<hibernate.version>3.3.1.GA</hibernate.version>
<slf4j.version>1.5.2</slf4j.version>
16 years, 6 months
JBoss JBPM SVN: r5799 - jbpm4/trunk/modules/test-cactus/src/main/java/org/jbpm/cactustool.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-10-26 10:18:13 -0400 (Mon, 26 Oct 2009)
New Revision: 5799
Modified:
jbpm4/trunk/modules/test-cactus/src/main/java/org/jbpm/cactustool/CactusTestGenerator.java
Log:
added creation of directory for generated test sources
Modified: jbpm4/trunk/modules/test-cactus/src/main/java/org/jbpm/cactustool/CactusTestGenerator.java
===================================================================
--- jbpm4/trunk/modules/test-cactus/src/main/java/org/jbpm/cactustool/CactusTestGenerator.java 2009-10-26 14:16:49 UTC (rev 5798)
+++ jbpm4/trunk/modules/test-cactus/src/main/java/org/jbpm/cactustool/CactusTestGenerator.java 2009-10-26 14:18:13 UTC (rev 5799)
@@ -37,7 +37,10 @@
log("syntax: java -cp ... org.jbpm.cactustool.CactusTestGenerator testdestroot testsrcroot1 testsrcroot2 ...");
}
- String testFileName = args[0]+"/org/jbpm/test/AllIntegrationTests.java";
+ String testPackageSourceDir = args[0]+"/org/jbpm/test";
+ new File(testPackageSourceDir).mkdirs();
+
+ String testFileName = testPackageSourceDir+"/AllIntegrationTests.java";
File testFile = new File(testFileName);
FileOutputStream fos = new FileOutputStream(testFile);
PrintWriter out = new PrintWriter(fos);
16 years, 6 months
JBoss JBPM SVN: r5798 - jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-10-26 10:16:49 -0400 (Mon, 26 Oct 2009)
New Revision: 5798
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransactionInterceptor.java
Log:
prevented exception for requires new transaction handling in jta environments
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransactionInterceptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransactionInterceptor.java 2009-10-26 13:32:54 UTC (rev 5797)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransactionInterceptor.java 2009-10-26 14:16:49 UTC (rev 5798)
@@ -58,6 +58,7 @@
if ( (status != Status.STATUS_NO_TRANSACTION)
&& (status != Status.STATUS_COMMITTED)
&& (status != Status.STATUS_ROLLEDBACK)
+ && (policy != Policy.REQUIRES_NEW)
) {
throw new JbpmException("invalid transaction state: "+JtaStatusHelper.toString(status));
}
16 years, 6 months
JBoss JBPM SVN: r5797 - jbpm4/trunk/modules/test-upgrade.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-10-26 09:32:54 -0400 (Mon, 26 Oct 2009)
New Revision: 5797
Modified:
jbpm4/trunk/modules/test-upgrade/pom.xml
Log:
Added mvn profile to cope with -Ddatabase property of Hudson db axis
Modified: jbpm4/trunk/modules/test-upgrade/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-upgrade/pom.xml 2009-10-26 10:42:39 UTC (rev 5796)
+++ jbpm4/trunk/modules/test-upgrade/pom.xml 2009-10-26 13:32:54 UTC (rev 5797)
@@ -40,5 +40,64 @@
</dependency>
</dependencies>
+ <profiles>
+ <!-- -Ddatabase= -->
+ <profile>
+ <id>run.database.upgrade.testsuite</id>
+ <activation>
+ <property>
+ <name>database</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>database-test-cfg-customization</id>
+ <!-- Replace the hibernate config during test compilation -->
+ <phase>test-compile</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <echo message="Creating test-upgrade cfg for database: ${database}" />
+ <mkdir dir="target/jdbc.properties" />
+ <copy todir="target/jdbc.properties" overwrite="true">
+ <fileset dir="../../qa/jdbc" />
+ </copy>
+ <copy todir="target/jdbc.properties" overwrite="true" failonerror="false">
+ <fileset dir="${user.home}/.jbpm4/jdbc" />
+ </copy>
+
+ <replace dir="target/jdbc.properties">
+ <include name="*.properties" />
+ <replacefilter token="PVM1" value="PVM2" />
+ <replacefilter token="pvm1" value="pvm2" />
+ </replace>
+
+ <ant antfile="../distro/src/main/files/install/build.xml" target="create.cfg">
+ <property name="tx" value="standalone.testsuite" />
+ <property name="mail.cfg" value="testsuite" />
+ <property name="database" value="${database}" />
+ <property name="cfg.dest.dir" value="target/test-classes" />
+ <property name="install.src.dir" value="../distro/src/main/files/install/src" />
+ <property name="jdbc.properties.dir" value="target/jdbc.properties" />
+ <property name="logging" value="none" /> <!-- then the original logging.properties in the resources of this project will be used -->
+ </ant>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ </profiles>
+
+
</project>
16 years, 6 months
JBoss JBPM SVN: r5796 - in jbpm4/trunk/modules/test-upgrade/src: test/java/org/jbpm/test/upgrade and 1 other directory.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-10-26 06:42:39 -0400 (Mon, 26 Oct 2009)
New Revision: 5796
Modified:
jbpm4/trunk/modules/test-upgrade/src/main/java/org/jbpm/upgrade/BeforeUpgrade.java
jbpm4/trunk/modules/test-upgrade/src/test/java/org/jbpm/test/upgrade/Process2AfterUpgradeTest.java
jbpm4/trunk/modules/test-upgrade/src/test/java/org/jbpm/test/upgrade/Process3AfterUpgradeTest.java
Log:
Completed after upgrade test cases
Modified: jbpm4/trunk/modules/test-upgrade/src/main/java/org/jbpm/upgrade/BeforeUpgrade.java
===================================================================
--- jbpm4/trunk/modules/test-upgrade/src/main/java/org/jbpm/upgrade/BeforeUpgrade.java 2009-10-26 10:26:10 UTC (rev 5795)
+++ jbpm4/trunk/modules/test-upgrade/src/main/java/org/jbpm/upgrade/BeforeUpgrade.java 2009-10-26 10:42:39 UTC (rev 5796)
@@ -122,7 +122,7 @@
// Deploy test process
deploy(TEST_PROCESS_2);
- // Start 6 instances, of which 3 will be ended
+ // Start 7 instances, of which 3 will be ended
List<String> ids = new ArrayList<String>();
for (int i = 0; i < 7; i++) {
Modified: jbpm4/trunk/modules/test-upgrade/src/test/java/org/jbpm/test/upgrade/Process2AfterUpgradeTest.java
===================================================================
--- jbpm4/trunk/modules/test-upgrade/src/test/java/org/jbpm/test/upgrade/Process2AfterUpgradeTest.java 2009-10-26 10:26:10 UTC (rev 5795)
+++ jbpm4/trunk/modules/test-upgrade/src/test/java/org/jbpm/test/upgrade/Process2AfterUpgradeTest.java 2009-10-26 10:42:39 UTC (rev 5796)
@@ -1,8 +1,11 @@
package org.jbpm.test.upgrade;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.Set;
+import org.jbpm.api.Execution;
import org.jbpm.api.ProcessDefinition;
import org.jbpm.api.ProcessInstance;
import org.jbpm.api.history.HistoryProcessInstance;
@@ -11,6 +14,10 @@
private static final String PROCESS_2_KEY = "testprocess2";
+ private static final String STATE_MORE_THAN_5 = "more than 5";
+
+ private static final String VARIABLE_KEY = "var";
+
public void testDataValid() {
// 4 process instances should be active
@@ -22,7 +29,7 @@
for (ProcessInstance processInstance : procInstances) {
Set<String> activeActivities = processInstance.findActiveActivityNames();
assertEquals(1, activeActivities.size());
- assertActivityActive(processInstance.getId(), "more than 5");
+ assertActivityActive(processInstance.getId(), STATE_MORE_THAN_5);
}
// 4 process instances should have ended
@@ -31,12 +38,47 @@
}
- @Override
public void testContinueExistingInstance() {
+
+ final String piKey = PROCESS_2_KEY + "-3";
+ ProcessInstance pi = findProcessInstanceByKey(piKey);
+ Set<String> activeActivities = pi.findActiveActivityNames();
+ assertEquals(1, activeActivities.size());
+
+ // Resignalling it should put it again in "more than 5"
+ Execution execution = pi.findActiveExecutionIn(STATE_MORE_THAN_5);
+ executionService.signalExecutionById(execution.getId());
+
+ pi = findProcessInstanceByKey(piKey);
+ activeActivities = pi.findActiveActivityNames();
+ assertEquals(1, activeActivities.size());
+ execution = pi.findActiveExecutionIn(STATE_MORE_THAN_5);
+
+ // Changing the variable to < 5 and signal the execution should end the proc
+ Map<String, Object> vars = new HashMap<String, Object>();
+ vars.put(VARIABLE_KEY, 3);
+ executionService.signalExecutionById(execution.getId(), vars);
+ assertProcessInstanceEnded(pi);
+
}
- @Override
public void testStartFreshProcessInstance() {
+
+ // Start a new ProcessInstance with var < 5 -> will be in wait state
+ Map<String, Object> vars = new HashMap<String, Object>();
+ vars.put(VARIABLE_KEY, 7);
+ ProcessInstance pi = executionService.startProcessInstanceByKey(PROCESS_2_KEY, vars);
+
+ Set<String> activeActivities = pi.findActiveActivityNames();
+ assertEquals(1, activeActivities.size());
+ assertEquals(STATE_MORE_THAN_5, activeActivities.iterator().next());
+
+ // Signalling with a var < 5 will end the process instance
+ Execution execution = pi.findActiveExecutionIn(STATE_MORE_THAN_5);
+ vars.put(VARIABLE_KEY, 2);
+ executionService.signalExecutionById(execution.getId(), vars);
+ assertProcessInstanceEnded(pi);
+
}
}
Modified: jbpm4/trunk/modules/test-upgrade/src/test/java/org/jbpm/test/upgrade/Process3AfterUpgradeTest.java
===================================================================
--- jbpm4/trunk/modules/test-upgrade/src/test/java/org/jbpm/test/upgrade/Process3AfterUpgradeTest.java 2009-10-26 10:26:10 UTC (rev 5795)
+++ jbpm4/trunk/modules/test-upgrade/src/test/java/org/jbpm/test/upgrade/Process3AfterUpgradeTest.java 2009-10-26 10:42:39 UTC (rev 5796)
@@ -11,6 +11,10 @@
private static final String PROCESS_3_KEY = "testprocess3";
+ private static final String TASK_NAME = "do something important";
+
+ private static final String TASK_DONE_OUTCOME = "done";
+
public void testDataValid() {
// 2 process instances should be active
@@ -33,12 +37,36 @@
}
- @Override
public void testContinueExistingInstance() {
+
+ // There is one process instance currently waiting at the human task
+ ProcessInstance pi = findProcessInstanceByKey(PROCESS_3_KEY + "-1");
+ Job job = managementService.createJobQuery().processInstanceId(pi.getId()).uniqueResult();
+ assertNotNull(job);
+
+ Task task = taskService.createTaskQuery().processInstanceId(pi.getId()).uniqueResult();
+ assertEquals(TASK_NAME, task.getName());
+ taskService.completeTask(task.getId(), TASK_DONE_OUTCOME);
+
+ assertProcessInstanceEnded(pi);
+ List<Job> jobs = managementService.createJobQuery().processInstanceId(pi.getId()).list();
+ assertEquals(0, jobs.size());
+
}
- @Override
public void testStartFreshProcessInstance() {
+
+ ProcessInstance pi = executionService.startProcessInstanceByKey(PROCESS_3_KEY);
+ Task task = taskService.createTaskQuery().processInstanceId(pi.getId()).uniqueResult();
+ assertEquals(TASK_NAME, task.getName());
+
+ Job job = managementService.createJobQuery().processInstanceId(pi.getId()).uniqueResult();
+ assertNotNull(job);
+
+ taskService.completeTask(task.getId(), TASK_DONE_OUTCOME);
+ assertProcessInstanceEnded(pi);
+ List<Job> jobs = managementService.createJobQuery().processInstanceId(pi.getId()).list();
+ assertEquals(0, jobs.size());
}
}
16 years, 6 months
JBoss JBPM SVN: r5795 - jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-10-26 06:26:10 -0400 (Mon, 26 Oct 2009)
New Revision: 5795
Added:
jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/jbpm.cfg.xml
jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/jbpm.hibernate.cfg.xml
jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/logging.properties
jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/testprocess1.jpdl.xml
jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/testprocess2.jpdl.xml
jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/testprocess3.jpdl.xml
Log:
added test-upgrade module
Added: jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/jbpm.cfg.xml (rev 0)
+++ jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/jbpm.cfg.xml 2009-10-26 10:26:10 UTC (rev 5795)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <import resource="jbpm.default.cfg.xml" />
+ <import resource="jbpm.businesscalendar.cfg.xml" />
+ <import resource="jbpm.tx.hibernate.cfg.xml" />
+ <import resource="jbpm.jpdl.cfg.xml" />
+ <import resource="jbpm.identity.cfg.xml" />
+
+</jbpm-configuration>
Property changes on: jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/jbpm.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/jbpm.hibernate.cfg.xml
===================================================================
--- jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/jbpm.hibernate.cfg.xml (rev 0)
+++ jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/jbpm.hibernate.cfg.xml 2009-10-26 10:26:10 UTC (rev 5795)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+ <session-factory>
+
+ <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
+ <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
+ <property name="hibernate.connection.url">jdbc:hsqldb:mem:.</property>
+ <property name="hibernate.connection.username">sa</property>
+ <property name="hibernate.connection.password"></property>
+ <property name="hibernate.hbm2ddl.auto">create-drop</property>
+ <property name="hibernate.format_sql">true</property>
+
+ <mapping resource="jbpm.repository.hbm.xml" />
+ <mapping resource="jbpm.execution.hbm.xml" />
+ <mapping resource="jbpm.history.hbm.xml" />
+ <mapping resource="jbpm.task.hbm.xml" />
+ <mapping resource="jbpm.identity.hbm.xml" />
+
+ </session-factory>
+</hibernate-configuration>
Property changes on: jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/jbpm.hibernate.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/logging.properties
===================================================================
--- jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/logging.properties (rev 0)
+++ jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/logging.properties 2009-10-26 10:26:10 UTC (rev 5795)
@@ -0,0 +1,18 @@
+handlers= java.util.logging.ConsoleHandler
+redirect.commons.logging = enabled
+
+java.util.logging.ConsoleHandler.level = FINEST
+java.util.logging.ConsoleHandler.formatter = org.jbpm.internal.log.LogFormatter
+
+org.jbpm.level=FINE
+# org.jbpm.pvm.internal.tx.level=FINE
+# org.jbpm.pvm.internal.wire.level=FINE
+# org.jbpm.pvm.internal.util.level=FINE
+
+org.hibernate.level=INFO
+org.hibernate.cfg.SettingsFactory.level=SEVERE
+org.hibernate.cfg.HbmBinder.level=SEVERE
+# org.hibernate.SQL.level=FINEST
+# org.hibernate.type.level=FINEST
+# org.hibernate.tool.hbm2ddl.SchemaExport.level=FINEST
+# org.hibernate.transaction.level=FINEST
\ No newline at end of file
Property changes on: jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/logging.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/testprocess1.jpdl.xml
===================================================================
--- jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/testprocess1.jpdl.xml (rev 0)
+++ jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/testprocess1.jpdl.xml 2009-10-26 10:26:10 UTC (rev 5795)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+ <process name="testprocess1">
+
+ <start>
+ <transition to="theFork"/>
+ </start>
+
+ <fork name="theFork">
+ <transition to="send invoice"/>
+ <transition to="load truck"/>
+ <transition to="print documents"/>
+ </fork>
+
+ <state name="send invoice">
+ <transition to="theJoin"/>
+ </state>
+
+ <state name="load truck">
+ <transition to="shipping join"/>
+ </state>
+
+ <state name="print documents">
+ <transition to="shipping join"/>
+ </state>
+
+ <join name="shipping join">
+ <transition to="drive truck"/>
+ </join>
+
+ <state name="drive truck">
+ <transition to="theJoin"/>
+ </state>
+
+ <join name="theJoin">
+ <transition to="end"/>
+ </join>
+
+ <end name="end"/>
+
+ </process>
\ No newline at end of file
Property changes on: jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/testprocess1.jpdl.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/testprocess2.jpdl.xml
===================================================================
--- jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/testprocess2.jpdl.xml (rev 0)
+++ jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/testprocess2.jpdl.xml 2009-10-26 10:26:10 UTC (rev 5795)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="testprocess2">
+
+ <start>
+ <transition to="testVariable" />
+ </start>
+
+ <decision name="testVariable">
+ <transition to="end">
+ <condition expr="#{var < 6}" />
+ </transition>
+ <transition to="more than 5">
+ <condition expr="#{var > 5}" />
+ </transition>
+ </decision>
+
+ <state name="more than 5">
+ <transition to="testVariable" />
+ </state>
+
+ <end name="end" />
+
+</process>
\ No newline at end of file
Property changes on: jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/testprocess2.jpdl.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/testprocess3.jpdl.xml
===================================================================
--- jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/testprocess3.jpdl.xml (rev 0)
+++ jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/testprocess3.jpdl.xml 2009-10-26 10:26:10 UTC (rev 5795)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="testprocess3">
+
+ <start>
+ <transition to="do something important" />
+ </start>
+
+ <task name="do something important" assignee="johnDoe">
+ <transition name="timeout" to="timed out">
+ <timer duedate="3 days" />
+ </transition>
+ <transition name="done" to="end" />
+ </task>
+
+ <state name="timed out">
+ <transition to="end" />
+ </state>
+
+ <end name="end" />
+
+</process>
\ No newline at end of file
Property changes on: jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/testprocess3.jpdl.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 6 months
JBoss JBPM SVN: r5794 - in jbpm4/tags/jbpm-4.1/modules: test-upgrade and 7 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-10-26 06:20:11 -0400 (Mon, 26 Oct 2009)
New Revision: 5794
Added:
jbpm4/tags/jbpm-4.1/modules/test-upgrade/
jbpm4/tags/jbpm-4.1/modules/test-upgrade/.classpath
jbpm4/tags/jbpm-4.1/modules/test-upgrade/.project
jbpm4/tags/jbpm-4.1/modules/test-upgrade/.settings/
jbpm4/tags/jbpm-4.1/modules/test-upgrade/pom.xml
jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/
jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/
jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/java/
jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/java/org/
jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/java/org/jbpm/
jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/java/org/jbpm/upgrade/
jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/java/org/jbpm/upgrade/BeforeUpgrade.java
jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/resources/
jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/test/
jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/test/java/
jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/test/resources/
jbpm4/tags/jbpm-4.1/modules/test-upgrade/target/
Log:
added test-upgrade module
Added: jbpm4/tags/jbpm-4.1/modules/test-upgrade/.classpath
===================================================================
--- jbpm4/tags/jbpm-4.1/modules/test-upgrade/.classpath (rev 0)
+++ jbpm4/tags/jbpm-4.1/modules/test-upgrade/.classpath 2009-10-26 10:20:11 UTC (rev 5794)
@@ -0,0 +1,10 @@
+<?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/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/classes"/>
+</classpath>
Property changes on: jbpm4/tags/jbpm-4.1/modules/test-upgrade/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/tags/jbpm-4.1/modules/test-upgrade/.project
===================================================================
--- jbpm4/tags/jbpm-4.1/modules/test-upgrade/.project (rev 0)
+++ jbpm4/tags/jbpm-4.1/modules/test-upgrade/.project 2009-10-26 10:20:11 UTC (rev 5794)
@@ -0,0 +1,23 @@
+<projectDescription>
+ <name>jbpm-test-upgrade</name>
+ <comment/>
+ <projects>
+ <project>api</project>
+ <project>jpdl</project>
+ <project>log</project>
+ <project>pvm</project>
+ <project>test-base</project>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Property changes on: jbpm4/tags/jbpm-4.1/modules/test-upgrade/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/tags/jbpm-4.1/modules/test-upgrade/pom.xml
===================================================================
--- jbpm4/tags/jbpm-4.1/modules/test-upgrade/pom.xml (rev 0)
+++ jbpm4/tags/jbpm-4.1/modules/test-upgrade/pom.xml 2009-10-26 10:20:11 UTC (rev 5794)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ====================================================================== -->
+<!-- -->
+<!-- JBoss, the OpenSource J2EE webOS -->
+<!-- -->
+<!-- Distributable under LGPL license. -->
+<!-- See terms of license at http://www.gnu.org. -->
+<!-- -->
+<!-- ====================================================================== -->
+
+<!-- $Id: pom.xml 3010 2008-11-20 08:30:16Z tom.baeyens(a)jboss.com $ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <!-- Module Info -->
+ <modelVersion>4.0.0</modelVersion>
+ <name>jBPM 4 - TEST-UPGRADE</name>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-test-upgrade</artifactId>
+ <packaging>jar</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm</artifactId>
+ <version>4.1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-jpdl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>${hsqldb.version}</version>
+ </dependency>
+ </dependencies>
+
+</project>
Property changes on: jbpm4/tags/jbpm-4.1/modules/test-upgrade/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/java/org/jbpm/upgrade/BeforeUpgrade.java
===================================================================
--- jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/java/org/jbpm/upgrade/BeforeUpgrade.java (rev 0)
+++ jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/java/org/jbpm/upgrade/BeforeUpgrade.java 2009-10-26 10:20:11 UTC (rev 5794)
@@ -0,0 +1,163 @@
+/*
+ * 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.upgrade;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.jbpm.api.Configuration;
+import org.jbpm.api.Execution;
+import org.jbpm.api.ExecutionService;
+import org.jbpm.api.ManagementService;
+import org.jbpm.api.NewDeployment;
+import org.jbpm.api.ProcessEngine;
+import org.jbpm.api.RepositoryService;
+import org.jbpm.api.job.Job;
+
+/**
+ * Class to be executed during the upgrade test, before the actual schema
+ * upgrade is applied. This class will populate the 'old' DB schema with
+ * process, variables, history, ... data, that will be verified by the
+ * {@link AfterUpgrade} class.
+ *
+ * @author jbarrez
+ */
+public class BeforeUpgrade {
+
+ private ProcessEngine processEngine;
+
+ private RepositoryService repositoryService;
+
+ private ExecutionService executionService;
+
+ private ManagementService managementService;
+
+ private static final String TEST_PROCESS_1 = "testprocess1.jpdl.xml";
+
+ private static final String TEST_PROCESS_2 = "testprocess2.jpdl.xml";
+
+ private static final String TEST_PROCESS_3 = "testprocess3.jpdl.xml";
+
+ public static void main(String[] args) {
+ BeforeUpgrade beforeUpgrade = new BeforeUpgrade();
+ beforeUpgrade.generateProcess1Data();
+ beforeUpgrade.generateProcess2Data();
+ beforeUpgrade.generateProcess3Data();
+ }
+
+ public BeforeUpgrade() {
+ this.processEngine = new Configuration().buildProcessEngine();
+ this.repositoryService = processEngine.getRepositoryService();
+ this.executionService = processEngine.getExecutionService();
+ this.managementService = processEngine.getManagementService();
+ }
+
+
+ private void deploy(String processFile) {
+ NewDeployment deployment = repositoryService.createDeployment();
+ deployment.addResourceFromClasspath(processFile);
+ deployment.deploy();
+ }
+
+ /**
+ * Process 1 is a simple process using fork/join and states
+ */
+ private void generateProcess1Data() {
+
+ // Deploy test processes
+ deploy(TEST_PROCESS_1);
+
+ // Start 5 instances of process1
+ List<String> ids = new ArrayList<String>();
+ for (int i = 0; i < 5; i++) {
+ String procDefKey = TEST_PROCESS_1.replace(".jpdl.xml", "");
+ String procInstKey = procDefKey + "-" + i;
+ ids.add(executionService.startProcessInstanceByKey(procDefKey, procInstKey).getId());
+ }
+
+ // Put these instances in various states
+
+ // First one: only in state 'print documents'
+ String execId = executionService.findProcessInstanceById(ids.get(0)).findActiveExecutionIn("send invoice").getId();
+ executionService.signalExecutionById(execId);
+
+ execId = executionService.findProcessInstanceById(ids.get(0)).findActiveExecutionIn("load truck").getId();
+ executionService.signalExecutionById(execId);
+
+ // Second one: put in state 'load truck' and 'send invoice'
+ execId = executionService.findProcessInstanceById(ids.get(1)).findActiveExecutionIn("print documents").getId();
+ executionService.signalExecutionById(execId);
+
+ // third one: finished
+ executionService.endProcessInstance(ids.get(2), Execution.STATE_ENDED);
+
+ }
+
+ /**
+ * Process 2 is a process using variables and a decision
+ */
+ private void generateProcess2Data() {
+
+ // Deploy test process
+ deploy(TEST_PROCESS_2);
+
+ // Start 6 instances, of which 3 will be ended
+ List<String> ids = new ArrayList<String>();
+ for (int i = 0; i < 7; i++) {
+
+ String procDefKey = TEST_PROCESS_2.replace(".jpdl.xml", "");
+ String procInstKey = procDefKey + "-" + i;
+
+ Map<String, Object> vars = new HashMap<String, Object>();
+ vars.put("var", i * 2); // we store as var: 0, 2, 4, 6, 8, 10, 12
+ ids.add(executionService.startProcessInstanceByKey(procDefKey, vars, procInstKey).getId());
+ }
+
+
+ }
+
+ /**
+ * Process 3 is a basic process containing a human task and a timer
+ */
+ private void generateProcess3Data() {
+
+ // Deploy test process
+ deploy(TEST_PROCESS_3);
+
+ // Start 2 instances, 1 will have timer fired
+ List<String> ids = new ArrayList<String>();
+ for (int i = 0; i < 2; i++) {
+
+ String procDefKey = TEST_PROCESS_3.replace(".jpdl.xml", "");
+ String procInstKey = procDefKey + "-" + i;
+ ids.add(executionService.startProcessInstanceByKey(procDefKey, procInstKey).getId());
+ }
+
+ Job timer = managementService.createJobQuery()
+ .processInstanceId(ids.get(0)).uniqueResult();
+ managementService.executeJob(timer.getId());
+
+ }
+
+}
Property changes on: jbpm4/tags/jbpm-4.1/modules/test-upgrade/src/main/java/org/jbpm/upgrade/BeforeUpgrade.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 6 months
JBoss JBPM SVN: r5793 - jbpm4/tags/jbpm-4.0/modules/test-upgrade.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-10-26 05:53:18 -0400 (Mon, 26 Oct 2009)
New Revision: 5793
Modified:
jbpm4/tags/jbpm-4.0/modules/test-upgrade/
Log:
added target to svn:ignore of module test-upgrade
Property changes on: jbpm4/tags/jbpm-4.0/modules/test-upgrade
___________________________________________________________________
Name: svn:ignore
+ target
16 years, 6 months