[jbpm-commits] JBoss JBPM SVN: r5970 - in jbpm4/trunk: modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd and 15 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Wed Dec 16 10:38:58 EST 2009
Author: tom.baeyens at jboss.com
Date: 2009-12-16 10:38:57 -0500 (Wed, 16 Dec 2009)
New Revision: 5970
Added:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/AbstractTransaction.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/DeserializedObject.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/Transaction.java
jbpm4/trunk/qa/debug.on.jboss.setup.bat
Removed:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Transaction.java
Modified:
jbpm4/trunk/modules/distro/src/main/files/install/build.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExceptionHandler.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorMessageSession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTimerSession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerSynchronization.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransaction.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionInterceptor.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/StandardTransaction.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransaction.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/SerializableToBytesConverter.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TransactionBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TransactionRefBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/TransactionRefDescriptor.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/EnlistOperation.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/EnlistTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/tx/BasicTransactionTest.java
jbpm4/trunk/modules/test-cactus/src/main/java/org/jbpm/cactustool/CactusTestGenerator.java
jbpm4/trunk/modules/test-db/pom.xml
jbpm4/trunk/qa/build.xml
Log:
JBPM-2631 spring transactions
Modified: jbpm4/trunk/modules/distro/src/main/files/install/build.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/install/build.xml 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/distro/src/main/files/install/build.xml 2009-12-16 15:38:57 UTC (rev 5970)
@@ -72,17 +72,17 @@
<os name="sunos" />
</or>
</condition>
- <condition property="hsqldb.needed">
- <equals arg1="${database}" arg2="hsqldb" />
- </condition>
+ <condition property="is.hsqldb">
+ <equals arg1="${database}" arg2="hsqldb" />
+ </condition>
<!-- OS CONDITIONS -->
- <condition property="isWindows">
+ <condition property="is.windows">
<os family="windows"/>
</condition>
- <condition property="isNotWindows">
+ <condition property="is.not.windows">
<not>
- <isset property="isWindows" />
+ <isset property="is.windows" />
</not>
</condition>
@@ -143,7 +143,8 @@
description="installs jboss, installs jbpm into jboss, starts jboss, creates the jBPM DB schema, deploys examples, loads example identities, installs and starts eclipse">
<antcall target="internal.enable.jboss.debug.jboss500" />
<antcall target="internal.enable.jboss.debug.jboss510" />
- <antcall target="internal.install.and.start.hsqldb.if.needed" />
+ <antcall target="install.hsqldb.server" />
+ <antcall target="start.hsqldb.server" />
<antcall target="create.jbpm.schema" />
<antcall target="start.jboss" />
<antcall target="install.examples.into.jboss" />
@@ -402,7 +403,8 @@
<target name="demo.setup.tomcat"
depends="delete.tomcat, install.tomcat, install.jbpm.into.tomcat"
description="installs tomcat, installs jbpm into tomcat, starts tomcat, creates the jBPM DB schema, deploys examples, loads example identities, installs and starts eclipse">
- <antcall target="internal.install.and.start.hsqldb.if.needed" />
+ <antcall target="install.hsqldb.server" />
+ <antcall target="start.hsqldb.server" />
<antcall target="create.jbpm.schema" />
<antcall target="install.examples.into.tomcat" />
<antcall target="load.example.identities" />
@@ -413,7 +415,7 @@
<!-- ### DEMO TEARDOWN TOMCAT ################################################ -->
<target name="demo.teardown.tomcat"
- depends="stop.tomcat, internal.stop.hsqldb.server.if.needed"
+ depends="stop.tomcat, stop.hsqldb.server"
description="stops tomcat and then the hsqldb server if needed">
</target>
@@ -557,7 +559,7 @@
</target>
<!-- ### INSTALL HSQLDB SERVER ################################################ -->
- <target name="install.hsqldb.server">
+ <target name="install.hsqldb.server" if="is.hsqldb">
<delete dir="${hsqldb.server.install.dir}" /> <!-- Also deletes old data -->
<mkdir dir="${hsqldb.server.install.dir}"/>
<copy file="${jbpm.home}/lib/hsqldb.jar" todir="${hsqldb.server.install.dir}" />
@@ -572,7 +574,7 @@
</target>
<!-- ### START HSQLDB SERVER ################################################ -->
- <target name="start.hsqldb.server" >
+ <target name="start.hsqldb.server" if="is.hsqldb">
<taskdef name="start-hsqldb-server" classname="org.jbpm.pvm.internal.ant.StartHsqldbServerTask">
<classpath>
<fileset dir="${jbpm.home}">
@@ -584,7 +586,7 @@
</target>
<!-- ### SHUTDOWN HSQLDB SERVER ################################################ -->
- <target name="stop.hsqldb.server">
+ <target name="stop.hsqldb.server" if="is.hsqldb">
<sql driver="${jdbc.driver}"
password="${jdbc.password}"
url="${jdbc.url}"
@@ -772,15 +774,9 @@
<!-- ### INTERNAL TARGETS ### -->
<!-- ######################## -->
- <target name="internal.install.and.start.hsqldb.if.needed" if="hsqldb.needed">
- <antcall target="install.hsqldb.server" />
- <antcall target="start.hsqldb.server" />
- </target>
-
- <target name="internal.stop.hsqldb.server.if.needed" if="hsqldb.needed">
- <antcall target="stop.hsqldb.server" />
- </target>
-
+ <target name="enable.jboss.debug"
+ depends="internal.enable.jboss.debug.jboss500, internal.enable.jboss.debug.jboss510" />
+
<target name="internal.enable.jboss.debug.jboss500" if="is.jboss.500">
<echo message="enabling debug on ${jboss.home}" />
<replace file="${jboss.home}/bin/run.bat"
@@ -853,11 +849,11 @@
<copy file="${signavio.tmp.dir}/${signavio.war.file.name}" todir="${signavio.src.dir}" overwrite="true"/>
</target>
- <target name="internal.install.eclipse.windows" if="isWindows">
+ <target name="internal.install.eclipse.windows" if="is.windows">
<unzip src="${eclipse.distro.dir}/${eclipse.filename}" dest="${jbpm.home}" overwrite="true" />
</target>
- <target name="internal.install.eclipse.non.windows" if="isNotWindows">
+ <target name="internal.install.eclipse.non.windows" if="is.not.windows">
<gunzip src="${eclipse.distro.dir}/${eclipse.filename}" dest="${eclipse.distro.dir}" />
<untar src="${eclipse.distro.dir}/${eclipse.tarfilename}" dest="${jbpm.home}" overwrite="true" />
<delete file="${eclipse.distro.dir}/${eclipse.tarfilename}"/>
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -29,10 +29,10 @@
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.JobContext;
-import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.job.JobImpl;
import org.jbpm.pvm.internal.jobexecutor.JobExceptionHandler;
import org.jbpm.pvm.internal.session.DbSession;
+import org.jbpm.pvm.internal.tx.Transaction;
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Transaction.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Transaction.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Transaction.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -1,36 +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.pvm.internal.env;
-
-import javax.transaction.Synchronization;
-
-
-/** provides access to the transaction in the environment.
- *
- * @author Tom Baeyens
- */
-public interface Transaction {
-
- /** register a transaction listener. This method will have no
- * effect if the transactionListener is null. */
- void registerSynchronization(Synchronization synchronization);
-}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -30,7 +30,6 @@
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.cal.BusinessCalendar;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
-import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.id.DbidGenerator;
import org.jbpm.pvm.internal.jobexecutor.JobAddedNotification;
import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
@@ -38,6 +37,7 @@
import org.jbpm.pvm.internal.script.ScriptManager;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.session.TimerSession;
+import org.jbpm.pvm.internal.tx.Transaction;
import org.jbpm.pvm.internal.util.Clock;
/** a runtime timer instance.
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExceptionHandler.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExceptionHandler.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExceptionHandler.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -31,9 +31,9 @@
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.Transaction;
import org.jbpm.pvm.internal.job.JobImpl;
import org.jbpm.pvm.internal.session.DbSession;
+import org.jbpm.pvm.internal.tx.Transaction;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorMessageSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorMessageSession.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorMessageSession.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -24,9 +24,9 @@
import org.jbpm.api.job.Message;
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
-import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.session.MessageSession;
+import org.jbpm.pvm.internal.tx.Transaction;
import org.jbpm.pvm.internal.util.ReflectUtil;
/**
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTimerSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTimerSession.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTimerSession.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -21,9 +21,9 @@
import org.jbpm.api.JbpmException;
import org.jbpm.api.job.Timer;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.job.TimerImpl;
import org.jbpm.pvm.internal.session.TimerSession;
+import org.jbpm.pvm.internal.tx.Transaction;
/**
* Timers created with this service are committed at the end of the transaction,
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -31,9 +31,9 @@
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.cmd.CommandService;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
-import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.model.op.AtomicOperation;
import org.jbpm.pvm.internal.model.op.MoveToChildActivity;
+import org.jbpm.pvm.internal.tx.Transaction;
import org.jbpm.pvm.internal.wire.Descriptor;
/**
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerSynchronization.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerSynchronization.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerSynchronization.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -28,8 +28,8 @@
import org.jbpm.api.cmd.Command;
import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.cmd.CommandService;
-import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.session.DbSession;
+import org.jbpm.pvm.internal.tx.Transaction;
public class ExceptionHandlerSynchronization implements Synchronization, Command<Object> {
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/AbstractTransaction.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/AbstractTransaction.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/AbstractTransaction.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -0,0 +1,49 @@
+/*
+ * 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.pvm.internal.tx;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public abstract class AbstractTransaction implements Transaction {
+
+ List<DeserializedObject> deserializedObjects = null;
+
+ public void registerDeserializedObject(DeserializedObject deserializedObject) {
+ if (deserializedObjects==null) {
+ deserializedObjects = new ArrayList<DeserializedObject>();
+ }
+ deserializedObjects.add(deserializedObject);
+ }
+
+ public void flushDeserializedObjects() {
+ if (deserializedObjects!=null) {
+ for (DeserializedObject deserializedObject: deserializedObjects) {
+ deserializedObject.flush();
+ }
+ }
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/AbstractTransaction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/DeserializedObject.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/DeserializedObject.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/DeserializedObject.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -0,0 +1,67 @@
+/*
+ * 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.pvm.internal.tx;
+
+import java.util.Arrays;
+
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
+import org.jbpm.pvm.internal.type.converter.SerializableToBytesConverter;
+import org.jbpm.pvm.internal.type.variable.BlobVariable;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DeserializedObject {
+
+ private static final SerializableToBytesConverter serializableToBytesConverter = new SerializableToBytesConverter();
+
+ Object deserializedObject;
+ ScopeInstanceImpl scopeInstance;
+ BlobVariable blobVariable;
+
+ public DeserializedObject(Object deserializedObject, ScopeInstanceImpl scopeInstance, BlobVariable blobVariable) {
+ this.deserializedObject = deserializedObject;
+ this.scopeInstance = scopeInstance;
+ this.blobVariable = blobVariable;
+ }
+
+ public void flush() {
+ String variableName = blobVariable.getKey();
+ Object currentValue = scopeInstance.getVariable(variableName);
+
+ // first check if the deserialized object still is the value for that variable.
+ // a different, new object (of any type) might have been set in the meantime in that key-value-pair
+ if ( (currentValue!=null)
+ && (currentValue==deserializedObject)
+ ) {
+ // next, we check if the serialized object was actually changed or not
+ byte[] newBytes = (byte[]) serializableToBytesConverter.convert(currentValue, null, null);
+ byte[] persistedBytes = blobVariable.getLob().extractBytes();
+ // if it is changed
+ if (!Arrays.equals(persistedBytes, newBytes)) {
+ // then do an automatic update
+ blobVariable.setValue(deserializedObject, scopeInstance);
+ }
+ }
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/DeserializedObject.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransaction.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransaction.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransaction.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -25,14 +25,13 @@
import javax.transaction.Synchronization;
-import org.jbpm.pvm.internal.env.Transaction;
import org.springframework.transaction.support.TransactionSynchronizationManager;
/**
* @author Tom Baeyens
*/
-public class SpringTransaction implements Transaction, Serializable {
+public class SpringTransaction extends AbstractTransaction implements Transaction, Serializable {
private static final long serialVersionUID = 1L;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionInterceptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionInterceptor.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionInterceptor.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -57,6 +57,10 @@
try {
returnValue = next.execute(command);
+ EnvironmentImpl
+ .getFromCurrent(SpringTransaction.class)
+ .flushDeserializedObjects();
+
completedSuccessfully = true;
} finally {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/StandardTransaction.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/StandardTransaction.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/StandardTransaction.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -28,7 +28,6 @@
import javax.transaction.Synchronization;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Transaction;
/** simple 2 phase commit transaction.
@@ -36,7 +35,7 @@
* non thread safe (which is ok).
* @author Tom Baeyens
*/
-public class StandardTransaction implements Transaction, Serializable {
+public class StandardTransaction extends AbstractTransaction implements Transaction, Serializable {
private static final long serialVersionUID = 1L;
private static Log log = Log.getLog(StandardTransaction.class.getName());
@@ -89,6 +88,8 @@
/** implements simplest two phase commit. */
public void commit() {
+ flushDeserializedObjects();
+
if (state!=State.ACTIVE) {
throw new TransactionException("commit on transaction in state "+state);
}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/Transaction.java (from rev 5967, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Transaction.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/Transaction.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/Transaction.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -0,0 +1,40 @@
+/*
+ * 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.pvm.internal.tx;
+
+import javax.transaction.Synchronization;
+
+
+
+/** provides access to the transaction in the environment.
+ *
+ * @author Tom Baeyens
+ */
+public interface Transaction {
+
+ /** register a transaction listener. This method will have no
+ * effect if the transactionListener is null. */
+ void registerSynchronization(Synchronization synchronization);
+
+ /** for auto update of deserialized objects */
+ void registerDeserializedObject(DeserializedObject deserializedObject);
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/Transaction.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransaction.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransaction.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransaction.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -30,16 +30,14 @@
import org.jbpm.api.JbpmException;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Transaction;
-import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
-import org.jbpm.pvm.internal.tx.FlushDeserializedObject;
-import org.jbpm.pvm.internal.type.Variable;
+import org.jbpm.pvm.internal.tx.AbstractTransaction;
+import org.jbpm.pvm.internal.tx.Transaction;
/**
* @author Tom Baeyens
*/
-public class JtaTransaction implements Transaction {
+public class JtaTransaction extends AbstractTransaction implements Transaction {
private static Log log = Log.getLog(JtaTransaction.class.getName());
@@ -91,6 +89,8 @@
public void commit() {
try {
+ flushDeserializedObjects();
+
lookupJeeUserTransaction().commit();
} catch (Exception e) {
throw new JbpmException("couldn't commit: "+e.getMessage(), e);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/SerializableToBytesConverter.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/SerializableToBytesConverter.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/SerializableToBytesConverter.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -30,11 +30,13 @@
import org.jbpm.api.JbpmException;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
-import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
+import org.jbpm.pvm.internal.tx.DeserializedObject;
import org.jbpm.pvm.internal.tx.FlushDeserializedObject;
+import org.jbpm.pvm.internal.tx.Transaction;
import org.jbpm.pvm.internal.type.Converter;
import org.jbpm.pvm.internal.type.Variable;
+import org.jbpm.pvm.internal.type.variable.BlobVariable;
public class SerializableToBytesConverter implements Converter {
@@ -69,7 +71,7 @@
Transaction transaction = EnvironmentImpl.getFromCurrent(Transaction.class, false);
if (transaction!=null) {
- transaction.registerSynchronization(new FlushDeserializedObject(object, scopeInstance, variable));
+ transaction.registerDeserializedObject(new DeserializedObject(object, scopeInstance, (BlobVariable) variable));
}
return object;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TransactionBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TransactionBinding.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TransactionBinding.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -21,9 +21,9 @@
*/
package org.jbpm.pvm.internal.wire.binding;
-import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.tx.SpringTransaction;
import org.jbpm.pvm.internal.tx.StandardTransaction;
+import org.jbpm.pvm.internal.tx.Transaction;
import org.jbpm.pvm.internal.tx.jta.JtaTransaction;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.internal.xml.Parse;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TransactionRefBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TransactionRefBinding.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TransactionRefBinding.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.wire.binding;
-import org.jbpm.pvm.internal.env.Transaction;
+import org.jbpm.pvm.internal.tx.Transaction;
import org.jbpm.pvm.internal.wire.descriptor.TransactionRefDescriptor;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/TransactionRefDescriptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/TransactionRefDescriptor.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/TransactionRefDescriptor.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.wire.descriptor;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
-import org.jbpm.pvm.internal.env.Transaction;
+import org.jbpm.pvm.internal.tx.Transaction;
import org.jbpm.pvm.internal.wire.WireContext;
/**
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/EnlistOperation.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/EnlistOperation.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/EnlistOperation.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -1,9 +1,9 @@
package org.jbpm.pvm.internal.wire.operation;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.tx.StandardResource;
import org.jbpm.pvm.internal.tx.StandardTransaction;
+import org.jbpm.pvm.internal.tx.Transaction;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.WireException;
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/EnlistTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/EnlistTest.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/EnlistTest.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -4,7 +4,6 @@
import java.util.List;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
-import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.WireException;
import org.jbpm.pvm.internal.wire.WireTestCase;
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/tx/BasicTransactionTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/tx/BasicTransactionTest.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/tx/BasicTransactionTest.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -31,9 +31,9 @@
import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.cmd.CommandService;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
-import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.history.model.HistoryCommentImpl;
import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
+import org.jbpm.pvm.internal.tx.Transaction;
import org.jbpm.test.JbpmTestCase;
/**
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-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/test-cactus/src/main/java/org/jbpm/cactustool/CactusTestGenerator.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -31,12 +31,20 @@
*/
public class CactusTestGenerator {
+ static String testFilter = System.getProperty("test.filter");
+
public static void main(String[] args) {
try {
if (args==null) {
log("syntax: java -cp ... org.jbpm.cactustool.CactusTestGenerator testdestroot testsrcroot1 testsrcroot2 ...");
}
+ if (testFilter!=null) {
+ log("################################################################################################");
+ log("# test.filter: "+testFilter);
+ log("################################################################################################");
+ }
+
String testPackageSourceDir = args[0]+"/org/jbpm/test";
new File(testPackageSourceDir).mkdirs();
@@ -85,7 +93,8 @@
String fileName = file.getName();
if ( file.isFile()
&& fileName.endsWith("Test.java")
- && ! fileName.endsWith("SQLStmtTest.java")
+ && (! fileName.endsWith("SQLStmtTest.java"))
+ && (testFilter==null || (fileName.indexOf(testFilter)!=-1))
) {
String className = packageName + "." + fileName.substring(0, fileName.length()-5)+".class";
log(" adding "+className);
Modified: jbpm4/trunk/modules/test-db/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-db/pom.xml 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/test-db/pom.xml 2009-12-16 15:38:57 UTC (rev 5970)
@@ -66,13 +66,13 @@
<artifactId>drools-compiler</artifactId>
</dependency>
<dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring</artifactId>
+ <groupId>org.subethamail</groupId>
+ <artifactId>subethasmtp-wiser</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.subethamail</groupId>
- <artifactId>subethasmtp-wiser</artifactId>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
@@ -98,14 +98,6 @@
</execution>
</executions>
</plugin>
-
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <forkMode>never</forkMode> <!-- Without this setting, mvn 2.1.0 doesn't copy command line properties sometimes -->
- </configuration>
- </plugin>
-
</plugins>
</build>
Modified: jbpm4/trunk/qa/build.xml
===================================================================
--- jbpm4/trunk/qa/build.xml 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/qa/build.xml 2009-12-16 15:38:57 UTC (rev 5970)
@@ -64,7 +64,8 @@
depends="reinstall.jbpm">
<ant antfile="${jbpm.home}/install/build.xml" target="reinstall.tomcat" />
<ant antfile="${jbpm.home}/install/build.xml" target="create.user.webapp" />
- <ant antfile="${jbpm.home}/install/build.xml" target="internal.install.and.start.hsqldb.if.needed" />
+ <ant antfile="${jbpm.home}/install/build.xml" target="install.hsqldb.server" />
+ <ant antfile="${jbpm.home}/install/build.xml" target="start.hsqldb.server" />
<ant antfile="${jbpm.home}/install/build.xml" target="create.jbpm.schema" />
<!-- to build the jbpm test webapp we start by copying the user webapp -->
@@ -101,112 +102,43 @@
<target name="testsuite.tomcat.teardown">
<ant antfile="${jbpm.home}/install/build.xml" target="stop.tomcat" />
<ant antfile="${jbpm.home}/install/build.xml" target="drop.jbpm.schema" />
- <ant antfile="${jbpm.home}/install/build.xml" target="internal.stop.hsqldb.server.if.needed" />
- </target>
-
+ <ant antfile="${jbpm.home}/install/build.xml" target="stop.hsqldb.server" />
+ </target>
+
<!-- JBOSS SETUP -->
<target name="testsuite.jboss.setup"
- depends="reinstall.jbpm"
+ depends="jboss.test.setup.base"
description="reinstalls jbpm, reinstalls jboss, installs jbpm into jboss, starts jboss and then creates the jbpm schema">
- <ant antfile="${jbpm.home}/install/build.xml" target="reinstall.jboss" />
- <ant antfile="${jbpm.home}/install/build.xml" target="install.jbpm.into.jboss" />
- <ant antfile="${jbpm.home}/install/build.xml" target="create.user.webapp" />
-
- <ant antfile="${jbpm.home}/install/build.xml" target="internal.install.and.start.hsqldb.if.needed" />
+ <!-- start hsqldb -->
+ <ant antfile="${jbpm.home}/install/build.xml" target="start.hsqldb.server" />
<ant antfile="${jbpm.home}/install/build.xml" target="create.jbpm.schema" />
- <ant antfile="${jbpm.home}/examples/build.xml" target="examples.jar" />
- <mkdir dir="${jboss.server.config.dir}/deploy/jbpm/userlibs" />
- <copy file="${jbpm.home}/examples/target/examples.jar"
- todir="${jboss.server.config.dir}/deploy/jbpm/userlibs" />
-
- <!-- to build the jbpm test webapp we start by copying the user webapp -->
- <mkdir dir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war" />
- <copy todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war">
- <fileset dir="${jbpm.home}/install/generated/user-webapp"/>
- </copy>
-
- <!-- customize the jbpm configuration for the testsuite -->
- <copy todir="${jboss.home}/server/default/deploy/jbpm/jbpm-service.sar" overwrite="true">
- <fileset dir="jboss.jbpm.cfg" />
- </copy>
-
- <!-- customize the configuration for the jbpm-test-webapp -->
- <copy todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war" overwrite="true">
- <fileset dir="cactus.webapp.cfg" />
- </copy>
-
- <!-- delete the jbpm configuration files -->
- <delete dir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/classes" />
- <delete file="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib/jta.jar" />
-
- <!-- add examples.jar -->
- <ant antfile="${jbpm.home}/examples/build.xml" target="examples.jar" />
- <copy file="${jbpm.home}/examples/target/examples.jar" todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib" />
-
- <!-- add junit.jar -->
- <copy file="${jbpm.home}/lib/junit.jar" todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib" />
-
- <!-- add the cactus libs -->
- <copy todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib">
- <fileset dir="../modules/test-cactus/target/jbpm.test.webapp.libs" />
- </copy>
-
<!-- start jboss -->
<ant antfile="${jbpm.home}/install/build.xml" target="start.jboss" />
</target>
+ <target name="testsuite.jboss.setup.for.debug"
+ depends="jboss.test.setup.base"
+ description="reinstalls jbpm, reinstalls jboss, installs jbpm into jboss, starts jboss and then creates the jbpm schema">
+ <!-- start hsqldb -->
+ <ant antfile="${jbpm.home}/install/build.xml" target="start.hsqldb.server" />
+ <ant antfile="${jbpm.home}/install/build.xml" target="create.jbpm.schema" />
+ <!-- enable debug on jboss -->
+ <ant antfile="${jbpm.home}/install/build.xml" target="enable.jboss.debug" />
+ </target>
+
<!-- JBOSS TEARDOWN -->
<target name="testsuite.jboss.teardown"
description="drops the jbpm schema and stops jboss">
<ant antfile="${jbpm.home}/install/build.xml" target="stop.jboss" />
<ant antfile="${jbpm.home}/install/build.xml" target="drop.jbpm.schema" />
- <ant antfile="${jbpm.home}/install/build.xml" target="internal.stop.hsqldb.server.if.needed" />
+ <ant antfile="${jbpm.home}/install/build.xml" target="stop.hsqldb.server" />
</target>
<!-- ENTERPRISE SETUP -->
<target name="testsuite.enterprise.setup"
- depends="reinstall.jbpm"
- description="reinstalls jbpm, reinstalls jboss, installs jbpm into jboss, starts jboss and then creates the jbpm schema">
- <ant antfile="${jbpm.home}/install/build.xml" target="reinstall.jboss" />
- <ant antfile="${jbpm.home}/install/build.xml" target="install.jbpm.into.jboss" />
- <ant antfile="${jbpm.home}/install/build.xml" target="create.user.webapp" />
-
- <ant antfile="${jbpm.home}/install/build.xml" target="internal.install.and.start.hsqldb.if.needed" />
- <ant antfile="${jbpm.home}/install/build.xml" target="create.jbpm.schema" />
-
- <!-- to build the jbpm test webapp we start by copying the user webapp -->
- <mkdir dir="${jboss.home}/server/default/deploy/jbpm-test/jbpm-test-webapp.war" />
- <copy todir="${jboss.home}/server/default/deploy/jbpm-test/jbpm-test-webapp.war">
- <fileset dir="${jbpm.home}/install/generated/user-webapp"/>
- </copy>
-
- <!-- customize the jbpm configuration for the testsuite -->
- <copy todir="${jboss.home}/server/default/deploy/jbpm/jbpm-service.sar" overwrite="true">
- <fileset dir="jboss.jbpm.cfg" />
- </copy>
-
- <!-- customize the configuration for the jbpm-test-webapp -->
- <copy todir="${jboss.home}/server/default/deploy/jbpm-test/jbpm-test-webapp.war" overwrite="true">
- <fileset dir="cactus.webapp.cfg" />
- </copy>
-
- <!-- delete the jbpm configuration files -->
- <delete dir="${jboss.home}/server/default/deploy/jbpm-test/jbpm-test-webapp.war/WEB-INF/classes" />
- <delete file="${jboss.home}/server/default/deploy/jbpm-test/jbpm-test-webapp.war/WEB-INF/lib/jta.jar" />
-
- <!-- copy the test classes to the test web app -->
- <copy file="../modules/test-enterprise/test-enterprise-suite/target/jbpm-test-enterprise-suite-${jbpm.version}-tests.jar"
- todir="${jboss.home}/server/default/deploy/jbpm-test/jbpm-test-webapp.war/WEB-INF/lib" />
-
- <!-- add junit.jar -->
- <copy file="${jbpm.home}/lib/junit.jar"
- todir="${jboss.home}/server/default/deploy/jbpm-test/jbpm-test-webapp.war/WEB-INF/lib" />
-
- <!-- add the cactus libs -->
- <copy todir="${jboss.home}/server/default/deploy/jbpm-test/jbpm-test-webapp.war/WEB-INF/lib">
- <fileset dir="../modules/test-enterprise/test-enterprise-suite/target/jbpm.test.webapp.libs" />
- </copy>
+ depends="jboss.test.setup.base"
+ description="reinstalls jbpm, reinstalls jboss, installs jbpm into jboss, starts jboss and then creates the jbpm schema">
<!-- create the test queue -->
<copy file="../modules/test-enterprise/test-enterprise-suite/src/test/resources/jbpm-test-destinations-service.xml"
@@ -218,16 +150,14 @@
<!-- start jboss
<ant antfile="${jbpm.home}/install/build.xml" target="start.jboss" /> -->
-
</target>
-
<!-- ENTERPRISE TEARDOWN -->
<target name="testsuite.enterprise.teardown"
description="drops the jbpm schema and stops jboss">
<ant antfile="${jbpm.home}/install/build.xml" target="stop.jboss" />
<ant antfile="${jbpm.home}/install/build.xml" target="drop.jbpm.schema" />
- <ant antfile="${jbpm.home}/install/build.xml" target="internal.stop.hsqldb.server.if.needed" />
+ <ant antfile="${jbpm.home}/install/build.xml" target="stop.hsqldb.server" />
</target>
@@ -373,6 +303,54 @@
<!-- ### These targets can be called directly ### -->
<!-- ############################################ -->
+ <!-- re-install jbpm and setup jboss for cactus testing -->
+ <target name="jboss.test.setup.base"
+ depends="reinstall.jbpm">
+ <ant antfile="${jbpm.home}/install/build.xml" target="reinstall.jboss" />
+ <ant antfile="${jbpm.home}/install/build.xml" target="install.jbpm.into.jboss" />
+ <ant antfile="${jbpm.home}/install/build.xml" target="create.user.webapp" />
+ <ant antfile="${jbpm.home}/install/build.xml" target="install.hsqldb.server" />
+
+ <!-- make the example test classes and test delegation classes available as a user lib
+ <ant antfile="${jbpm.home}/examples/build.xml" target="examples.jar" />
+ <mkdir dir="${jboss.server.config.dir}/deploy/jbpm/userlibs" />
+ <copy file="${jbpm.home}/examples/target/examples.jar"
+ todir="${jboss.server.config.dir}/deploy/jbpm/userlibs" />
+ -->
+
+ <!-- to build the jbpm test webapp we start by copying the user webapp -->
+ <mkdir dir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war" />
+ <copy todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war">
+ <fileset dir="${jbpm.home}/install/generated/user-webapp"/>
+ </copy>
+
+ <!-- customize the jbpm configuration for the testsuite -->
+ <copy todir="${jboss.home}/server/default/deploy/jbpm/jbpm-service.sar" overwrite="true">
+ <fileset dir="jboss.jbpm.cfg" />
+ </copy>
+
+ <!-- customize the configuration for the jbpm-test-webapp -->
+ <copy todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war" overwrite="true">
+ <fileset dir="cactus.webapp.cfg" />
+ </copy>
+
+ <!-- delete the jbpm configuration files -->
+ <delete dir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/classes" />
+ <delete file="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib/jta.jar" />
+
+ <!-- add examples.jar -->
+ <ant antfile="${jbpm.home}/examples/build.xml" target="examples.jar" />
+ <copy file="${jbpm.home}/examples/target/examples.jar" todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib" />
+
+ <!-- add junit.jar -->
+ <copy file="${jbpm.home}/lib/junit.jar" todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib" />
+
+ <!-- add the cactus libs -->
+ <copy todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib">
+ <fileset dir="../modules/test-cactus/target/jbpm.test.webapp.libs" />
+ </copy>
+ </target>
+
<!-- REINSTALL JBPM -->
<target name="reinstall.jbpm"
description="deletes the jbpm installation and then reinstalls jbpm">
Added: jbpm4/trunk/qa/debug.on.jboss.setup.bat
===================================================================
--- jbpm4/trunk/qa/debug.on.jboss.setup.bat (rev 0)
+++ jbpm4/trunk/qa/debug.on.jboss.setup.bat 2009-12-16 15:38:57 UTC (rev 5970)
@@ -0,0 +1,4 @@
+ at echo off
+
+cmd /C mvn -U -Pdistro,integration clean install
+cmd /C ant -f qa/build.xml -Djboss.version=5.1.0.GA testsuite.jboss.setup.for.debug
More information about the jbpm-commits
mailing list