[jboss-svn-commits] JBL Code SVN: r16542 - in labs/jbossrules/branches/4.0.x/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:25:56 EST 2007
Author: tirelli
Date: 2007-11-12 14:25:56 -0500 (Mon, 12 Nov 2007)
New Revision: 16542
Modified:
labs/jbossrules/branches/4.0.x/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java
labs/jbossrules/branches/4.0.x/drools-compiler/src/test/resources/org/drools/integrationtests/test_MatchesNotMatches.drl
Log:
JBRULES-1243: adding integration test
Modified: labs/jbossrules/branches/4.0.x/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java
===================================================================
--- labs/jbossrules/branches/4.0.x/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java 2007-11-12 19:03:22 UTC (rev 16541)
+++ labs/jbossrules/branches/4.0.x/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java 2007-11-12 19:25:56 UTC (rev 16542)
@@ -3144,6 +3144,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",
@@ -3154,6 +3156,7 @@
10 );
workingMemory.insert( stilton );
workingMemory.insert( stilton2 );
+ workingMemory.insert( agedStilton );
workingMemory.insert( brie );
workingMemory.insert( brie2 );
workingMemory.insert( muzzarella );
@@ -3161,13 +3164,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 {
@@ -4551,5 +4556,4 @@
}
-
}
Modified: labs/jbossrules/branches/4.0.x/drools-compiler/src/test/resources/org/drools/integrationtests/test_MatchesNotMatches.drl
===================================================================
--- labs/jbossrules/branches/4.0.x/drools-compiler/src/test/resources/org/drools/integrationtests/test_MatchesNotMatches.drl 2007-11-12 19:03:22 UTC (rev 16541)
+++ labs/jbossrules/branches/4.0.x/drools-compiler/src/test/resources/org/drools/integrationtests/test_MatchesNotMatches.drl 2007-11-12 19:25:56 UTC (rev 16542)
@@ -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