[jboss-svn-commits] JBL Code SVN: r34661 - in labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core: src/test/java and 6 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Aug 12 02:46:29 EDT 2010
Author: diegoll
Date: 2010-08-12 02:46:28 -0400 (Thu, 12 Aug 2010)
New Revision: 34661
Added:
labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/java/org/
labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/java/org/drools/
labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/java/org/drools/timer/
labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/java/org/drools/timer/test/
labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/java/org/drools/timer/test/PersistentTimerProcessTest.java
labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/META-INF/
labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/META-INF/orm.xml
labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/META-INF/persistence.xml
labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/hornetq-context.xml
labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/log4j.xml
labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/timerProcess.rf
labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/timerProcessSession.xml
Modified:
labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/pom.xml
Log:
[JBRULES-2616] initial integration test
Modified: labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/pom.xml
===================================================================
--- labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/pom.xml 2010-08-12 06:40:46 UTC (rev 34660)
+++ labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/pom.xml 2010-08-12 06:46:28 UTC (rev 34661)
@@ -78,7 +78,16 @@
<version>4.8.1</version>
<scope>test</scope>
</dependency>
-
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-timer-executor</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-timer-scheduler</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
Added: labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/java/org/drools/timer/test/PersistentTimerProcessTest.java
===================================================================
--- labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/java/org/drools/timer/test/PersistentTimerProcessTest.java (rev 0)
+++ labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/java/org/drools/timer/test/PersistentTimerProcessTest.java 2010-08-12 06:46:28 UTC (rev 34661)
@@ -0,0 +1,97 @@
+package org.drools.timer.test;
+
+import java.util.Properties;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import org.drools.KnowledgeBase;
+import org.drools.core.util.KnowledgeSessionRuntimeConfigurator;
+import org.drools.job.executor.JobExecutorService;
+import org.drools.persistence.jpa.KnowledgeStoreService;
+import org.drools.runtime.Environment;
+import org.drools.runtime.StatefulKnowledgeSession;
+import org.drools.timer.message.TimerJob;
+import org.drools.timer.scheduler.TimerSchedulerHornetQService;
+import org.junit.Assert;
+import org.junit.Test;
+import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.AbstractApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class PersistentTimerProcessTest {
+
+ @Test
+ public void scheduleAndTriggerPersistentTimer() throws InterruptedException{
+ String sessionContextLocation = "classpath:/completedProcessSession.xml";
+ String sessionConfiguratorBeanName = "sessionConfigurator";
+ String knowledgeStoreServiceBeanName = "kstore";
+ String knowledgeBaseBeanName = "kbase";
+ String environmentBeanName = "env";
+
+ AbstractApplicationContext mainApplicationContext = createMainApplicationContext(sessionContextLocation);
+ AbstractApplicationContext executorApplicationContext = createExecutorApplicationContext(sessionContextLocation);
+ AbstractApplicationContext schedulerApplicationContext = createSchedulerApplicationContext();
+
+ //start services
+ @SuppressWarnings("unchecked")
+ JobExecutorService<TimerJob> timerJobExecutor = (JobExecutorService<TimerJob>) executorApplicationContext.getBean("timerJobExecutorService");
+ TimerSchedulerHornetQService timerScheduler = (TimerSchedulerHornetQService) schedulerApplicationContext.getBean("schedulerService");
+ ExecutorService executor = Executors.newFixedThreadPool(2);
+ executor.execute(timerJobExecutor);
+ executor.execute(timerScheduler);
+ Thread.sleep(1500); // executor doesn't guarantee you it'll run immediately
+ Assert.assertTrue(timerJobExecutor.isRunning());
+ Assert.assertTrue(timerScheduler.isRunning());
+
+ //start process
+ StatefulKnowledgeSession ksession = createSession(environmentBeanName, knowledgeBaseBeanName, knowledgeStoreServiceBeanName, sessionConfiguratorBeanName, mainApplicationContext);
+ int sessionId = ksession.getId();
+ long processId = ksession.startProcess("timerProcess").getId();
+ ksession.dispose();
+
+ Thread.sleep(5000);
+
+ //close everything
+ timerJobExecutor.cancel();
+ timerScheduler.cancel();
+ executorApplicationContext.close();
+ schedulerApplicationContext.close();
+ mainApplicationContext.close();
+ }
+
+
+ private StatefulKnowledgeSession createSession(String envName, String kbaseName, String kstoreName, String sessionConfiguratorBeanName, ApplicationContext sessionContext) {
+ Environment env = (Environment) sessionContext.getBean(envName);
+ KnowledgeStoreService kstore = (KnowledgeStoreService) sessionContext.getBean(kstoreName);
+ KnowledgeBase kbase = (KnowledgeBase) sessionContext.getBean(kbaseName);
+ StatefulKnowledgeSession ksession = kstore.newStatefulKnowledgeSession(kbase, null, env);
+ KnowledgeSessionRuntimeConfigurator sessionConfigurator = (KnowledgeSessionRuntimeConfigurator) sessionContext.getBean(sessionConfiguratorBeanName);
+ sessionConfigurator.configure(ksession);
+ return ksession;
+ }
+
+ private AbstractApplicationContext createSchedulerApplicationContext() {
+ return new ClassPathXmlApplicationContext("classpath:/schedulerContext.xml");
+ }
+
+ private AbstractApplicationContext createMainApplicationContext(String sessionContextLocation) {
+ return new ClassPathXmlApplicationContext(new String[]{
+ sessionContextLocation,
+ "classpath:/hornetq-context.xml"
+ });
+ }
+
+ private AbstractApplicationContext createExecutorApplicationContext(String sessionContextLocation) {
+ PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer();
+ Properties properties = new Properties();
+ properties.setProperty( "sessioncontext.location", sessionContextLocation );
+ configurer.setProperties( properties );
+ ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext();
+ context.addBeanFactoryPostProcessor(configurer);
+ context.setConfigLocation("classpath:/executorContext.xml");
+ context.refresh();
+
+ return context;
+ }
+}
Property changes on: labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/java/org/drools/timer/test/PersistentTimerProcessTest.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/META-INF/orm.xml
===================================================================
--- labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/META-INF/orm.xml (rev 0)
+++ labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/META-INF/orm.xml 2010-08-12 06:46:28 UTC (rev 34661)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
+ version="1.0">
+ <named-query name="ProcessInstancesWaitingForEvent">
+ <query>
+select
+ processInstanceInfo.processInstanceId
+from
+ ProcessInstanceInfo processInstanceInfo
+where
+ :type in elements(processInstanceInfo.eventTypes)
+ </query>
+ </named-query>
+</entity-mappings>
Property changes on: labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/META-INF/orm.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/META-INF/persistence.xml
===================================================================
--- labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/META-INF/persistence.xml (rev 0)
+++ labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/META-INF/persistence.xml 2010-08-12 06:46:28 UTC (rev 34661)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"
+ xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
+ http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd">
+
+ <persistence-unit name="org.drools.persistence.jpa.local" transaction-type="RESOURCE_LOCAL">
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
+ <!--
+ <jta-data-source>jdbc/testDS1</jta-data-source>
+ -->
+ <class>org.drools.persistence.session.SessionInfo</class>
+ <class>org.drools.persistence.processinstance.ProcessInstanceInfo</class>
+ <class>org.drools.persistence.processinstance.variabletypes.JPAPersistedVariable</class>
+ <class>org.drools.persistence.processinstance.variabletypes.VariableInstanceInfo</class>
+ <class>org.drools.persistence.processinstance.variabletypes.SerializablePersistedVariable</class>
+ <class>org.drools.persistence.processinstance.WorkItemInfo</class>
+
+ <properties>
+ <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />
+ <!--property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect"/-->
+ <!--property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/-->
+
+ <property name="hibernate.max_fetch_depth" value="3" />
+ <property name="hibernate.hbm2ddl.auto" value="create" />
+ <property name="hibernate.show_sql" value="false" />
+
+ <!--
+ <property name="hibernate.connection.autocommit" value="false" />
+ <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.BTMTransactionManagerLookup" />
+ -->
+ </properties>
+ </persistence-unit>
+</persistence>
Property changes on: labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/META-INF/persistence.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/hornetq-context.xml
===================================================================
--- labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/hornetq-context.xml (rev 0)
+++ labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/hornetq-context.xml 2010-08-12 06:46:28 UTC (rev 34661)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context" xmlns:util="http://www.springframework.org/schema/util"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
+ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
+
+ <!-- start HornetQ server -->
+ <bean id="hornetQServer" class="org.hornetq.core.server.HornetQServers" factory-method="newHornetQServer"
+ init-method="start" destroy-method="stop">
+ <constructor-arg>
+ <bean class="org.hornetq.core.config.impl.ConfigurationImpl">
+ <property name="persistenceEnabled" value="false" />
+ <property name="securityEnabled" value="false" />
+ <property name="clustered" value="false" />
+ <property name="queueConfigurations">
+ <list>
+ <bean class="org.hornetq.core.server.cluster.QueueConfiguration">
+ <constructor-arg name="address" value="executeTimerMessages" />
+ <constructor-arg name="name" value="executeTimerMessages" />
+ <constructor-arg name="filterString"><null/></constructor-arg>
+ <constructor-arg name="durable" value="true" />
+ </bean>
+ <bean class="org.hornetq.core.server.cluster.QueueConfiguration">
+ <constructor-arg name="address" value="timerServiceMessages"/>
+ <constructor-arg name="name" value="timerServiceMessages"/>
+ <constructor-arg name="filterString"><null/></constructor-arg>
+ <constructor-arg name="durable" value="true"/>
+ </bean>
+ </list>
+ </property>
+ <property name="acceptorConfigurations">
+ <set>
+ <bean class="org.hornetq.api.core.TransportConfiguration">
+ <constructor-arg>
+ <value>org.hornetq.integration.transports.netty.NettyAcceptorFactory</value>
+ </constructor-arg>
+ <constructor-arg>
+ <map>
+ <entry>
+ <key>
+ <util:constant static-field="org.hornetq.integration.transports.netty.TransportConstants.PORT_PROP_NAME" />
+ </key>
+ <value>5446</value>
+ </entry>
+ </map>
+ </constructor-arg>
+ </bean>
+ </set>
+ </property>
+ </bean>
+ </constructor-arg>
+ </bean>
+</beans>
\ No newline at end of file
Property changes on: labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/hornetq-context.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/log4j.xml
===================================================================
--- labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/log4j.xml (rev 0)
+++ labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/log4j.xml 2010-08-12 06:46:28 UTC (rev 34661)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+<!-- $Id: log4j.xml,v 1.8 2006/04/26 17:29:10 gavin Exp $ -->
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%-5p %d{dd-MM HH:mm:ss,SSS} (%F:%M:%L) \t %m%n"/>
+ </layout>
+ </appender>
+ <logger name="org.drools">
+ <level value="DEBUG"/>
+ </logger>
+ <logger name="org.hibernate.SQL">
+ <level value="DEBUG"/>
+ </logger>
+ <root>
+ <priority value="ERROR"/>
+ <appender-ref ref="CONSOLE"/>
+ </root>
+</log4j:configuration>
Property changes on: labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/log4j.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/timerProcess.rf
===================================================================
--- labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/timerProcess.rf (rev 0)
+++ labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/timerProcess.rf 2010-08-12 06:46:28 UTC (rev 34661)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<process xmlns="http://drools.org/drools-5.0/process"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
+ xs:schemaLocation="http://drools.org/drools-5.0/process drools-processes-5.0.xsd"
+ type="RuleFlow" name="org.drools.timer.TimerProcess" id="timerProcess" package-name="org.drools.timer" version="1" >
+
+ <header>
+ <imports>
+ <import name="org.drools.job.executor.timer.Buddy" />
+ </imports>
+ </header>
+
+ <nodes>
+ <start id="1" name="Start" x="96" y="96" width="48" height="48" />
+ <timerNode id="2" name="Timer" x="228" y="96" width="48" height="48" delay="800ms" period="200ms" />
+ <actionNode id="3" name="Action" x="348" y="96" width="80" height="48" >
+ <action type="expression" dialect="java" >System.out.println("Triggered");
+insert( new Buddy() );</action>
+ </actionNode>
+ <milestone id="4" name="Wait" x="504" y="96" width="80" height="48" >
+ <constraint type="rule" dialect="mvel" >Number( intValue >= 5 ) from accumulate ( b: Buddy( ), count( b ) )</constraint>
+ </milestone>
+ <end id="5" name="End" x="648" y="96" width="48" height="48" />
+ </nodes>
+
+ <connections>
+ <connection from="1" to="2" />
+ <connection from="2" to="3" />
+ <connection from="3" to="4" />
+ <connection from="4" to="5" />
+ </connections>
+
+</process>
\ No newline at end of file
Property changes on: labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/timerProcess.rf
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/timerProcessSession.xml
===================================================================
--- labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/timerProcessSession.xml (rev 0)
+++ labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/timerProcessSession.xml 2010-08-12 06:46:28 UTC (rev 34661)
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans
+ xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:util="http://www.springframework.org/schema/util"
+ xmlns:drools="http://drools.org/schema/drools-spring"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
+ http://drools.org/schema/drools-spring http://drools.org/schema/drools-spring.xsd">
+
+
+ <!-- drools configuration -->
+
+ <bean id="sessionConfigurator" class="org.drools.core.util.KnowledgeSessionRuntimeConfiguratorImpl">
+ <property name="workItemHandlers">
+ <map>
+ <entry key="nothing">
+ <bean class="org.drools.process.instance.impl.demo.DoNothingWorkItemHandler" />
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+ <drools:kstore id="kstore" />
+
+ <drools:connection id="connection1" type="local" />
+ <drools:execution-node id="node1" connection="connection1" />
+
+ <drools:kbase id="kbase">
+ <drools:resources>
+ <drools:resource type="DRF" source="classpath:timerProcess.rf" />
+ </drools:resources>
+ </drools:kbase>
+
+ <bean id="env" class="org.drools.container.spring.beans.EnvironmentFactoryBean">
+ <property name="environment">
+ <map>
+ <entry>
+ <key>
+ <util:constant static-field="org.drools.runtime.EnvironmentName.ENTITY_MANAGER_FACTORY"/>
+ </key>
+ <ref bean="entityManagerFactory"/>
+ </entry>
+ <entry>
+ <key>
+ <util:constant static-field="org.drools.runtime.EnvironmentName.TRANSACTION_MANAGER"/>
+ </key>
+ <ref bean="transactionManager"/>
+ </entry>
+ <entry>
+ <key>
+ <util:constant static-field="org.drools.runtime.EnvironmentName.GLOBALS"/>
+ </key>
+ <bean class="org.drools.base.MapGlobalResolver"/>
+ </entry>
+ <entry>
+ <key>
+ <util:constant static-field="org.drools.runtime.EnvironmentName.PROCESS_TIMER_STRATEGY"/>
+ </key>
+ <bean class="org.drools.job.executor.timer.MockProcessTimerPersistenceStrategy" />
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+ <!-- persistence configuration -->
+ <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
+ <property name="driverClassName" value="org.h2.Driver" />
+ <property name="url" value="jdbc:h2:tcp://localhost/persistentTimersTest" />
+ <property name="username" value="sa" />
+ <property name="password" value="" />
+ </bean>
+
+ <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+ <property name="dataSource" ref="dataSource" />
+ <property name="persistenceUnitName" value="org.drools.persistence.jpa.local" />
+ </bean>
+
+ <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
+ <property name="entityManagerFactory" ref="entityManagerFactory" />
+ </bean>
+</beans>
\ No newline at end of file
Property changes on: labs/jbossrules/branches/5_1_20100802_esteban_diega/drools-process/drools-persistent-timer/drools-timer-core/src/test/resources/timerProcessSession.xml
___________________________________________________________________
Name: svn:eol-style
+ native
More information about the jboss-svn-commits
mailing list