[jboss-svn-commits] JBL Code SVN: r16984 - 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 08:25:26 EST 2007
Author: fmeyer
Date: 2007-12-03 08:25:25 -0500 (Mon, 03 Dec 2007)
New Revision: 16984
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/resources/org/drools/integrationtests/test_MatchesNotMatches.drl
Log:
SOA-193 - Pattern matching does not allow spaces
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 11:53:01 UTC (rev 16983)
+++ labs/jbossrules/branches/Branch_4_0_2_SOA_4_2/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java 2007-12-03 13:25:25 UTC (rev 16984)
@@ -3067,6 +3067,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",
@@ -3077,6 +3079,7 @@
10 );
workingMemory.insert( stilton );
workingMemory.insert( stilton2 );
+ workingMemory.insert( agedStilton );
workingMemory.insert( brie );
workingMemory.insert( brie2 );
workingMemory.insert( muzzarella );
@@ -3084,13 +3087,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 {
@@ -4409,5 +4414,4 @@
0,
list.size() );
}
-
-}
+}
\ No newline at end of file
Modified: labs/jbossrules/branches/Branch_4_0_2_SOA_4_2/drools-compiler/src/test/resources/org/drools/integrationtests/test_MatchesNotMatches.drl
===================================================================
--- labs/jbossrules/branches/Branch_4_0_2_SOA_4_2/drools-compiler/src/test/resources/org/drools/integrationtests/test_MatchesNotMatches.drl 2007-12-03 11:53:01 UTC (rev 16983)
+++ labs/jbossrules/branches/Branch_4_0_2_SOA_4_2/drools-compiler/src/test/resources/org/drools/integrationtests/test_MatchesNotMatches.drl 2007-12-03 13:25:25 UTC (rev 16984)
@@ -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