[jboss-svn-commits] JBL Code SVN: r16989 - in labs/jbossrules/branches/Branch_4_0_2_SOA_4_2/drools-compiler/src/test: resources/org/drools/integrationtests and 1 other directory.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Dec 3 13:32:27 EST 2007
Author: fmeyer
Date: 2007-12-03 13:32:27 -0500 (Mon, 03 Dec 2007)
New Revision: 16989
Added:
labs/jbossrules/branches/Branch_4_0_2_SOA_4_2/drools-compiler/src/test/resources/org/drools/integrationtests/test_ActivationCancellation.drl
Modified:
labs/jbossrules/branches/Branch_4_0_2_SOA_4_2/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java
Log:
SOA-201 Activation.remove() is removing the WRONG activation when used in events
Patch related to JBRULES-1268
Modified: labs/jbossrules/branches/Branch_4_0_2_SOA_4_2/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java
===================================================================
--- labs/jbossrules/branches/Branch_4_0_2_SOA_4_2/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java 2007-12-03 15:50:30 UTC (rev 16988)
+++ labs/jbossrules/branches/Branch_4_0_2_SOA_4_2/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java 2007-12-03 18:32:27 UTC (rev 16989)
@@ -232,13 +232,13 @@
} );
workingMemory.fireAllRules();
-
+
assertEquals(1, list.size() );
assertEquals( new Integer( 5 ),
list.get( 0 ) );
}
-
+
public void testCustomGlobalResolverWithWorkingMemoryObject() throws Exception {
final PackageBuilder builder = new PackageBuilder();
builder.addPackageFromDrl( new InputStreamReader( getClass().getResourceAsStream( "test_globalCustomResolver.drl" ) ) );
@@ -256,7 +256,7 @@
list );
map.put( "string",
string );
-
+
workingMemory.setGlobalResolver( new GlobalResolver() {
public Object resolveGlobal(String identifier) {
return map.get( identifier );
@@ -268,25 +268,25 @@
value );
}
- } );
-
+ } );
+
Cheese bree = new Cheese ();
bree.setPrice( 100 );
-
+
workingMemory.insert( bree );
workingMemory.fireAllRules();
- assertEquals(2, list.size() );
-
+ assertEquals(2, list.size() );
+
assertEquals( new Integer( 5 ),
list.get( 0 ) );
-
+
assertEquals( new Integer( 6 ),
- list.get( 1 ) );
+ list.get( 1 ) );
}
-
+
public void testFieldBiningsAndEvalSharing() throws Exception {
final String drl = "test_FieldBindingsAndEvalSharing.drl";
evalSharingTest( drl );
@@ -402,7 +402,7 @@
list.size() );
}
-
+
public void NullFieldOnCompositeSink() throws Exception {
final PackageBuilder builder = new PackageBuilder();
builder.addPackageFromDrl( new InputStreamReader( getClass().getResourceAsStream( "test_NullFieldOnCompositeSink.drl" ) ) );
@@ -411,18 +411,18 @@
// add the package to a rulebase
final RuleBase ruleBase = getRuleBase();
ruleBase.addPackage( pkg );
-
+
WorkingMemory workingMemory = ruleBase.newStatefulSession();
List list = new ArrayList();
workingMemory.setGlobal("list", list);
-
+
workingMemory.insert(new Attribute());
workingMemory.insert(new Message());
workingMemory.fireAllRules();
-
+
assertEquals(1, list.size());
assertEquals("X", list.get(0));
-
+
}
public void testEmptyPattern() throws Exception {
@@ -4348,7 +4348,7 @@
// final PackageBuilder builder2 = new PackageBuilder();
// builder2.addPackageFromDrl( new InputStreamReader( getClass().getResourceAsStream( "test_FinalClass2.drl" ) ) );
// ruleBase.addPackage( builder2.getPackage() );
- //
+ //
// // it will automatically fire the rule
// assertEquals( 2,
// list.size() );
Copied: labs/jbossrules/branches/Branch_4_0_2_SOA_4_2/drools-compiler/src/test/resources/org/drools/integrationtests/test_ActivationCancellation.drl (from rev 15740, labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_ActivationCancellation.drl)
===================================================================
--- labs/jbossrules/branches/Branch_4_0_2_SOA_4_2/drools-compiler/src/test/resources/org/drools/integrationtests/test_ActivationCancellation.drl (rev 0)
+++ labs/jbossrules/branches/Branch_4_0_2_SOA_4_2/drools-compiler/src/test/resources/org/drools/integrationtests/test_ActivationCancellation.drl 2007-12-03 18:32:27 UTC (rev 16989)
@@ -0,0 +1,35 @@
+package foo.bar
+
+import org.drools.Cheese
+
+global java.util.List list
+
+rule "rule1"
+ when
+ c: Cheese()
+ then
+ list.add("rule1");
+
+end
+
+rule "rule2"
+ when
+ c: Cheese()
+ then
+ list.add("rule2");
+end
+
+rule "rule3"
+ when
+ c: Cheese()
+ then
+ list.add("rule3");
+end
+
+rule "rule4"
+ when
+ not Cheese()
+ then
+ list.add("rule4");
+
+end
\ No newline at end of file
More information about the jboss-svn-commits
mailing list