[jboss-svn-commits] JBL Code SVN: r10993 - in labs/jbossrules/trunk/drools-compiler/src/test: resources/org/drools/compiler and 1 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sun Apr 15 22:30:46 EDT 2007


Author: mark.proctor at jboss.com
Date: 2007-04-15 22:30:46 -0400 (Sun, 15 Apr 2007)
New Revision: 10993

Added:
   labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/HelloWorld.drl
   labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/rule_with_expander_dsl.drl
   labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_expander.dsl
Removed:
   labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/compiler/HelloWorld.drl
   labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/compiler/rule_with_expander_dsl.drl
   labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/compiler/test_expander.dsl
Modified:
   labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/compiler/RuleBaseLoaderTest.java
Log:
JBRULES-795 Refactor IntegrationCases into a number of other categorised classes
-rejigging some of the resources, that where in the wrong directories.

Modified: labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/compiler/RuleBaseLoaderTest.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/compiler/RuleBaseLoaderTest.java	2007-04-16 02:25:21 UTC (rev 10992)
+++ labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/compiler/RuleBaseLoaderTest.java	2007-04-16 02:30:46 UTC (rev 10993)
@@ -6,18 +6,19 @@
 import junit.framework.TestCase;
 
 import org.drools.RuleBase;
+import org.drools.integrationtests.DslTest;
 
 public class RuleBaseLoaderTest extends TestCase {
 
     public void testLoadRuleBase() throws Exception {
-        final InputStream in = RuleBaseLoaderTest.class.getResourceAsStream( "HelloWorld.drl" );
+        final InputStream in = DslTest.class.getResourceAsStream( "HelloWorld.drl" );
         final RuleBase rb = RuleBaseLoader.getInstance().loadFromReader( new InputStreamReader( in ) );
         assertNotNull( rb );
     }
 
     public void testLoadRuleBaseWithDSL() throws Exception {
-        final InputStream in = RuleBaseLoaderTest.class.getResourceAsStream( "rule_with_expander_dsl.drl" );
-        final InputStream inDSL = RuleBaseLoaderTest.class.getResourceAsStream( "test_expander.dsl" );
+        final InputStream in = DslTest.class.getResourceAsStream( "rule_with_expander_dsl.drl" );
+        final InputStream inDSL = DslTest.class.getResourceAsStream( "test_expander.dsl" );
         final RuleBase rb = RuleBaseLoader.getInstance().loadFromReader( new InputStreamReader( in ),
                                                                          new InputStreamReader( inDSL ) );
         assertNotNull( rb );

Deleted: labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/compiler/HelloWorld.drl
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/compiler/HelloWorld.drl	2007-04-16 02:25:21 UTC (rev 10992)
+++ labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/compiler/HelloWorld.drl	2007-04-16 02:30:46 UTC (rev 10993)
@@ -1,29 +0,0 @@
-package HelloWorld
- 
-#we don't use the import, as class is fully qualified below 
-#import org.drools.integrationtests.helloworld.Message
-
-global java.util.List list;
-
-rule "Hello World"
-	when
-		$m : org.drools.integrationtests.helloworld.Message(list contains "hello", 
-					text:message == "hola", 
-					number > 40, 
-					birthday > "10-Jul-1974", 
-					message matches ".*ho.*",
-					list excludes "wax")
-	then
-	    // putting in a complex consequence, to make sure it picks up the variabels correctly
-		if (1==1)  {
-			int a = 0;
-		}
-		try {
-			//System.out.println("hello world with collections " + $m.getMessage());
-	    } catch  ( Exception e ) {
-	    
-	    } finally {
-	        list.add( $m );
-	    }
-		$m.setFired(true); 
-end

Deleted: labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/compiler/rule_with_expander_dsl.drl
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/compiler/rule_with_expander_dsl.drl	2007-04-16 02:25:21 UTC (rev 10992)
+++ labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/compiler/rule_with_expander_dsl.drl	2007-04-16 02:30:46 UTC (rev 10993)
@@ -1,26 +0,0 @@
-package test
-
-#must be in the following order.
-import org.drools.Person
-import org.drools.Cheese
-
-#refer to test_expander.dsl
-expander test_expander.dsl
-
-global java.util.List messages;
-
-
-
-
-rule "my rule"
-	when
-		#Person(name=="Bob", likes=="stilton")
-		#Cheese(type=="stilton")
-		There is a person with the name of Bob who likes "http://foo.bar"
-		There is some stilton cheese available
-		
-	then
-		Add the message "We have a winner"
-		#messages.add("We have a winner");
-end
-

Deleted: labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/compiler/test_expander.dsl
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/compiler/test_expander.dsl	2007-04-16 02:25:21 UTC (rev 10992)
+++ labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/compiler/test_expander.dsl	2007-04-16 02:30:46 UTC (rev 10993)
@@ -1,5 +0,0 @@
-#some description
-[when]There is a person with the name of {name} who likes {cheese}=Person(name=="{name}", likes=={cheese})
-[when]There is some {cheese} cheese available=Cheese(type=="{cheese}")
-[then]Add the message {message}=messages.add({message});
-[when]person with eval=p : Person() eval(p.getName().equals("fire"))

Copied: labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/HelloWorld.drl (from rev 10991, labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/compiler/HelloWorld.drl)
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/HelloWorld.drl	                        (rev 0)
+++ labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/HelloWorld.drl	2007-04-16 02:30:46 UTC (rev 10993)
@@ -0,0 +1,29 @@
+package HelloWorld
+ 
+#we don't use the import, as class is fully qualified below 
+#import org.drools.integrationtests.helloworld.Message
+
+global java.util.List list;
+
+rule "Hello World"
+	when
+		$m : org.drools.integrationtests.helloworld.Message(list contains "hello", 
+					text:message == "hola", 
+					number > 40, 
+					birthday > "10-Jul-1974", 
+					message matches ".*ho.*",
+					list excludes "wax")
+	then
+	    // putting in a complex consequence, to make sure it picks up the variabels correctly
+		if (1==1)  {
+			int a = 0;
+		}
+		try {
+			//System.out.println("hello world with collections " + $m.getMessage());
+	    } catch  ( Exception e ) {
+	    
+	    } finally {
+	        list.add( $m );
+	    }
+		$m.setFired(true); 
+end

Copied: labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/rule_with_expander_dsl.drl (from rev 10991, labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/compiler/rule_with_expander_dsl.drl)
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/rule_with_expander_dsl.drl	                        (rev 0)
+++ labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/rule_with_expander_dsl.drl	2007-04-16 02:30:46 UTC (rev 10993)
@@ -0,0 +1,26 @@
+package test
+
+#must be in the following order.
+import org.drools.Person
+import org.drools.Cheese
+
+#refer to test_expander.dsl
+expander test_expander.dsl
+
+global java.util.List messages;
+
+
+
+
+rule "my rule"
+	when
+		#Person(name=="Bob", likes=="stilton")
+		#Cheese(type=="stilton")
+		There is a person with the name of Bob who likes "http://foo.bar"
+		There is some stilton cheese available
+		
+	then
+		Add the message "We have a winner"
+		#messages.add("We have a winner");
+end
+

Copied: labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_expander.dsl (from rev 10992, labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/compiler/test_expander.dsl)
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_expander.dsl	                        (rev 0)
+++ labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_expander.dsl	2007-04-16 02:30:46 UTC (rev 10993)
@@ -0,0 +1,5 @@
+#some description
+[when]There is a person with the name of {name} who likes {cheese}=Person(name=="{name}", likes=={cheese})
+[when]There is some {cheese} cheese available=Cheese(type=="{cheese}")
+[then]Add the message {message}=messages.add({message});
+[when]person with eval=p : Person() eval(p.getName().equals("fire"))




More information about the jboss-svn-commits mailing list