[jboss-svn-commits] JBL Code SVN: r29138 - in labs/jbossrules/branches/salaboy_RelationalVariablePersistence/drools-persistence-jpa/src/test: resources and 1 other directory.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Sep 1 11:39:23 EDT 2009
Author: KrisVerlaenen
Date: 2009-09-01 11:39:23 -0400 (Tue, 01 Sep 2009)
New Revision: 29138
Modified:
labs/jbossrules/branches/salaboy_RelationalVariablePersistence/drools-persistence-jpa/src/test/java/org/drools/persistence/session/VariablePersistenceStrategyTest.java
labs/jbossrules/branches/salaboy_RelationalVariablePersistence/drools-persistence-jpa/src/test/resources/VariablePersistenceStrategyProcess.rf
labs/jbossrules/branches/salaboy_RelationalVariablePersistence/drools-persistence-jpa/src/test/resources/VariablePersistenceStrategyProcessTypeChange.rf
Log:
- extended test case
Modified: labs/jbossrules/branches/salaboy_RelationalVariablePersistence/drools-persistence-jpa/src/test/java/org/drools/persistence/session/VariablePersistenceStrategyTest.java
===================================================================
--- labs/jbossrules/branches/salaboy_RelationalVariablePersistence/drools-persistence-jpa/src/test/java/org/drools/persistence/session/VariablePersistenceStrategyTest.java 2009-09-01 14:44:58 UTC (rev 29137)
+++ labs/jbossrules/branches/salaboy_RelationalVariablePersistence/drools-persistence-jpa/src/test/java/org/drools/persistence/session/VariablePersistenceStrategyTest.java 2009-09-01 15:39:23 UTC (rev 29138)
@@ -33,27 +33,27 @@
protected void setUp() throws Exception {
ds1 = new PoolingDataSource();
ds1.setUniqueName( "jdbc/testDS1" );
-// ds1.setClassName( "org.h2.jdbcx.JdbcDataSource" );
+ ds1.setClassName( "org.h2.jdbcx.JdbcDataSource" );
+ ds1.setMaxPoolSize( 3 );
+ ds1.setAllowLocalTransactions( true );
+ ds1.getDriverProperties().put( "user",
+ "sa" );
+ ds1.getDriverProperties().put( "password",
+ "sasa" );
+ ds1.getDriverProperties().put( "URL",
+ "jdbc:h2:mem:mydb" );
+
+// ds1.setClassName( "org.postgresql.xa.PGXADataSource" );
// ds1.setMaxPoolSize( 3 );
// ds1.setAllowLocalTransactions( true );
// ds1.getDriverProperties().put( "user",
-// "sa" );
+// "salaboy" );
// ds1.getDriverProperties().put( "password",
-// "sasa" );
-// ds1.getDriverProperties().put( "URL",
-// "jdbc:h2:mem:mydb" );
+// "salaboy" );
+// ds1.getDriverProperties().put( "serverName",
+// "localhost:5432/droolsPersistence" );
- ds1.setClassName( "org.postgresql.xa.PGXADataSource" );
- ds1.setMaxPoolSize( 3 );
- ds1.setAllowLocalTransactions( true );
- ds1.getDriverProperties().put( "user",
- "salaboy" );
- ds1.getDriverProperties().put( "password",
- "salaboy" );
- ds1.getDriverProperties().put( "serverName",
- "localhost:5432/droolsPersistence" );
-
ds1.init();
}
@@ -105,12 +105,21 @@
ksession.getWorkItemManager().completeWorkItem( workItem.getId(), null );
workItem = handler.getWorkItem();
+ assertNotNull( workItem );
+
+ ksession = JPAKnowledgeService.loadStatefulKnowledgeSession( id, kbase, null, env );
+ processInstance = ksession.getProcessInstance( processInstance.getId() );
+ assertNotNull( processInstance );
+ ksession.getWorkItemManager().completeWorkItem( workItem.getId(), null );
+
+ workItem = handler.getWorkItem();
assertNull( workItem );
ksession = JPAKnowledgeService.loadStatefulKnowledgeSession( id, kbase, null, env );
processInstance = ksession.getProcessInstance( processInstance.getId() );
assertNull( processInstance );
}
+
public void testPersistenceVariablesWithTypeChange() {
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add( new ClassPathResource( "VariablePersistenceStrategyProcessTypeChange.rf" ), ResourceType.DRF );
Modified: labs/jbossrules/branches/salaboy_RelationalVariablePersistence/drools-persistence-jpa/src/test/resources/VariablePersistenceStrategyProcess.rf
===================================================================
--- labs/jbossrules/branches/salaboy_RelationalVariablePersistence/drools-persistence-jpa/src/test/resources/VariablePersistenceStrategyProcess.rf 2009-09-01 14:44:58 UTC (rev 29137)
+++ labs/jbossrules/branches/salaboy_RelationalVariablePersistence/drools-persistence-jpa/src/test/resources/VariablePersistenceStrategyProcess.rf 2009-09-01 15:39:23 UTC (rev 29138)
@@ -104,15 +104,47 @@
kcontext.setVariable("b", new MyEntity("This is a changed test Entity"));
kcontext.setVariable("c", new MyVariableSerializable("This is a changed test SerializableObject"));</action>
</actionNode>
+ <humanTask id="9" name="Human Task" >
+ <work name="Human Task" >
+ <parameter name="ActorId" >
+ <type name="org.drools.process.core.datatype.impl.type.StringDataType" />
+ </parameter>
+ <parameter name="Comment" >
+ <type name="org.drools.process.core.datatype.impl.type.StringDataType" />
+ </parameter>
+ <parameter name="Content" >
+ <type name="org.drools.process.core.datatype.impl.type.StringDataType" />
+ </parameter>
+ <parameter name="Priority" >
+ <type name="org.drools.process.core.datatype.impl.type.StringDataType" />
+ </parameter>
+ <parameter name="Skippable" >
+ <type name="org.drools.process.core.datatype.impl.type.StringDataType" />
+ </parameter>
+ <parameter name="TaskName" >
+ <type name="org.drools.process.core.datatype.impl.type.StringDataType" />
+ </parameter>
+ </work>
+ </humanTask>
+ <actionNode id="10" name="Action" >
+ <action type="expression" dialect="java" >System.out.println("x = " + x);
+System.out.println("y = " + y);
+System.out.println("z = " + z);
+System.out.println("a = " + a);
+System.out.println("b = " + b);
+System.out.println("c = " + c);</action>
+ </actionNode>
</nodes>
<connections>
- <connection from="8" to="3" />
+ <connection from="10" to="3" />
<connection from="5" to="4" />
<connection from="1" to="5" />
<connection from="4" to="6" />
<connection from="6" to="7" />
<connection from="7" to="8" />
+ <connection from="8" to="9" />
+ <connection from="9" to="10" />
</connections>
</process>
\ No newline at end of file
Modified: labs/jbossrules/branches/salaboy_RelationalVariablePersistence/drools-persistence-jpa/src/test/resources/VariablePersistenceStrategyProcessTypeChange.rf
===================================================================
--- labs/jbossrules/branches/salaboy_RelationalVariablePersistence/drools-persistence-jpa/src/test/resources/VariablePersistenceStrategyProcessTypeChange.rf 2009-09-01 14:44:58 UTC (rev 29137)
+++ labs/jbossrules/branches/salaboy_RelationalVariablePersistence/drools-persistence-jpa/src/test/resources/VariablePersistenceStrategyProcessTypeChange.rf 2009-09-01 15:39:23 UTC (rev 29138)
@@ -25,10 +25,10 @@
<value></value>
</variable>
<variable name="b" >
- <type name="org.drools.process.core.datatype.impl.type.ObjectDataType" className="org.drools.persistence.session.MyEntity" />
+ <type name="org.drools.process.core.datatype.impl.type.ObjectDataType" />
</variable>
<variable name="c" >
- <type name="org.drools.process.core.datatype.impl.type.ObjectDataType" className="org.drools.persistence.session.MyVariableSerializable" />
+ <type name="org.drools.process.core.datatype.impl.type.ObjectDataType" />
</variable>
</variables>
</header>
More information about the jboss-svn-commits
mailing list