Author: ainze
Date: 2009-07-23 15:40:58 -0400 (Thu, 23 Jul 2009)
New Revision: 5343
Added:
projects/demos/richfaces-spring-jbpm4/trunk/src/main/resources/be/inze/spring/demo/v12/
projects/demos/richfaces-spring-jbpm4/trunk/src/main/resources/be/inze/spring/demo/v12/applicationContext-v12.xml
projects/demos/richfaces-spring-jbpm4/trunk/src/main/spring/
projects/demos/richfaces-spring-jbpm4/trunk/src/main/springv12/
projects/demos/richfaces-spring-jbpm4/trunk/src/test/java/be/inze/spring/demo/process/RegistrationProcessTestsv12.java
Modified:
projects/demos/richfaces-spring-jbpm4/trunk/pom.xml
Log:
added minor support for spring 1.2 testing
Modified: projects/demos/richfaces-spring-jbpm4/trunk/pom.xml
===================================================================
--- projects/demos/richfaces-spring-jbpm4/trunk/pom.xml 2009-07-23 19:35:15 UTC (rev
5342)
+++ projects/demos/richfaces-spring-jbpm4/trunk/pom.xml 2009-07-23 19:40:58 UTC (rev
5343)
@@ -225,7 +225,27 @@
<artifactId>commons-collections</artifactId>
<version>${commons-collections.version}</version>
</dependency>
- </dependencies>
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ </profile>
+ <profile>
+ <id>springv12</id>
+ <properties>
+ <spring.version>1.2.8</spring.version>
+ </properties>
+ </profile>
+ <profile>
+ <id>snapshot</id>
+ <properties>
+ <jbpm.version>4.1-SNAPSHOT</jbpm.version>
+ </properties>
+ </profile>
+ </profiles>
-
</project>
Added:
projects/demos/richfaces-spring-jbpm4/trunk/src/main/resources/be/inze/spring/demo/v12/applicationContext-v12.xml
===================================================================
---
projects/demos/richfaces-spring-jbpm4/trunk/src/main/resources/be/inze/spring/demo/v12/applicationContext-v12.xml
(rev 0)
+++
projects/demos/richfaces-spring-jbpm4/trunk/src/main/resources/be/inze/spring/demo/v12/applicationContext-v12.xml 2009-07-23
19:40:58 UTC (rev 5343)
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
+
+<beans>
+ <bean id="sessionFactory"
+ class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
+ <property name="dataSource" ref="dataSource" />
+ <property name="hibernateProperties">
+ <props>
+ <prop
key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
+ <prop key="hibernate.show_sql">true</prop>
+ <prop key="hibernate.hbm2ddl.auto">create-drop</prop>
+ </props>
+ </property>
+ <property name="configLocations">
+ <list>
+ <value>classpath:be/inze/spring/demo/hibernate.cfg.xml</value>
+ </list>
+ </property>
+ <property name="mappingLocations">
+ <list>
+ <value>classpath:jbpm.execution.hbm.xml</value>
+ <value>classpath:jbpm.repository.hbm.xml</value>
+ <value>classpath:jbpm.task.hbm.xml</value>
+ <value>classpath:jbpm.history.hbm.xml</value>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource"
+ destroy-method="close">
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver"
/>
+ <property name="url" value="jdbc:hsqldb:jbpm4;shutdown=true"
/>
+ <property name="username" value="sa" />
+ <property name="password" value="" />
+ </bean>
+
+
+ <bean
+ class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+ <property name="locations">
+ <list>
+ <value>classpath:/log4j.properties</value>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="jbpmConfiguration"
class="org.jbpm.pvm.internal.cfg.SpringConfiguration">
+ <constructor-arg value="be/inze/spring/demo/jbpm.cfg.xml" />
+ </bean>
+
+ <bean id="processEngine" factory-bean="jbpmConfiguration"
+ factory-method="buildProcessEngine" />
+ <bean id="repositoryService" factory-bean="processEngine"
+ factory-method="getRepositoryService" />
+ <bean id="executionService" factory-bean="processEngine"
+ factory-method="getExecutionService" />
+
+ <bean id="transactionManager"
+ class="org.springframework.orm.hibernate3.HibernateTransactionManager">
+ <property name="sessionFactory" ref="sessionFactory" />
+ </bean>
+
+
+ <bean id="deployService"
class="be.inze.spring.demo.service.impl.DeployServiceImpl">
+ <property name="repositoryService" ref="repositoryService"
/>
+ </bean>
+
+ <bean id="processInformationService"
+ class="be.inze.spring.demo.service.impl.ProcessInformationServiceImpl">
+ <property name="repositoryService" ref="repositoryService"
/>
+ <property name="executionService" ref="executionService" />
+ </bean>
+
+ <bean id="simpleProcessService"
+ class="be.inze.spring.demo.service.impl.SimpleProcessServiceImpl">
+ <property name="repositoryService" ref="repositoryService"
/>
+ <property name="executionService" ref="executionService" />
+ </bean>
+
+ <bean id="echoService"
class="be.inze.spring.demo.service.impl.EchoServiceImpl" />
+
+ <bean id="initialFillService"
class="be.inze.spring.demo.service.impl.InitialFillServiceImpl"
+ init-method="init">
+ <property name="deployService" ref="deployService" />
+ <property name="simpleProcessService" ref="simpleProcessService"
/>
+ </bean>
+</beans>
Property changes on:
projects/demos/richfaces-spring-jbpm4/trunk/src/main/resources/be/inze/spring/demo/v12/applicationContext-v12.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
projects/demos/richfaces-spring-jbpm4/trunk/src/test/java/be/inze/spring/demo/process/RegistrationProcessTestsv12.java
===================================================================
---
projects/demos/richfaces-spring-jbpm4/trunk/src/test/java/be/inze/spring/demo/process/RegistrationProcessTestsv12.java
(rev 0)
+++
projects/demos/richfaces-spring-jbpm4/trunk/src/test/java/be/inze/spring/demo/process/RegistrationProcessTestsv12.java 2009-07-23
19:40:58 UTC (rev 5343)
@@ -0,0 +1,63 @@
+package be.inze.spring.demo.process;
+
+import java.util.Collection;
+
+import org.jbpm.api.Execution;
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.activity.ActivityExecution;
+import org.jbpm.api.job.Job;
+import org.jbpm.test.AbstractTransactionalSpringJbpmTestCase;
+
+public class RegistrationProcessTestsv12 extends
+ AbstractTransactionalSpringJbpmTestCase {
+
+ private String processInstanceId;
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[] {
+ "be/inze/spring/demo/v12/applicationContext-v12.xml",
+ };
+ }
+
+ @Override
+ protected void onSetUpInTransaction() throws Exception {
+ super.onSetUpInTransaction();
+ deployJpdlFromClasspath("be/inze/spring/process/Registration.jpdl.xml");
+ }
+
+ public void testStart() {
+ ProcessInstance processInstance = executionService
+ .startProcessInstanceByKey("DemoProcess");
+ processInstanceId = processInstance.getId();
+ assertTrue(processInstance.isActive("accept"));
+ }
+
+ public void testSignalAccept() {
+ testStart();
+
+ Execution execution = executionService.findExecutionById(processInstanceId);
+
+ ProcessInstance processInstance =
executionService.signalExecutionById(execution.getExecutions().iterator().next().getId(),
"transition");
+ ActivityExecution activityExecution = (ActivityExecution) processInstance;
+ assertEquals("grant access", activityExecution.getActivityName());
+ }
+
+ public void testTimeOut() {
+ testStart();
+
+ Collection<Job> result =
managementService.createJobQuery().processInstanceId(processInstanceId).list();
+ assertEquals(1, result.size());
+
+ managementService.executeJob(result.iterator().next().getId());
+
+ result =
managementService.createJobQuery().processInstanceId(processInstanceId).list();
+ assertEquals(1, result.size());
+
+ ProcessInstance instance =
executionService.findProcessInstanceById(processInstanceId);
+ ActivityExecution activityExecution = (ActivityExecution) instance;
+ assertEquals("timed out", activityExecution.getActivityName());
+
+ }
+
+}
Property changes on:
projects/demos/richfaces-spring-jbpm4/trunk/src/test/java/be/inze/spring/demo/process/RegistrationProcessTestsv12.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Show replies by date