JBoss JBPM SVN: r6415 - in jbpm4/trunk/modules/test-db: src/test/java/org/jbpm/test/process and 1 other directory.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-06-15 04:40:55 -0400 (Tue, 15 Jun 2010)
New Revision: 6415
Modified:
jbpm4/trunk/modules/test-db/pom.xml
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/RepositoryServiceTest.java
Log:
exclude RepositoryServiceTest.testNonLatinProcessName from oracle suite
Modified: jbpm4/trunk/modules/test-db/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-db/pom.xml 2010-06-15 02:32:49 UTC (rev 6414)
+++ jbpm4/trunk/modules/test-db/pom.xml 2010-06-15 08:40:55 UTC (rev 6415)
@@ -97,6 +97,12 @@
<configuration>
<failIfNoTests>false</failIfNoTests>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
+ <systemProperties>
+ <property>
+ <name>database</name>
+ <value>${database}</value>
+ </property>
+ </systemProperties>
</configuration>
</plugin>
</plugins>
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/RepositoryServiceTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/RepositoryServiceTest.java 2010-06-15 02:32:49 UTC (rev 6414)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/RepositoryServiceTest.java 2010-06-15 08:40:55 UTC (rev 6415)
@@ -379,6 +379,11 @@
* @see <a href="https://jira.jboss.org/browse/JBPM-2746">JBPM-2746</a>
*/
public void testNonLatinProcessName() {
+ // temporarily exclude oracle due to qa database
+ String database = System.getProperty("database");
+ if (database != null && database.startsWith("oracle"))
+ return;
+
// "Lev Trotskij"
deployJpdlXmlString("<process name='\u041B\u0435\u0412 \u0422\u0440\u043E\u0446\u043A\u0438\u0439'>" +
" <start/>" +
13 years, 10 months
JBoss JBPM SVN: r6414 - jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model.
by do-not-reply@jboss.org
Author: rebody
Date: 2010-06-14 22:32:49 -0400 (Mon, 14 Jun 2010)
New Revision: 6414
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
Log:
JBPM-2820 try to handle NPE when using sub-process on DB2 environment.
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2010-06-15 01:58:05 UTC (rev 6413)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2010-06-15 02:32:49 UTC (rev 6414)
@@ -183,7 +183,6 @@
this.key = key;
save();
- composeIds();
HistoryEvent.fire(new ProcessInstanceCreate(), this);
}
@@ -191,7 +190,10 @@
protected void save() {
this.dbid = DbidGenerator.getDbidGenerator().getNextId();
DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class, false);
- if (dbSession!=null) {
+
+ composeIds();
+
+ if (dbSession != null) {
dbSession.save(this);
}
}
@@ -881,13 +883,14 @@
childExecution.processInstance = this.processInstance;
childExecution.name = name;
+ // composeIds uses the parent so the childExecution has to be added before the ids are composed
+ childExecution.setParent(this);
childExecution.save();
+
// make sure that child execution are saved before added to a persistent collection
// cause of the 'assigned' id strategy, adding the childExecution to the persistent collection
// before the dbid is assigned will result in identifier of an instance of ExecutionImpl altered from 0 to x
addExecution(childExecution);
- // composeIds uses the parent so the childExecution has to be added before the ids are composed
- childExecution.composeIds();
log.debug("created "+childExecution);
13 years, 10 months
JBoss JBPM SVN: r6413 - in jbpm4/trunk/modules/pvm/src: main/java/org/jbpm/pvm/internal/wire/binding and 1 other directories.
by do-not-reply@jboss.org
Author: rebody
Date: 2010-06-14 21:58:05 -0400 (Mon, 14 Jun 2010)
New Revision: 6413
Added:
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/binding/TransactionBindingTest.java
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/JtaTransaction.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TransactionBinding.java
Log:
JBPM-2694 let JtaTransaction's attributes configurable.
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/JtaTransaction.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/JtaTransaction.java 2010-06-15 01:07:58 UTC (rev 6412)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/JtaTransaction.java 2010-06-15 01:58:05 UTC (rev 6413)
@@ -1,152 +1,161 @@
-/*
- * 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.naming.InitialContext;
-import javax.transaction.Status;
-import javax.transaction.Synchronization;
-import javax.transaction.SystemException;
-import javax.transaction.TransactionManager;
-import javax.transaction.UserTransaction;
-
-import org.jbpm.api.JbpmException;
-import org.jbpm.internal.log.Log;
-
-
-/**
- * @author Tom Baeyens
- */
-public class JtaTransaction extends AbstractTransaction implements Transaction {
-
- private static Log log = Log.getLog(JtaTransaction.class.getName());
-
- public static final String JNDINAME_USERTRANSACTION_JBOSS_GLOBAL = "UserTransaction";
- public static final String JNDINAME_TRANSACTIONMANAGER_JBOSS_GLOBAL = "java:/TransactionManager";
-
- protected String userTransactionJndiName = JNDINAME_USERTRANSACTION_JBOSS_GLOBAL;
- protected String transactionManagerJndiName = JNDINAME_TRANSACTIONMANAGER_JBOSS_GLOBAL;
-
- public boolean isRollbackOnly() {
- try {
- return lookupJeeUserTransaction().getStatus()==Status.STATUS_MARKED_ROLLBACK;
- } catch (SystemException e) {
- throw new JbpmException("couldn't get status of user transaction: "+e.getMessage(), e);
- }
- }
-
- public void setRollbackOnly() {
- try {
- lookupJeeUserTransaction().setRollbackOnly();
- } catch (Exception e) {
- throw new JbpmException("couldn't set user transaction to rollback only: "+e.getMessage(), e);
- }
- }
-
- public void registerSynchronization(Synchronization synchronization) {
- try {
- lookupJeeTransaction().registerSynchronization(synchronization);
- } catch (Exception e) {
- throw new JbpmException("couldn't register synchronization: "+e.getMessage(), e);
- }
- }
-
- public void begin() {
- try {
- lookupJeeUserTransaction().begin();
- } catch (Exception e) {
- throw new JbpmException("couldn't begin transaction: "+e.getMessage(), e);
- }
- }
-
- public void rollback() {
- try {
- lookupJeeUserTransaction().rollback();
- } catch (Exception e) {
- throw new JbpmException("couldn't rollback: "+e.getMessage(), e);
- }
- }
-
- public void commit() {
- try {
- flushDeserializedObjects();
-
- lookupJeeUserTransaction().commit();
- } catch (Exception e) {
- throw new JbpmException("couldn't commit: "+e.getMessage(), e);
- }
- }
-
- public javax.transaction.Transaction suspend() {
- try {
- return lookupJeeTransactionManager().suspend();
- } catch (Exception e) {
- throw new JbpmException("couldn't suspend: "+e.getMessage(), e);
- }
- }
-
- public void resume(javax.transaction.Transaction transaction) {
- try {
- lookupJeeTransactionManager().resume(transaction);
- } catch (Exception e) {
- throw new JbpmException("couldn't resume: "+e.getMessage(), e);
- }
- }
-
- // lookups //////////////////////////////////////////////////////////////////
-
- public UserTransaction lookupJeeUserTransaction() {
- return (UserTransaction) lookupFromJndi(userTransactionJndiName);
- }
-
- public javax.transaction.Transaction lookupJeeTransaction() {
- try {
- TransactionManager transactionManager = lookupJeeTransactionManager();
- return transactionManager.getTransaction();
- } catch (Exception e) {
- throw new JbpmException("couldn't get transaction from transaction manager "+transactionManagerJndiName+": "+e.getMessage(), e);
- }
- }
-
- public TransactionManager lookupJeeTransactionManager() {
- return (TransactionManager) lookupFromJndi(transactionManagerJndiName);
- }
-
- public static Object lookupFromJndi(String jndiName) {
- try {
- InitialContext initialContext = new InitialContext();
- return initialContext.lookup(jndiName);
- } catch (Exception e) {
- throw new JbpmException("couldn't lookup '"+jndiName+"' from jndi: "+e.getMessage()+": "+e.getMessage(), e);
- }
- }
-
- public static int getUserTransactionStatus(UserTransaction userTransaction) {
- int status = -1;
- try {
- status = userTransaction.getStatus();
- } catch (SystemException e) {
- throw new JbpmException("couldn't get transaction status: "+e.getMessage(), e);
- }
- log.trace("jta transaction status: "+JtaStatusHelper.toString(status));
- return status;
- }
-}
+/*
+ * 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.naming.InitialContext;
+import javax.transaction.Status;
+import javax.transaction.Synchronization;
+import javax.transaction.SystemException;
+import javax.transaction.TransactionManager;
+import javax.transaction.UserTransaction;
+
+import org.jbpm.api.JbpmException;
+import org.jbpm.internal.log.Log;
+
+
+/**
+ * @author Tom Baeyens
+ * @author Huisheng Xu
+ */
+public class JtaTransaction extends AbstractTransaction implements Transaction {
+
+ private static Log log = Log.getLog(JtaTransaction.class.getName());
+
+ public static final String JNDINAME_USERTRANSACTION_JBOSS_GLOBAL = "UserTransaction";
+ public static final String JNDINAME_TRANSACTIONMANAGER_JBOSS_GLOBAL = "java:/TransactionManager";
+
+ protected String userTransactionJndiName = JNDINAME_USERTRANSACTION_JBOSS_GLOBAL;
+ protected String transactionManagerJndiName = JNDINAME_TRANSACTIONMANAGER_JBOSS_GLOBAL;
+
+ public boolean isRollbackOnly() {
+ try {
+ return lookupJeeUserTransaction().getStatus()==Status.STATUS_MARKED_ROLLBACK;
+ } catch (SystemException e) {
+ throw new JbpmException("couldn't get status of user transaction: "+e.getMessage(), e);
+ }
+ }
+
+ public void setRollbackOnly() {
+ try {
+ lookupJeeUserTransaction().setRollbackOnly();
+ } catch (Exception e) {
+ throw new JbpmException("couldn't set user transaction to rollback only: "+e.getMessage(), e);
+ }
+ }
+
+ public void registerSynchronization(Synchronization synchronization) {
+ try {
+ lookupJeeTransaction().registerSynchronization(synchronization);
+ } catch (Exception e) {
+ throw new JbpmException("couldn't register synchronization: "+e.getMessage(), e);
+ }
+ }
+
+ public void begin() {
+ try {
+ lookupJeeUserTransaction().begin();
+ } catch (Exception e) {
+ throw new JbpmException("couldn't begin transaction: "+e.getMessage(), e);
+ }
+ }
+
+ public void rollback() {
+ try {
+ lookupJeeUserTransaction().rollback();
+ } catch (Exception e) {
+ throw new JbpmException("couldn't rollback: "+e.getMessage(), e);
+ }
+ }
+
+ public void commit() {
+ try {
+ flushDeserializedObjects();
+
+ lookupJeeUserTransaction().commit();
+ } catch (Exception e) {
+ throw new JbpmException("couldn't commit: "+e.getMessage(), e);
+ }
+ }
+
+ public javax.transaction.Transaction suspend() {
+ try {
+ return lookupJeeTransactionManager().suspend();
+ } catch (Exception e) {
+ throw new JbpmException("couldn't suspend: "+e.getMessage(), e);
+ }
+ }
+
+ public void resume(javax.transaction.Transaction transaction) {
+ try {
+ lookupJeeTransactionManager().resume(transaction);
+ } catch (Exception e) {
+ throw new JbpmException("couldn't resume: "+e.getMessage(), e);
+ }
+ }
+
+ // lookups //////////////////////////////////////////////////////////////////
+
+ public UserTransaction lookupJeeUserTransaction() {
+ return (UserTransaction) lookupFromJndi(userTransactionJndiName);
+ }
+
+ public javax.transaction.Transaction lookupJeeTransaction() {
+ try {
+ TransactionManager transactionManager = lookupJeeTransactionManager();
+ return transactionManager.getTransaction();
+ } catch (Exception e) {
+ throw new JbpmException("couldn't get transaction from transaction manager "+transactionManagerJndiName+": "+e.getMessage(), e);
+ }
+ }
+
+ public TransactionManager lookupJeeTransactionManager() {
+ return (TransactionManager) lookupFromJndi(transactionManagerJndiName);
+ }
+
+ public static Object lookupFromJndi(String jndiName) {
+ try {
+ InitialContext initialContext = new InitialContext();
+ return initialContext.lookup(jndiName);
+ } catch (Exception e) {
+ throw new JbpmException("couldn't lookup '"+jndiName+"' from jndi: "+e.getMessage()+": "+e.getMessage(), e);
+ }
+ }
+
+ public static int getUserTransactionStatus(UserTransaction userTransaction) {
+ int status = -1;
+ try {
+ status = userTransaction.getStatus();
+ } catch (SystemException e) {
+ throw new JbpmException("couldn't get transaction status: "+e.getMessage(), e);
+ }
+ log.trace("jta transaction status: "+JtaStatusHelper.toString(status));
+ return status;
+ }
+
+ public String getUserTransactionJndiName() {
+ return userTransactionJndiName;
+ }
+
+ public String getTransactionManagerJndiName() {
+ return transactionManagerJndiName;
+ }
+}
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 2010-06-15 01:07:58 UTC (rev 6412)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TransactionBinding.java 2010-06-15 01:58:05 UTC (rev 6413)
@@ -21,23 +21,32 @@
*/
package org.jbpm.pvm.internal.wire.binding;
+import org.jbpm.internal.log.Log;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.tx.JtaTransaction;
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.wire.descriptor.ObjectDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.StringDescriptor;
+import org.jbpm.pvm.internal.wire.operation.FieldOperation;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
+import org.hibernate.cfg.Configuration;
import org.w3c.dom.Element;
+
/** parses a descriptor for creating a {@link Transaction}.
- *
+ *
* See schema docs for more details.
*
* @author Tom Baeyens
+ * @author Huisheng Xu
*/
public class TransactionBinding extends WireDescriptorBinding {
+ private static Log log = Log.getLog(TransactionBinding.class.getName());
+
public TransactionBinding() {
super("transaction");
}
@@ -49,17 +58,92 @@
if (element.hasAttribute("type")) {
type = element.getAttribute("type");
}
-
+
if ("standard".equals(type)) {
transactionDescriptor = new ObjectDescriptor(StandardTransaction.class);
} else if ("jta".equals(type)){
transactionDescriptor = new ObjectDescriptor(JtaTransaction.class);
+
+ this.autoDetectOrParseAttribute(transactionDescriptor, element);
} else if ("spring".equals(type)){
transactionDescriptor = new ObjectDescriptor(SpringTransaction.class);
} else {
parse.addProblem("unsupported transaction type: "+type, element);
}
-
+
return transactionDescriptor;
}
+
+ protected void autoDetectOrParseAttribute(ObjectDescriptor transactionDescriptor, Element element) {
+ if (element.hasAttribute("user-transaction")) {
+ String userTransactionValue = element.getAttribute("user-transaction");
+
+ if (log.isDebugEnabled()) {
+ log.debug("get user-transaction from xml: [" + userTransactionValue + "]");
+ }
+
+ this.parseFieldOperation(transactionDescriptor, element,
+ "userTransactionJndiName", userTransactionValue);
+ } else {
+ String userTransactionValue = this.autoDetectHibernateConfiguration("jta.UserTransaction");
+
+ if (userTransactionValue != null) {
+ if (log.isDebugEnabled()) {
+ log.debug("get user-transaction from hibernate configuration: [" + userTransactionValue + "]");
+ }
+
+ this.parseFieldOperation(transactionDescriptor, element,
+ "userTransactionJndiName", userTransactionValue);
+ } else {
+ if (log.isDebugEnabled()) {
+ log.debug("use default user-transaction: ["
+ + JtaTransaction.JNDINAME_USERTRANSACTION_JBOSS_GLOBAL + "]");
+ }
+ }
+ }
+
+ if (element.hasAttribute("transaction-manager")) {
+ String transactionManagerValue = element.getAttribute("transaction-manager");
+
+ if (log.isDebugEnabled()) {
+ log.debug("get transaction-manager from xml: [" + transactionManagerValue + "]");
+ }
+
+ this.parseFieldOperation(transactionDescriptor, element,
+ "transactionManagerJndiName", transactionManagerValue);
+ } else {
+ String transactionManagerValue =
+ this.autoDetectHibernateConfiguration("hibernate.transaction.manager_lookup_class");
+
+ if (log.isDebugEnabled()) {
+ log.debug("get transaction-manager from hibernate configuration: [" + transactionManagerValue + "]");
+ }
+
+ if (transactionManagerValue != null) {
+ this.parseFieldOperation(transactionDescriptor, element,
+ "transactionManagerJndiName", transactionManagerValue);
+ } else {
+ if (log.isDebugEnabled()) {
+ log.debug("use default transaction-manager: ["
+ + JtaTransaction.JNDINAME_TRANSACTIONMANAGER_JBOSS_GLOBAL + "]");
+ }
+ }
+ }
+ }
+
+ protected void parseFieldOperation(ObjectDescriptor objectDescriptor,
+ Element element, String fieldName, String fieldValue) {
+ FieldOperation fieldOperation = new FieldOperation();
+ fieldOperation.setFieldName(fieldName);
+ fieldOperation.setDescriptor(new StringDescriptor(fieldValue));
+ objectDescriptor.addOperation(fieldOperation);
+ }
+
+ protected String autoDetectHibernateConfiguration(String propertyName) {
+ Configuration cfg = EnvironmentImpl.getFromCurrent(Configuration.class, false);
+ if (cfg == null) {
+ return null;
+ }
+ return cfg.getProperty(propertyName);
+ }
}
Added: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/binding/TransactionBindingTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/binding/TransactionBindingTest.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/binding/TransactionBindingTest.java 2010-06-15 01:58:05 UTC (rev 6413)
@@ -0,0 +1,81 @@
+/*
+ * 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.wire.binding;
+
+import java.util.List;
+import org.jbpm.test.BaseJbpmTestCase;
+import org.jbpm.pvm.internal.tx.JtaTransaction;
+import org.jbpm.pvm.internal.xml.Parser;
+import org.jbpm.pvm.internal.xml.Bindings;
+import org.jbpm.pvm.internal.xml.Problem;
+import org.jbpm.pvm.internal.wire.WireContext;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
+
+
+/**
+ * @author Huisheng Xu
+ */
+public class TransactionBindingTest extends BaseJbpmTestCase {
+ public void testDefaultJndiName() {
+ Parser parser = new Parser();
+ Bindings bindings = new Bindings();
+ parser.setBindings(bindings);
+ parser.getBindings().addBinding(new TransactionBinding());
+
+ // jndi for jboss
+ String xml = "<transaction type='jta' />";
+
+ ObjectDescriptor objectDescriptor = (ObjectDescriptor) parser
+ .createParse()
+ .setString(xml)
+ .execute()
+ .getDocumentObject();
+
+ JtaTransaction jtaTransaction = (JtaTransaction) WireContext.create(objectDescriptor);
+
+ assertEquals("UserTransaction", jtaTransaction.getUserTransactionJndiName());
+ assertEquals("java:/TransactionManager", jtaTransaction.getTransactionManagerJndiName());
+ }
+
+ public void testCustomJndiName() {
+ Parser parser = new Parser();
+ Bindings bindings = new Bindings();
+ parser.setBindings(bindings);
+ parser.getBindings().addBinding(new TransactionBinding());
+
+ // jndi for jotm on tomcat
+ String xml = "<transaction type='jta'"
+ + " user-transaction='java:comp/UserTransaction'"
+ + " transaction-manager='java:comp/UserTransaction' />";
+
+ ObjectDescriptor objectDescriptor = (ObjectDescriptor) parser
+ .createParse()
+ .setString(xml)
+ .execute()
+ .getDocumentObject();
+
+ JtaTransaction jtaTransaction = (JtaTransaction) WireContext.create(objectDescriptor);
+
+ assertEquals("java:comp/UserTransaction", jtaTransaction.getUserTransactionJndiName());
+ assertEquals("java:comp/UserTransaction", jtaTransaction.getTransactionManagerJndiName());
+ }
+}
13 years, 10 months
JBoss JBPM SVN: r6412 - in jbpm4/trunk/modules: db and 5 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-06-14 21:07:58 -0400 (Mon, 14 Jun 2010)
New Revision: 6412
Added:
jbpm4/trunk/modules/distro/.classpath
Modified:
jbpm4/trunk/modules/bpmn/.classpath
jbpm4/trunk/modules/db/.classpath
jbpm4/trunk/modules/distro/.project
jbpm4/trunk/modules/examples/.classpath
jbpm4/trunk/modules/test-db/.classpath
jbpm4/trunk/modules/test-enterprise/test-enterprise-ejb/.classpath
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.classpath
Log:
update eclipse classpath files
Modified: jbpm4/trunk/modules/bpmn/.classpath
===================================================================
--- jbpm4/trunk/modules/bpmn/.classpath 2010-06-13 20:33:36 UTC (rev 6411)
+++ jbpm4/trunk/modules/bpmn/.classpath 2010-06-15 01:07:58 UTC (rev 6412)
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry 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>
+<?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>
Modified: jbpm4/trunk/modules/db/.classpath
===================================================================
--- jbpm4/trunk/modules/db/.classpath 2010-06-13 20:33:36 UTC (rev 6411)
+++ jbpm4/trunk/modules/db/.classpath 2010-06-15 01:07:58 UTC (rev 6412)
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" 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>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/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>
Added: jbpm4/trunk/modules/distro/.classpath
===================================================================
--- jbpm4/trunk/modules/distro/.classpath (rev 0)
+++ jbpm4/trunk/modules/distro/.classpath 2010-06-15 01:07:58 UTC (rev 6412)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <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>
Modified: jbpm4/trunk/modules/distro/.project
===================================================================
--- jbpm4/trunk/modules/distro/.project 2010-06-13 20:33:36 UTC (rev 6411)
+++ jbpm4/trunk/modules/distro/.project 2010-06-15 01:07:58 UTC (rev 6412)
@@ -1,17 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>jbpm-distro</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.maven.ide.eclipse.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jbpm-distro</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Modified: jbpm4/trunk/modules/examples/.classpath
===================================================================
--- jbpm4/trunk/modules/examples/.classpath 2010-06-13 20:33:36 UTC (rev 6411)
+++ jbpm4/trunk/modules/examples/.classpath 2010-06-15 01:07:58 UTC (rev 6412)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Modified: jbpm4/trunk/modules/test-db/.classpath
===================================================================
--- jbpm4/trunk/modules/test-db/.classpath 2010-06-13 20:33:36 UTC (rev 6411)
+++ jbpm4/trunk/modules/test-db/.classpath 2010-06-15 01:07:58 UTC (rev 6412)
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry 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>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <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>
Modified: jbpm4/trunk/modules/test-enterprise/test-enterprise-ejb/.classpath
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-ejb/.classpath 2010-06-13 20:33:36 UTC (rev 6411)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-ejb/.classpath 2010-06-15 01:07:58 UTC (rev 6412)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
<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"/>
Modified: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.classpath
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.classpath 2010-06-13 20:33:36 UTC (rev 6411)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.classpath 2010-06-15 01:07:58 UTC (rev 6412)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
13 years, 10 months
JBoss JBPM SVN: r6411 - in jbpm4/trunk: modules/pvm/src/main/java/org/jbpm/pvm/internal/query and 3 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-06-13 16:33:36 -0400 (Sun, 13 Jun 2010)
New Revision: 6411
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/DeploymentQueryImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/TaskQueryImpl.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/custom/CustomHistoryTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/query/HistoryActivityInstanceQueryTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/query/TaskQueryTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryCandidatesTest.java
jbpm4/trunk/pom.xml
Log:
JBPM-2872: fix hudson db job - oracle chapter
avoid select distinct task as oracle does not support distinct with clob columns
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 2010-06-13 05:17:29 UTC (rev 6410)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/AbstractQuery.java 2010-06-13 20:33:36 UTC (rev 6411)
@@ -46,10 +46,11 @@
private static final long serialVersionUID = 1L;
protected CommandService commandService;
- protected String orderByClause = null;
- protected Page page = null;
- protected boolean isWhereAdded = false;
- protected boolean count = false;
+ protected String orderByClause;
+ protected Page page;
+ protected boolean isWhereAdded;
+ protected boolean count;
+ protected boolean uniqueResult;
protected abstract void applyParameters(Query query);
@@ -63,54 +64,39 @@
}
*/
- public List untypedList() {
+ public List<?> untypedList() {
if (commandService!=null) {
- return (List) commandService.execute(this);
+ return (List<?>) commandService.execute(this);
}
Session session = EnvironmentImpl.getFromCurrent(Session.class);
- return (List) execute(session);
+ return (List<?>) execute(session);
}
protected Object untypedUniqueResult() {
- List list = untypedList();
- if (list.isEmpty()) {
- return null;
+ uniqueResult = true;
+
+ if (commandService!=null) {
+ return commandService.execute(this);
}
- if (list.size()>1) {
- throw new JbpmException("result not unique: "+list.size());
- }
- return list.get(0);
+ Session session = EnvironmentImpl.getFromCurrent(Session.class);
+ return execute(session);
}
public Object execute(Environment environment) throws Exception {
Session session = environment.get(Session.class);
- return execute(session);
- }
-
- public Object execute(Session session) {
- String hql = hql();
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;
+ return execute(session);
} finally {
resetQuery(); // reset the query member fields so the query can be reused.
}
}
+
+ public Object execute(Session session) {
+ Query query = session.createQuery(hql());
+ applyParameters(query);
+ applyPage(query);
+ return uniqueResult ? query.uniqueResult() : query.list();
+ }
/**
* Returns the count of the query.
@@ -135,6 +121,7 @@
private void resetQuery() {
isWhereAdded = false;
count = false;
+ uniqueResult = false;
}
protected void appendWhereClause(String whereClause, StringBuilder hql) {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/DeploymentQueryImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/DeploymentQueryImpl.java 2010-06-13 05:17:29 UTC (rev 6410)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/DeploymentQueryImpl.java 2010-06-13 20:33:36 UTC (rev 6411)
@@ -102,7 +102,7 @@
}
public List<Deployment> list() {
- return untypedList();
+ return (List<Deployment>) untypedList();
}
public Deployment uniqueResult() {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java 2010-06-13 05:17:29 UTC (rev 6410)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java 2010-06-13 20:33:36 UTC (rev 6411)
@@ -22,6 +22,7 @@
package org.jbpm.pvm.internal.query;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -62,20 +63,34 @@
protected String deploymentId;
public Object execute(Session session) {
- List<Map<String, Object>> propertyMaps = (List<Map<String, Object>>) super.execute(session);
-
- List<ProcessDefinition> processDefinitions = new ArrayList<ProcessDefinition>();
- for (Map<String, Object> properties: propertyMaps) {
- String deploymentId = properties.get("deploymentDbid").toString();
- String objectName = (String)properties.get("objectName");
- RepositorySession repositorySession = EnvironmentImpl.getFromCurrent(RepositorySession.class);
- ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) repositorySession.getObject(deploymentId, objectName);
- processDefinitions.add(processDefinition);
+ Object result = super.execute(session);
+ RepositorySession repositorySession = EnvironmentImpl.getFromCurrent(RepositorySession.class);
+
+ if (uniqueResult) {
+ if (result == null) return null;
+ return getProcessDefinition(repositorySession, result);
}
-
- return processDefinitions;
+ else {
+ List<?> propertyMaps = (List<?>) result;
+ if (propertyMaps.isEmpty()) return Collections.EMPTY_LIST;
+
+ List<ProcessDefinition> processDefinitions = new ArrayList<ProcessDefinition>();
+ for (Object propertyObject: propertyMaps) {
+ ProcessDefinitionImpl processDefinition = getProcessDefinition(repositorySession, propertyObject);
+ processDefinitions.add(processDefinition);
+ }
+ return processDefinitions;
+ }
}
+ private static ProcessDefinitionImpl getProcessDefinition(RepositorySession repositorySession,
+ Object propertyObject) {
+ Map<?, ?> propertyMap = (Map<?, ?>) propertyObject;
+ String deploymentId = propertyMap.get("deploymentDbid").toString();
+ String objectName = (String)propertyMap.get("objectName");
+ return (ProcessDefinitionImpl) repositorySession.getObject(deploymentId, objectName);
+ }
+
public String hql() {
StringBuilder hql = new StringBuilder();
hql.append("select new map( idProperty.objectName as objectName, " +
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/TaskQueryImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/TaskQueryImpl.java 2010-06-13 05:17:29 UTC (rev 6410)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/TaskQueryImpl.java 2010-06-13 20:33:36 UTC (rev 6411)
@@ -21,10 +21,14 @@
*/
package org.jbpm.pvm.internal.query;
+import java.io.Serializable;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import org.hibernate.Query;
+import org.hibernate.Session;
+
import org.jbpm.api.JbpmException;
import org.jbpm.api.TaskQuery;
import org.jbpm.api.identity.Group;
@@ -43,16 +47,15 @@
public class TaskQueryImpl extends AbstractQuery implements TaskQuery {
private static final long serialVersionUID = 1L;
-
- private static Log log = Log.getLog(TaskQueryImpl.class.getName());
+ private static final Log log = Log.getLog(TaskQueryImpl.class.getName());
- protected boolean unassigned = false;
- protected String assignee = null;
- protected String candidate = null;
- protected Boolean suspended = null;
- protected String processInstanceId = null;
- protected String processDefinitionId = null;
- protected String activityName = null;
+ protected boolean unassigned;
+ protected String assignee;
+ protected String candidate;
+ protected Boolean suspended;
+ protected String processInstanceId;
+ protected String processDefinitionId;
+ protected String activityName;
/* groupIds transports the groupIds from the hql to the applyParameters */
protected List<String> groupIds;
@@ -136,25 +139,20 @@
public String hql() {
StringBuilder hql = new StringBuilder();
- hql.append("select ");
+ hql.append("select ");
- if (count) {
- hql.append("count(distinct task) ");
- } else {
- hql.append("distinct task ");
- }
-
- hql.append("from ");
- hql.append(TaskImpl.class.getName());
- hql.append(" as task ");
-
// participations
if (candidate!=null) {
- hql.append(", ");
+ if (count) {
+ hql.append("count(distinct task.id) ");
+ } else {
+ hql.append("distinct task.id ");
+ }
+
+ hql.append("from ");
hql.append(ParticipationImpl.class.getName());
- hql.append(" as participant ");
+ hql.append(" as participant join participant.task as task ");
- appendWhereClause("participant.task = task ", hql);
appendWhereClause("participant.type = 'candidate' ", hql);
IdentitySession identitySession = EnvironmentImpl.getFromCurrent(IdentitySession.class);
@@ -162,15 +160,26 @@
if (groups.isEmpty()) {
groupIds = null;
appendWhereClause("participant.userId = :candidateUserId ", hql);
-
- } else {
+ }
+ else {
groupIds = new ArrayList<String>();
for (Group group: groups) {
groupIds.add(group.getId());
}
- appendWhereClause("((participant.userId = :candidateUserId) or (participant.groupId in (:candidateGroupIds)))", hql);
+ appendWhereClause("(participant.userId = :candidateUserId or participant.groupId in (:candidateGroupIds))", hql);
}
}
+ else {
+ if (count) {
+ hql.append("count(task) ");
+ } else {
+ hql.append("task ");
+ }
+
+ hql.append("from ");
+ hql.append(TaskImpl.class.getName());
+ hql.append(" as task ");
+ }
if (suspended!=null) {
if (suspended) {
@@ -198,20 +207,44 @@
appendWhereClause("task.assignee is null ", hql);
}
- appendOrderByClause(hql);
+ if (candidate == null && !count)
+ appendOrderByClause(hql);
String hqlQuery = hql.toString();
-
log.debug(hqlQuery);
-
return hqlQuery;
}
+ @Override
+ public Object execute(Session session) {
+ Object result = super.execute(session);
+ if (candidate == null || count) return result;
+
+ if (uniqueResult) {
+ if (result == null) return null;
+ return session.get(TaskImpl.class, (Serializable) result);
+ }
+ else {
+ List<?> list = (List<?>) result;
+ if (list.isEmpty()) return Collections.EMPTY_LIST;
+
+ StringBuilder hql = new StringBuilder();
+ hql.append("from ").append(TaskImpl.class.getName()).append(" as task ");
+ isWhereAdded = false;
+ appendWhereClause("task.id in (:identifiers) ", hql);
+ appendOrderByClause(hql);
+
+ return session.createQuery(hql.toString())
+ .setParameterList("identifiers", list)
+ .list();
+ }
+ }
+
public List<Task> list() {
return (List<Task>) commandService.execute(this);
}
public Task uniqueResult() {
- return (Task)untypedUniqueResult();
+ return (Task) untypedUniqueResult();
}
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/custom/CustomHistoryTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/custom/CustomHistoryTest.java 2010-06-13 05:17:29 UTC (rev 6410)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/custom/CustomHistoryTest.java 2010-06-13 20:33:36 UTC (rev 6411)
@@ -70,7 +70,7 @@
List<HistoryActivityInstance> histActivities = historyService
.createHistoryActivityInstanceQuery()
.processInstanceId(processInstance.getId())
- .orderAsc("startTime").list();
+ .orderAsc("id").list();
assertEquals(2, histActivities.size());
assertEquals("c", histActivities.get(0).getActivityName());
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/query/HistoryActivityInstanceQueryTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/query/HistoryActivityInstanceQueryTest.java 2010-06-13 05:17:29 UTC (rev 6410)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/query/HistoryActivityInstanceQueryTest.java 2010-06-13 20:33:36 UTC (rev 6411)
@@ -330,7 +330,7 @@
List<HistoryActivityInstance> history = historyService
.createHistoryActivityInstanceQuery()
.processInstanceId(ids.get(0))
- .orderAsc("startTime").list();
+ .orderAsc("id").list();
//first check size of history entries
assertEquals(3, history.size());
@@ -349,7 +349,10 @@
public void testQueryByExecutionIdMissingTask() {
deployTestProcessWithTask();
List<String> ids = generateHistoryForTestProcessWithTask();
- List<HistoryActivityInstance> history = historyService.createHistoryActivityInstanceQuery().executionId(ids.get(0)).list();
+ List<HistoryActivityInstance> history = historyService
+ .createHistoryActivityInstanceQuery()
+ .executionId(ids.get(0))
+ .orderAsc("id").list();
// check size of history entries
assertEquals(2, history.size());
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/query/TaskQueryTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/query/TaskQueryTest.java 2010-06-13 05:17:29 UTC (rev 6410)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/query/TaskQueryTest.java 2010-06-13 20:33:36 UTC (rev 6411)
@@ -86,11 +86,11 @@
public void testOrderByName() {
testOrderBy(TaskQuery.PROPERTY_NAME,
- new String[] {"change dyper", "do laundry", "find venture capital", "start new business"});
+ "change dyper", "do laundry", "find venture capital", "start new business");
}
public void testOrderByAssignee() {
- testOrderBy(TaskQuery.PROPERTY_ASSIGNEE, new String[] {"Alex", "Joram", "Koen", "Tom"});
+ testOrderBy(TaskQuery.PROPERTY_ASSIGNEE, "Alex", "Joram", "Koen", "Tom");
}
public void testOrderByCreateTime() {
@@ -106,7 +106,7 @@
}
public void testOrderByProgress() {
- testOrderBy(TaskQuery.PROPERTY_PROGRESS, new Integer[] {2, 15, 75, 99});
+ testOrderBy(TaskQuery.PROPERTY_PROGRESS, 2, 15, 75, 99);
}
public void testCount() {
@@ -175,7 +175,7 @@
return result;
}
- private void testOrderBy(String property, Object[] expectedValues) {
+ private void testOrderBy(String property, Object... expectedValues) {
List<Task> tasks = createTestTasks();
List<Task> taskListAsc = taskService.createTaskQuery().orderAsc(property).list();
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryCandidatesTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryCandidatesTest.java 2010-06-13 05:17:29 UTC (rev 6410)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryCandidatesTest.java 2010-06-13 20:33:36 UTC (rev 6411)
@@ -136,17 +136,16 @@
taskService.addTaskParticipatingGroup(taskId, salesGroupId, Participation.CANDIDATE);
taskService.addTaskParticipatingGroup(taskId, developmentGroupId, Participation.CANDIDATE);
- // this tasks are a diversion to see if the query only selects the above task
- task = taskService.newTask();
- task.setName("dishes");
- String johnsOtherTaskId = taskService.saveTask(task);
+// // this tasks are a diversion to see if the query only selects the above task
+// task = taskService.newTask();
+// task.setName("dishes");
+// String johnsOtherTaskId = taskService.saveTask(task);
+//
+// // this tasks are a diversion to see if the query only selects the above task
+// task = taskService.newTask();
+// task.setName("dishes");
+// String joesOtherTaskId = taskService.saveTask(task);
- // this tasks are a diversion to see if the query only selects the above task
- task = taskService.newTask();
- task.setName("dishes");
- String joesOtherTaskId = taskService.saveTask(task);
-
-
List<Task> groupTasks = taskService.findGroupTasks("johndoe");
assertEquals(1, groupTasks.size());
assertEquals(taskId, groupTasks.get(0).getId());
@@ -159,8 +158,8 @@
assertEquals(1, groupTasks.size());
taskService.deleteTaskCascade(taskId);
- taskService.deleteTaskCascade(johnsOtherTaskId);
- taskService.deleteTaskCascade(joesOtherTaskId);
+// taskService.deleteTaskCascade(johnsOtherTaskId);
+// taskService.deleteTaskCascade(joesOtherTaskId);
}
public void testCountGroupCandidateDuplicate() {
@@ -186,7 +185,7 @@
taskService.addTaskParticipatingUser(taskId, "boss_rigging", Participation.CANDIDATE);
taskService.addTaskParticipatingUser(taskId, "boss_rigging", Participation.CANDIDATE);
- assertEquals(1, taskService.createTaskQuery().candidate("boss_rigging").list().size());
+ assertEquals(1, taskService.createTaskQuery().candidate("boss_rigging").count());
taskService.deleteTaskCascade(taskId);
}
Modified: jbpm4/trunk/pom.xml
===================================================================
--- jbpm4/trunk/pom.xml 2010-06-13 05:17:29 UTC (rev 6410)
+++ jbpm4/trunk/pom.xml 2010-06-13 20:33:36 UTC (rev 6411)
@@ -444,16 +444,11 @@
<configuration>
<source>1.5</source>
<target>1.5</target>
- <showDeprecation>true</showDeprecation>
- <showWarnings>true</showWarnings>
- <optimize>true</optimize>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <failIfNoTests>false</failIfNoTests>
- <trimStackTrace>false</trimStackTrace>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<excludes>
<exclude>**/*TestCase.java</exclude>
13 years, 10 months
JBoss JBPM SVN: r6410 - in jbpm4/trunk/modules: test-db/src/test/java/org/jbpm/test/activity/custom and 1 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-06-13 01:17:29 -0400 (Sun, 13 Jun 2010)
New Revision: 6410
Modified:
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/assertion/QueryAssertions.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/custom/CustomHistoryTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/query/HistoryActivityInstanceQueryTest.java
Log:
JBPM-2872: add order-by clause to queries in tests that assume ordered results
Modified: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/assertion/QueryAssertions.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/assertion/QueryAssertions.java 2010-06-13 02:38:39 UTC (rev 6409)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/assertion/QueryAssertions.java 2010-06-13 05:17:29 UTC (rev 6410)
@@ -24,11 +24,14 @@
*/
package org.jbpm.test.assertion;
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertNotNull;
+import static junit.framework.Assert.assertTrue;
+import static junit.framework.Assert.fail;
+
import java.lang.reflect.Method;
import java.util.List;
-import junit.framework.Assert;
-
/**
* Utility class with assertions for query test.
*
@@ -70,73 +73,58 @@
* list
*/
public static <T> void assertOrderOnProperty(Class<T> clazz, String property,
- List<T> listOrderedAsc, List<T> listOrderedDesc, List<Object> expectedValuesAsc) {
-
- Assert.assertNotNull(listOrderedAsc);
- Assert.assertEquals(expectedValuesAsc.size(), expectedValuesAsc.size());
+ List<T> listOrderedAsc, List<T> listOrderedDesc, List<?> expectedValuesAsc) {
+ assertNotNull(listOrderedAsc);
+ assertEquals(expectedValuesAsc.size(), expectedValuesAsc.size());
- Assert.assertNotNull(listOrderedDesc);
- Assert.assertEquals(expectedValuesAsc.size(), listOrderedDesc.size());
+ assertNotNull(listOrderedDesc);
+ assertEquals(expectedValuesAsc.size(), listOrderedDesc.size());
for (int i = 0; i < expectedValuesAsc.size(); i++) {
-
Object realValueAsc = null;
Object realValueDesc = null;
try {
-
realValueAsc = invokeGetter(property, clazz, listOrderedAsc.get(i));
realValueDesc = invokeGetter(property, clazz, listOrderedDesc.get(i));
-
} catch (Exception e) {
- Assert.fail(e.getMessage());
+ fail(e.getMessage());
}
- Assert.assertEquals("Incorrect order by ASC for property " + property,
+ assertEquals("Incorrect order by ASC for property " + property,
expectedValuesAsc.get(i), realValueAsc);
- Assert.assertEquals("Incorrect order by DESC for property " + property,
+ assertEquals("Incorrect order by DESC for property " + property,
expectedValuesAsc.get((listOrderedDesc.size() -1) - i), realValueDesc);
-
}
}
/**
* Does the same as the assertOrderOnProperty assertion, but instead of
* checking if the resulting list have the correct elements now it is checked
- * if the elements are naturally ordered ascending and descending.
- *
- * IMPORTANT: the type T must be implementing the {@link Comparable} interface!
+ * if the elements are naturally ordered ascending and descending
+ * on the given property.
*/
- @SuppressWarnings("unchecked")
public static <T> void assertOrderIsNatural(Class<T> clazz, String property, List<T> listOrderedAsc, List<T> listOrderedDesc, int nrOfExpectedElements) {
+ assertEquals(nrOfExpectedElements, listOrderedAsc.size());
+ assertEquals(nrOfExpectedElements, listOrderedDesc.size());
- Assert.assertEquals(nrOfExpectedElements, listOrderedAsc.size());
- Assert.assertEquals(nrOfExpectedElements, listOrderedDesc.size());
-
if (nrOfExpectedElements > 1) {
-
for (int i = 1; i < listOrderedAsc.size(); i++) {
-
// ascending check
- Comparable c1 = (Comparable) invokeGetter(property, clazz, listOrderedAsc.get(i - 1));
- Comparable c2 = (Comparable) invokeGetter(property, clazz, listOrderedAsc.get(i));
- if (c1 != null && c2 != null) {
- Assert.assertTrue("The ascending list does not have a natural order",c1.compareTo(c2) <= 0); // c1 <= c2 when ascending
- }
+ Object c1 = invokeGetter(property, clazz, listOrderedAsc.get(i - 1));
+ Object c2 = invokeGetter(property, clazz, listOrderedAsc.get(i));
+ // c1 <= c2 when ascending
+ assertTrue("the ascending list does not have a natural order", compare(c1, c2) <= 0);
- // ascending check
- Comparable c3 = (Comparable) invokeGetter(property, clazz, listOrderedDesc.get(i - 1));
- Comparable c4 = (Comparable) invokeGetter(property, clazz, listOrderedDesc.get(i));
- if (c3 != null && c4 != null) {
- Assert.assertTrue("The descending list does not have a natural order", c3.compareTo(c4) >= 0); // c3 >= c4 when ascending
- }
-
+ // descending check
+ Object c3 = invokeGetter(property, clazz, listOrderedDesc.get(i - 1));
+ Object c4 = invokeGetter(property, clazz, listOrderedDesc.get(i));
+ // c3 >= c4 when descending
+ assertTrue("the descending list does not have a natural order", compare(c3, c4) >= 0);
}
-
}
-
}
-
+
private static <T> Object invokeGetter(String property, Class<T> clazz, T obj) {
try {
Method getter = clazz.getMethod("get" + property.substring(0, 1).toUpperCase() + property.substring(1));
@@ -145,6 +133,12 @@
throw new RuntimeException("Couldn't invoke getter for property " + property);
}
}
-
+ @SuppressWarnings("unchecked")
+ private static int compare(Object o1, Object o2) {
+ if (o1 == null || o2 == null) return 0;
+
+ Comparable c1 = (Comparable) o1;
+ return c1.compareTo(o2);
+ }
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/custom/CustomHistoryTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/custom/CustomHistoryTest.java 2010-06-13 02:38:39 UTC (rev 6409)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/custom/CustomHistoryTest.java 2010-06-13 05:17:29 UTC (rev 6410)
@@ -67,7 +67,10 @@
assertProcessInstanceEnded(processInstance);
- List<HistoryActivityInstance> histActivities = historyService.createHistoryActivityInstanceQuery().processInstanceId(processInstance.getId()).list();
+ List<HistoryActivityInstance> histActivities = historyService
+ .createHistoryActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .orderAsc("startTime").list();
assertEquals(2, histActivities.size());
assertEquals("c", histActivities.get(0).getActivityName());
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/query/HistoryActivityInstanceQueryTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/query/HistoryActivityInstanceQueryTest.java 2010-06-13 02:38:39 UTC (rev 6409)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/query/HistoryActivityInstanceQueryTest.java 2010-06-13 05:17:29 UTC (rev 6410)
@@ -257,7 +257,7 @@
return ids;
}
- private void testOrderBy(String property, List expectedValues) {
+ private void testOrderBy(String property, List<?> expectedValues) {
testOrderBy(property, expectedValues, null, false);
}
@@ -265,8 +265,7 @@
testOrderBy(property, null, expectedNrOfResults, true);
}
- @SuppressWarnings("unchecked")
- private void testOrderBy(String property, List expectedValues,
+ private void testOrderBy(String property, List<?> expectedValues,
Integer expectedNrOfResults, boolean naturalOrderCheck) {
deployStartAndSignalTestProcesses();
@@ -282,7 +281,6 @@
} else {
QueryAssertions.assertOrderOnProperty(HistoryActivityInstance.class, property, listAsc, listDesc, expectedValues);
}
-
}
/**
@@ -329,7 +327,10 @@
public void testQueryByProcessInstanceId() {
deployTestProcessWithTask();
List<String> ids = generateHistoryForTestProcessWithTask();
- List<HistoryActivityInstance> history = historyService.createHistoryActivityInstanceQuery().processInstanceId(ids.get(0)).list();
+ List<HistoryActivityInstance> history = historyService
+ .createHistoryActivityInstanceQuery()
+ .processInstanceId(ids.get(0))
+ .orderAsc("startTime").list();
//first check size of history entries
assertEquals(3, history.size());
13 years, 10 months
JBoss JBPM SVN: r6409 - in jbpm4/trunk/modules: test-db and 8 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-06-12 22:38:39 -0400 (Sat, 12 Jun 2010)
New Revision: 6409
Added:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/group/
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/group/concurrency/
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/group/multipleentries/
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/group/simple/
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/group/timer/
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.mail.templates.examples.xml
Removed:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/concurrency/
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/multipleentries/
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/simple/
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/timer/
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.mail.templates.xml
Modified:
jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/jbpm/standalone.testsuite.jbpm.cfg.xml
jbpm4/trunk/modules/test-db/pom.xml
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/group/concurrency/GroupConcurrencyTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/group/multipleentries/MultipleEntriesTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/group/simple/GroupSimpleTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/group/timer/GroupTimerTest.java
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.cfg.xml
Log:
JBPM-2872: have test-db module employ standalone.testsuite.examples configuration
restore original standalone.testsuite configuration
fix typo in org.examples.group package
Modified: jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/jbpm/standalone.testsuite.jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/jbpm/standalone.testsuite.jbpm.cfg.xml 2010-06-12 03:40:59 UTC (rev 6408)
+++ jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/jbpm/standalone.testsuite.jbpm.cfg.xml 2010-06-13 02:38:39 UTC (rev 6409)
@@ -9,6 +9,4 @@
<import resource="jbpm.identity.cfg.xml" />
<import resource="jbpm.businesscalendar.cfg.xml" />
- <import resource="jbpm.mail.templates.xml" />
-
</jbpm-configuration>
Modified: jbpm4/trunk/modules/test-db/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-db/pom.xml 2010-06-12 03:40:59 UTC (rev 6408)
+++ jbpm4/trunk/modules/test-db/pom.xml 2010-06-13 02:38:39 UTC (rev 6409)
@@ -134,7 +134,7 @@
<fileset dir="${user.home}/.jbpm4/jdbc" />
</copy>
<ant antfile="../distro/src/main/files/install/build.xml" target="create.cfg">
- <property name="tx" value="standalone.testsuite" />
+ <property name="tx" value="standalone.testsuite.examples" />
<property name="mail.cfg" value="testsuite" />
<property name="database" value="${database}" />
<property name="cfg.dest.dir" value="target/test-classes" />
Copied: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/group/concurrency (from rev 6386, jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/concurrency)
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/group/concurrency/GroupConcurrencyTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/concurrency/GroupConcurrencyTest.java 2010-06-01 08:29:00 UTC (rev 6386)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/group/concurrency/GroupConcurrencyTest.java 2010-06-13 02:38:39 UTC (rev 6409)
@@ -19,7 +19,7 @@
* 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.examples.goup.concurrency;
+package org.jbpm.examples.group.concurrency;
import org.jbpm.api.ProcessInstance;
import org.jbpm.test.JbpmTestCase;
Copied: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/group/multipleentries (from rev 6386, jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/multipleentries)
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/group/multipleentries/MultipleEntriesTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/multipleentries/MultipleEntriesTest.java 2010-06-01 08:29:00 UTC (rev 6386)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/group/multipleentries/MultipleEntriesTest.java 2010-06-13 02:38:39 UTC (rev 6409)
@@ -19,7 +19,7 @@
* 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.examples.goup.multipleentries;
+package org.jbpm.examples.group.multipleentries;
import java.util.HashMap;
import java.util.Map;
Copied: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/group/simple (from rev 6386, jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/simple)
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/group/simple/GroupSimpleTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/simple/GroupSimpleTest.java 2010-06-01 08:29:00 UTC (rev 6386)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/group/simple/GroupSimpleTest.java 2010-06-13 02:38:39 UTC (rev 6409)
@@ -19,7 +19,7 @@
* 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.examples.goup.simple;
+package org.jbpm.examples.group.simple;
import org.jbpm.api.ProcessInstance;
import org.jbpm.test.JbpmTestCase;
Copied: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/group/timer (from rev 6386, jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/timer)
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/group/timer/GroupTimerTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/timer/GroupTimerTest.java 2010-06-01 08:29:00 UTC (rev 6386)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/group/timer/GroupTimerTest.java 2010-06-13 02:38:39 UTC (rev 6409)
@@ -19,7 +19,7 @@
* 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.examples.goup.timer;
+package org.jbpm.examples.group.timer;
import java.util.List;
Modified: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/jbpm.cfg.xml 2010-06-12 03:40:59 UTC (rev 6408)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.cfg.xml 2010-06-13 02:38:39 UTC (rev 6409)
@@ -8,7 +8,6 @@
<import resource="jbpm.jpdl.cfg.xml" />
<import resource="jbpm.bpmn.cfg.xml" />
<import resource="jbpm.identity.cfg.xml" />
+ <import resource="jbpm.mail.templates.examples.xml" />
- <import resource="jbpm.mail.templates.xml" />
-
</jbpm-configuration>
Copied: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.mail.templates.examples.xml (from rev 6404, jbpm4/trunk/modules/test-db/src/test/resources/jbpm.mail.templates.xml)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/jbpm.mail.templates.examples.xml (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.mail.templates.examples.xml 2010-06-13 02:38:39 UTC (rev 6409)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <process-engine-context>
+
+ <mail-template name="rectify-template">
+ <to addresses="${addressee}" />
+ <cc users="bb" groups="innerparty" />
+ <subject>rectify ${newspaper}</subject>
+ <text>${newspaper} ${date} ${details}</text>
+ </mail-template>
+
+ </process-engine-context>
+
+</jbpm-configuration>
Deleted: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.mail.templates.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/jbpm.mail.templates.xml 2010-06-12 03:40:59 UTC (rev 6408)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.mail.templates.xml 2010-06-13 02:38:39 UTC (rev 6409)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jbpm-configuration>
-
- <process-engine-context>
-
- <mail-template name="rectify-template">
- <to addresses="${addressee}" />
- <cc users="bb" groups="innerparty" />
- <subject>rectify ${newspaper}</subject>
- <text>${newspaper} ${date} ${details}</text>
- </mail-template>
-
- </process-engine-context>
-
-</jbpm-configuration>
13 years, 10 months
JBoss JBPM SVN: r6408 - jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-06-11 23:40:59 -0400 (Fri, 11 Jun 2010)
New Revision: 6408
Modified:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/RepositoryServiceTest.java
Log:
JBPM-2872: fix hudson db job - postgresql chapter
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/RepositoryServiceTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/RepositoryServiceTest.java 2010-06-12 03:14:46 UTC (rev 6407)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/RepositoryServiceTest.java 2010-06-12 03:40:59 UTC (rev 6408)
@@ -21,19 +21,13 @@
*/
package org.jbpm.test.process;
-import java.sql.ResultSet;
import java.util.List;
-import org.hibernate.Session;
-
import org.jbpm.api.Execution;
import org.jbpm.api.JbpmException;
import org.jbpm.api.ProcessDefinition;
import org.jbpm.api.ProcessDefinitionQuery;
import org.jbpm.api.ProcessInstance;
-import org.jbpm.api.cmd.Command;
-import org.jbpm.api.cmd.Environment;
-import org.jbpm.pvm.internal.cmd.CommandService;
import org.jbpm.test.JbpmTestCase;
/**
@@ -385,24 +379,6 @@
* @see <a href="https://jira.jboss.org/browse/JBPM-2746">JBPM-2746</a>
*/
public void testNonLatinProcessName() {
- processEngine.execute(new Command<Void>() {
-
- public Void execute(Environment environment) throws Exception {
- ResultSet resultSet = environment.get(Session.class)
- .connection()
- .createStatement()
- .executeQuery("select @@character_set_client, @@character_set_connection, @@character_set_results, @@collation_connection");
- if (resultSet.next()) {
- log.info("character set client: " + resultSet.getString(1));
- log.info("character set connection: " + resultSet.getString(2));
- log.info("character set results: " + resultSet.getString(3));
- log.info("collation connection: " + resultSet.getString(4));
- }
- resultSet.close();
- return null;
- }
- });
-
// "Lev Trotskij"
deployJpdlXmlString("<process name='\u041B\u0435\u0412 \u0422\u0440\u043E\u0446\u043A\u0438\u0439'>" +
" <start/>" +
13 years, 10 months
JBoss JBPM SVN: r6407 - in jbpm3/branches/jbpm-3.2-soa/modules/core/src: test/java/org/jbpm/jbpm2630 and 1 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-06-11 23:14:46 -0400 (Fri, 11 Jun 2010)
New Revision: 6407
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/AbstractDbTestCase.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2630/JBPM2630Test.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2691/JBPM2691Test.java
Log:
SOA-2100: fix JBPM-2691 test, times out with larger jbpm.job.retries values
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/AbstractDbTestCase.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/AbstractDbTestCase.java 2010-06-12 02:26:05 UTC (rev 6406)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/AbstractDbTestCase.java 2010-06-12 03:14:46 UTC (rev 6407)
@@ -101,7 +101,8 @@
}
private void ensureCleanDatabase() {
- DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) getJbpmConfiguration().getServiceFactory("persistence");
+ DbPersistenceServiceFactory persistenceServiceFactory =
+ (DbPersistenceServiceFactory) getJbpmConfiguration().getServiceFactory("persistence");
if (persistenceServiceFactory == null) return;
boolean hasLeftOvers = false;
@@ -113,8 +114,7 @@
Long count = (Long) entry.getValue();
if (count.intValue() != 0) {
hasLeftOvers = true;
- System.err.println("FIXME: " + getClass().getName() + "." + getName() + " left "
- + count + " records in " + entry.getKey());
+ log.error(getName() + " left " + count + " records in " + entry.getKey());
}
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2630/JBPM2630Test.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2630/JBPM2630Test.java 2010-06-12 02:26:05 UTC (rev 6406)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2630/JBPM2630Test.java 2010-06-12 03:14:46 UTC (rev 6407)
@@ -41,7 +41,7 @@
protected void setUp() throws Exception {
super.setUp();
testConfiguration = JbpmConfiguration.getInstance();
- noLogConfiguration = JbpmConfiguration.getInstance("org/jbpm/jbpm2630/jbpm.nolog.cfg.xml");
+ noLogConfiguration = JbpmConfiguration.parseResource("org/jbpm/jbpm2630/jbpm.nolog.cfg.xml");
}
protected void tearDown() throws Exception {
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2691/JBPM2691Test.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2691/JBPM2691Test.java 2010-06-12 02:26:05 UTC (rev 6406)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2691/JBPM2691Test.java 2010-06-12 03:14:46 UTC (rev 6407)
@@ -23,6 +23,7 @@
import java.util.List;
+import org.jbpm.JbpmConfiguration;
import org.jbpm.db.AbstractDbTestCase;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;
@@ -37,12 +38,26 @@
*/
public class JBPM2691Test extends AbstractDbTestCase {
+ protected JbpmConfiguration getJbpmConfiguration() {
+ if (jbpmConfiguration == null) {
+ jbpmConfiguration = JbpmConfiguration.parseXmlString("<jbpm-configuration>"
+ + " <int name='jbpm.job.retries' value='1' />"
+ + "</jbpm-configuration>");
+ }
+ return jbpmConfiguration;
+ }
+
protected void setUp() throws Exception {
super.setUp();
ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("org/jbpm/jbpm2691/processdefinition.xml");
deployProcessDefinition(processDefinition);
}
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ jbpmConfiguration.close();
+ }
+
public void testSaveExceptionInSeparateTx() {
ProcessInstance processInstance = jbpmContext.newProcessInstance("jobex");
processInstance.signal();
13 years, 10 months
JBoss JBPM SVN: r6406 - jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-06-11 22:26:05 -0400 (Fri, 11 Jun 2010)
New Revision: 6406
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/default.jbpm.cfg.xml
Log:
SOA-2100: increase jbpm.job.retries to 10
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/default.jbpm.cfg.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/default.jbpm.cfg.xml 2010-06-11 18:05:08 UTC (rev 6405)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/default.jbpm.cfg.xml 2010-06-12 02:26:05 UTC (rev 6406)
@@ -107,5 +107,5 @@
</bean>
<!-- job retry count -->
- <int name="jbpm.job.retries" value="3" />
+ <int name="jbpm.job.retries" value="10" />
</jbpm-configuration>
13 years, 10 months