[jboss-svn-commits] JBL Code SVN: r16541 - in labs/jbossrules/trunk/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 Nov 12 14:03:23 EST 2007
Author: tirelli
Date: 2007-11-12 14:03:22 -0500 (Mon, 12 Nov 2007)
New Revision: 16541
Modified:
labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java
labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_MatchesNotMatches.drl
Log:
JBRULES-1243: adding integration test
Modified: labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java 2007-11-12 18:54:36 UTC (rev 16540)
+++ labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java 2007-11-12 19:03:22 UTC (rev 16541)
@@ -3226,6 +3226,8 @@
12 );
final Cheese stilton2 = new Cheese( "stilton2",
12 );
+ final Cheese agedStilton = new Cheese( "aged stilton",
+ 12 );
final Cheese brie = new Cheese( "brie",
10 );
final Cheese brie2 = new Cheese( "brie2",
@@ -3236,6 +3238,7 @@
10 );
workingMemory.insert( stilton );
workingMemory.insert( stilton2 );
+ workingMemory.insert( agedStilton );
workingMemory.insert( brie );
workingMemory.insert( brie2 );
workingMemory.insert( muzzarella );
@@ -3243,13 +3246,15 @@
workingMemory.fireAllRules();
- assertEquals( 2,
+ assertEquals( 3,
list.size() );
assertEquals( stilton,
list.get( 0 ) );
assertEquals( brie,
list.get( 1 ) );
+ assertEquals( agedStilton,
+ list.get( 2 ) );
}
public void testAutomaticBindings() throws Exception {
@@ -4633,5 +4638,4 @@
}
-
}
\ No newline at end of file
Modified: labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_MatchesNotMatches.drl
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_MatchesNotMatches.drl 2007-11-12 18:54:36 UTC (rev 16540)
+++ labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_MatchesNotMatches.drl 2007-11-12 19:03:22 UTC (rev 16541)
@@ -14,7 +14,16 @@
rule "Cheese not matches"
when
- brie : Cheese( type not matches "(stil.*|mu\w*|brie\d)" )
+ brie : Cheese( type not matches "(stil.*|mu\w*|brie\d|aged.*)" )
then
list.add( brie );
-end
\ No newline at end of file
+end
+
+rule "Cheese matches with space"
+ salience -10
+ when
+ stilton : Cheese( type matches "aged stilton" )
+ then
+ list.add( stilton );
+end
+
More information about the jboss-svn-commits
mailing list