[jboss-svn-commits] JBL Code SVN: r7097 - in labs/jbossrules/trunk/drools-compiler/src/test: java/org/drools/integrationtests resources/org/drools/integrationtests
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Oct 25 05:10:55 EDT 2006
Author: mark.proctor at jboss.com
Date: 2006-10-25 05:10:51 -0400 (Wed, 25 Oct 2006)
New Revision: 7097
Modified:
labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/IntegrationCases.java
labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_LogicalAssertionWithExists.drl
Log:
-Fixed testLogicalAssertionsWithExists, did this my doing the retractObject before we update the handle with the potentially new object
Modified: labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/IntegrationCases.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/IntegrationCases.java 2006-10-25 01:31:30 UTC (rev 7096)
+++ labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/IntegrationCases.java 2006-10-25 09:10:51 UTC (rev 7097)
@@ -2975,25 +2975,25 @@
workingMemory.fireAllRules();
// all 3 in europe, so, 2 cheese
- List cheeseList = workingMemory.getObjects( String.class );
+ List cheeseList = workingMemory.getObjects( Cheese.class );
assertEquals( 2,
cheeseList.size() );
// europe=[ 1, 2 ], america=[ 3 ]
p3.setStatus( "america" );
workingMemory.modifyObject( c3FactHandle,
- p3 );
+ p3 );
workingMemory.fireAllRules();
- cheeseList = workingMemory.getObjects( String.class );
+ cheeseList = workingMemory.getObjects( Cheese.class );
assertEquals( 1,
- cheeseList.size() );
+ cheeseList.size() );
// europe=[ 1 ], america=[ 2, 3 ]
p2.setStatus( "america" );
workingMemory.modifyObject( c2FactHandle,
p2 );
workingMemory.fireAllRules();
- cheeseList = workingMemory.getObjects( String.class );
+ cheeseList = workingMemory.getObjects( Cheese.class );
assertEquals( 1,
cheeseList.size() );
@@ -3002,7 +3002,7 @@
workingMemory.modifyObject( c1FactHandle,
p1 );
workingMemory.fireAllRules();
- cheeseList = workingMemory.getObjects( String.class );
+ cheeseList = workingMemory.getObjects( Cheese.class );
assertEquals( 2,
cheeseList.size() );
@@ -3011,7 +3011,7 @@
workingMemory.modifyObject( c2FactHandle,
p2 );
workingMemory.fireAllRules();
- cheeseList = workingMemory.getObjects( String.class );
+ cheeseList = workingMemory.getObjects( Cheese.class );
assertEquals( 1,
cheeseList.size() );
@@ -3020,7 +3020,7 @@
workingMemory.modifyObject( c1FactHandle,
p1 );
workingMemory.fireAllRules();
- cheeseList = workingMemory.getObjects( String.class );
+ cheeseList = workingMemory.getObjects( Cheese.class );
assertEquals( 1,
cheeseList.size() );
@@ -3029,7 +3029,7 @@
workingMemory.modifyObject( c3FactHandle,
p3 );
workingMemory.fireAllRules();
- cheeseList = workingMemory.getObjects( String.class );
+ cheeseList = workingMemory.getObjects( Cheese.class );
assertEquals( 2,
cheeseList.size() );
}
Modified: labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_LogicalAssertionWithExists.drl
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_LogicalAssertionWithExists.drl 2006-10-25 01:31:30 UTC (rev 7096)
+++ labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_LogicalAssertionWithExists.drl 2006-10-25 09:10:51 UTC (rev 7097)
@@ -1,9 +1,9 @@
package org.drools
-rule "Supply cheese for every 2 persons with the same status"
+rule "Supply cheese for for every person when there already exists someone of the same status"
when
p : Person($status : status, $age : age)
exists Person(status == $status, age > $age);
then
- assertLogical(new String("Cheese for person with age " + $age));
+ assertLogical(new Cheese("Cheese for person with age " + $age, 0));
end
\ No newline at end of file
More information about the jboss-svn-commits
mailing list