[jboss-svn-commits] JBL Code SVN: r10990 - 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
Sun Apr 15 21:32:41 EDT 2007
Author: mark.proctor at jboss.com
Date: 2007-04-15 21:32:40 -0400 (Sun, 15 Apr 2007)
New Revision: 10990
Added:
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/rule_with_expander_dsl_more.drl
Removed:
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/rule_with_expander_dsl_more.drl
Log:
JBRULES-795 Refactor IntegrationCases into a number of other categorised classes
-refactored IntegrationCases into TruthMaintenanceTest, DslTest, DynamicRulesTest,
ExecutionFlowControlTest, FirstOrderLogicTest and MiscTest
Copied: labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/compiler/HelloWorld.drl (from rev 10946, labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/HelloWorld.drl)
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/compiler/HelloWorld.drl (rev 0)
+++ labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/compiler/HelloWorld.drl 2007-04-16 01:32:40 UTC (rev 10990)
@@ -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/compiler/rule_with_expander_dsl.drl (from rev 10946, 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/compiler/rule_with_expander_dsl.drl (rev 0)
+++ labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/compiler/rule_with_expander_dsl.drl 2007-04-16 01:32:40 UTC (rev 10990)
@@ -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/compiler/rule_with_expander_dsl_more.drl (from rev 10946, labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/rule_with_expander_dsl_more.drl)
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/compiler/rule_with_expander_dsl_more.drl (rev 0)
+++ labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/compiler/rule_with_expander_dsl_more.drl 2007-04-16 01:32:40 UTC (rev 10990)
@@ -0,0 +1,23 @@
+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
+ #both of these should stop it from firing
+ person with eval
+ >cheese : Cheese() eval(cheese.getType().equals( "brie" ) )
+ then
+ >messages.add("fired");
+end
+
Deleted: labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/HelloWorld.drl
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/HelloWorld.drl 2007-04-16 01:26:29 UTC (rev 10989)
+++ labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/HelloWorld.drl 2007-04-16 01:32:40 UTC (rev 10990)
@@ -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/integrationtests/rule_with_expander_dsl.drl
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/rule_with_expander_dsl.drl 2007-04-16 01:26:29 UTC (rev 10989)
+++ labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/rule_with_expander_dsl.drl 2007-04-16 01:32:40 UTC (rev 10990)
@@ -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/integrationtests/rule_with_expander_dsl_more.drl
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/rule_with_expander_dsl_more.drl 2007-04-16 01:26:29 UTC (rev 10989)
+++ labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/rule_with_expander_dsl_more.drl 2007-04-16 01:32:40 UTC (rev 10990)
@@ -1,23 +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
- #both of these should stop it from firing
- person with eval
- >cheese : Cheese() eval(cheese.getType().equals( "brie" ) )
- then
- >messages.add("fired");
-end
-
More information about the jboss-svn-commits
mailing list