JBoss JBPM SVN: r6446 - jbpm4/trunk/qa.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-06-30 16:45:31 -0400 (Wed, 30 Jun 2010)
New Revision: 6446
Modified:
jbpm4/trunk/qa/hudson-jbpm4-cfg.sh
jbpm4/trunk/qa/hudson-jbpm4-db.sh
jbpm4/trunk/qa/hudson-jbpm4-spring.sh
Log:
JBPM-2893: update snapshots and ignore test failures in hudson shell scripts
Modified: jbpm4/trunk/qa/hudson-jbpm4-cfg.sh
===================================================================
--- jbpm4/trunk/qa/hudson-jbpm4-cfg.sh 2010-06-30 20:18:22 UTC (rev 6445)
+++ jbpm4/trunk/qa/hudson-jbpm4-cfg.sh 2010-06-30 20:45:31 UTC (rev 6446)
@@ -2,6 +2,6 @@
#
# runs the configuration test suite
-mvn -DskipTests clean install
+mvn -U -Pdistro clean install
cd modules/test-cfg
mvn -Dmaven.test.failure.ignore=true clean test
Modified: jbpm4/trunk/qa/hudson-jbpm4-db.sh
===================================================================
--- jbpm4/trunk/qa/hudson-jbpm4-db.sh 2010-06-30 20:18:22 UTC (rev 6445)
+++ jbpm4/trunk/qa/hudson-jbpm4-db.sh 2010-06-30 20:45:31 UTC (rev 6446)
@@ -1,8 +1,8 @@
#!/bin/sh
#
-# runs the smoke test suite
+# runs the database test suite
mvn -U -Pdistro clean install
ant -f qa/build.xml -Ddatabase=$DATABASE -Djbpm.parent.dir=$WORKSPACE testsuite.db.setup
-mvn -Ddatabase=$DATABASE test
+mvn -Ddatabase=$DATABASE -Dmaven.test.failure.ignore=true test
ant -f qa/build.xml -Ddatabase=$DATABASE -Djbpm.parent.dir=$WORKSPACE testsuite.db.teardown
Modified: jbpm4/trunk/qa/hudson-jbpm4-spring.sh
===================================================================
--- jbpm4/trunk/qa/hudson-jbpm4-spring.sh 2010-06-30 20:18:22 UTC (rev 6445)
+++ jbpm4/trunk/qa/hudson-jbpm4-spring.sh 2010-06-30 20:45:31 UTC (rev 6446)
@@ -1,5 +1,5 @@
#!/bin/sh
#
-# runs the smoke test suite
+# runs the spring test suite
-mvn -U -Prun.spring.testsuite clean install
+mvn -U -Prun.spring.testsuite -Dmaven.test.failure.ignore=true clean install
13 years, 10 months
JBoss JBPM SVN: r6445 - in jbpm4/trunk/modules: integration/console/src/main/java/org/jbpm/integration/console and 15 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-06-30 16:18:22 -0400 (Wed, 30 Jun 2010)
New Revision: 6445
Removed:
jbpm4/trunk/modules/integration/console/scripts/
Modified:
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/JBPMIntegration.java
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/services/HistoryService.java
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/exception/ConvertException.java
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/problem/Problem.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/ConfigurationImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/EnvironmentBindings.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/GroovyCompiledScript.java
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/JtaTransactionInterceptor.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/util/ReflectUtil.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ClassDescriptor.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/JuelExpressionTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ClassWireTest.java
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/LoadTestCase.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ContinuationTest.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveTestCommand.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceMessageTest.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingMessageTest.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingTestCommand.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/JobExecutorTestCase.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageTest.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/executions/ProcessExecutionTest.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/AddCommentCmd.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/MessageProcessingTest.java
Log:
JBPM-2893: fix raw type and unused import warnings
Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/JBPMIntegration.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/JBPMIntegration.java 2010-06-30 17:48:23 UTC (rev 6444)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/JBPMIntegration.java 2010-06-30 20:18:22 UTC (rev 6445)
@@ -21,15 +21,12 @@
*/
package org.jbpm.integration.console;
-import org.jbpm.api.Configuration;
import org.jbpm.api.ExecutionService;
import org.jbpm.api.HistoryService;
import org.jbpm.api.ProcessEngine;
import org.jbpm.api.RepositoryService;
import org.jbpm.api.TaskService;
-import javax.naming.InitialContext;
-
/**
* Base class for jbpm integration
*
Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/services/HistoryService.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/services/HistoryService.java 2010-06-30 17:48:23 UTC (rev 6444)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/services/HistoryService.java 2010-06-30 20:18:22 UTC (rev 6445)
@@ -10,13 +10,14 @@
import org.jboss.errai.bus.client.api.base.MessageBuilder;
import org.jboss.errai.bus.client.framework.MessageBus;
import org.jboss.errai.bus.server.annotations.Service;
+
+import org.jbpm.api.JbpmException;
import org.jbpm.api.history.HistoryActivityInstance;
import org.jbpm.api.history.HistoryProcessInstance;
import org.jbpm.integration.console.JBPMIntegration;
import org.jbpm.integration.console.ModelAdaptor;
import java.util.ArrayList;
-import java.util.Date;
import java.util.List;
/**
@@ -43,26 +44,19 @@
String definitionId = message.get(String.class, HistoryParts.PROCESS_DEFINITION_ID);
List<HistoryProcessInstanceRef> results = getFinishedProcessInstances(definitionId);
- try
- {
- MessageBuilder.createConversation(message)
- .subjectProvided()
- .command(HistoryCommands.GET_FINISHED_PROCESS_INSTANCES)
- .with(HistoryParts.PROCESS_DEFINITION_ID, definitionId)
- .with(HistoryParts.INSTANCE_LIST, results)
- .errorsHandledBy(new ErrorCallback()
+ MessageBuilder.createConversation(message)
+ .subjectProvided()
+ .command(HistoryCommands.GET_FINISHED_PROCESS_INSTANCES)
+ .with(HistoryParts.PROCESS_DEFINITION_ID, definitionId)
+ .with(HistoryParts.INSTANCE_LIST, results)
+ .errorsHandledBy(new ErrorCallback()
+ {
+ public boolean error(Message message, Throwable throwable)
{
- public boolean error(Message message, Throwable throwable)
- {
- throw new RuntimeException("Failed to send message", throwable);
- }
- })
- .sendNowWith(bus);
- }
- catch (Throwable e)
- {
- throw new RuntimeException("Sending failed", e);
- }
+ throw new JbpmException("Failed to send message", throwable);
+ }
+ })
+ .sendNowWith(bus);
break;
case GET_PROCESS_INSTANCE_HISTORY:
Modified: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/exception/ConvertException.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/exception/ConvertException.java 2010-06-30 17:48:23 UTC (rev 6444)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/exception/ConvertException.java 2010-06-30 20:18:22 UTC (rev 6445)
@@ -30,9 +30,9 @@
private static final long serialVersionUID = 1L;
- protected List problems = null;
+ protected List<Problem> problems = null;
- public ConvertException(List problems) {
+ public ConvertException(List<Problem> problems) {
super(problems.toString());
this.problems = problems;
}
@@ -42,7 +42,7 @@
public ConvertException(String msg, Throwable e ) {
this(Collections.singletonList(new Problem(Problem.LEVEL_ERROR, msg, e)));
}
- public List getProblems() {
+ public List<Problem> getProblems() {
return problems;
}
}
Modified: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/problem/Problem.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/problem/Problem.java 2010-06-30 17:48:23 UTC (rev 6444)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/problem/Problem.java 2010-06-30 20:18:22 UTC (rev 6445)
@@ -23,11 +23,9 @@
import java.io.Serializable;
import java.util.Collection;
-import java.util.Iterator;
/**
- * This class orginates from jpbm3 codebase
- *
+ * This class orginates from jbbm3 codebase
*/
public class Problem implements Serializable {
@@ -74,10 +72,8 @@
return buffer.toString();
}
- public static boolean containsProblemsOfLevel(Collection c, int level) {
- Iterator iter = c.iterator();
- while (iter.hasNext()) {
- Problem problem = (Problem) iter.next();
+ public static boolean containsProblemsOfLevel(Collection<Problem> problems, int level) {
+ for (Problem problem : problems) {
if (problem.level <= level) {
return true;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/ConfigurationImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/ConfigurationImpl.java 2010-06-30 17:48:23 UTC (rev 6444)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/ConfigurationImpl.java 2010-06-30 20:18:22 UTC (rev 6445)
@@ -89,7 +89,7 @@
if (isSpringEnabled) {
return SpringProcessEngine.create(this);
}
- return new ProcessEngineImpl(this);
+ return instantiateProcessEngine();
}
/**
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/EnvironmentBindings.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/EnvironmentBindings.java 2010-06-30 17:48:23 UTC (rev 6444)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/EnvironmentBindings.java 2010-06-30 20:18:22 UTC (rev 6445)
@@ -22,7 +22,6 @@
package org.jbpm.pvm.internal.script;
import java.util.Collection;
-import java.util.Collections;
import java.util.Map;
import java.util.Set;
@@ -30,7 +29,6 @@
import org.jbpm.pvm.internal.env.EnvironmentImpl;
-
/**
* @author Tom Baeyens
* @author Huisheng Xu
@@ -44,50 +42,52 @@
}
public Object get(Object key) {
- return environment.get((String)key);
+ return environment.get((String) key);
}
public boolean containsKey(Object key) {
- return (get(key)!=null);
+ return get(key) != null;
}
public Object put(String key, Object value) {
- return null;
+ // return named object, if any, to comply with Map contract
+ // ignore put otherwise
+ return environment.get(key);
}
- public void putAll(Map< ? extends String, ? extends Object> toMerge) {
- //
+ public void putAll(Map<? extends String, ? extends Object> toMerge) {
+ // ignore puts
}
public Object remove(Object key) {
- return null;
+ throw new UnsupportedOperationException();
}
public void clear() {
- //
+ throw new UnsupportedOperationException();
}
public boolean containsValue(Object value) {
- return false;
+ throw new UnsupportedOperationException();
}
- public Set<java.util.Map.Entry<String, Object>> entrySet() {
- return Collections.EMPTY_SET;
+ public Set<Entry<String, Object>> entrySet() {
+ throw new UnsupportedOperationException();
}
public boolean isEmpty() {
- return true;
+ throw new UnsupportedOperationException();
}
public Set<String> keySet() {
- return Collections.EMPTY_SET;
+ throw new UnsupportedOperationException();
}
public int size() {
- return 0;
+ throw new UnsupportedOperationException();
}
public Collection<Object> values() {
- return Collections.EMPTY_SET;
+ throw new UnsupportedOperationException();
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/GroovyCompiledScript.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/GroovyCompiledScript.java 2010-06-30 17:48:23 UTC (rev 6444)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/GroovyCompiledScript.java 2010-06-30 20:18:22 UTC (rev 6445)
@@ -29,25 +29,28 @@
*/
package org.jbpm.pvm.internal.script;
-import javax.script.*;
+import javax.script.CompiledScript;
+import javax.script.ScriptContext;
+import javax.script.ScriptEngine;
+import javax.script.ScriptException;
public class GroovyCompiledScript extends CompiledScript {
-
- private GroovyScriptEngine engine;
- private Class clasz;
-
- public GroovyCompiledScript(GroovyScriptEngine engine, Class clasz) {
- this.engine = engine;
- this.clasz = clasz;
- }
-
- public Object eval(ScriptContext context) throws ScriptException {
- return engine.eval(clasz, context);
- }
-
- public ScriptEngine getEngine() {
- return engine;
- }
-
+
+ private GroovyScriptEngine engine;
+ private Class<?> clasz;
+
+ public GroovyCompiledScript(GroovyScriptEngine engine, Class<?> clasz) {
+ this.engine = engine;
+ this.clasz = clasz;
+ }
+
+ public Object eval(ScriptContext context) throws ScriptException {
+ return engine.eval(clasz, context);
+ }
+
+ public ScriptEngine getEngine() {
+ return engine;
+ }
+
}
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-30 17:48:23 UTC (rev 6444)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/JtaTransaction.java 2010-06-30 20:18:22 UTC (rev 6445)
@@ -31,12 +31,11 @@
import org.jbpm.api.JbpmException;
import org.jbpm.internal.log.Log;
-
/**
* @author Tom Baeyens
* @author Huisheng Xu
*/
-public class JtaTransaction extends AbstractTransaction implements Transaction {
+public class JtaTransaction extends AbstractTransaction {
private static Log log = Log.getLog(JtaTransaction.class.getName());
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/JtaTransactionInterceptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/JtaTransactionInterceptor.java 2010-06-30 17:48:23 UTC (rev 6444)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/JtaTransactionInterceptor.java 2010-06-30 20:18:22 UTC (rev 6445)
@@ -27,19 +27,15 @@
import org.jbpm.api.JbpmException;
import org.jbpm.api.cmd.Command;
-import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.svc.Interceptor;
import org.jbpm.pvm.internal.svc.Policy;
-
/**
* @author Tom Baeyens
*/
public class JtaTransactionInterceptor extends Interceptor {
- private static Log log = Log.getLog(JtaTransactionInterceptor.class.getName());
-
protected Policy policy = Policy.REQUIRES;
public <T> T execute(Command<T> command) {
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 2010-06-30 17:48:23 UTC (rev 6444)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/StandardTransaction.java 2010-06-30 20:18:22 UTC (rev 6445)
@@ -127,7 +127,7 @@
// here is the point of no return :-)
// commit ///////////////////////////////////////////////////////////////
- Throwable commitException = null;
+ RuntimeException commitException = null;
if (resources!=null) {
// The commit loop will try to send the commit to every resource,
// No matter what it takes. If exceptions come out of resource.commit's
@@ -140,7 +140,7 @@
// Exceptions in the commit phase will not lead to rollback, since some resources
// might have committed and can't go back.
- } catch (Throwable t) {
+ } catch (RuntimeException t) {
// TODO this should go to a special log for sys admin recovery
log.error("commit failed for resource "+standardResource, t);
if (commitException==null) {
@@ -155,12 +155,7 @@
if (log.isTraceEnabled()) log.trace("committed "+this);
if (commitException!=null) {
- if (commitException instanceof RuntimeException) {
- throw (RuntimeException) commitException;
- } else if (commitException instanceof Error) {
- throw (Error) commitException;
- }
- throw new TransactionException("resource failed to commit", commitException);
+ throw commitException;
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java 2010-06-30 17:48:23 UTC (rev 6444)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java 2010-06-30 20:18:22 UTC (rev 6445)
@@ -57,8 +57,6 @@
try {
field = clazz.getDeclaredField(fieldName);
if (log.isTraceEnabled()) log.trace("found field "+fieldName+" in "+clazz.getName());
- } catch (SecurityException e) {
- throw new JbpmException("wasn't allowed to get field '"+clazz.getName()+"."+fieldName+"'", e);
} catch (NoSuchFieldException e) {
if (clazz.getSuperclass()!=null) {
return findField(clazz.getSuperclass(), fieldName, original);
@@ -83,8 +81,6 @@
if (log.isTraceEnabled()) log.trace("found method "+clazz.getName()+"."+methodName+"("+Arrays.toString(parameterTypes)+")");
- } catch (SecurityException e) {
- throw new JbpmException("wasn't allowed to get method '"+clazz.getName()+"."+methodName+"("+getParameterTypesText(parameterTypes)+")'", e);
} catch (NoSuchMethodException e) {
if (clazz.getSuperclass()!=null) {
return getMethod(clazz.getSuperclass(), methodName, parameterTypes, original);
@@ -110,37 +106,40 @@
}
public static <T> T newInstance(Class<T> clazz) {
- return newInstance(clazz, null, null);
+ if (clazz==null) {
+ throw new IllegalArgumentException("cannot create new instance without class");
+ }
+ try {
+ return newInstance(clazz.getConstructor());
+ }
+ catch (NoSuchMethodException e) {
+ throw new IllegalArgumentException("cannot instantiate class without default constructor");
+ }
}
- public static <T> T newInstance(Constructor<T> constructor) {
- return newInstance(null, constructor, null);
- }
- public static <T> T newInstance(Constructor<T> constructor, Object[] args) {
- return newInstance(null, constructor, args);
- }
- private static <T> T newInstance(Class<T> clazz, Constructor<T> constructor, Object[] args) {
- if ( (clazz==null)
- && (constructor==null)
- ) {
- throw new IllegalArgumentException("can't create new instance without clazz or constructor");
+ public static <T> T newInstance(Constructor<T> constructor, Object... args) {
+ if (constructor==null) {
+ throw new IllegalArgumentException("cannot create new instance without constructor");
}
+ Class<T> clazz = constructor.getDeclaringClass();
+ if (log.isTraceEnabled()) log.trace("creating new instance for "+clazz+" with args "+Arrays.toString(args));
+ if (!constructor.isAccessible()) {
+ if (log.isTraceEnabled()) log.trace("making constructor accessible");
+ constructor.setAccessible(true);
+ }
try {
- if (log.isTraceEnabled()) log.trace("creating new instance for class '"+clazz.getName()+"' with args "+Arrays.toString(args));
- if (constructor==null) {
- if (log.isTraceEnabled()) log.trace("getting default constructor");
- constructor = clazz.getConstructor((Class[])null);
- }
- if (!constructor.isAccessible()) {
- if (log.isTraceEnabled()) log.trace("making constructor accessible");
- constructor.setAccessible(true);
- }
return constructor.newInstance(args);
-
- } catch (Throwable t) {
- throw new JbpmException("couldn't construct new '"+clazz.getName()+"' with args "+Arrays.toString(args), t);
}
+ catch (InstantiationException e) {
+ throw new JbpmException("failed to instantiate " + clazz, e);
+ }
+ catch (IllegalAccessException e) {
+ throw new JbpmException(ReflectUtil.class + " has no access to " + constructor, e);
+ }
+ catch (InvocationTargetException e) {
+ throw new JbpmException(constructor + " threw exception", e.getCause());
+ }
}
public static Object get(Field field, Object object) {
@@ -446,15 +445,16 @@
* @return The class reference.
* @throws ClassNotFoundException From {@link Class#forName(String)}.
*/
- public static Class classForName(String name) throws ClassNotFoundException {
- try {
- ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
- if (contextClassLoader != null) {
- return contextClassLoader.loadClass(name);
+ public static Class<?> classForName(String name) throws ClassNotFoundException {
+ ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
+ if (contextClassLoader != null) {
+ try {
+ return Class.forName(name, true, contextClassLoader);
}
+ catch (ClassNotFoundException e) {
+ // keep going to load through the loader of the current class
+ }
}
- catch (Throwable ignore) {
- }
return Class.forName(name);
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ClassDescriptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ClassDescriptor.java 2010-06-30 17:48:23 UTC (rev 6444)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ClassDescriptor.java 2010-06-30 20:18:22 UTC (rev 6445)
@@ -15,29 +15,24 @@
private static final long serialVersionUID = 1L;
- String text;
+ String className;
/** loads the class from the class loader of the specified WireContext.
* @throws WireException if the class could not be loaded.
*/
public Object construct(WireContext wireContext) {
try {
- return ReflectUtil.classForName(text);
- } catch (Exception e) {
- Throwable cause = (e.getCause()!=null ? e.getCause() : e);
- throw new WireException("couldn't load class '"+text+"': "+cause.getMessage(), cause);
+ return ReflectUtil.classForName(className);
+ } catch (ClassNotFoundException e) {
+ throw new WireException("could not find class: "+className, e);
}
}
public void setClassName(String className) {
- this.text = className;
+ this.className = className;
}
public void setClass(Class<?> clazz) {
- if (clazz==null) {
- text = null;
- } else {
- this.text = clazz.getName();
- }
+ className = clazz != null ? clazz.getName() : null;
}
}
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/JuelExpressionTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/JuelExpressionTest.java 2010-06-30 17:48:23 UTC (rev 6444)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/JuelExpressionTest.java 2010-06-30 20:18:22 UTC (rev 6445)
@@ -23,7 +23,6 @@
import org.jbpm.pvm.activities.WaitState;
import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
-import org.jbpm.pvm.internal.client.ClientExecution;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.env.ExecutionContext;
@@ -32,7 +31,6 @@
import org.jbpm.pvm.internal.script.ScriptManager;
import org.jbpm.test.BaseJbpmTestCase;
-
/**
* @author Tom Baeyens
*/
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ClassWireTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ClassWireTest.java 2010-06-30 17:48:23 UTC (rev 6444)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ClassWireTest.java 2010-06-30 20:18:22 UTC (rev 6445)
@@ -53,7 +53,7 @@
wireContext.get("o");
fail("expected exception");
} catch (WireException e) {
- assertTextPresent("couldn't load class '"+className+"'", e.getMessage());
+ assertTextPresent(className, e.getMessage());
}
}
Modified: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java 2010-06-30 17:48:23 UTC (rev 6444)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java 2010-06-30 20:18:22 UTC (rev 6445)
@@ -61,7 +61,7 @@
*/
public abstract class JbpmTestCase extends BaseJbpmTestCase {
- protected static ProcessEngine processEngine = null;
+ protected static ProcessEngine processEngine;
protected static RepositoryService repositoryService;
protected static ExecutionService executionService;
Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/LoadTestCase.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/LoadTestCase.java 2010-06-30 17:48:23 UTC (rev 6444)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/LoadTestCase.java 2010-06-30 20:18:22 UTC (rev 6445)
@@ -132,6 +132,8 @@
public boolean areJobsAvailable() {
return commandService.execute(new Command<Boolean>() {
+ private static final long serialVersionUID = 1L;
+
public Boolean execute(Environment environment) {
Session session = environment.get(Session.class);
Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ContinuationTest.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ContinuationTest.java 2010-06-30 17:48:23 UTC (rev 6444)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ContinuationTest.java 2010-06-30 20:18:22 UTC (rev 6445)
@@ -25,8 +25,9 @@
import java.util.List;
import org.hibernate.Session;
-import org.jbpm.api.cmd.Command;
+
import org.jbpm.api.cmd.Environment;
+import org.jbpm.api.cmd.VoidCommand;
import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
import org.jbpm.pvm.internal.model.OpenProcessDefinition;
@@ -67,8 +68,11 @@
}
public void deployProcess() {
- commandService.execute(new Command<Object>() {
- public Object execute(Environment environment) throws Exception {
+ commandService.execute(new VoidCommand() {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void executeVoid(Environment environment) throws Exception {
OpenProcessDefinition processDefinition = ProcessDefinitionBuilder.startProcess("continuations")
.key("continuations")
.startActivity("start", AutomaticActivity.class)
@@ -94,7 +98,6 @@
Session session = environment.get(Session.class);
session.save(processDefinition);
- return null;
}
});
}
Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveTestCommand.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveTestCommand.java 2010-06-30 17:48:23 UTC (rev 6444)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveTestCommand.java 2010-06-30 20:18:22 UTC (rev 6445)
@@ -26,23 +26,21 @@
import java.util.Set;
import org.hibernate.Session;
+
import org.jbpm.api.Execution;
-import org.jbpm.api.cmd.Command;
import org.jbpm.api.cmd.Environment;
-import org.jbpm.internal.log.Log;
+import org.jbpm.api.cmd.VoidCommand;
import org.jbpm.pvm.internal.job.CommandMessage;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.internal.wire.descriptor.StringDescriptor;
-
/**
* @author Tom Baeyens
*/
-public class ExclusiveTestCommand implements Command<Object> {
+public class ExclusiveTestCommand extends VoidCommand {
private static final long serialVersionUID = 1L;
- private static final Log log = Log.getLog(ExclusiveTestCommand.class.getName());
static Random random = new Random();
String executionId;
@@ -61,7 +59,7 @@
return commandMessage;
}
- public Object execute(Environment environment) throws Exception {
+ protected void executeVoid(Environment environment) throws Exception {
Long threadId = Thread.currentThread().getId();
Session session = environment.get(Session.class);
@@ -92,8 +90,6 @@
log.debug("sleeping was interrupted");
}
*/
-
- return null;
}
}
Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceMessageTest.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceMessageTest.java 2010-06-30 17:48:23 UTC (rev 6444)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceMessageTest.java 2010-06-30 20:18:22 UTC (rev 6445)
@@ -28,13 +28,14 @@
import org.hibernate.Session;
import org.jbpm.api.cmd.Command;
import org.jbpm.api.cmd.Environment;
+import org.jbpm.api.cmd.VoidCommand;
import org.jbpm.api.history.HistoryComment;
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
import org.jbpm.pvm.internal.job.CommandMessage;
import org.jbpm.pvm.internal.session.MessageSession;
+import org.jbpm.pvm.internal.util.CollectionUtil;
-
/**
* @author Tom Baeyens
*/
@@ -66,20 +67,21 @@
log.debug("==== all messages processed, now checking if all messages have arrived exactly once ====");
- commandService.execute(new Command<Object>() {
+ commandService.execute(new VoidCommand() {
+ private static final long serialVersionUID = 1L;
- public Object execute(Environment environment) throws Exception {
+ @Override
+ protected void executeVoid(Environment environment) throws Exception {
Session session = environment.get(Session.class);
- List<HistoryComment> comments = session.createQuery("from " + HistoryDetailImpl.class.getName()).list();
+ List<?> comments = session.createCriteria(HistoryDetailImpl.class).list();
- for (HistoryComment comment : comments) {
+ for (HistoryComment comment : CollectionUtil.checkList(comments, HistoryComment.class)) {
log.debug("retrieved message: "+comment.getMessage());
Integer messageId = new Integer(comment.getMessage());
assertTrue("message " + messageId + " committed twice", failOnceMessageIds.remove(messageId));
}
assertTrue("not all messages made a successful commit: " + failOnceMessageIds, failOnceMessageIds.isEmpty());
- return null;
}
});
}
Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingMessageTest.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingMessageTest.java 2010-06-30 17:48:23 UTC (rev 6444)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingMessageTest.java 2010-06-30 20:18:22 UTC (rev 6445)
@@ -24,13 +24,12 @@
import java.util.List;
import org.jbpm.api.JbpmException;
-import org.jbpm.api.cmd.Command;
import org.jbpm.api.cmd.Environment;
+import org.jbpm.api.cmd.VoidCommand;
import org.jbpm.api.job.Job;
import org.jbpm.pvm.internal.job.CommandMessage;
import org.jbpm.pvm.internal.session.MessageSession;
-
/**
* @author Tom Baeyens
*/
@@ -40,13 +39,14 @@
public void testFailedMessageProcessing() {
jobExecutor.start();
try {
- commandService.execute(new Command<Object>() {
+ commandService.execute(new VoidCommand() {
+ private static final long serialVersionUID = 1L;
- public Object execute(Environment environment) throws Exception {
+ @Override
+ protected void executeVoid(Environment environment) throws Exception {
MessageSession messageSession = environment.get(MessageSession.class);
CommandMessage commandMessage = FailingTestCommand.createMessage();
messageSession.send(commandMessage);
- return null;
}
});
@@ -56,16 +56,17 @@
jobExecutor.stop(true);
}
- commandService.execute(new Command<Object>() {
+ commandService.execute(new VoidCommand() {
+ private static final long serialVersionUID = 1L;
- public Object execute(Environment environment) throws Exception {
+ @Override
+ public void executeVoid(Environment environment) throws Exception {
List<Job> deadJobs = null;
throw new JbpmException("todo get the jobs with exception");
// Session session = environment.get(Session.class);
// List commands = session.createQuery("from " + HistoryCommentImpl.class.getName()).list();
// assertTrue("command insertion should have been rolled back", commands.isEmpty());
-// return null;
}
});
}
Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingTestCommand.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingTestCommand.java 2010-06-30 17:48:23 UTC (rev 6444)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingTestCommand.java 2010-06-30 20:18:22 UTC (rev 6445)
@@ -27,7 +27,6 @@
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
-
/**
* @author Tom Baeyens
*/
Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/JobExecutorTestCase.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/JobExecutorTestCase.java 2010-06-30 17:48:23 UTC (rev 6444)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/JobExecutorTestCase.java 2010-06-30 20:18:22 UTC (rev 6445)
@@ -93,6 +93,8 @@
public boolean areJobsAvailable() {
return commandService.execute(new Command<Boolean>() {
+ private static final long serialVersionUID = 1L;
+
public Boolean execute(Environment environment) {
Session session = environment.get(Session.class);
Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageTest.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageTest.java 2010-06-30 17:48:23 UTC (rev 6444)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageTest.java 2010-06-30 20:18:22 UTC (rev 6445)
@@ -32,6 +32,7 @@
import org.jbpm.pvm.internal.job.CommandMessage;
import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
import org.jbpm.pvm.internal.session.MessageSession;
+import org.jbpm.pvm.internal.util.CollectionUtil;
import org.jbpm.test.Db;
/**
@@ -64,11 +65,13 @@
}
List<Integer> processedMessageNumbers = commandService.execute(new Command<List<Integer>>() {
+ private static final long serialVersionUID = 1L;
+
public List<Integer> execute(Environment environment) {
List<Integer> processedMessageNumbers = new ArrayList<Integer>();
Session session = environment.get(Session.class);
- List<HistoryComment> comments = session.createCriteria(HistoryDetailImpl.class).list();
- for (HistoryComment comment: comments) {
+ List<?> comments = session.createCriteria(HistoryDetailImpl.class).list();
+ for (HistoryComment comment: CollectionUtil.checkList(comments, HistoryComment.class)) {
int processedMessageNumber = Integer.parseInt(comment.getMessage());
processedMessageNumbers.add(processedMessageNumber);
// make sure the db stays clean
Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/executions/ProcessExecutionTest.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/executions/ProcessExecutionTest.java 2010-06-30 17:48:23 UTC (rev 6444)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/executions/ProcessExecutionTest.java 2010-06-30 20:18:22 UTC (rev 6445)
@@ -94,8 +94,8 @@
for (int i=0; i<processes; i++) {
executeProcess();
}
- } catch (Throwable t) {
- exception = t;
+ } catch (RuntimeException e) {
+ exception = e;
}
}
public void executeProcess() {
Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/AddCommentCmd.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/AddCommentCmd.java 2010-06-30 17:48:23 UTC (rev 6444)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/AddCommentCmd.java 2010-06-30 20:18:22 UTC (rev 6445)
@@ -22,24 +22,23 @@
package org.jbpm.test.load.messages;
import org.hibernate.Session;
-import org.jbpm.api.cmd.Command;
import org.jbpm.api.cmd.Environment;
+import org.jbpm.api.cmd.VoidCommand;
import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
/**
* @author Tom Baeyens
*/
-public class AddCommentCmd implements Command<Void> {
+public class AddCommentCmd extends VoidCommand {
private static final long serialVersionUID = 1L;
protected String message;
- public Void execute(Environment environment) throws Exception {
+ public void executeVoid(Environment environment) throws Exception {
// HistoryDetailImpl comment = new HistoryDetailImpl(message);
// Session session = environment.get(Session.class);
// session.save(comment);
// MessageProcessingTest.commentAdded();
- return null;
}
}
Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/MessageProcessingTest.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/MessageProcessingTest.java 2010-06-30 17:48:23 UTC (rev 6444)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/MessageProcessingTest.java 2010-06-30 20:18:22 UTC (rev 6445)
@@ -34,6 +34,7 @@
import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
import org.jbpm.pvm.internal.job.CommandMessage;
import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
+import org.jbpm.pvm.internal.util.CollectionUtil;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.internal.wire.descriptor.StringDescriptor;
import org.jbpm.test.load.LoadTestCase;
@@ -116,11 +117,13 @@
log.info("processing "+nbrOfTestMessages+" messages took "+getMeasuredTime());
List<Integer> processedMessageNumbers = commandService.execute(new Command<List<Integer>>() {
+ private static final long serialVersionUID = 1L;
+
public List<Integer> execute(Environment environment) {
List<Integer> processedMessageNumbers = new ArrayList<Integer>();
Session session = environment.get(Session.class);
- List<HistoryComment> comments = session.createCriteria(HistoryDetailImpl.class).list();
- for (HistoryComment comment: comments) {
+ List<?> comments = session.createCriteria(HistoryDetailImpl.class).list();
+ for (HistoryComment comment: CollectionUtil.checkList(comments, HistoryComment.class)) {
int processedMessageNumber = Integer.parseInt(comment.getMessage());
processedMessageNumbers.add(processedMessageNumber);
// make sure the db stays clean
13 years, 10 months
JBoss JBPM SVN: r6444 - projects/jsf-console/branches.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-06-30 13:48:23 -0400 (Wed, 30 Jun 2010)
New Revision: 6444
Removed:
projects/jsf-console/branches/jsf-console-3.3.1.SP/
Log:
removing jsf-console 3.3.1.SP branch, already tagged 3.3.1.SP1
13 years, 10 months
JBoss JBPM SVN: r6443 - jbpm3/trunk/modules/core/src/main/java/org/jbpm/command.
by do-not-reply@jboss.org
Author: camunda
Date: 2010-06-30 02:54:24 -0400 (Wed, 30 Jun 2010)
New Revision: 6443
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/ChangeProcessInstanceVersionCommand.java
Log:
JBPM-2903: Added changing the process instance version for a job as well
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/ChangeProcessInstanceVersionCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/ChangeProcessInstanceVersionCommand.java 2010-06-29 17:57:11 UTC (rev 6442)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/ChangeProcessInstanceVersionCommand.java 2010-06-30 06:54:24 UTC (rev 6443)
@@ -9,6 +9,7 @@
import org.apache.commons.logging.LogFactory;
import org.hibernate.Query;
import org.jbpm.JbpmException;
+import org.jbpm.graph.def.Action;
import org.jbpm.graph.def.GraphElement;
import org.jbpm.graph.def.Node;
import org.jbpm.graph.def.ProcessDefinition;
@@ -16,6 +17,8 @@
import org.jbpm.graph.exe.Token;
import org.jbpm.graph.node.ProcessState;
import org.jbpm.graph.node.TaskNode;
+import org.jbpm.job.ExecuteActionJob;
+import org.jbpm.job.ExecuteNodeJob;
import org.jbpm.job.Job;
import org.jbpm.job.Timer;
import org.jbpm.logging.log.ProcessLog;
@@ -145,8 +148,8 @@
Node newNode = findReplacementNode(newDef, oldNode);
token.setNode(newNode);
- // Change timers too!
- adjustTimersForToken(token);
+ // Change timers and jobs
+ adjustJobsAndTimersForToken(token);
// change tasks
adjustTaskInstancesForToken(token);
@@ -182,7 +185,7 @@
}
}
- private void adjustTimersForToken(Token token)
+ private void adjustJobsAndTimersForToken(Token token)
{
ProcessDefinition newDef = getNewProcessDefinition(token);
List<Job> jobs = getJbpmContext().getJobSession().findJobsByToken(token);
@@ -211,6 +214,29 @@
}
}
}
+ else if (job instanceof ExecuteNodeJob)
+ {
+ ExecuteNodeJob nodeJob = (ExecuteNodeJob)job;
+
+ if (nodeJob.getNode()!=null) {
+ // change to new node
+ GraphElement oldNode = nodeJob.getNode();
+ // TODO: What with other GraphElements?
+ nodeJob.setNode(
+ findReplacementNode(newDef, oldNode));
+ }
+ }
+ else if (job instanceof ExecuteActionJob)
+ {
+ ExecuteActionJob actionJob = (ExecuteActionJob)job;
+
+ if (actionJob.getAction()!=null) {
+ // change to new action
+ Action oldAction = actionJob.getAction();
+ actionJob.setAction(
+ findReplacementAction(newDef, oldAction));
+ }
+ }
}
}
@@ -241,6 +267,23 @@
}
return newTask;
}
+
+ private Action findReplacementAction(ProcessDefinition newDef, Action oldAction)
+ {
+ // if there exists an action not connected to a process definition (Check if there is a use case for this)
+ if (oldAction.getProcessDefinition()==null) {
+ return oldAction;
+ }
+
+ // TODO: We do not have a mapping for action names in place yet
+ String name = oldAction.getName();
+ Action newAction = newDef.getAction(name);
+ if (newAction == null)
+ {
+ throw new JbpmException("action with name '" + name + "' not found in new process definition");
+ }
+ return newAction;
+ }
/**
* @param oldNode
13 years, 10 months
JBoss JBPM SVN: r6442 - in jbpm4/trunk/modules: db/src/main/java/org/jbpm/db and 2 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-06-29 13:57:11 -0400 (Tue, 29 Jun 2010)
New Revision: 6442
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/cmd/VoidCommand.java
jbpm4/trunk/modules/db/src/main/java/org/jbpm/db/Create.java
jbpm4/trunk/modules/db/src/main/java/org/jbpm/db/DbHelper.java
jbpm4/trunk/modules/db/src/main/java/org/jbpm/db/JbpmVersion.java
jbpm4/trunk/modules/db/src/main/java/org/jbpm/db/Upgrade.java
jbpm4/trunk/modules/distro/scripts/assembly-distro.xml
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveMessagesTest.java
Log:
JBPM-2893: remove unused exclusion patterns from distro assembly
clean up create/update database schema programs
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/cmd/VoidCommand.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/cmd/VoidCommand.java 2010-06-29 06:57:29 UTC (rev 6441)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/cmd/VoidCommand.java 2010-06-29 17:57:11 UTC (rev 6442)
@@ -21,7 +21,6 @@
*/
package org.jbpm.api.cmd;
-
/** convenience for commands without return value.
*
* @author Tom Baeyens
@@ -35,6 +34,6 @@
return null;
}
- public abstract void executeVoid(Environment environment) throws Exception;
+ protected abstract void executeVoid(Environment environment) throws Exception;
}
Modified: jbpm4/trunk/modules/db/src/main/java/org/jbpm/db/Create.java
===================================================================
--- jbpm4/trunk/modules/db/src/main/java/org/jbpm/db/Create.java 2010-06-29 06:57:29 UTC (rev 6441)
+++ jbpm4/trunk/modules/db/src/main/java/org/jbpm/db/Create.java 2010-06-29 17:57:11 UTC (rev 6442)
@@ -36,41 +36,34 @@
private static final long serialVersionUID = 1L;
- private static Log log = Log.getLog(Upgrade.class.getName());
-
- static String database;
+ private static final Log log = Log.getLog(Create.class.getName());
public static void main(String[] args) {
- if ( (args==null)
- || (args.length!=1)
- ) {
+ if (args.length != 1) {
DbHelper.printSyntax(Upgrade.class);
return;
}
-
- database = args[0];
-
- ProcessEngine processEngine = new ConfigurationImpl()
- .skipDbCheck()
- .buildProcessEngine();
-
+
+ final String database = args[0];
+ ProcessEngine processEngine = new ConfigurationImpl().skipDbCheck().buildProcessEngine();
+
try {
- processEngine.execute(new Command<Void>(){
+ processEngine.execute(new Command<Void>() {
private static final long serialVersionUID = 1L;
+
public Void execute(Environment environment) throws Exception {
Session session = environment.get(Session.class);
- DbHelper.executeSqlResource("create/jbpm."+database+".create.sql", session);
+ DbHelper.executeSqlResource("create/jbpm." + database + ".create.sql", session);
PropertyImpl.createProperties(session);
return null;
}
});
-
- log.info("jBPM DB create completed successfully.");
-
- } catch (Exception e) {
- log.error("ERROR: jBPM DB create FAILED", e);
-
- } finally {
+ log.info("database schema created successfully");
+ }
+ catch (Exception e) {
+ log.error("database schema creation failed", e);
+ }
+ finally {
processEngine.close();
}
}
Modified: jbpm4/trunk/modules/db/src/main/java/org/jbpm/db/DbHelper.java
===================================================================
--- jbpm4/trunk/modules/db/src/main/java/org/jbpm/db/DbHelper.java 2010-06-29 06:57:29 UTC (rev 6441)
+++ jbpm4/trunk/modules/db/src/main/java/org/jbpm/db/DbHelper.java 2010-06-29 17:57:11 UTC (rev 6442)
@@ -35,22 +35,26 @@
/**
* @author Tom Baeyens
*/
-public abstract class DbHelper {
-
- private static Log log = Log.getLog(DbHelper.class.getName());
+public class DbHelper {
+ private static final Log log = Log.getLog(DbHelper.class.getName());
+
+ private DbHelper() {
+ // hide default constructor to prevent instantiation
+ }
+
public static void initializeLogging() {
- Jdk14LogFactory.initializeJdk14Logging();
+ Jdk14LogFactory.initializeJdk14Logging();
}
public static void printSyntax(Class<?> clazz) {
- log.info("Syntax: java -cp ... "+clazz.getName()+" database [delimiter]");
- log.info("where database is one of {oracle, postgresql, mysql, hsqldb}");
+ log.info("Syntax: java -cp ... " + clazz.getName() + " database [delimiter]");
+ log.info("where database is one of {oracle, postgresql, mysql, hsqldb}");
log.info("and delimiter is the db sql delimiter. default delimiter is ;");
}
public static void executeSqlResource(String resource, Session session) {
- InputStream stream = Upgrade.class.getClassLoader().getResourceAsStream(resource);
+ InputStream stream = DbHelper.class.getClassLoader().getResourceAsStream(resource);
if (stream == null) {
throw new JbpmException("resource not found: " + resource);
}
@@ -59,14 +63,15 @@
byte[] bytes = IoUtil.readBytes(stream);
String fileContents = new String(bytes);
List<String> commands = extractCommands(fileContents);
-
+
log.info("--- Executing DB Commands -------------------------");
- for (String command: commands) {
+ for (String command : commands) {
log.info(command);
try {
int result = session.createSQLQuery(command).executeUpdate();
- log.info("--- Result: "+result+" --------------------------");
- } catch (Exception e) {
+ log.info("--- Result: " + result + " --------------------------");
+ }
+ catch (Exception e) {
e.printStackTrace();
log.info("-----------------------------------------------");
}
@@ -83,16 +88,16 @@
public static List<String> extractCommands(String fileContents) {
List<String> commands = new ArrayList<String>();
int i = 0;
- while (i<fileContents.length()) {
+ while (i < fileContents.length()) {
int j = fileContents.indexOf(";", i);
- if (j==-1) {
+ if (j == -1) {
j = fileContents.length();
}
String command = fileContents.substring(i, j).trim();
- if (command.length()>0) {
+ if (command.length() > 0) {
commands.add(command);
}
- i = j+1;
+ i = j + 1;
}
return commands;
}
Modified: jbpm4/trunk/modules/db/src/main/java/org/jbpm/db/JbpmVersion.java
===================================================================
--- jbpm4/trunk/modules/db/src/main/java/org/jbpm/db/JbpmVersion.java 2010-06-29 06:57:29 UTC (rev 6441)
+++ jbpm4/trunk/modules/db/src/main/java/org/jbpm/db/JbpmVersion.java 2010-06-29 17:57:11 UTC (rev 6442)
@@ -37,10 +37,6 @@
dbVersion = dbVersion.substring(0, dbVersion.length() - 9);
}
return dbVersion.startsWith("4.") && dbVersion.length() > 2 ? valueOf("V_4_"
- + dbVersion.substring(2)) : null;
+ + dbVersion.substring(2)) : null;
}
-
- public boolean isEarlier(JbpmVersion other) {
- return ordinal() < other.ordinal();
- }
}
Modified: jbpm4/trunk/modules/db/src/main/java/org/jbpm/db/Upgrade.java
===================================================================
--- jbpm4/trunk/modules/db/src/main/java/org/jbpm/db/Upgrade.java 2010-06-29 06:57:29 UTC (rev 6441)
+++ jbpm4/trunk/modules/db/src/main/java/org/jbpm/db/Upgrade.java 2010-06-29 17:57:11 UTC (rev 6442)
@@ -30,12 +30,14 @@
import org.jbpm.api.ProcessEngine;
import org.jbpm.api.cmd.Command;
import org.jbpm.api.cmd.Environment;
+import org.jbpm.api.cmd.VoidCommand;
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.cfg.ConfigurationImpl;
import org.jbpm.pvm.internal.id.PropertyImpl;
import org.jbpm.pvm.internal.processengine.ProcessEngineImpl;
import org.jbpm.pvm.internal.repository.DeploymentImpl;
import org.jbpm.pvm.internal.repository.DeploymentProperty;
+import org.jbpm.pvm.internal.util.CollectionUtil;
/**
* @author Tom Baeyens
@@ -44,122 +46,156 @@
public class Upgrade {
private static final long serialVersionUID = 1L;
-
- private static Log log = Log.getLog(Upgrade.class.getName());
-
- static String database;
- static JbpmVersion jbpmVersion;
- static boolean propertiesTableExists;
+ static final Log log = Log.getLog(Upgrade.class.getName());
+
+ private Upgrade() {
+ // hide default constructor to prevent instantiation
+ }
+
public static void main(String[] args) {
- if ( (args==null)
- || (args.length!=1)
- ) {
+ if (args.length != 1) {
DbHelper.printSyntax(Upgrade.class);
return;
}
-
- database = args[0];
-
- ProcessEngine processEngine = new ConfigurationImpl()
- .skipDbCheck()
- .buildProcessEngine();
-
+
+ String database = args[0];
+ ProcessEngine processEngine = new ConfigurationImpl().skipDbCheck().buildProcessEngine();
+
try {
- processEngine.execute(new Command<Object>(){
- private static final long serialVersionUID = 1L;
- public Object execute(Environment environment) throws Exception {
- Session session = environment.get(Session.class);
- propertiesTableExists = PropertyImpl.propertiesTableExists(session);
- return null;
+ boolean propertiesTableExists = processEngine.execute(PropertiesTableExists.INSTANCE);
+ final JbpmVersion databaseVersion = processEngine.execute(new FindDatabaseVersion(propertiesTableExists));
+ JbpmVersion libraryVersion = JbpmVersion.getJbpmVersion(ProcessEngineImpl.JBPM_LIBRARY_VERSION);
+
+ if (databaseVersion == libraryVersion) {
+ log.info("database schema is already up to date");
+ }
+ else {
+ processEngine.execute(new RunUpgradeScripts(database, databaseVersion, propertiesTableExists));
+ processEngine.execute(new UpdateDatabaseVersion(databaseVersion));
+ }
+
+ log.info("database schema upgraded successfully");
+ }
+ catch (Exception e) {
+ log.error("database schema upgrade failed", e);
+ }
+ finally {
+ processEngine.close();
+ }
+ }
+
+ private static class PropertiesTableExists implements Command<Boolean> {
+
+ private static final long serialVersionUID = 1L;
+
+ static final PropertiesTableExists INSTANCE = new PropertiesTableExists();
+
+ public Boolean execute(Environment environment) throws Exception {
+ Session session = environment.get(Session.class);
+ return PropertyImpl.propertiesTableExists(session);
+ }
+ }
+
+ private static class FindDatabaseVersion implements Command<JbpmVersion> {
+
+ private final boolean propertiesTableExists;
+
+ private static final long serialVersionUID = 1L;
+
+ FindDatabaseVersion(boolean propertiesTableExists) {
+ this.propertiesTableExists = propertiesTableExists;
+ }
+
+ public JbpmVersion execute(Environment environment) throws Exception {
+ Session session = environment.get(Session.class);
+ if (!propertiesTableExists) {
+ try {
+ session.createSQLQuery("select CLASSNAME_ from JBPM4_VARIABLE").list();
+ return JbpmVersion.V_4_1;
}
- });
- processEngine.execute(new Command<Object>(){
- private static final long serialVersionUID = 1L;
- public Object execute(Environment environment) throws Exception {
- Session session = environment.get(Session.class);
- if (!propertiesTableExists) {
- try {
- session.createSQLQuery("select CLASSNAME_ from JBPM4_VARIABLE").list();
- jbpmVersion = JbpmVersion.V_4_1;
+ catch (HibernateException e) {
+ return JbpmVersion.V_4_0;
+ }
+ }
+ else {
+ String dbVersion = PropertyImpl.getDbVersion(session);
+ if (dbVersion == null) {
+ throw new JbpmException("property table exists, but no db version property is present");
+ }
+ return JbpmVersion.getJbpmVersion(dbVersion);
+ }
+ }
+ }
- } catch (HibernateException e) {
- jbpmVersion = JbpmVersion.V_4_0;
- }
- } else {
- String dbVersion = PropertyImpl.getDbVersion(session);
- if (dbVersion == null) {
- throw new JbpmException("property table exists, but no db version property is present");
- }
+ private static class RunUpgradeScripts extends VoidCommand {
- jbpmVersion = JbpmVersion.getJbpmVersion(dbVersion);
- }
- return null;
+ private final JbpmVersion databaseVersion;
+ private final String database;
+ private final boolean propertiesTableExists;
+
+ private static final long serialVersionUID = 1L;
+
+ RunUpgradeScripts(String database, JbpmVersion databaseVersion,
+ boolean propertiesTableExists) {
+ this.database = database;
+ this.databaseVersion = databaseVersion;
+ this.propertiesTableExists = propertiesTableExists;
+ }
+
+ protected void executeVoid(Environment environment) throws Exception {
+ Session session = environment.get(Session.class);
+
+ log.info("upgrading from " + databaseVersion + " to "
+ + ProcessEngineImpl.JBPM_LIBRARY_VERSION);
+
+ if (databaseVersion.compareTo(JbpmVersion.V_4_1) < 0) {
+ DbHelper.executeSqlResource("upgrade-4.0-to-4.1/jbpm." + database + ".upgrade.sql", session);
+ }
+
+ if (databaseVersion.compareTo(JbpmVersion.V_4_2) < 0) {
+ // the first part of the upgrade to 4.2 might already be done before as that
+ // happens in the next transaction (and that next transaction might have failed in
+ // a previous run of upgrade)
+ // in that case, the next part is skipped
+ if (!propertiesTableExists) {
+ DbHelper.executeSqlResource("upgrade-4.1-to-4.2/jbpm." + database + ".upgrade.sql", session);
+ PropertyImpl.initializeNextDbid(session);
+ // we set the version to 4.1 as the next transaction might fail
+ PropertyImpl.setDbVersionTo41(session);
}
- });
+ }
+ // transaction is now committed as the next transaction requires the NextDbid
+ // property to be initialized and committed.
+ }
+ }
- JbpmVersion currentJbpmVersion = JbpmVersion.getJbpmVersion(ProcessEngineImpl.JBPM_LIBRARY_VERSION);
- if (jbpmVersion == currentJbpmVersion) {
- log.info("jBPM schema is already up to date");
-
- } else {
- processEngine.execute(new Command<Object>(){
- private static final long serialVersionUID = 1L;
- public Object execute(Environment environment) throws Exception {
- Session session = environment.get(Session.class);
-
- log.info("upgrading from "+jbpmVersion+" to "+ProcessEngineImpl.JBPM_LIBRARY_VERSION);
-
- if (jbpmVersion.isEarlier(JbpmVersion.V_4_1)) {
- DbHelper.executeSqlResource("upgrade-4.0-to-4.1/jbpm." + database + ".upgrade.sql", session);
- }
+ private static final class UpdateDatabaseVersion extends VoidCommand {
- if (jbpmVersion.isEarlier(JbpmVersion.V_4_2)) {
- // the first part of the upgrade to 4.2 might already be done before as that happens in the next transaction (and that next transaction might have failed in a previous run of upgrade)
- // in that case, the next part is skipped
- if (!propertiesTableExists) {
- DbHelper.executeSqlResource("upgrade-4.1-to-4.2/jbpm." + database + ".upgrade.sql", session);
- PropertyImpl.initializeNextDbid(session);
- // we set the version to 4.1 as the next transaction might fail
- PropertyImpl.setDbVersionTo41(session);
- }
- }
- // transaction is now committed as the next transaction requires the NextDbid property to be initialized and committed.
- return null;
- }
- });
+ private final JbpmVersion databaseVersion;
- processEngine.execute(new Command<Object>(){
- private static final long serialVersionUID = 1L;
- public Object execute(Environment environment) throws Exception {
- Session session = environment.get(Session.class);
-
- if (jbpmVersion.isEarlier(JbpmVersion.V_4_2)) {
- // find deployments without a langid property
- List<DeploymentProperty> deploymentProperties = session.createCriteria(DeploymentProperty.class)
- .add(Restrictions.eq("key", DeploymentImpl.KEY_PROCESS_DEFINITION_ID))
- .list();
-
- for (DeploymentProperty deploymentProperty : deploymentProperties) {
- String objectName = deploymentProperty.getObjectName();
- DeploymentImpl deployment = deploymentProperty.getDeployment();
- deployment.setProcessLanguageId(objectName, "jpdl-4.0");
- }
- }
-
- PropertyImpl.setDbVersionToLibraryVersion(session);
- return null;
- }
- });
- }
+ private static final long serialVersionUID = 1L;
- log.info("jBPM DB upgrade completed successfully.");
+ UpdateDatabaseVersion(JbpmVersion databaseVersion) {
+ this.databaseVersion = databaseVersion;
+ }
- } catch (Exception e) {
- log.error("ERROR: jBPM DB upgrade FAILED", e);
+ protected void executeVoid(Environment environment) throws Exception {
+ Session session = environment.get(Session.class);
- } finally {
- processEngine.close();
+ if (databaseVersion.compareTo(JbpmVersion.V_4_2) < 0) {
+ // find deployments without a langid property
+ List<?> deploymentProperties = session.createCriteria(DeploymentProperty.class)
+ .add(Restrictions.eq("key", DeploymentImpl.KEY_PROCESS_DEFINITION_ID))
+ .list();
+
+ for (DeploymentProperty deploymentProperty : CollectionUtil.checkList(deploymentProperties, DeploymentProperty.class)) {
+ DeploymentImpl deployment = deploymentProperty.getDeployment();
+ deployment.setProcessLanguageId(deploymentProperty.getObjectName(), "jpdl-4.0");
+ }
+ }
+
+ PropertyImpl.setDbVersionToLibraryVersion(session);
}
}
}
Modified: jbpm4/trunk/modules/distro/scripts/assembly-distro.xml
===================================================================
--- jbpm4/trunk/modules/distro/scripts/assembly-distro.xml 2010-06-29 06:57:29 UTC (rev 6441)
+++ jbpm4/trunk/modules/distro/scripts/assembly-distro.xml 2010-06-29 17:57:11 UTC (rev 6442)
@@ -22,10 +22,11 @@
<unpack>false</unpack>
</dependencySet -->
<dependencySet>
+ <outputDirectory>lib</outputDirectory>
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<!-- useStrictFiltering>true</useStrictFiltering -->
- <unpack>false</unpack>
<scope>test</scope>
+ <unpack>false</unpack>
<excludes>
<exclude>org.jbpm.jbpm4:jbpm-api:jar</exclude>
<exclude>org.jbpm.jbpm4:jbpm-log:jar</exclude>
@@ -34,26 +35,23 @@
<exclude>org.jbpm.jbpm4:jbpm-jpdl:jar</exclude>
<exclude>org.jbpm.jbpm4:jbpm-enterprise:jar</exclude>
<exclude>org.jbpm.jbpm4:jbpm-distro:jar</exclude>
- <exclude>org.jbpm.jbpm4:jbpm-examples:jar</exclude>
<exclude>org.jbpm.jbpm4:jbpm-gpd:zip</exclude>
<exclude>org.jbpm.jbpm4.dependencies.signavio:jbpmeditor:war</exclude>
- <exclude>org.jbpm.jbpm4:jbpm-test-db:jar</exclude>
</excludes>
- <outputDirectory>lib</outputDirectory>
</dependencySet>
<dependencySet>
+ <outputDirectory>install/src/gpd</outputDirectory>
+ <outputFileNameMapping>jbpm-gpd-site.zip</outputFileNameMapping>
<includes>
<include>org.jbpm.jbpm4:jbpm-gpd:zip</include>
</includes>
- <outputFileNameMapping>jbpm-gpd-site.zip</outputFileNameMapping>
- <outputDirectory>install/src/gpd</outputDirectory>
</dependencySet>
<dependencySet>
+ <outputDirectory>install/src/signavio</outputDirectory>
+ <outputFileNameMapping>jbpmeditor.war</outputFileNameMapping>
<includes>
<include>org.jbpm.jbpm4.dependencies.signavio:jbpmeditor:war</include>
</includes>
- <outputFileNameMapping>jbpmeditor.war</outputFileNameMapping>
- <outputDirectory>install/src/signavio</outputDirectory>
</dependencySet>
</dependencySets>
Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveMessagesTest.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveMessagesTest.java 2010-06-29 06:57:29 UTC (rev 6441)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveMessagesTest.java 2010-06-29 17:57:11 UTC (rev 6442)
@@ -70,7 +70,7 @@
commandService.execute(new VoidCommand() {
private static final long serialVersionUID = 1L;
- public void executeVoid(Environment environment) {
+ protected void executeVoid(Environment environment) {
// exclusiveMessageIds maps execution keys to a set of thread ids.
// the idea is that for each execution, all the exclusive jobs will
// be executed by 1 thread sequentially.
@@ -101,7 +101,7 @@
commandService.execute(new VoidCommand() {
private static final long serialVersionUID = 1L;
- public void executeVoid(Environment environment) {
+ protected void executeVoid(Environment environment) {
ProcessDefinitionImpl processDefinition = ProcessDefinitionBuilder
.startProcess("excl")
.startActivity("wait", WaitState.class)
@@ -118,7 +118,7 @@
commandService.execute(new VoidCommand() {
private static final long serialVersionUID = 1L;
- public void executeVoid(Environment environment) throws Exception {
+ protected void executeVoid(Environment environment) throws Exception {
MessageSession messageSession = environment.get(MessageSession.class);
for (int i = 0; i < nbrOfTestExecutions; i++) {
Execution execution = new StartProcessInstanceCmd("excl:1", null, "execution-" + i).execute(environment);
13 years, 10 months
JBoss JBPM SVN: r6441 - jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-06-29 02:57:29 -0400 (Tue, 29 Jun 2010)
New Revision: 6441
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/ConfigurationParser.java
Log:
JBPM-2893: guard configuration parser against empty document element
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/ConfigurationParser.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/ConfigurationParser.java 2010-06-29 06:49:27 UTC (rev 6440)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/ConfigurationParser.java 2010-06-29 06:57:29 UTC (rev 6441)
@@ -53,70 +53,70 @@
}
public Object parseDocument(Document document, Parse parse) {
- Element documentElement = document.getDocumentElement();
-
// if the default environment factory was already set in the parse
ConfigurationImpl configuration = parse.contextStackFind(ConfigurationImpl.class);
-
- // this code will be called for the original jbpm.cfg.xml document as
- // well as for the imported documents. only one of those can specify
- // a spring-cfg. for sure no 2 config files can specify different jndi-names
- String spring = XmlUtil.attribute(documentElement, "spring");
- if ("enabled".equals(spring)) {
- configuration.springEnabled();
- }
-
- // this code will be called for the original jbpm.cfg.xml document as
- // well as for the imported documents. only one of those can specify
- // a jndi-name. for sure no 2 config files can specify different jndi-names
- String jndiName = XmlUtil.attribute(documentElement, "jndi-name");
- if (jndiName!=null) {
- if ( (configuration.getJndiName()!=null)
- && (!jndiName.equals(configuration.getJndiName()))
- ) {
- parse.addProblem("duplicate jndi name specification: "+jndiName+" != "+configuration.getJndiName());
- } else {
- configuration.jndi(jndiName);
+
+ Element documentElement = document.getDocumentElement();
+ if (documentElement != null) {
+ // this code will be called for the original jbpm.cfg.xml document as
+ // well as for the imported documents. only one of those can specify
+ // a spring-cfg. for sure no 2 config files can specify different jndi-names
+ String spring = XmlUtil.attribute(documentElement, "spring");
+ if ("enabled".equals(spring)) {
+ configuration.springEnabled();
}
- }
-
- for (Element importElement : XmlUtil.elements(documentElement, "import")) {
- if (importElement.hasAttribute("resource")) {
- String resource = importElement.getAttribute("resource");
- Parse importParse = createParse()
- .setResource(resource)
- .contextStackPush(configuration)
- .propagateContexMap(parse)
- .execute();
-
- parse.addProblems(importParse.getProblems());
+
+ // this code will be called for the original jbpm.cfg.xml document as
+ // well as for the imported documents. only one of those can specify
+ // a jndi-name. for sure no 2 config files can specify different jndi-names
+ String jndiName = XmlUtil.attribute(documentElement, "jndi-name");
+ if (jndiName!=null) {
+ if ( (configuration.getJndiName()!=null)
+ && (!jndiName.equals(configuration.getJndiName()))
+ ) {
+ parse.addProblem("duplicate jndi name specification: "+jndiName+" != "+configuration.getJndiName());
+ } else {
+ configuration.jndi(jndiName);
+ }
}
- }
-
- Element processEngineElement = XmlUtil.element(documentElement, "process-engine-context");
- if (processEngineElement != null) {
- WireDefinition processEngineContextDefinition = configuration.getProcessEngineWireContext().getWireDefinition();
- parse.contextStackPush(processEngineContextDefinition);
- try {
- processEngineContextParser.parseDocumentElement(processEngineElement, parse);
- } finally {
- parse.contextStackPop();
+
+ for (Element importElement : XmlUtil.elements(documentElement, "import")) {
+ if (importElement.hasAttribute("resource")) {
+ String resource = importElement.getAttribute("resource");
+ Parse importParse = createParse()
+ .setResource(resource)
+ .contextStackPush(configuration)
+ .propagateContexMap(parse)
+ .execute();
+
+ parse.addProblems(importParse.getProblems());
+ }
}
- }
-
- Element txCtxElement = XmlUtil.element(documentElement, "transaction-context");
- if (txCtxElement != null) {
- WireDefinition transactionContextDefinition = configuration.getTransactionWireDefinition();
- parse.contextStackPush(transactionContextDefinition);
- try {
- transactionContextParser.parseDocumentElement(txCtxElement, parse);
- } finally {
- parse.contextStackPop();
+
+ Element processEngineElement = XmlUtil.element(documentElement, "process-engine-context");
+ if (processEngineElement != null) {
+ WireDefinition processEngineContextDefinition = configuration.getProcessEngineWireContext().getWireDefinition();
+ parse.contextStackPush(processEngineContextDefinition);
+ try {
+ processEngineContextParser.parseDocumentElement(processEngineElement, parse);
+ } finally {
+ parse.contextStackPop();
+ }
}
+
+ Element txCtxElement = XmlUtil.element(documentElement, "transaction-context");
+ if (txCtxElement != null) {
+ WireDefinition transactionContextDefinition = configuration.getTransactionWireDefinition();
+ parse.contextStackPush(transactionContextDefinition);
+ try {
+ transactionContextParser.parseDocumentElement(txCtxElement, parse);
+ } finally {
+ parse.contextStackPop();
+ }
+ }
}
parse.setDocumentObject(configuration);
-
return configuration;
}
13 years, 10 months
JBoss JBPM SVN: r6440 - in jbpm4/trunk/modules: distro/src/main/files/install/src/cfg/jbpm and 1 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-06-29 02:49:27 -0400 (Tue, 29 Jun 2010)
New Revision: 6440
Added:
jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/jbpm/spring.testsuite.examples.jbpm.cfg.xml
Modified:
jbpm4/trunk/modules/distro/src/main/files/install/build.xml
jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/jbpm/spring.testsuite.jbpm.cfg.xml
jbpm4/trunk/modules/examples/pom.xml
Log:
JBPM-2893: fix broken jbpm4-spring job - introduce spring.testsuite.examples configuration
Modified: jbpm4/trunk/modules/distro/src/main/files/install/build.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/install/build.xml 2010-06-29 03:07:20 UTC (rev 6439)
+++ jbpm4/trunk/modules/distro/src/main/files/install/build.xml 2010-06-29 06:49:27 UTC (rev 6440)
@@ -188,10 +188,7 @@
<!-- If the target environment uses Spring, also copy the applicationContext.xml file-->
<condition property="is.spring.environment">
- <or>
- <equals arg1="${tx}" arg2="spring" />
- <equals arg1="${tx}" arg2="spring.testsuite" />
- </or>
+ <contains string="${tx}" substring="spring" />
</condition>
<antcall target="internal.copy.spring.applicationContext" />
</target>
Added: jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/jbpm/spring.testsuite.examples.jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/jbpm/spring.testsuite.examples.jbpm.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/jbpm/spring.testsuite.examples.jbpm.cfg.xml 2010-06-29 06:49:27 UTC (rev 6440)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <import resource="jbpm.default.cfg.xml" />
+ <import resource="jbpm.tx.spring.cfg.xml" />
+ <import resource="jbpm.jpdl.cfg.xml" />
+ <import resource="jbpm.bpmn.cfg.xml" />
+ <import resource="jbpm.identity.cfg.xml" />
+ <import resource="jbpm.businesscalendar.cfg.xml" />
+ <import resource="jbpm.console.cfg.xml" />
+ <import resource="jbpm.mail.templates.examples.xml" />
+
+ <process-engine-context>
+ <string name="spring.cfg" value="applicationContext.xml" />
+ </process-engine-context>
+
+</jbpm-configuration>
Property changes on: jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/jbpm/spring.testsuite.examples.jbpm.cfg.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Modified: jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/jbpm/spring.testsuite.jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/jbpm/spring.testsuite.jbpm.cfg.xml 2010-06-29 03:07:20 UTC (rev 6439)
+++ jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/jbpm/spring.testsuite.jbpm.cfg.xml 2010-06-29 06:49:27 UTC (rev 6440)
@@ -9,7 +9,6 @@
<import resource="jbpm.identity.cfg.xml" />
<import resource="jbpm.businesscalendar.cfg.xml" />
<import resource="jbpm.console.cfg.xml" />
- <import resource="jbpm.mail.templates.examples.xml" />
<process-engine-context>
<string name="spring.cfg" value="applicationContext.xml" />
Modified: jbpm4/trunk/modules/examples/pom.xml
===================================================================
--- jbpm4/trunk/modules/examples/pom.xml 2010-06-29 03:07:20 UTC (rev 6439)
+++ jbpm4/trunk/modules/examples/pom.xml 2010-06-29 06:49:27 UTC (rev 6440)
@@ -162,7 +162,7 @@
<configuration>
<tasks>
<ant antfile="../distro/src/main/files/install/build.xml" target="create.cfg">
- <property name="tx" value="spring.testsuite" />
+ <property name="tx" value="spring.testsuite.examples" />
<property name="hibernate.connection.type" value="spring" />
<property name="database" value="hsqldb.inmem" />
<property name="mail.cfg" value="testsuite" />
13 years, 10 months
JBoss JBPM SVN: r6439 - in jbpm4/trunk/modules/test-db/src/test: resources/org/jbpm/test/ant and 1 other directory.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-06-28 23:07:20 -0400 (Mon, 28 Jun 2010)
New Revision: 6439
Modified:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/ant/DeployTaskTest.java
jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/ant/build.xml
Log:
JBPM-2893: fix broken deploy task test :-P
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/ant/DeployTaskTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/ant/DeployTaskTest.java 2010-06-28 23:26:55 UTC (rev 6438)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/ant/DeployTaskTest.java 2010-06-29 03:07:20 UTC (rev 6439)
@@ -37,17 +37,17 @@
public void testDeployXml() {
runTarget("deploy-xml");
- checkDeployment();
+ checkDeployment("valid.jpdl.xml");
}
public void testDeployZip() {
runTarget("deploy-zip");
- checkDeployment();
+ checkDeployment("valid.zip");
}
public void testDeployBar() {
runTarget("deploy-bar");
- checkDeployment();
+ checkDeployment("valid.bar");
}
private void runTarget(String target) {
@@ -73,14 +73,17 @@
finally {
System.setOut(stdout);
System.setErr(stderr);
+ }
- log.info(new String(memout.toByteArray()));
- }
+ log.info(memout.toString());
}
- private void checkDeployment() {
+ private void checkDeployment(String deploymentName) {
List<Deployment> deployments = repositoryService.createDeploymentQuery().list();
assertEquals(1, deployments.size());
- repositoryService.deleteDeploymentCascade(deployments.get(0).getId());
+
+ Deployment deployment = deployments.get(0);
+ assertEquals(deploymentName, deployment.getName());
+ repositoryService.deleteDeploymentCascade(deployment.getId());
}
}
Modified: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/ant/build.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/ant/build.xml 2010-06-28 23:26:55 UTC (rev 6438)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/ant/build.xml 2010-06-29 03:07:20 UTC (rev 6439)
@@ -1,18 +1,20 @@
<?xml version="1.0"?>
<project name="test-ant">
<target name="init">
+ <dirname file="${ant.file}" property="base.dir" />
+ <echo>base directory: ${base.dir}</echo>
<taskdef name="jbpm-deploy" classname="org.jbpm.pvm.internal.ant.JbpmDeployTask" />
</target>
<target name="deploy-xml" depends="init">
- <jbpm-deploy file="valid.jpdl.xml" />
+ <jbpm-deploy file="${base.dir}/valid.jpdl.xml" />
</target>
<target name="deploy-zip" depends="init">
- <jbpm-deploy file="valid.zip" />
+ <jbpm-deploy file="${base.dir}/valid.zip" />
</target>
<target name="deploy-bar" depends="init">
- <jbpm-deploy file="valid.bar" />
+ <jbpm-deploy file="${base.dir}/valid.bar" />
</target>
</project>
\ No newline at end of file
13 years, 10 months
JBoss JBPM SVN: r6438 - in jbpm4/trunk/modules: pvm/src/main/java/org/jbpm/pvm/internal/xml and 6 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-06-28 19:26:55 -0400 (Mon, 28 Jun 2010)
New Revision: 6438
Added:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/ant/
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/ant/DeployTaskTest.java
jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/ant/
jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/ant/build.xml
jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/ant/valid.bar
jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/ant/valid.jpdl.xml
jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/ant/valid.zip
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/JbpmDeployTask.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java
jbpm4/trunk/modules/test-db/pom.xml
jbpm4/trunk/modules/test-pojo/.classpath
Log:
JBPM-2893: fix broken deploy ant task, provide unit test
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/JbpmDeployTask.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/JbpmDeployTask.java 2010-06-26 01:59:29 UTC (rev 6437)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/JbpmDeployTask.java 2010-06-28 23:26:55 UTC (rev 6438)
@@ -24,7 +24,7 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
-import java.net.URLConnection;
+import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -34,6 +34,7 @@
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.taskdefs.MatchingTask;
import org.apache.tools.ant.types.FileSet;
+
import org.jbpm.api.NewDeployment;
import org.jbpm.api.ProcessEngine;
import org.jbpm.api.RepositoryService;
@@ -84,29 +85,43 @@
protected void deployFile(ProcessEngine processEngine, File processFile) {
RepositoryService repositoryService = processEngine.getRepositoryService();
+ String fileName = processFile.getName();
+
NewDeployment deployment = repositoryService.createDeployment();
- deployment.setName(processFile.getName());
+ deployment.setName(fileName);
deployment.setTimestamp(System.currentTimeMillis());
- String contentType = URLConnection.guessContentTypeFromName(processFile.getName());
- if (contentType.contains("xml")) {
- log("deploying process file " + processFile.getName());
- deployment.addResourceFromFile(processFile);
- }
- else if (contentType.contains("zip")) {
- log("deploying business archive " + processFile.getName());
- try {
- FileInputStream fileInputStream = new FileInputStream(processFile);
- ZipInputStream zipInputStream = new ZipInputStream(fileInputStream);
+ try {
+ String contentType = new URL("file", null, processFile.getPath()).openConnection()
+ .getContentType();
+ // XXX getContentType() is supposed to return null if not known,
+ // yet sun jdk returns "content/unknown"
+ if (contentType == null || "content/unknown".equals(contentType)) {
+ // guess content type from file name
+ if (fileName.endsWith(".bar") || fileName.endsWith(".jar") || fileName.endsWith(".zip"))
+ contentType = "application/zip";
+ else if (fileName.endsWith(".xml"))
+ contentType = "application/xml";
+ else
+ throw new BuildException("failed to determine content type of " + processFile);
+ }
+
+ if ("application/xml".equals(contentType)) {
+ log("deploying process file " + fileName);
+ deployment.addResourceFromFile(processFile);
+ }
+ else if ("application/zip".equals(contentType)) {
+ log("deploying business archive " + fileName);
+ ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(processFile));
deployment.addResourcesFromZipInputStream(zipInputStream);
}
- catch (IOException e) {
- throw new BuildException("failed to read process archive " + processFile, e);
+ else {
+ throw new BuildException("unsupported content type: " + contentType
+ + " - only xml and zip files are allowed");
}
}
- else {
- throw new BuildException("unsupported extension: " + processFile
- + " Only .xml files and .*ar archives are supported");
+ catch (IOException e) {
+ throw new BuildException("failed to read: " + processFile, e);
}
deployment.deploy();
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java 2010-06-26 01:59:29 UTC (rev 6437)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java 2010-06-28 23:26:55 UTC (rev 6438)
@@ -41,7 +41,7 @@
static final String NEWLINE = System.getProperty("line.separator");
- protected List<ProblemImpl> problems;
+ protected List<Problem> problems;
// problem constructor method ///////////////////////////////////////////////
@@ -93,13 +93,13 @@
if (problems==null) {
return Collections.emptyList();
}
- return (List) problems;
+ return problems;
}
/** to add parsing problems during XML parsing and DOM walking. */
public void addProblem(ProblemImpl problem) {
if (problems==null) {
- problems = new ArrayList<ProblemImpl>();
+ problems = new ArrayList<Problem>();
}
problems.add(problem);
}
@@ -107,14 +107,14 @@
/** add all problems */
public void addProblems(List<Problem> problems) {
if (this.problems==null) {
- this.problems = new ArrayList<ProblemImpl>();
+ this.problems = new ArrayList<Problem>();
}
- this.problems.addAll((List)problems);
+ this.problems.addAll(problems);
}
/** indicates presence of problems */
public boolean hasProblems() {
- return ((problems != null) && (problems.size() > 0));
+ return problems != null && !problems.isEmpty();
}
/** indicates presence of errors */
@@ -133,7 +133,7 @@
/** allows to provide the list object that should be used to
* capture the parsing problems. */
public void setProblems(List<Problem> problems) {
- this.problems = (List)problems;
+ this.problems = problems;
}
@@ -168,7 +168,7 @@
errorMsg.append(p.toString());
if (p.getCause()!=null) {
- cause = new JbpmException(p.getCause());
+ cause = p.getCause();
}
}
}
Modified: jbpm4/trunk/modules/test-db/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-db/pom.xml 2010-06-26 01:59:29 UTC (rev 6437)
+++ jbpm4/trunk/modules/test-db/pom.xml 2010-06-28 23:26:55 UTC (rev 6438)
@@ -66,6 +66,11 @@
<artifactId>spring</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant</artifactId>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
<build>
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/ant/DeployTaskTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/ant/DeployTaskTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/ant/DeployTaskTest.java 2010-06-28 23:26:55 UTC (rev 6438)
@@ -0,0 +1,86 @@
+/*
+ * 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.test.ant;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import java.util.List;
+
+import org.apache.tools.ant.Main;
+
+import org.jbpm.api.Deployment;
+import org.jbpm.test.JbpmTestCase;
+
+/**
+ * @author Alejandro Guizar
+ */
+public class DeployTaskTest extends JbpmTestCase {
+
+ public void testDeployXml() {
+ runTarget("deploy-xml");
+ checkDeployment();
+ }
+
+ public void testDeployZip() {
+ runTarget("deploy-zip");
+ checkDeployment();
+ }
+
+ public void testDeployBar() {
+ runTarget("deploy-bar");
+ checkDeployment();
+ }
+
+ private void runTarget(String target) {
+ PrintStream stdout = System.out;
+ PrintStream stderr = System.err;
+
+ ByteArrayOutputStream memout = new ByteArrayOutputStream();
+ PrintStream prnout = new PrintStream(memout);
+
+ try {
+ System.setOut(prnout);
+ System.setErr(prnout);
+
+ Main antMain = new Main() {
+
+ protected void exit(int exitCode) {
+ // prevent ant from terminating the VM
+ }
+ };
+ String[] args = { "-f", getClass().getResource("build.xml").getPath(), target };
+ antMain.startAnt(args, System.getProperties(), getClass().getClassLoader());
+ }
+ finally {
+ System.setOut(stdout);
+ System.setErr(stderr);
+
+ log.info(new String(memout.toByteArray()));
+ }
+ }
+
+ private void checkDeployment() {
+ List<Deployment> deployments = repositoryService.createDeploymentQuery().list();
+ assertEquals(1, deployments.size());
+ repositoryService.deleteDeploymentCascade(deployments.get(0).getId());
+ }
+}
Property changes on: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/ant/DeployTaskTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/ant/build.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/ant/build.xml (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/ant/build.xml 2010-06-28 23:26:55 UTC (rev 6438)
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<project name="test-ant">
+ <target name="init">
+ <taskdef name="jbpm-deploy" classname="org.jbpm.pvm.internal.ant.JbpmDeployTask" />
+ </target>
+
+ <target name="deploy-xml" depends="init">
+ <jbpm-deploy file="valid.jpdl.xml" />
+ </target>
+
+ <target name="deploy-zip" depends="init">
+ <jbpm-deploy file="valid.zip" />
+ </target>
+
+ <target name="deploy-bar" depends="init">
+ <jbpm-deploy file="valid.bar" />
+ </target>
+</project>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/ant/build.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/ant/valid.bar
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/ant/valid.bar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/ant/valid.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/ant/valid.jpdl.xml (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/ant/valid.jpdl.xml 2010-06-28 23:26:55 UTC (rev 6438)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="Purchase order" xmlns="http://jbpm.org/4.3/jpdl">
+
+ <start g="46,33,80,40">
+ <transition to="a" />
+ </start>
+
+ <state name="a" g="169,36,80,40">
+ <transition name="Supplier ok" to="b" g="-85,-23"/>
+ </state>
+
+ <state name="b" g="169,145,80,40">
+ <transition name="nok" to="Error" g="-31,-23"/>
+ <transition name="ok" to="Completed" g="-22,-23"/>
+ </state>
+
+ <end name="Completed" g="350,142,80,40"/>
+
+ <end name="Error" g="186,253,80,40"/>
+
+</process>
Property changes on: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/ant/valid.jpdl.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/ant/valid.zip
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/ant/valid.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: jbpm4/trunk/modules/test-pojo/.classpath
===================================================================
--- jbpm4/trunk/modules/test-pojo/.classpath 2010-06-26 01:59:29 UTC (rev 6437)
+++ jbpm4/trunk/modules/test-pojo/.classpath 2010-06-28 23:26:55 UTC (rev 6438)
@@ -1,7 +1,5 @@
<?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"/>
13 years, 10 months
JBoss JBPM SVN: r6437 - in jbpm4/trunk/modules: distro/src/main/files/install and 23 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-06-25 21:59:29 -0400 (Fri, 25 Jun 2010)
New Revision: 6437
Added:
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/mail/
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/mail/MailTestSetup.java
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/cal/
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/cal/cfg/
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/cal/impl/
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/mail/
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/mail/CustomMailProducerTest.java
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/type/
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/cal/
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/cal/cfg/
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/cal/impl/
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/mail/
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/mail/jbpm.cfg.xml
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/mail/jbpm.mail.templates.cfg.xml
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/type/
jbpm4/trunk/modules/test-pojo/src/test/
Removed:
jbpm4/trunk/modules/test-cactus/src/test/java/org/jbpm/test/
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarcfg/
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarimpl/
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype/
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarcfg/
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarimpl/
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype/
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/CustomMailProducerTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/MailTestSetup.java
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.mail.templates.examples.xml
jbpm4/trunk/modules/test-pojo/src/main/
Modified:
jbpm4/trunk/modules/distro/src/main/files/examples/build.xml
jbpm4/trunk/modules/distro/src/main/files/install/build.xml
jbpm4/trunk/modules/jpdl/src/test/resources/org/jbpm/test/xml/valid.jpdl.xml
jbpm4/trunk/modules/test-base/pom.xml
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/cal/cfg/CustomBusinessCalendarCfgTest.java
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/cal/impl/CustomBusinessCalendar.java
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/cal/impl/CustomBusinessCalendarImplTest.java
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/type/CustomVariableTypeTest.java
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/type/Husky.java
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/type/HuskyMatcher.java
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/type/HuskyVariable.java
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/cal/impl/jbpm.cfg.xml
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/type/husky.hbm.xml
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/type/jbpm.cfg.xml
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/type/jbpm.hibernate.cfg.xml
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/type/jbpm.variable.types.xml
jbpm4/trunk/modules/test-db/pom.xml
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/AttachmentTest.java
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.cfg.xml
jbpm4/trunk/modules/test-pojo/.classpath
jbpm4/trunk/modules/test-pojo/pom.xml
Log:
JBPM-2893: move custom mail producer test from test-db to test-cfg
move test cases in test-pojo from src/main to src/test
Modified: jbpm4/trunk/modules/distro/src/main/files/examples/build.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/examples/build.xml 2010-06-24 19:31:56 UTC (rev 6436)
+++ jbpm4/trunk/modules/distro/src/main/files/examples/build.xml 2010-06-26 01:59:29 UTC (rev 6437)
@@ -1,109 +1,117 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!-- ====================================================================== -->
+<!-- jBPM: Workflow in Java -->
+<!-- -->
+<!-- Distributable under LGPL license. -->
+<!-- See terms of license at http://www.gnu.org. -->
+<!-- ====================================================================== -->
+
+<!-- $Id$ -->
+
<project name="jbpm.examples">
- <!-- DEVELOPER SPECIFIC CONFIGURATIONS -->
- <property file="${user.home}/.jbpm4/build.properties" />
+ <!-- DEVELOPER SPECIFIC CONFIGURATIONS -->
+ <property file="${user.home}/.jbpm4/build.properties" />
- <!-- DEFAULT PROPERTY VALUES -->
- <property name="database" value="hsqldb" />
- <property name="jbpm.parent.dir" value="../.." />
- <property name="jbpm.version" value="4.4-SNAPSHOT" />
- <property name="jboss.version" value="5.0.0.GA" />
- <property name="jbpm.home" value="${jbpm.parent.dir}/jbpm-${jbpm.version}" />
+ <!-- DEFAULT PROPERTY VALUES -->
+ <property name="database" value="hsqldb" />
+ <property name="jbpm.parent.dir" value="../.." />
+ <property name="jbpm.version" value="4.4-SNAPSHOT" />
+ <property name="jboss.version" value="5.0.0.GA" />
+ <property name="jbpm.home" value="${jbpm.parent.dir}/jbpm-${jbpm.version}" />
- <!-- JDBC PROPERTIES -->
- <property file="${user.home}/.jbpm4/jdbc/${database}.properties" />
- <property file="${jbpm.home}/db/jdbc/${database}.properties" />
+ <!-- JDBC PROPERTIES -->
+ <property file="${user.home}/.jbpm4/jdbc/${database}.properties" />
+ <property file="${jbpm.home}/db/jdbc/${database}.properties" />
- <!-- ### LOG PROPERTIES ################################################# -->
- <target name="log.properties">
- <echo message="database: ${database}" />
- <echo message="jdbc.driver........ ${jdbc.driver}" />
- <echo message="jdbc.url........... ${jdbc.url}" />
- <echo message="jdbc.username...... ${jdbc.username}" />
- <echo message="jbpm.version....... ${jbpm.version}" />
- <echo message="jbpm.home.......... ${jbpm.home}" />
- </target>
+ <!-- ### LOG PROPERTIES ################################################# -->
+ <target name="log.properties">
+ <echo message="database: ${database}" />
+ <echo message="jdbc.driver........ ${jdbc.driver}" />
+ <echo message="jdbc.url........... ${jdbc.url}" />
+ <echo message="jdbc.username...... ${jdbc.username}" />
+ <echo message="jbpm.version....... ${jbpm.version}" />
+ <echo message="jbpm.home.......... ${jbpm.home}" />
+ </target>
- <target name="jbpm.libs.path">
- <path id="jbpm.libs.incl.dependencies">
- <pathelement location="${jbpm.home}/examples/target/classes" />
- <fileset dir="${jbpm.home}">
- <include name="jbpm.jar" />
- </fileset>
- <fileset dir="${jbpm.home}/lib" />
- </path>
- </target>
+ <target name="jbpm.libs.path">
+ <path id="jbpm.libs.incl.dependencies">
+ <pathelement location="${jbpm.home}/examples/target/classes" />
+ <pathelement location="${jbpm.home}/jbpm.jar" />
+ <fileset dir="${jbpm.home}/lib" includes="*.jar" />
+ </path>
+ </target>
- <!-- ### DEPLOY EXAMPLE BUSINESS ARCHIVES ############################### -->
- <target name="create.and.deploy.examples"
- depends="jbpm.libs.path, examples.jar">
- <mkdir dir="${jbpm.home}/examples/target" />
- <copy file="${jbpm.home}/install/src/cfg/hibernate/jdbc/${database}.hibernate.cfg.xml"
- tofile="${jbpm.home}/examples/target/classes/jbpm.hibernate.cfg.xml"
- overwrite="true">
- <filterset filtersfile="${jbpm.home}/install/jdbc/${database}.properties" />
- </copy>
- <jar destfile="${jbpm.home}/examples/target/examples.bar">
- <fileset dir="${jbpm.home}/examples/src">
- <exclude name="jbpm.cfg.xml" />
- <exclude name="jbpm.hibernate.cfg.xml" />
- <exclude name="jbpm.mail.properties" />
- <exclude name="jbpm.mail.templates.examples.xml" />
- <exclude name="logging.properties" />
- <exclude name="org/jbpm/examples/task/swimlane/process.jpdl.xml" />
- <exclude name="org/jbpm/examples/task/candidates/process.jpdl.xml" />
- <exclude name="org/jbpm/examples/concurrency/graphbased/process.jpdl.xml" />
- <exclude name="org/jbpm/examples/timer/repeat/process.jpdl.xml" />
- <exclude name="org/jbpm/examples/script/text/process.jpdl.xml" />
- <exclude name="org/jbpm/examples/decision/handler/process.jpdl.xml" />
- <exclude name="org/jbpm/examples/mail/template/process.jpdl.xml" />
- <exclude name="org/jbpm/examples/script/expression/process.jpdl.xml" />
- <exclude name="org/jbpm/examples/task/assignee/process.jpdl.xml" />
- <exclude name="org/jbpm/examples/mail/inline/process.jpdl.xml" />
- <exclude name="org/jbpm/examples/mail/template/process.jpdl.xml" />
- <exclude name="org/jbpm/examples/eventlistener/process.jpdl.xml" />
- <exclude name="org/jbpm/examples/timer/event/process.jpdl.xml" />
- <exclude name="org/jbpm/examples/task/assignmenthandler/process.jpdl.xml" />
- <exclude name="org/jbpm/examples/java/JavaInstantiateTest.java" />
- <exclude name="org/jbpm/examples/decision/conditions/process.jpdl.xml" />
- <exclude name="org/jbpm/examples/decision/expression/process.jpdl.xml" />
- <exclude name="org/jbpm/examples/java/process.jpdl.xml" />
- <exclude name="org/jbpm/examples/task/notification process.jpdl.xml" />
- <exclude name="org/jbpm/examples/task/reminder process.jpdl.xml" />
+ <!-- ### DEPLOY EXAMPLE BUSINESS ARCHIVES ############################### -->
+ <target name="create.and.deploy.examples" depends="jbpm.libs.path, examples.jar">
+ <mkdir dir="${jbpm.home}/examples/target" />
+ <copy file="${jbpm.home}/install/src/cfg/hibernate/jdbc/${database}.hibernate.cfg.xml"
+ tofile="${jbpm.home}/examples/target/classes/jbpm.hibernate.cfg.xml"
+ overwrite="true">
+ <filterset filtersfile="${jbpm.home}/install/jdbc/${database}.properties" />
+ </copy>
+ <jar destfile="${jbpm.home}/examples/target/examples.bar">
+ <fileset dir="${jbpm.home}/examples/src">
+ <exclude name="jbpm.cfg.xml" />
+ <exclude name="jbpm.hibernate.cfg.xml" />
+ <exclude name="jbpm.mail.properties" />
+ <exclude name="jbpm.mail.templates.examples.xml" />
+ <exclude name="logging.properties" />
+ <exclude name="org/jbpm/examples/task/swimlane/process.jpdl.xml" />
+ <exclude name="org/jbpm/examples/task/candidates/process.jpdl.xml" />
+ <exclude name="org/jbpm/examples/concurrency/graphbased/process.jpdl.xml" />
+ <exclude name="org/jbpm/examples/timer/repeat/process.jpdl.xml" />
+ <exclude name="org/jbpm/examples/script/text/process.jpdl.xml" />
+ <exclude name="org/jbpm/examples/decision/handler/process.jpdl.xml" />
+ <exclude name="org/jbpm/examples/mail/template/process.jpdl.xml" />
+ <exclude name="org/jbpm/examples/script/expression/process.jpdl.xml" />
+ <exclude name="org/jbpm/examples/task/assignee/process.jpdl.xml" />
+ <exclude name="org/jbpm/examples/mail/inline/process.jpdl.xml" />
+ <exclude name="org/jbpm/examples/mail/template/process.jpdl.xml" />
+ <exclude name="org/jbpm/examples/eventlistener/process.jpdl.xml" />
+ <exclude name="org/jbpm/examples/timer/event/process.jpdl.xml" />
+ <exclude name="org/jbpm/examples/task/assignmenthandler/process.jpdl.xml" />
+ <exclude name="org/jbpm/examples/java/JavaInstantiateTest.java" />
+ <exclude name="org/jbpm/examples/decision/conditions/process.jpdl.xml" />
+ <exclude name="org/jbpm/examples/decision/expression/process.jpdl.xml" />
+ <exclude name="org/jbpm/examples/java/process.jpdl.xml" />
+ <exclude name="org/jbpm/examples/task/notification process.jpdl.xml" />
+ <exclude name="org/jbpm/examples/task/reminder process.jpdl.xml" />
<exclude name="org/jbpm/examples/rulesdecision/process.jpdl.xml" />
- <exclude name="org/jbpm/examples/task/notification/process.jpdl.xml" />
- <exclude name="org/jbpm/examples/task/reminder/process.jpdl.xml" />
- <exclude name="org/jbpm/examples/bpmn/event/terminateend/terminate_end_event.bpmn.xml" />
- <exclude name="org/jbpm/examples/bpmn/gateway/exclusive/exclusive_gateway.bpmn.xml" />
- <exclude name="org/jbpm/examples/bpmn/gateway/exclusive/exclusive_gateway_default_seq_flow.bpmn.xml" />
- <exclude name="org/jbpm/examples/bpmn/gateway/parallel/parallel_gateway.bpmn.xml" />
- <exclude name="org/jbpm/examples/bpmn/task/service/service_task_java.bpmn.xml" />
- <exclude name="org/jbpm/examples/bpmn/task/usertask/user_task_human_performer_variable.bpmn.xml" />
- <exclude name="org/jbpm/examples/bpmn/task/script/script_task.bpmn.xml" />
- </fileset>
- </jar>
- <taskdef name="jbpm-deploy" classname="org.jbpm.pvm.internal.ant.JbpmDeployTask" classpathref="jbpm.libs.incl.dependencies" />
- <jbpm-deploy file="${jbpm.home}/examples/target/examples.bar" />
- </target>
+ <exclude name="org/jbpm/examples/task/notification/process.jpdl.xml" />
+ <exclude name="org/jbpm/examples/task/reminder/process.jpdl.xml" />
+ <exclude name="org/jbpm/examples/bpmn/event/terminateend/terminate_end_event.bpmn.xml" />
+ <exclude name="org/jbpm/examples/bpmn/gateway/exclusive/exclusive_gateway.bpmn.xml" />
+ <exclude name="org/jbpm/examples/bpmn/gateway/exclusive/exclusive_gateway_default_seq_flow.bpmn.xml" />
+ <exclude name="org/jbpm/examples/bpmn/gateway/parallel/parallel_gateway.bpmn.xml" />
+ <exclude name="org/jbpm/examples/bpmn/task/service/service_task_java.bpmn.xml" />
+ <exclude name="org/jbpm/examples/bpmn/task/usertask/user_task_human_performer_variable.bpmn.xml" />
+ <exclude name="org/jbpm/examples/bpmn/task/script/script_task.bpmn.xml" />
+ </fileset>
+ </jar>
+ <taskdef name="jbpm-deploy"
+ classname="org.jbpm.pvm.internal.ant.JbpmDeployTask"
+ classpathref="jbpm.libs.incl.dependencies" />
+ <jbpm-deploy file="${jbpm.home}/examples/target/examples.bar" />
+ </target>
- <target name="examples.jar" depends="jbpm.libs.path">
- <mkdir dir="${jbpm.home}/examples/target/classes" />
- <javac srcdir="${jbpm.home}/examples/src"
+ <target name="examples.jar" depends="jbpm.libs.path">
+ <mkdir dir="${jbpm.home}/examples/target/classes" />
+ <javac srcdir="${jbpm.home}/examples/src"
destdir="${jbpm.home}/examples/target/classes"
- source="1.5"
+ source="1.5"
classpathref="jbpm.libs.incl.dependencies" />
- <copy todir="${jbpm.home}/examples/target/classes">
- <fileset dir="${jbpm.home}/examples/src">
- <exclude name="**/*.java" />
- </fileset>
- </copy>
- <jar destfile="${jbpm.home}/examples/target/examples.jar" >
- <fileset dir="${jbpm.home}/examples/target/classes">
- <include name="**/*.class" />
- </fileset>
- </jar>
- </target>
+ <copy todir="${jbpm.home}/examples/target/classes">
+ <fileset dir="${jbpm.home}/examples/src">
+ <exclude name="**/*.java" />
+ </fileset>
+ </copy>
+ <jar destfile="${jbpm.home}/examples/target/examples.jar">
+ <fileset dir="${jbpm.home}/examples/target/classes">
+ <include name="**/*.class" />
+ </fileset>
+ </jar>
+ </target>
</project>
Property changes on: jbpm4/trunk/modules/distro/src/main/files/examples/build.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: jbpm4/trunk/modules/distro/src/main/files/install/build.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/install/build.xml 2010-06-24 19:31:56 UTC (rev 6436)
+++ jbpm4/trunk/modules/distro/src/main/files/install/build.xml 2010-06-26 01:59:29 UTC (rev 6437)
@@ -1,4 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ====================================================================== -->
+<!-- jBPM: Workflow in Java -->
+<!-- -->
+<!-- Distributable under LGPL license. -->
+<!-- See terms of license at http://www.gnu.org. -->
+<!-- ====================================================================== -->
+
+<!-- $Id$ -->
+
<project name="jbpm.install">
<!-- DEVELOPER SPECIFIC CONFIGURATIONS -->
Property changes on: jbpm4/trunk/modules/distro/src/main/files/install/build.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: jbpm4/trunk/modules/jpdl/src/test/resources/org/jbpm/test/xml/valid.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/org/jbpm/test/xml/valid.jpdl.xml 2010-06-24 19:31:56 UTC (rev 6436)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/org/jbpm/test/xml/valid.jpdl.xml 2010-06-26 01:59:29 UTC (rev 6437)
@@ -2,21 +2,21 @@
<process name="Purchase order" xmlns="http://jbpm.org/4.3/jpdl">
- <start>
+ <start g="46,33,80,40">
<transition to="a" />
</start>
- <state name="a">
- <transition name="Supplier ok" to="b" />
+ <state name="a" g="169,36,80,40">
+ <transition name="Supplier ok" to="b" g="-85,-23"/>
</state>
- <state name="b">
- <transition name="nok" to="Error" />
- <transition name="ok" to="Completed" />
- </state >
+ <state name="b" g="169,145,80,40">
+ <transition name="nok" to="Error" g="-31,-23"/>
+ <transition name="ok" to="Completed" g="-22,-23"/>
+ </state>
- <end name="Completed" />
+ <end name="Completed" g="350,142,80,40"/>
- <end name="Error" />
+ <end name="Error" g="186,253,80,40"/>
</process>
Modified: jbpm4/trunk/modules/test-base/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-base/pom.xml 2010-06-24 19:31:56 UTC (rev 6436)
+++ jbpm4/trunk/modules/test-base/pom.xml 2010-06-26 01:59:29 UTC (rev 6437)
@@ -56,6 +56,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
@@ -93,5 +94,9 @@
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.subethamail</groupId>
+ <artifactId>subethasmtp-wiser</artifactId>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
Copied: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/mail/MailTestSetup.java (from rev 6436, jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/MailTestSetup.java)
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/mail/MailTestSetup.java (rev 0)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/mail/MailTestSetup.java 2010-06-26 01:59:29 UTC (rev 6437)
@@ -0,0 +1,56 @@
+/*
+ * 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.test.mail;
+
+import org.subethamail.wiser.Wiser;
+
+import junit.extensions.TestSetup;
+import junit.framework.TestSuite;
+
+/**
+ * @author Alejandro Guizar
+ */
+public class MailTestSetup extends TestSetup {
+
+ private final Wiser wiser;
+
+ public MailTestSetup(Class<?> testClass, Wiser wiser) {
+ super(new TestSuite(testClass));
+ this.wiser = wiser;
+ }
+
+ public Wiser getWiser() {
+ return wiser;
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ wiser.setPort(2525);
+ wiser.start();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ wiser.stop();
+ }
+
+}
Copied: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/cal/cfg (from rev 6436, jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarcfg)
Modified: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/cal/cfg/CustomBusinessCalendarCfgTest.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarcfg/CustomBusinessCalendarCfgTest.java 2010-06-24 19:31:56 UTC (rev 6436)
+++ jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/cal/cfg/CustomBusinessCalendarCfgTest.java 2010-06-26 01:59:29 UTC (rev 6437)
@@ -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.test.custombusinesscalendarcfg;
+package org.jbpm.test.custom.cal.cfg;
import java.util.Calendar;
import java.util.Date;
Copied: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/cal/impl (from rev 6436, jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarimpl)
Modified: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/cal/impl/CustomBusinessCalendar.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarimpl/CustomBusinessCalendar.java 2010-06-24 19:31:56 UTC (rev 6436)
+++ jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/cal/impl/CustomBusinessCalendar.java 2010-06-26 01:59:29 UTC (rev 6437)
@@ -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.test.custombusinesscalendarimpl;
+package org.jbpm.test.custom.cal.impl;
import java.util.Calendar;
import java.util.Date;
Modified: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/cal/impl/CustomBusinessCalendarImplTest.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarimpl/CustomBusinessCalendarImplTest.java 2010-06-24 19:31:56 UTC (rev 6436)
+++ jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/cal/impl/CustomBusinessCalendarImplTest.java 2010-06-26 01:59:29 UTC (rev 6437)
@@ -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.test.custombusinesscalendarimpl;
+package org.jbpm.test.custom.cal.impl;
import java.util.Calendar;
import java.util.Date;
Copied: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/mail/CustomMailProducerTest.java (from rev 6436, jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/CustomMailProducerTest.java)
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/mail/CustomMailProducerTest.java (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/mail/CustomMailProducerTest.java 2010-06-26 01:59:29 UTC (rev 6437)
@@ -0,0 +1,158 @@
+/*
+ * 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.test.custom.mail;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.mail.Message;
+import javax.mail.MessagingException;
+import javax.mail.Message.RecipientType;
+
+import org.subethamail.wiser.Wiser;
+import org.subethamail.wiser.WiserMessage;
+
+import org.jbpm.api.Execution;
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.identity.Group;
+import org.jbpm.pvm.internal.email.impl.MailProducerImpl;
+import org.jbpm.pvm.internal.email.impl.MailTemplateRegistry;
+import org.jbpm.pvm.internal.email.spi.AddressResolver;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
+import org.jbpm.pvm.internal.identity.spi.IdentitySession;
+import org.jbpm.test.JbpmCustomCfgTestCase;
+
+/**
+ * @author Alejandro Guizar
+ */
+public class CustomMailProducerTest extends JbpmCustomCfgTestCase {
+
+ private Wiser wiser = new Wiser();
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ // create actors
+ identityService.createUser("bb", "Big Brother", null, "bb@oceania");
+ identityService.createUser("obrien", null, "O'Brien", "obrien@miniluv");
+ identityService.createUser("charr", null, "Charrington", "charr@miniluv");
+ identityService.createGroup("thinkpol");
+ identityService.createGroup("innerparty");
+ identityService.createMembership("obrien", "innerparty");
+ identityService.createMembership("charr", "thinkpol");
+ identityService.createMembership("obrien", "thinkpol");
+ // start mail server
+ wiser.setPort(2525);
+ wiser.start();
+ }
+
+ protected void tearDown() throws Exception {
+ // stop mail server
+ wiser.stop();
+ // delete actors
+ identityService.deleteGroup("thinkpol");
+ identityService.deleteGroup("innerparty");
+ identityService.deleteUser("bb");
+ identityService.deleteUser("obrien");
+ identityService.deleteUser("charr");
+ super.tearDown();
+ }
+
+ public void testCustomMailProducer() {
+ // deploy process
+ deployJpdlXmlString("<process name='custommail' xmlns='http://jbpm.org/jpdl/4.4'>"
+ + " <start>"
+ + " <transition to='send mail' />"
+ + " </start>"
+ + " <mail name='send mail' class='"
+ + AuditMailProducer.class.getName()
+ + "'>"
+ + " <property name='template'>"
+ + " <object method='getTemplate'>"
+ + " <factory><ref type='"
+ + MailTemplateRegistry.class.getName()
+ + "'/></factory>"
+ + " <arg><string value='rectify-template'/></arg>"
+ + " </object>"
+ + " </property>"
+ + " <property name='auditGroup'><string value='thinkpol'/></property>"
+ + " <transition to='end' />"
+ + " </mail>"
+ + " <end name='end'/>"
+ + "</process>");
+
+ // prepare dynamic values
+ String addressee = "winston@minitrue";
+ String newspaper = "times";
+ Calendar calendar = Calendar.getInstance();
+ calendar.clear();
+ calendar.set(1983, Calendar.DECEMBER, 3);
+ Date date = calendar.getTime();
+ String details = "reporting bb dayorder doubleplusungood refs unpersons rewrite "
+ + "fullwise upsub antefiling";
+ // assemble variables
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("addressee", addressee);
+ variables.put("newspaper", newspaper);
+ variables.put("date", date);
+ variables.put("details", details);
+ // start process instance
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("custommail", variables);
+ assertProcessInstanceEnded(processInstance);
+
+ // examine produced messages
+ List<WiserMessage> messages = wiser.getMessages();
+ // winston, bb, innerparty(obrien), thinkpol(charr, obrien)
+ assertEquals(5, messages.size());
+ }
+
+ public static class AuditMailProducer extends MailProducerImpl {
+
+ private String auditGroup;
+ private static final long serialVersionUID = 1L;
+
+ public String getAuditGroup() {
+ return auditGroup;
+ }
+
+ public void setAuditGroup(String auditGroup) {
+ this.auditGroup = auditGroup;
+ }
+
+ @Override
+ protected void fillRecipients(Execution execution, Message email) throws MessagingException {
+ // add recipients from template
+ super.fillRecipients(execution, email);
+
+ // load audit group from database
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
+ IdentitySession identitySession = environment.get(IdentitySession.class);
+ Group group = identitySession.findGroupById(auditGroup);
+
+ // send a blind carbon copy of every message to the audit group
+ AddressResolver addressResolver = environment.get(AddressResolver.class);
+ email.addRecipients(RecipientType.BCC, addressResolver.resolveAddresses(group));
+ }
+ }
+}
Copied: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/type (from rev 6436, jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype)
Modified: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/type/CustomVariableTypeTest.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype/CustomVariableTypeTest.java 2010-06-24 19:31:56 UTC (rev 6436)
+++ jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/type/CustomVariableTypeTest.java 2010-06-26 01:59:29 UTC (rev 6437)
@@ -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.test.customtype;
+package org.jbpm.test.custom.type;
import java.util.HashMap;
import java.util.Map;
Modified: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/type/Husky.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype/Husky.java 2010-06-24 19:31:56 UTC (rev 6436)
+++ jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/type/Husky.java 2010-06-26 01:59:29 UTC (rev 6437)
@@ -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.test.customtype;
+package org.jbpm.test.custom.type;
/**
Modified: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/type/HuskyMatcher.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype/HuskyMatcher.java 2010-06-24 19:31:56 UTC (rev 6436)
+++ jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/type/HuskyMatcher.java 2010-06-26 01:59:29 UTC (rev 6437)
@@ -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.test.customtype;
+package org.jbpm.test.custom.type;
import org.jbpm.pvm.internal.type.Matcher;
Modified: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/type/HuskyVariable.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype/HuskyVariable.java 2010-06-24 19:31:56 UTC (rev 6436)
+++ jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/type/HuskyVariable.java 2010-06-26 01:59:29 UTC (rev 6437)
@@ -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.test.customtype;
+package org.jbpm.test.custom.type;
import org.jbpm.pvm.internal.type.Variable;
Copied: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/cal/cfg (from rev 6436, jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarcfg)
Copied: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/cal/impl (from rev 6436, jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarimpl)
Modified: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/cal/impl/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarimpl/jbpm.cfg.xml 2010-06-24 19:31:56 UTC (rev 6436)
+++ jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/cal/impl/jbpm.cfg.xml 2010-06-26 01:59:29 UTC (rev 6437)
@@ -8,7 +8,7 @@
<import resource="jbpm.identity.cfg.xml" />
<process-engine-context>
- <object class="org.jbpm.test.custombusinesscalendarimpl.CustomBusinessCalendar" />
+ <object class="org.jbpm.test.custom.cal.impl.CustomBusinessCalendar" />
</process-engine-context>
</jbpm-configuration>
Added: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/mail/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/mail/jbpm.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/mail/jbpm.cfg.xml 2010-06-26 01:59:29 UTC (rev 6437)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <import resource="jbpm.default.cfg.xml" />
+ <import resource="jbpm.businesscalendar.cfg.xml" />
+ <import resource="jbpm.tx.hibernate.cfg.xml" />
+ <import resource="jbpm.jpdl.cfg.xml" />
+ <import resource="jbpm.bpmn.cfg.xml" />
+ <import resource="jbpm.identity.cfg.xml" />
+ <import resource="org/jbpm/test/custom/mail/jbpm.mail.templates.cfg.xml" />
+
+</jbpm-configuration>
Property changes on: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/mail/jbpm.cfg.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Copied: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/mail/jbpm.mail.templates.cfg.xml (from rev 6436, jbpm4/trunk/modules/test-db/src/test/resources/jbpm.mail.templates.examples.xml)
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/mail/jbpm.mail.templates.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/mail/jbpm.mail.templates.cfg.xml 2010-06-26 01:59:29 UTC (rev 6437)
@@ -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>
Copied: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/type (from rev 6436, jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype)
Modified: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/type/husky.hbm.xml
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype/husky.hbm.xml 2010-06-24 19:31:56 UTC (rev 6436)
+++ jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/type/husky.hbm.xml 2010-06-26 01:59:29 UTC (rev 6437)
@@ -3,7 +3,7 @@
<hibernate-mapping default-access="field">
- <subclass name="org.jbpm.test.customtype.HuskyVariable" extends="org.jbpm.pvm.internal.type.Variable" discriminator-value="husky">
+ <subclass name="org.jbpm.test.custom.type.HuskyVariable" extends="org.jbpm.pvm.internal.type.Variable" discriminator-value="husky">
<property name="name" column="STRING_VALUE_" type="string"/>
</subclass>
Modified: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/type/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype/jbpm.cfg.xml 2010-06-24 19:31:56 UTC (rev 6436)
+++ jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/type/jbpm.cfg.xml 2010-06-26 01:59:29 UTC (rev 6437)
@@ -9,10 +9,10 @@
<process-engine-context>
- <types resource="org/jbpm/test/customtype/jbpm.variable.types.xml" />
+ <types resource="org/jbpm/test/custom/type/jbpm.variable.types.xml" />
<hibernate-configuration>
- <cfg resource="org/jbpm/test/customtype/jbpm.hibernate.cfg.xml" />
+ <cfg resource="org/jbpm/test/custom/type/jbpm.hibernate.cfg.xml" />
</hibernate-configuration>
Modified: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/type/jbpm.hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype/jbpm.hibernate.cfg.xml 2010-06-24 19:31:56 UTC (rev 6436)
+++ jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/type/jbpm.hibernate.cfg.xml 2010-06-26 01:59:29 UTC (rev 6437)
@@ -15,7 +15,7 @@
<property name="hibernate.hbm2ddl.auto">create-drop</property>
<property name="hibernate.format_sql">true</property>
- <mapping resource="org/jbpm/test/customtype/husky.hbm.xml" />
+ <mapping resource="org/jbpm/test/custom/type/husky.hbm.xml" />
<mapping resource="jbpm.repository.hbm.xml" />
<mapping resource="jbpm.execution.hbm.xml" />
Modified: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/type/jbpm.variable.types.xml
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype/jbpm.variable.types.xml 2010-06-24 19:31:56 UTC (rev 6436)
+++ jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custom/type/jbpm.variable.types.xml 2010-06-26 01:59:29 UTC (rev 6437)
@@ -1,7 +1,7 @@
<types>
- <type name="husky" variable-class="org.jbpm.test.customtype.HuskyVariable">
- <matcher><object class="org.jbpm.test.customtype.HuskyMatcher" /></matcher>
+ <type name="husky" variable-class="org.jbpm.test.custom.type.HuskyVariable">
+ <matcher><object class="org.jbpm.test.custom.type.HuskyMatcher" /></matcher>
</type>
<!-- types stored in a native column -->
Modified: jbpm4/trunk/modules/test-db/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-db/pom.xml 2010-06-24 19:31:56 UTC (rev 6436)
+++ jbpm4/trunk/modules/test-db/pom.xml 2010-06-26 01:59:29 UTC (rev 6437)
@@ -62,10 +62,6 @@
<scope>runtime</scope>
</dependency>
<dependency>
- <groupId>org.subethamail</groupId>
- <artifactId>subethasmtp-wiser</artifactId>
- </dependency>
- <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<scope>test</scope>
@@ -141,7 +137,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.examples" />
+ <property name="tx" value="standalone.testsuite" />
<property name="mail.cfg" value="testsuite" />
<property name="database" value="${database}" />
<property name="cfg.dest.dir" value="target/test-classes" />
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/AttachmentTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/AttachmentTest.java 2010-06-24 19:31:56 UTC (rev 6436)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/AttachmentTest.java 2010-06-26 01:59:29 UTC (rev 6437)
@@ -39,6 +39,8 @@
import org.jbpm.api.ProcessInstance;
import org.jbpm.pvm.internal.util.IoUtil;
import org.jbpm.test.JbpmTestCase;
+import org.jbpm.test.mail.MailTestSetup;
+
import org.subethamail.wiser.Wiser;
import org.subethamail.wiser.WiserMessage;
Deleted: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/CustomMailProducerTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/CustomMailProducerTest.java 2010-06-24 19:31:56 UTC (rev 6436)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/CustomMailProducerTest.java 2010-06-26 01:59:29 UTC (rev 6437)
@@ -1,157 +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.test.activity.mail;
-
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.mail.Message;
-import javax.mail.MessagingException;
-import javax.mail.Message.RecipientType;
-
-import org.jbpm.api.Execution;
-import org.jbpm.api.ProcessInstance;
-import org.jbpm.api.identity.Group;
-import org.jbpm.pvm.internal.email.impl.MailProducerImpl;
-import org.jbpm.pvm.internal.email.impl.MailTemplateRegistry;
-import org.jbpm.pvm.internal.email.spi.AddressResolver;
-import org.jbpm.pvm.internal.env.EnvironmentImpl;
-import org.jbpm.pvm.internal.identity.spi.IdentitySession;
-import org.jbpm.test.JbpmTestCase;
-import org.subethamail.wiser.Wiser;
-import org.subethamail.wiser.WiserMessage;
-
-/**
- * @author Alejandro Guizar
- */
-public class CustomMailProducerTest extends JbpmTestCase {
-
- private Wiser wiser = new Wiser();
-
- protected void setUp() throws Exception {
- super.setUp();
- // create actors
- identityService.createUser("bb", "Big Brother", null, "bb@oceania");
- identityService.createUser("obrien", null, "O'Brien", "obrien@miniluv");
- identityService.createUser("charr", null, "Charrington", "charr@miniluv");
- identityService.createGroup("thinkpol");
- identityService.createGroup("innerparty");
- identityService.createMembership("obrien", "innerparty");
- identityService.createMembership("charr", "thinkpol");
- identityService.createMembership("obrien", "thinkpol");
- // start mail server
- wiser.setPort(2525);
- wiser.start();
- }
-
- protected void tearDown() throws Exception {
- // stop mail server
- wiser.stop();
- // delete actors
- identityService.deleteGroup("thinkpol");
- identityService.deleteGroup("innerparty");
- identityService.deleteUser("bb");
- identityService.deleteUser("obrien");
- identityService.deleteUser("charr");
- super.tearDown();
- }
-
- public void testCustomMailProducer() {
- // deploy process
- deployJpdlXmlString("<process name='custommail' xmlns='http://jbpm.org/jpdl/4.4'>"
- + " <start>"
- + " <transition to='send mail' />"
- + " </start>"
- + " <mail name='send mail' class='"
- + AuditMailProducer.class.getName()
- + "'>"
- + " <property name='template'>"
- + " <object method='getTemplate'>"
- + " <factory><ref type='"
- + MailTemplateRegistry.class.getName()
- + "'/></factory>"
- + " <arg><string value='rectify-template'/></arg>"
- + " </object>"
- + " </property>"
- + " <property name='auditGroup'><string value='thinkpol'/></property>"
- + " <transition to='end' />"
- + " </mail>"
- + " <end name='end'/>"
- + "</process>");
-
- // prepare dynamic values
- String addressee = "winston@minitrue";
- String newspaper = "times";
- Calendar calendar = Calendar.getInstance();
- calendar.clear();
- calendar.set(1983, Calendar.DECEMBER, 3);
- Date date = calendar.getTime();
- String details = "reporting bb dayorder doubleplusungood refs unpersons rewrite "
- + "fullwise upsub antefiling";
- // assemble variables
- Map<String, Object> variables = new HashMap<String, Object>();
- variables.put("addressee", addressee);
- variables.put("newspaper", newspaper);
- variables.put("date", date);
- variables.put("details", details);
- // start process instance
- ProcessInstance processInstance = executionService.startProcessInstanceByKey("custommail", variables);
- assertProcessInstanceEnded(processInstance);
-
- // examine produced messages
- List<WiserMessage> messages = wiser.getMessages();
- // winston, bb, innerparty(obrien), thinkpol(charr, obrien)
- assertEquals(5, messages.size());
- }
-
- public static class AuditMailProducer extends MailProducerImpl {
-
- private String auditGroup;
- private static final long serialVersionUID = 1L;
-
- public String getAuditGroup() {
- return auditGroup;
- }
-
- public void setAuditGroup(String auditGroup) {
- this.auditGroup = auditGroup;
- }
-
- @Override
- protected void fillRecipients(Execution execution, Message email) throws MessagingException {
- // add recipients from template
- super.fillRecipients(execution, email);
-
- // load audit group from database
- EnvironmentImpl environment = EnvironmentImpl.getCurrent();
- IdentitySession identitySession = environment.get(IdentitySession.class);
- Group group = identitySession.findGroupById(auditGroup);
-
- // send a blind carbon copy of every message to the audit group
- AddressResolver addressResolver = environment.get(AddressResolver.class);
- email.addRecipients(RecipientType.BCC, addressResolver.resolveAddresses(group));
- }
- }
-}
Deleted: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/MailTestSetup.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/MailTestSetup.java 2010-06-24 19:31:56 UTC (rev 6436)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/MailTestSetup.java 2010-06-26 01:59:29 UTC (rev 6437)
@@ -1,56 +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.test.activity.mail;
-
-import org.subethamail.wiser.Wiser;
-
-import junit.extensions.TestSetup;
-import junit.framework.TestSuite;
-
-/**
- * @author Alejandro Guizar
- */
-public class MailTestSetup extends TestSetup {
-
- private final Wiser wiser;
-
- public MailTestSetup(Class<?> testClass, Wiser wiser) {
- super(new TestSuite(testClass));
- this.wiser = wiser;
- }
-
- public Wiser getWiser() {
- return wiser;
- }
-
- @Override
- protected void setUp() throws Exception {
- wiser.setPort(2525);
- wiser.start();
- }
-
- @Override
- protected void tearDown() throws Exception {
- wiser.stop();
- }
-
-}
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-24 19:31:56 UTC (rev 6436)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.cfg.xml 2010-06-26 01:59:29 UTC (rev 6437)
@@ -8,6 +8,5 @@
<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" />
</jbpm-configuration>
Deleted: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.mail.templates.examples.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/jbpm.mail.templates.examples.xml 2010-06-24 19:31:56 UTC (rev 6436)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.mail.templates.examples.xml 2010-06-26 01:59:29 UTC (rev 6437)
@@ -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>
Modified: jbpm4/trunk/modules/test-pojo/.classpath
===================================================================
--- jbpm4/trunk/modules/test-pojo/.classpath 2010-06-24 19:31:56 UTC (rev 6436)
+++ jbpm4/trunk/modules/test-pojo/.classpath 2010-06-26 01:59:29 UTC (rev 6437)
@@ -2,6 +2,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"/>
Modified: jbpm4/trunk/modules/test-pojo/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-pojo/pom.xml 2010-06-24 19:31:56 UTC (rev 6436)
+++ jbpm4/trunk/modules/test-pojo/pom.xml 2010-06-26 01:59:29 UTC (rev 6437)
@@ -54,20 +54,6 @@
</dependency>
</dependencies>
- <!-- Plugins -->
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <testSourceDirectory>src/main/java</testSourceDirectory>
- <classesDirectory>target/classes</classesDirectory>
- <testClassesDirectory>target/classes</testClassesDirectory>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
<profiles>
<!-- skip tests if this is an integration test run
(only examples and test-db are part of the integration test runs) -->
Copied: jbpm4/trunk/modules/test-pojo/src/test (from rev 6436, jbpm4/trunk/modules/test-pojo/src/main)
13 years, 10 months