JBoss JBPM SVN: r5663 - jbpm4/trunk/qa/jdbc.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-09-21 03:32:02 -0400 (Mon, 21 Sep 2009)
New Revision: 5663
Modified:
jbpm4/trunk/qa/jdbc/postgresql.properties
Log:
switching postgresql to user pvm1
Modified: jbpm4/trunk/qa/jdbc/postgresql.properties
===================================================================
--- jbpm4/trunk/qa/jdbc/postgresql.properties 2009-09-21 03:07:50 UTC (rev 5662)
+++ jbpm4/trunk/qa/jdbc/postgresql.properties 2009-09-21 07:32:02 UTC (rev 5663)
@@ -1,7 +1,7 @@
jdbc.driver=org.postgresql.Driver
jdbc.port=5432
jdbc.server=dev01.qa.atl.jboss.com
-jdbc.databasename=pvm4
-jdbc.url=jdbc:postgresql://vmg01.mw.lab.eng.bos.redhat.com:5432/pvm4
-jdbc.username=pvm4
-jdbc.password=pvm4
+jdbc.databasename=pvm1
+jdbc.url=jdbc:postgresql://vmg01.mw.lab.eng.bos.redhat.com:5432/pvm1
+jdbc.username=pvm1
+jdbc.password=pvm1
14 years, 7 months
JBoss JBPM SVN: r5662 - in projects/jopr-integration/trunk/src/main: java/org/rhq/plugins/jbpm4/connector and 1 other directories.
by do-not-reply@jboss.org
Author: jim.ma
Date: 2009-09-20 23:07:50 -0400 (Sun, 20 Sep 2009)
New Revision: 5662
Modified:
projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ProcessEngineDiscoveryComponent.java
projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/connector/LocalJBPMEngineConnector.java
projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/connector/RemoteJBPMEngineConnector.java
projects/jopr-integration/trunk/src/main/resources/META-INF/rhq-plugin.xml
Log:
Added startProcessInstance operation and refactored the RemoteJBPMEngineConnector
Modified: projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ProcessEngineDiscoveryComponent.java
===================================================================
--- projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ProcessEngineDiscoveryComponent.java 2009-09-18 15:39:33 UTC (rev 5661)
+++ projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ProcessEngineDiscoveryComponent.java 2009-09-21 03:07:50 UTC (rev 5662)
@@ -66,6 +66,7 @@
List<URL> clientJars = new ArrayList<URL>();
//TODO:Review it and removed the jars not needed
String[] jarFileNames = { "lib/jbpm.jar",
+ "./../../common/lib/hibernate-core.jar",
"deploy/jbpm/jbpm-service.sar/freemarker.jar",
"deploy/jbpm/jbpm-service.sar/juel.jar",
"deploy/jbpm/jbpm-service.sar/juel-engine.jar",
Modified: projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/connector/LocalJBPMEngineConnector.java
===================================================================
--- projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/connector/LocalJBPMEngineConnector.java 2009-09-18 15:39:33 UTC (rev 5661)
+++ projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/connector/LocalJBPMEngineConnector.java 2009-09-21 03:07:50 UTC (rev 5662)
@@ -214,9 +214,8 @@
public Job executeJob(String jobDbid) {
//These will cause jbpm4.1 class not fund org.jbpm.pvm.internal.cmd.Command execption
- /*CommandService commandService = processEngine.get(CommandService.class);
- return commandService.execute(new ExecuteJobCmd(jobDbid));*/
- return null;
+ CommandService commandService = processEngine.get(CommandService.class);
+ return commandService.execute(new ExecuteJobCmd(jobDbid));
}
public List<HistoryProcessInstance> getHistoryProcessInstances(String definitionId, String processInstanceId, String state, Page page) {
Modified: projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/connector/RemoteJBPMEngineConnector.java
===================================================================
--- projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/connector/RemoteJBPMEngineConnector.java 2009-09-18 15:39:33 UTC (rev 5661)
+++ projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/connector/RemoteJBPMEngineConnector.java 2009-09-21 03:07:50 UTC (rev 5662)
@@ -61,6 +61,7 @@
import org.jbpm.pvm.internal.cmd.StartProcessInstanceCmd;
import org.jbpm.pvm.internal.cmd.SuspendDeploymentCmd;
import org.jbpm.pvm.internal.query.AvgDurationPerActivityQueryCmd;
+import org.jbpm.pvm.internal.query.DeploymentQueryImpl;
import org.jbpm.pvm.internal.query.HistoryProcessInstanceQueryImpl;
import org.jbpm.pvm.internal.query.HistoryTaskQueryImpl;
import org.jbpm.pvm.internal.query.JobQueryImpl;
@@ -91,7 +92,7 @@
private String providerURL;
private String principal;
private String credentials;
- private RemoteCommandExecutor remoteCommandExecutor = null;
+ private static RemoteCommandExecutor remoteCommandExecutor = null;
public RemoteJBPMEngineConnector(String providerURL, String principal, String credentials) {
this.providerURL = providerURL;
@@ -99,14 +100,15 @@
this.credentials = credentials;
}
- public JBPMEngineConnection connect() {
- try {
- remoteCommandExecutor = this.retrieveCommandExecutor();
- return this;
- } catch (Exception e) {
- log.error("Failed to retrieve CommandExecutor");
- }
- return null;
+ public synchronized JBPMEngineConnection connect() {
+ if (remoteCommandExecutor == null) {
+ try {
+ remoteCommandExecutor = this.retrieveCommandExecutor();
+ } catch (Exception e) {
+ log.error("Failed to retrieve CommandExecutor");
+ }
+ }
+ return this;
}
public void disconnect() {
@@ -143,16 +145,20 @@
}
public List<Deployment> getDeployments() {
- CreateDeploymentQueryCmd queryCmd = new CreateDeploymentQueryCmd();
- DeploymentQuery deploymentQuery = execute(queryCmd);
- return deploymentQuery.list();
+ DeploymentQueryImpl queryImpl = new DeploymentQueryImpl();
+ List<Deployment> deployments = (List<Deployment>)execute(queryImpl);
+ return deployments;
}
public Deployment getDeployment(String deploymentId) {
- CreateDeploymentQueryCmd queryCmd = new CreateDeploymentQueryCmd();
- DeploymentQuery deploymentQuery = execute(queryCmd);
- return (Deployment) deploymentQuery.deploymentDbid(Long.valueOf(deploymentId)).uniqueResult();
+ DeploymentQueryImpl queryImpl = new DeploymentQueryImpl();
+ queryImpl.deploymentDbid(Long.valueOf(deploymentId));
+ List<Deployment> deployments = (List<Deployment>)execute(queryImpl);
+ if (deployments.size() > 0) {
+ return deployments.get(0);
+ }
+ return null;
}
@@ -179,27 +185,26 @@
// definition api
public List<ProcessDefinition> getProcessDefs() {
- CreateProcessDefinitionQueryCmd queryCmd = new CreateProcessDefinitionQueryCmd();
+ ProcessDefinitionQueryImpl queryImpl = new ProcessDefinitionQueryImpl();
+ List<ProcessDefinition> definitions = (List<ProcessDefinition>)execute(queryImpl);
+ return definitions;
- ProcessDefinitionQueryImpl queryIml = (ProcessDefinitionQueryImpl) execute(queryCmd);
- return queryIml.list();
-
}
public ProcessDefinition getProcessDefById(String id) {
- CreateProcessDefinitionQueryCmd queryCmd = new CreateProcessDefinitionQueryCmd();
+ ProcessDefinitionQueryImpl queryImpl = new ProcessDefinitionQueryImpl();
+ queryImpl.processDefinitionId(id);
+ List<ProcessDefinition> definitions = (List<ProcessDefinition>)execute(queryImpl);
+ if (definitions.size() > 0) {
+ return definitions.get(0);
+ }
+ return null;
- ProcessDefinitionQueryImpl queryIpml = (ProcessDefinitionQueryImpl) execute(queryCmd);
- queryIpml.processDefinitionId(id);
- return queryIpml.uniqueResult();
-
}
// process instance api
public List<ProcessInstance> getProcessInstances(String defId, String processInstanceId, String state, Page page) {
- CreateProcessInstanceQueryCmd queryCmd = new CreateProcessInstanceQueryCmd();
-
- ProcessInstanceQueryImpl query = (ProcessInstanceQueryImpl) execute(queryCmd);
+ ProcessInstanceQueryImpl query = new ProcessInstanceQueryImpl();
if (defId != null) {
query.processDefinitionId(defId);
}
@@ -217,9 +222,9 @@
if (page != null) {
query.page(page.firstResult, page.maxResults);
}
+ List<ProcessInstance> definitions = (List<ProcessInstance>)execute(query);
+ return definitions;
- return query.list();
-
}
public void deleteProcessInstance(String instanceId) {
@@ -232,15 +237,13 @@
public ProcessInstance startProcessInstance(String defId) {
StartProcessInstanceCmd startCmd = new StartProcessInstanceCmd(defId, null, null);
- return (ProcessInstance)execute(startCmd);
+ return (ProcessInstance) execute(startCmd);
}
// Job api
public List<Job> queryJob(boolean timerOnly, boolean messageOnly, boolean exception, String processInstanceId) {
- CreateJobQueryCmd queryCmd = new CreateJobQueryCmd();
-
- JobQuery jobQuery = (JobQuery) execute(queryCmd);
+ JobQueryImpl jobQuery = new JobQueryImpl();
if (processInstanceId != null) {
jobQuery.processInstanceId(processInstanceId);
}
@@ -250,21 +253,18 @@
}
if (timerOnly) {
- jobQuery = jobQuery.timers();
+ jobQuery.timers();
} else if (messageOnly) {
- jobQuery = jobQuery.messages();
+ jobQuery.messages();
}
- return jobQuery.list();
+ List<Job> jobs = (List<Job>)execute(jobQuery);
+ return jobs;
}
public Job getJob(String jobId) {
- CreateJobQueryCmd queryCmd = new CreateJobQueryCmd();
-
- JobQuery jobQuery = (JobQuery) execute(queryCmd);
-
- List<Job> jobs = jobQuery.list();
-
+ JobQueryImpl jobQuery = new JobQueryImpl();
+ List<Job> jobs = (List<Job>)execute(jobQuery);
for (Job job : jobs) {
if (job.getId().equals(jobId)) {
return job;
@@ -284,7 +284,6 @@
// Activity api
public Map<String, Long> avgDurationPerActivity(String processDefinitionId) {
AvgDurationPerActivityQueryCmd command = new AvgDurationPerActivityQueryCmd(processDefinitionId);
-
return (Map<String, Long>) execute(command);
}
@@ -292,9 +291,8 @@
// History process instance api
public List<HistoryProcessInstance> getHistoryProcessInstances(String definitionId, String processInstanceId,
String state, Page page) {
- CreateHistoryProcessInstanceQueryCmd command = new CreateHistoryProcessInstanceQueryCmd();
- HistoryProcessInstanceQueryImpl historyQuery = (HistoryProcessInstanceQueryImpl) execute(command);
+ HistoryProcessInstanceQueryImpl historyQuery = new HistoryProcessInstanceQueryImpl();
if (definitionId != null) {
historyQuery.processDefinitionId(definitionId);
}
@@ -309,15 +307,14 @@
if (page != null) {
historyQuery.page(page.firstResult, page.maxResults);
}
- return historyQuery.list();
+ List<HistoryProcessInstance> instances = (List<HistoryProcessInstance>)execute(historyQuery);
+ return instances;
}
// Task api
public List<Task> getTasks(String definitionId, String processInstanceId) {
- CreateTaskQueryCmd command = new CreateTaskQueryCmd();
-
- TaskQueryImpl taskQuery = (TaskQueryImpl) execute(command);
+ TaskQueryImpl taskQuery = new TaskQueryImpl();
if (definitionId != null) {
taskQuery.processDefinitionId(definitionId);
}
@@ -325,15 +322,14 @@
if (processInstanceId != null) {
taskQuery.processInstanceId(processInstanceId);
}
+ List<Task> tasks = (List<Task>)execute(taskQuery);
+ return tasks;
- return taskQuery.list();
-
}
public List<Task> getTasks(TaskQueryCondition condition) {
- CreateTaskQueryCmd command = new CreateTaskQueryCmd();
-
- TaskQueryImpl taskQuery = (TaskQueryImpl) execute(command);
+
+ TaskQueryImpl taskQuery = new TaskQueryImpl();
if (condition.getActivityName() != null) {
taskQuery.activityName(condition.getActivityName());
}
@@ -363,16 +359,14 @@
if (condition.getPage() != null) {
taskQuery.page(condition.getPage().firstResult, condition.getPage().maxResults);
}
+ List<Task> tasks = (List<Task>)execute(taskQuery);
+ return tasks;
- return taskQuery.list();
-
}
// History task api
public List<HistoryTask> getHIstoryTasks(TaskHistoryQueryCondition condition) {
- CreateHistoryTaskQueryCmd command = new CreateHistoryTaskQueryCmd();
-
- HistoryTaskQueryImpl historyTaskQuery = (HistoryTaskQueryImpl) execute(command);
+ HistoryTaskQueryImpl historyTaskQuery = new HistoryTaskQueryImpl();
if (condition.getTaskId() != null) {
historyTaskQuery.taskId(condition.getTaskId());
}
@@ -405,7 +399,7 @@
historyTaskQuery.tookLongerThen(condition.getTookLongerThen());
}
- List<HistoryTask> historyTasks = historyTaskQuery.list();
+ List<HistoryTask> historyTasks = (List<HistoryTask>)execute(historyTaskQuery);
// TODO: ask jbpm team to add select historyTasks by process
// instance id
if (condition.getDefinitionId() != null) {
Modified: projects/jopr-integration/trunk/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- projects/jopr-integration/trunk/src/main/resources/META-INF/rhq-plugin.xml 2009-09-18 15:39:33 UTC (rev 5661)
+++ projects/jopr-integration/trunk/src/main/resources/META-INF/rhq-plugin.xml 2009-09-21 03:07:50 UTC (rev 5662)
@@ -146,6 +146,16 @@
</c:list-property>
</results>
</operation>
+
+ <operation name="createProcessInstance" displayName="startProcessInstance"
+ description="start a new process instance">
+ <results>
+ <c:simple-property name="operationResult" readOnly="true" description="Start process instance result"/>
+ </results>
+ </operation>
+
+
+
<operation name="processInstanceSelector" displayName="processInstanceSelector"
description="Lists the process instance for the given condition">
<parameters>
14 years, 7 months
JBoss JBPM SVN: r5661 - in jbpm4/trunk/modules: distro/src/main/files/install and 3 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-09-18 11:39:33 -0400 (Fri, 18 Sep 2009)
New Revision: 5661
Added:
jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/logging/none/
Removed:
jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/logging/provided/
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/DeploymentQuery.java
jbpm4/trunk/modules/distro/src/main/files/install/build.xml
jbpm4/trunk/modules/test-db/pom.xml
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/query/DeploymentQueryTest.java
Log:
JBPM-2548 deprecated the name property in the DeploymentQuery
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/DeploymentQuery.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/DeploymentQuery.java 2009-09-18 09:08:54 UTC (rev 5660)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/DeploymentQuery.java 2009-09-18 15:39:33 UTC (rev 5661)
@@ -29,6 +29,9 @@
*/
public interface DeploymentQuery {
+ /** sorting by name does not work on oracle. that's why it is deprecated.
+ * will be removed in jBPM 4.3 */
+ @Deprecated
String PROPERTY_NAME = "name";
String PROPERTY_TIMESTAMP = "timestamp";
String PROPERTY_STATE = "state";
Modified: jbpm4/trunk/modules/distro/src/main/files/install/build.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/install/build.xml 2009-09-18 09:08:54 UTC (rev 5660)
+++ jbpm4/trunk/modules/distro/src/main/files/install/build.xml 2009-09-18 15:39:33 UTC (rev 5661)
@@ -18,7 +18,7 @@
<property name="jbpm.parent.dir" value="../.." />
<property name="jbpm.home" value="${jbpm.parent.dir}/jbpm-${jbpm.version}" />
<property name="hibernate.connection.type" value="jdbc" /> <!-- jdbc | datasource -->
- <property name="logging" value="jdk" /> <!-- jdk | provided -->
+ <property name="logging" value="jdk" /> <!-- jdk | none -->
<property name="cfg.dest.dir" value="${jbpm.home}/install/generated/cfg" />
<property name="install.src.dir" value="${jbpm.home}/install/src" />
<property name="mail.cfg" value="default" />
Copied: jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/logging/none (from rev 5660, jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/logging/provided)
Modified: jbpm4/trunk/modules/test-db/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-db/pom.xml 2009-09-18 09:08:54 UTC (rev 5660)
+++ jbpm4/trunk/modules/test-db/pom.xml 2009-09-18 15:39:33 UTC (rev 5661)
@@ -123,6 +123,7 @@
<property name="cfg.dest.dir" value="target/test-classes" />
<property name="install.src.dir" value="../distro/src/main/files/install/src" />
<property name="jdbc.properties.dir" value="target/jdbc.properties" />
+ <property name="logging" value="none" /> <!-- then the original logging.properties in the resources of this project will be used -->
</ant>
</tasks>
</configuration>
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/query/DeploymentQueryTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/query/DeploymentQueryTest.java 2009-09-18 09:08:54 UTC (rev 5660)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/query/DeploymentQueryTest.java 2009-09-18 15:39:33 UTC (rev 5661)
@@ -147,10 +147,6 @@
}
}
- public void testOrderByName() {
- testOrderBy(DeploymentQuery.PROPERTY_NAME, Arrays.asList("Claim", "Fire", "Hire"));
- }
-
public void testOrderByTimeStamp() {
testOrderByNaturalOrdening(DeploymentQuery.PROPERTY_TIMESTAMP, 3);
}
14 years, 7 months
JBoss JBPM SVN: r5660 - jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/query.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-09-18 05:08:54 -0400 (Fri, 18 Sep 2009)
New Revision: 5660
Modified:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/query/TaskQueryTest.java
Log:
Fixing test for Postgres
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/query/TaskQueryTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/query/TaskQueryTest.java 2009-09-17 16:06:37 UTC (rev 5659)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/query/TaskQueryTest.java 2009-09-18 09:08:54 UTC (rev 5660)
@@ -90,7 +90,7 @@
}
public void testOrderByAssignee() {
- testOrderBy(TaskQuery.PROPERTY_ASSIGNEE, new String[] {null, "Joram", "Koen", "Tom"});
+ testOrderBy(TaskQuery.PROPERTY_ASSIGNEE, new String[] {"Alex", "Joram", "Koen", "Tom"});
}
public void testOrderByCreateTime() {
@@ -139,6 +139,7 @@
Task task4 = taskService.newTask();
task4.setName("find venture capital");
+ task4.setAssignee("Alex");
task4.setPriority(7);
task4.setDuedate(stringToDate("09/09/2009"));
task4.setProgress(99);
14 years, 7 months
JBoss JBPM SVN: r5659 - jbpm4/trunk/modules/userguide/src/main/docbook/en/modules.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-09-17 12:06:37 -0400 (Thu, 17 Sep 2009)
New Revision: 5659
Modified:
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Jpdl.xml
Log:
Enhanced explanation of threadsafe notion of user code
Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Jpdl.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Jpdl.xml 2009-09-17 12:58:19 UTC (rev 5658)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Jpdl.xml 2009-09-17 16:06:37 UTC (rev 5659)
@@ -2900,8 +2900,11 @@
<listitem><literal>handler</literal> in decision</listitem>
</itemizedlist>
<para>For all objects that are referenced by a class name, will be
- instantiated during parsing time. Which implies that the objects have to be
- threadsafe. This is typically OK since those objects are typically immutable.
+ instantiated during parsing time. Which implies that the objects aren't
+ allowed to store non-stateless data (ie which can change).
+ This is typically OK since those objects are in practice almost always immutable.
+ If you do need to use 'dynamic' data in your user code, you can always
+ fall back to process variables (or Environment.get(xxx) calls).
</para>
<para>Objects that are referenced by an expression are calculated
dynamically.
14 years, 7 months
JBoss JBPM SVN: r5658 - jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-09-17 08:58:19 -0400 (Thu, 17 Sep 2009)
New Revision: 5658
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java
Log:
JBPM-2526 used dynamic lookup for DbidGenerator in repositorysession
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java 2009-09-17 12:53:44 UTC (rev 5657)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java 2009-09-17 12:58:19 UTC (rev 5658)
@@ -53,7 +53,7 @@
public String deploy(NewDeployment deployment) {
DeploymentImpl deploymentImpl = (DeploymentImpl) deployment;
- long dbid = EnvironmentImpl.getFromCurrent(DbidGenerator.class).getNextId();
+ long dbid = DbidGenerator.getDbidGenerator().getNextId();
deploymentImpl.setDbid(dbid);
session.save(deploymentImpl);
14 years, 7 months
JBoss JBPM SVN: r5657 - jbpm4/trunk/qa/jdbc.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-09-17 08:53:44 -0400 (Thu, 17 Sep 2009)
New Revision: 5657
Modified:
jbpm4/trunk/qa/jdbc/oracle.properties
jbpm4/trunk/qa/jdbc/postgresql.properties
Log:
updated new servernames of oracle and postgresql in qa lab
Modified: jbpm4/trunk/qa/jdbc/oracle.properties
===================================================================
--- jbpm4/trunk/qa/jdbc/oracle.properties 2009-09-17 12:39:11 UTC (rev 5656)
+++ jbpm4/trunk/qa/jdbc/oracle.properties 2009-09-17 12:53:44 UTC (rev 5657)
@@ -1,4 +1,4 @@
jdbc.driver=oracle.jdbc.driver.OracleDriver
-jdbc.url=jdbc:oracle:thin:@dev01.qa.atl.jboss.com:1521:qadb01
+jdbc.url=jdbc:oracle:thin:@vmg05.mw.lab.eng.bos.redhat.com:1521:qaora10
jdbc.username=PVM1
jdbc.password=PVM1
Modified: jbpm4/trunk/qa/jdbc/postgresql.properties
===================================================================
--- jbpm4/trunk/qa/jdbc/postgresql.properties 2009-09-17 12:39:11 UTC (rev 5656)
+++ jbpm4/trunk/qa/jdbc/postgresql.properties 2009-09-17 12:53:44 UTC (rev 5657)
@@ -2,6 +2,6 @@
jdbc.port=5432
jdbc.server=dev01.qa.atl.jboss.com
jdbc.databasename=pvm4
-jdbc.url=jdbc:postgresql://dev01.qa.atl.jboss.com:5432/pvm4
+jdbc.url=jdbc:postgresql://vmg01.mw.lab.eng.bos.redhat.com:5432/pvm4
jdbc.username=pvm4
jdbc.password=pvm4
14 years, 7 months
JBoss JBPM SVN: r5656 - jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/variables.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-09-17 08:39:11 -0400 (Thu, 17 Sep 2009)
New Revision: 5656
Added:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/variables/VariableExpressionTest.java
Log:
Added a testcase to verify expressions and variables usage
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/variables/VariableExpressionTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/variables/VariableExpressionTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/variables/VariableExpressionTest.java 2009-09-17 12:39:11 UTC (rev 5656)
@@ -0,0 +1,88 @@
+/*
+ * 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.variables;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.activity.ActivityBehaviour;
+import org.jbpm.api.activity.ActivityExecution;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Joram Barrez
+ */
+public class VariableExpressionTest extends JbpmTestCase {
+
+ public void testExpression() {
+ deployJpdlXmlString(
+ "<process name='theProcess'>" +
+ " <start name='theStart'>" +
+ " <transition to='incrementCounter' />" +
+ " </start>" +
+ " <custom name='incrementCounter' class='" + MyJavaActivity.class.getName() + "'>" +
+ " <transition to='decideToGoFurther' />" +
+ " </custom>" +
+ " <decision name='decideToGoFurther'>" +
+ " <transition to='waitHere'>" +
+ " <condition expr='#{counter == 10}' />" +
+ " </transition>" +
+ " <transition to='incrementCounter'>" +
+ " <condition expr='#{counter < 10}' />" +
+ " </transition>" +
+ " </decision>" +
+ " <state name='waitHere'>" +
+ " <transition to='theEnd' />" +
+ " </state>" +
+ " <end name='theEnd' />" +
+ "</process>"
+ );
+
+ Map<String, Integer> vars = new HashMap<String, Integer>();
+ vars.put("counter", 0);
+
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("theProcess", vars);
+ assertActivityActive(processInstance.getId(), "waitHere");
+
+ Integer counter = (Integer) executionService.getVariable(processInstance.getId(), "counter");
+ assertEquals(new Integer(10), counter);
+ }
+
+
+ public static class MyJavaActivity implements ActivityBehaviour {
+
+ private static final long serialVersionUID = 1L;
+
+ public void execute(ActivityExecution execution) throws Exception {
+ Integer counter = (Integer) execution.getVariable("counter");
+ counter++;
+ execution.setVariable("counter", counter);
+ }
+
+ }
+
+}
14 years, 7 months
JBoss JBPM SVN: r5655 - in jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test: assertion and 1 other directory.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-09-17 08:08:53 -0400 (Thu, 17 Sep 2009)
New Revision: 5655
Added:
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/assertion/
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/assertion/CollectionAssertions.java
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/assertion/QueryAssertions.java
Log:
Unit test helper classes
Added: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/assertion/CollectionAssertions.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/assertion/CollectionAssertions.java (rev 0)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/assertion/CollectionAssertions.java 2009-09-17 12:08:53 UTC (rev 5655)
@@ -0,0 +1,61 @@
+/*
+ * 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.assertion;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+import junit.framework.Assert;
+
+/**
+ * Utility class with assertions for collections.
+ *
+ * @author Joram Barrez
+ */
+public class CollectionAssertions {
+
+ public static <T> void assertElementsEqual(Collection<T> collection1, Collection<T> collection2) {
+
+ Assert.assertTrue( (collection1 == null && collection2 == null)
+ || (collection1 != null && collection2 != null) );
+
+ if (collection1 != null && collection2 != null) {
+
+ Assert.assertEquals(collection1.size(), collection2.size());
+
+ Iterator<T> it1 = collection1.iterator();
+ Iterator<T> it2 = collection2.iterator();
+
+ while (it1.hasNext()) {
+ T t1 = it1.next();
+ T t2 = it2.next();
+ Assert.assertEquals(t1, t2);
+ }
+
+ }
+
+ }
+
+}
Added: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/assertion/QueryAssertions.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/assertion/QueryAssertions.java (rev 0)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/assertion/QueryAssertions.java 2009-09-17 12:08:53 UTC (rev 5655)
@@ -0,0 +1,150 @@
+/*
+ * 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.assertion;
+
+import java.lang.reflect.Method;
+import java.util.List;
+
+import junit.framework.Assert;
+
+/**
+ * Utility class with assertions for query test.
+ *
+ * @author Joram Barrez
+ */
+public class QueryAssertions {
+
+ // No need to instantiate
+ private QueryAssertions() {
+ }
+
+ /**
+ * Assertion to be used to check if the result of a certain XXXQuery produces
+ * the correct result.
+ *
+ * Example usage:
+ *
+ * List<Task> taskListAsc = taskService.createTaskQuery().orderAsc(property).list(); List<Task>
+ * taskListDesc = taskService.createTaskQuery().orderDesc(property).list();
+ * QueryAssertions.assertOrderOnProperty(Task.class, property, taskListAsc, taskListDesc, Arrays.asList("a", "b", "c"));
+ *
+ * The assertion will do the following assertions:
+ *
+ * @param clazz
+ * Due to generics mumbo-jumbo, it's required to provide the class
+ * of the generic type T. If only we could do T.getClass() ...
+ * @param <T>
+ * The return type of the XXXQuery
+ * @param property
+ * The property on which the query was ordered
+ * @param listOrderedAsc
+ * The list resulting from executing the query with an 'order by asc'
+ * @param listOrderedDesc
+ * The list resulting from executing the query with an 'order by
+ * desc'
+ * @param expectedValuesAsc
+ * The hard coded list of expected elements, in ascending order. The
+ * assertion for the descending case will be done by reversing this
+ * list
+ */
+ public static <T> void assertOrderOnProperty(Class<T> clazz, String property,
+ List<T> listOrderedAsc, List<T> listOrderedDesc, List<Object> expectedValuesAsc) {
+
+ Assert.assertNotNull(listOrderedAsc);
+ Assert.assertEquals(expectedValuesAsc.size(), expectedValuesAsc.size());
+
+ Assert.assertNotNull(listOrderedDesc);
+ Assert.assertEquals(expectedValuesAsc.size(), listOrderedDesc.size());
+
+ for (int i = 0; i < expectedValuesAsc.size(); i++) {
+
+ Object realValueAsc = null;
+ Object realValueDesc = null;
+
+ try {
+
+ realValueAsc = invokeGetter(property, clazz, listOrderedAsc.get(i));
+ realValueDesc = invokeGetter(property, clazz, listOrderedDesc.get(i));
+
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ }
+
+ Assert.assertEquals("Incorrect order by ASC for property " + property,
+ expectedValuesAsc.get(i), realValueAsc);
+ Assert.assertEquals("Incorrect order by DESC for property " + property,
+ expectedValuesAsc.get((listOrderedDesc.size() -1) - i), realValueDesc);
+
+ }
+ }
+
+ /**
+ * Does the same as the assertOrderOnProperty assertion, but instead of
+ * checking if the resulting list have the correct elements now it is checked
+ * if the elements are naturally ordered ascending and descending.
+ *
+ * IMPORTANT: the type T must be implementing the {@link Comparable} interface!
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> void assertOrderIsNatural(Class<T> clazz, String property, List<T> listOrderedAsc, List<T> listOrderedDesc, int nrOfExpectedElements) {
+
+ Assert.assertEquals(nrOfExpectedElements, listOrderedAsc.size());
+ Assert.assertEquals(nrOfExpectedElements, listOrderedDesc.size());
+
+ if (nrOfExpectedElements > 1) {
+
+ for (int i = 1; i < listOrderedAsc.size(); i++) {
+
+ // ascending check
+ Comparable c1 = (Comparable) invokeGetter(property, clazz, listOrderedAsc.get(i - 1));
+ Comparable c2 = (Comparable) invokeGetter(property, clazz, listOrderedAsc.get(i));
+ if (c1 != null && c2 != null) {
+ Assert.assertTrue("The ascending list does not have a natural order",c1.compareTo(c2) <= 0); // c1 <= c2 when ascending
+ }
+
+ // ascending check
+ Comparable c3 = (Comparable) invokeGetter(property, clazz, listOrderedDesc.get(i - 1));
+ Comparable c4 = (Comparable) invokeGetter(property, clazz, listOrderedDesc.get(i));
+ if (c3 != null && c4 != null) {
+ Assert.assertTrue("The descending list does not have a natural order", c3.compareTo(c4) >= 0); // c3 >= c4 when ascending
+ }
+
+ }
+
+ }
+
+ }
+
+ private static <T> Object invokeGetter(String property, Class<T> clazz, T obj) {
+ try {
+ Method getter = clazz.getMethod("get" + property.substring(0, 1).toUpperCase() + property.substring(1));
+ return getter.invoke(obj);
+ } catch (Exception e) {
+ throw new RuntimeException("Couldn't invoke getter for property " + property);
+ }
+ }
+
+
+}
14 years, 7 months
JBoss JBPM SVN: r5654 - jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/deploy.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-09-17 08:06:07 -0400 (Thu, 17 Sep 2009)
New Revision: 5654
Added:
jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/deploy/process.zip
Log:
Test for deployment through zip file
Added: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/deploy/process.zip
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/deploy/process.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
14 years, 7 months