Moved the various test context files from config/test/alfresco/ to source/test-resource/jbpm-test. This was done to try and fix the currently broken build.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@15859 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
N Smith
2009-08-21 16:38:59 +00:00
parent e34403e636
commit 99395b7ed2
6 changed files with 386 additions and 2 deletions

View File

@@ -86,8 +86,8 @@ public class JBPMEngineUnitTest extends TestCase
private static final NodeRef companyHome = new NodeRef("for://test/home"); private static final NodeRef companyHome = new NodeRef("for://test/home");
private static final ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext( private static final ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(
new String[] { "classpath:test/alfresco/test-database-context.xml", new String[] { "classpath:jbpm-test/test-database-context.xml",
"classpath:test/alfresco/test-workflow-context.xml", }); "classpath:jbpm-test/test-workflow-context.xml", });
private JBPMEngine engine = new JBPMEngine(); private JBPMEngine engine = new JBPMEngine();

View File

@@ -0,0 +1,83 @@
<jbpm-configuration>
<jbpm-context>
<service name="persistence"
factory="org.jbpm.persistence.db.DbPersistenceServiceFactory" />
<service name="tx" factory="org.jbpm.tx.TxServiceFactory" />
<service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" />
<service name="scheduler"
factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" />
<service name="logging"
factory="org.jbpm.logging.db.DbLoggingServiceFactory" />
<service name="authentication"
factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
</jbpm-context>
<!--
configuration resource files pointing to default configuration
files in jbpm-{version}.jar
-->
<string name="resource.business.calendar"
value="org/jbpm/calendar/jbpm.business.calendar.properties" />
<string name="resource.default.modules"
value="org/jbpm/graph/def/jbpm.default.modules.properties" />
<string name='resource.converter'
value='org/alfresco/repo/workflow/jbpm/jbpm.converter.properties' />
<string name="resource.action.types"
value="org/alfresco/repo/workflow/jbpm/jbpm.action.types.xml" />
<string name="resource.node.types"
value="org/alfresco/repo/workflow/jbpm/jbpm.node.types.xml" />
<string name="resource.parsers"
value="org/alfresco/repo/workflow/jbpm/jbpm.parsers.xml" />
<string name="resource.varmapping"
value="org/alfresco/repo/workflow/jbpm/jbpm.varmapping.xml" />
<string name="resource.mail.templates" value="jbpm.mail.templates.xml" />
<int name="jbpm.byte.block.size" value="1024" singleton="true" />
<string name="jbpm.mail.smtp.host" value="localhost" />
<bean name="jbpm.task.instance.factory"
class="org.alfresco.repo.workflow.jbpm.WorkflowTaskInstanceFactory"
singleton="true">
<field name="jbpmEngineName">
<string value="test_jbpm_engine" />
</field>
</bean>
<bean name="jbpm.variable.resolver" class="org.jbpm.jpdl.el.impl.JbpmVariableResolver"
singleton="true" />
<bean name="jbpm.mail.address.resolver" class="org.jbpm.identity.mail.IdentityAddressResolver"
singleton="true" />
<bean name="jbpm.job.executor" class="org.alfresco.repo.workflow.jbpm.AlfrescoJobExecutor">
<field name="jbpmConfiguration">
<ref bean="jbpmConfiguration" />
</field>
<field name="name">
<string value="AlfrescoJbpmJobExector" />
</field>
<field name="nbrOfThreads">
<int value="1" />
</field>
<!-- overridden for WCM unit tests to 5 secs (was 1.5 mins) -->
<field name="idleInterval">
<int value="5000" />
</field>
<field name="maxIdleInterval">
<int value="3600000" />
</field> <!-- 1 hour -->
<field name="historyMaxSize">
<int value="20" />
</field>
<field name="maxLockTime">
<int value="600000" />
</field> <!-- 10 minutes -->
<field name="lockMonitorInterval">
<int value="60000" />
</field> <!-- 1 minute -->
<field name="lockBufferTime">
<int value="5000" />
</field> <!-- 5 seconds -->
</bean>
</jbpm-configuration>

View File

@@ -0,0 +1,21 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<!-- Overriding test properties to point to custom properties -->
<bean id="test-properties"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="ignoreUnresolvablePlaceholders" value="true" />
<property name="location" value="classpath:alfresco/repository.properties" />
<property name="properties">
<props>
<prop key="db.testname">${db.name}_test</prop>
<prop key="db.testurl">${db.url}_test</prop>
</props>
</property>
</bean>
<import resource="classpath*:alfresco/extension/dev-context.xml" />
</beans>

View File

@@ -0,0 +1,219 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<import resource="classpath:jbpm-test/test-context.xml" />
<!-- load hibernate configuration properties -->
<bean id="testHibernateConfigProperties"
class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<!-- Load in hibernate defaults -->
<property name="locations">
<list>
<value>classpath:jbpm-test/test-hibernate-cfg.properties</value>
</list>
</property>
<property name="localOverride">
<value>true</value>
</property>
</bean>
<!-- Datasource bean -->
<bean id="testDataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName">
<value>${db.driver}</value>
</property>
<property name="url">
<value>${db.testurl}</value>
</property>
<property name="username">
<value>${db.username}</value>
</property>
<property name="password">
<value>${db.password}</value>
</property>
<property name="initialSize">
<value>${db.pool.initial}</value>
</property>
<property name="maxActive">
<value>${db.pool.max}</value>
</property>
<property name="minIdle">
<value>${db.pool.min}</value>
</property>
<property name="maxIdle">
<value>${db.pool.idle}</value>
</property>
<property name="defaultAutoCommit">
<value>false</value>
</property>
<property name="defaultTransactionIsolation">
<value>${db.txn.isolation}</value>
</property>
<property name="maxWait">
<value>${db.pool.wait.max}</value>
</property>
<property name="validationQuery">
<value>${db.pool.validate.query}</value>
</property>
<property name="timeBetweenEvictionRunsMillis">
<value>${db.pool.evict.interval}</value>
</property>
<property name="minEvictableIdleTimeMillis">
<value>${db.pool.evict.idle.min}</value>
</property>
<property name="testOnBorrow">
<value>${db.pool.validate.borrow}</value>
</property>
<property name="testOnReturn">
<value>${db.pool.validate.return}</value>
</property>
<property name="testWhileIdle">
<value>${db.pool.evict.validate}</value>
</property>
<property name="removeAbandoned">
<value>${db.pool.abandoned.detect}</value>
</property>
<property name="removeAbandonedTimeout">
<value>${db.pool.abandoned.time}</value>
</property>
<property name="poolPreparedStatements">
<value>${db.pool.statements.enable}</value>
</property>
<property name="maxOpenPreparedStatements">
<value>${db.pool.statements.max}</value>
</property>
</bean>
<!-- Hibernate session factory -->
<bean id="testSessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="testDataSource" />
</property>
<property name="schemaUpdate">
<value>true</value>
</property>
<!--
<property name="eventListeners" > <map> <entry key="load">
<list> <ref bean="defaltOnLoadListsner" /> <ref
bean="clearCGLibThreadLocal" /> </list> </entry> </map>
</property>
-->
<property name="mappingResources">
<list>
<!-- -->
<!-- JBoss jBPM Workflow Engine -->
<!-- -->
<!--
TODO: Determine if it's possible to inject the following
mappings
-->
<!-- from elsewhere -->
<!-- -->
<value>org/jbpm/graph/action/Script.hbm.xml</value>
<value>org/jbpm/db/hibernate.queries.hbm.xml</value>
<value>org/jbpm/graph/def/ProcessDefinition.hbm.xml</value>
<value>org/jbpm/graph/def/Node.hbm.xml</value>
<value>org/jbpm/graph/def/Transition.hbm.xml</value>
<value>org/jbpm/graph/def/Event.hbm.xml</value>
<value>org/jbpm/graph/def/Action.hbm.xml</value>
<value>org/jbpm/graph/def/SuperState.hbm.xml</value>
<value>org/jbpm/graph/def/ExceptionHandler.hbm.xml</value>
<value>org/jbpm/instantiation/Delegation.hbm.xml</value>
<value>org/jbpm/graph/node/StartState.hbm.xml</value>
<value>org/jbpm/graph/node/EndState.hbm.xml</value>
<value>org/jbpm/graph/node/ProcessState.hbm.xml</value>
<value>org/jbpm/graph/node/Decision.hbm.xml</value>
<value>org/jbpm/graph/node/Fork.hbm.xml</value>
<value>org/alfresco/repo/workflow/jbpm/jbpm.Join.hbm.xml</value>
<value>org/jbpm/graph/node/State.hbm.xml</value>
<value>org/jbpm/graph/node/TaskNode.hbm.xml</value>
<value>org/jbpm/context/def/ContextDefinition.hbm.xml</value>
<value>org/jbpm/context/def/VariableAccess.hbm.xml</value>
<value>org/jbpm/taskmgmt/def/TaskMgmtDefinition.hbm.xml</value>
<value>org/jbpm/taskmgmt/def/Swimlane.hbm.xml</value>
<value>org/jbpm/taskmgmt/def/Task.hbm.xml</value>
<value>org/jbpm/taskmgmt/def/TaskController.hbm.xml</value>
<value>org/jbpm/module/def/ModuleDefinition.hbm.xml</value>
<value>org/jbpm/bytes/ByteArray.hbm.xml</value>
<value>org/jbpm/file/def/FileDefinition.hbm.xml</value>
<value>org/alfresco/repo/workflow/jbpm/jbpm.CreateTimerAction.hbm.xml</value>
<value>org/jbpm/scheduler/def/CancelTimerAction.hbm.xml</value>
<value>org/jbpm/graph/exe/Comment.hbm.xml</value>
<value>org/jbpm/graph/exe/ProcessInstance.hbm.xml</value>
<value>org/jbpm/graph/exe/Token.hbm.xml</value>
<value>org/jbpm/graph/exe/RuntimeAction.hbm.xml</value>
<value>org/jbpm/module/exe/ModuleInstance.hbm.xml</value>
<value>org/jbpm/context/exe/ContextInstance.hbm.xml</value>
<value>org/jbpm/context/exe/TokenVariableMap.hbm.xml</value>
<value>org/jbpm/context/exe/VariableInstance.hbm.xml</value>
<value>org/jbpm/context/exe/variableinstance/ByteArrayInstance.hbm.xml</value>
<value>org/jbpm/context/exe/variableinstance/DateInstance.hbm.xml</value>
<value>org/jbpm/context/exe/variableinstance/DoubleInstance.hbm.xml</value>
<value>org/jbpm/context/exe/variableinstance/HibernateLongInstance.hbm.xml</value>
<value>org/jbpm/context/exe/variableinstance/HibernateStringInstance.hbm.xml</value>
<value>org/jbpm/context/exe/variableinstance/LongInstance.hbm.xml</value>
<value>org/jbpm/context/exe/variableinstance/NullInstance.hbm.xml</value>
<value>org/jbpm/context/exe/variableinstance/StringInstance.hbm.xml</value>
<value>org/jbpm/job/Job.hbm.xml</value>
<value>org/jbpm/job/Timer.hbm.xml</value>
<value>org/alfresco/repo/workflow/jbpm/jbpm.Timer.hbm.xml</value>
<value>org/jbpm/job/ExecuteNodeJob.hbm.xml</value>
<value>org/jbpm/job/ExecuteActionJob.hbm.xml</value>
<value>org/jbpm/taskmgmt/exe/TaskMgmtInstance.hbm.xml</value>
<value>org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml</value>
<value>org/alfresco/repo/workflow/jbpm/WorkflowTaskInstance.hbm.xml</value>
<value>org/jbpm/taskmgmt/exe/PooledActor.hbm.xml</value>
<value>org/jbpm/taskmgmt/exe/SwimlaneInstance.hbm.xml</value>
<value>org/jbpm/logging/log/ProcessLog.hbm.xml</value>
<value>org/jbpm/logging/log/MessageLog.hbm.xml</value>
<value>org/jbpm/logging/log/CompositeLog.hbm.xml</value>
<value>org/jbpm/graph/log/ActionLog.hbm.xml</value>
<value>org/jbpm/graph/log/NodeLog.hbm.xml</value>
<value>org/jbpm/graph/log/ProcessInstanceCreateLog.hbm.xml</value>
<value>org/jbpm/graph/log/ProcessInstanceEndLog.hbm.xml</value>
<value>org/jbpm/graph/log/ProcessStateLog.hbm.xml</value>
<value>org/jbpm/graph/log/SignalLog.hbm.xml</value>
<value>org/jbpm/graph/log/TokenCreateLog.hbm.xml</value>
<value>org/jbpm/graph/log/TokenEndLog.hbm.xml</value>
<value>org/jbpm/graph/log/TransitionLog.hbm.xml</value>
<value>org/jbpm/context/log/VariableLog.hbm.xml</value>
<value>org/jbpm/context/log/VariableCreateLog.hbm.xml</value>
<value>org/jbpm/context/log/VariableDeleteLog.hbm.xml</value>
<value>org/jbpm/context/log/VariableUpdateLog.hbm.xml</value>
<value>org/jbpm/context/log/variableinstance/ByteArrayUpdateLog.hbm.xml</value>
<value>org/jbpm/context/log/variableinstance/DateUpdateLog.hbm.xml</value>
<value>org/jbpm/context/log/variableinstance/DoubleUpdateLog.hbm.xml</value>
<value>org/jbpm/context/log/variableinstance/HibernateLongUpdateLog.hbm.xml</value>
<value>org/jbpm/context/log/variableinstance/HibernateStringUpdateLog.hbm.xml</value>
<value>org/jbpm/context/log/variableinstance/LongUpdateLog.hbm.xml</value>
<value>org/jbpm/context/log/variableinstance/StringUpdateLog.hbm.xml</value>
<value>org/jbpm/taskmgmt/log/TaskLog.hbm.xml</value>
<value>org/jbpm/taskmgmt/log/TaskCreateLog.hbm.xml</value>
<value>org/jbpm/taskmgmt/log/TaskAssignLog.hbm.xml</value>
<value>org/jbpm/taskmgmt/log/TaskEndLog.hbm.xml</value>
<value>org/jbpm/taskmgmt/log/SwimlaneLog.hbm.xml</value>
<value>org/jbpm/taskmgmt/log/SwimlaneCreateLog.hbm.xml</value>
<value>org/jbpm/taskmgmt/log/SwimlaneAssignLog.hbm.xml</value>
<value>org/jbpm/job/CleanUpProcessJob.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties" ref="testHibernateConfigProperties" />
</bean>
<!-- create a transaction manager -->
<bean id="testTransactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="transactionSynchronizationName">
<value>SYNCHRONIZATION_ALWAYS</value>
</property>
<property name="sessionFactory">
<ref bean="testSessionFactory" />
</property>
</bean>
</beans>

View File

@@ -0,0 +1,28 @@
#
# Hibernate configuration
#
# The Hibernate Dialect:
# As of V3.1, the dialect is automatically detected.
# It is still possible to set the dialect explicitly, for example:
hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
hibernate.hbm2ddl.auto=update
hibernate.jdbc.use_streams_for_binary=true
hibernate.show_sql=false
hibernate.cache.use_query_cache=true
hibernate.max_fetch_depth=10
hibernate.cache.provider_class=org.alfresco.repo.cache.InternalEhCacheManagerFactoryBean
hibernate.cache.use_second_level_cache=true
hibernate.default_batch_fetch_size=1
hibernate.jdbc.batch_size=32
hibernate.connection.release_mode=auto
hibernate.connection.isolation=2
#hibernate.query.substitutions=
#hibernate.jdbc.use_get_generated_keys=false
# Oracle Schema Distinction:
# See https://issues.alfresco.com/jira/browse/ETHREEOH-680
# Metadata queries to Oracle have to be limited by schema name
# when multiple instances of Alfresco are installed on an Oracle server.
#hibernate.default_schema=

View File

@@ -0,0 +1,33 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<!-- -->
<!-- Alfresco BPM Registry -->
<!-- -->
<bean id="test_bpm_engineRegistry" class="org.alfresco.repo.workflow.BPMEngineRegistry" />
<bean id="test_bpm_engine" class="org.alfresco.repo.workflow.BPMEngine"
abstract="true">
<property name="BPMEngineRegistry" ref="test_bpm_engineRegistry" />
</bean>
<!-- -->
<!-- jBPM Implementation -->
<!-- -->
<bean id="test_jbpm_configuration"
class="org.alfresco.repo.workflow.jbpm.AlfrescoJbpmConfigurationFactoryBean">
<property name="sessionFactory" ref="testSessionFactory" />
<property name="configuration"
value="classpath:jbpm-test/jbpm.cfg.xml" />
</bean>
<bean id="test_jbpm_template"
class="org.alfresco.repo.workflow.jbpm.JBPMTransactionTemplate">
<constructor-arg index="0" ref="test_jbpm_configuration" />
</bean>
</beans>