[jboss-svn-commits] JBL Code SVN: r18509 - 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
Tue Feb 19 09:29:37 EST 2008


Author: tirelli
Date: 2008-02-19 09:29:36 -0500 (Tue, 19 Feb 2008)
New Revision: 18509

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-1278: adding test case

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	2008-02-19 14:28:40 UTC (rev 18508)
+++ labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java	2008-02-19 14:29:36 UTC (rev 18509)
@@ -3303,6 +3303,10 @@
                                               10 );
         final Cheese muzzarella2 = new Cheese( "muzzarella2",
                                                10 );
+        final Cheese provolone = new Cheese( "provolone",
+                                              10 );
+        final Cheese provolone2 = new Cheese( "another cheese (provolone)",
+                                               10 );
         workingMemory.insert( stilton );
         workingMemory.insert( stilton2 );
         workingMemory.insert( agedStilton );
@@ -3310,10 +3314,13 @@
         workingMemory.insert( brie2 );
         workingMemory.insert( muzzarella );
         workingMemory.insert( muzzarella2 );
+        workingMemory.insert( provolone );
+        workingMemory.insert( provolone2 );
 
         workingMemory.fireAllRules();
 
-        assertEquals( 3,
+        System.out.println(list.toString());
+        assertEquals( 4,
                       list.size() );
 
         assertEquals( stilton,
@@ -3322,6 +3329,8 @@
                       list.get( 1 ) );
         assertEquals( agedStilton,
                       list.get( 2 ) );
+        assertEquals( provolone,
+                      list.get( 3 ) );
     }
 
     public void testAutomaticBindings() throws Exception {

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	2008-02-19 14:28:40 UTC (rev 18508)
+++ labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_MatchesNotMatches.drl	2008-02-19 14:29:36 UTC (rev 18509)
@@ -14,7 +14,7 @@
 
 rule "Cheese not matches"
     when
-        brie : Cheese( type not matches "(stil.*|mu\w*|brie\d|aged.*)" )
+        brie : Cheese( type not matches "(stil.*|mu\w*|brie\d|aged.*|.*prov.*)" )
     then
 		list.add( brie );
 end   
@@ -27,3 +27,10 @@
 		list.add( stilton );
 end   
 
+rule "Cheese matches with ^ and escaped s"
+	salience -20
+    when
+        prov : Cheese( type matches "^provolone\s*" )
+    then
+		list.add( prov );
+end   




More information about the jboss-svn-commits mailing list