[jboss-svn-commits] JBL Code SVN: r20346 - labs/jbossrules/branches/parser-rewrite/drools-compiler/src/test/java/org/drools/lang.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Jun 5 22:31:03 EDT 2008


Author: porcelli
Date: 2008-06-05 22:31:03 -0400 (Thu, 05 Jun 2008)
New Revision: 20346

Modified:
   labs/jbossrules/branches/parser-rewrite/drools-compiler/src/test/java/org/drools/lang/TestDRL.java
   labs/jbossrules/branches/parser-rewrite/drools-compiler/src/test/java/org/drools/lang/TestTree2TestDRL.java
   labs/jbossrules/branches/parser-rewrite/drools-compiler/src/test/java/org/drools/lang/gUnitTest.testsuite
   labs/jbossrules/branches/parser-rewrite/drools-compiler/src/test/java/org/drools/lang/gUnitTreeWalkerTest.testsuite
Log:
Tests updted for pluggable operators (added grave accent).

Modified: labs/jbossrules/branches/parser-rewrite/drools-compiler/src/test/java/org/drools/lang/TestDRL.java
===================================================================
--- labs/jbossrules/branches/parser-rewrite/drools-compiler/src/test/java/org/drools/lang/TestDRL.java	2008-06-05 22:19:46 UTC (rev 20345)
+++ labs/jbossrules/branches/parser-rewrite/drools-compiler/src/test/java/org/drools/lang/TestDRL.java	2008-06-06 02:31:03 UTC (rev 20346)
@@ -749,8 +749,8 @@
 	}
 
 	public void testCompilation_unit83() throws Exception {
-		// test input: "package org.drools;\n\nrule \"test pluggable operators\"\nwhen\n    $a : EventA()\n    $b : EventB( this after[1,10] $a )\n    $c : EventC( this finishes $b )\n    $d : EventD( this not starts $a )\n    $e : EventE( this not before [1, 10] $b )\nthen\nend"
-		Object retval = execParser("compilation_unit", "package org.drools;\n\nrule \"test pluggable operators\"\nwhen\n    $a : EventA()\n    $b : EventB( this after[1,10] $a )\n    $c : EventC( this finishes $b )\n    $d : EventD( this not starts $a )\n    $e : EventE( this not before [1, 10] $b )\nthen\nend", false);
+		// test input: "package org.drools;\n\nrule \"test pluggable operators\"\nwhen\n    $a : EventA()\n    $b : EventB( this `after[1,10] $a )\n    $c : EventC( this finishes $b )\n    $d : EventD( this not starts $a )\n    $e : EventE( this not `before [1, 10] $b )\nthen\nend"
+		Object retval = execParser("compilation_unit", "package org.drools;\n\nrule \"test pluggable operators\"\nwhen\n    $a : EventA()\n    $b : EventB( this `after[1,10] $a )\n    $c : EventC( this finishes $b )\n    $d : EventD( this not starts $a )\n    $e : EventE( this not `before [1, 10] $b )\nthen\nend", false);
 		Object actual = examineParserExecResult(10, retval);
 		Object expecting = "(VT_COMPILATION_UNIT (package (VT_PACKAGE_ID org drools)) (rule \"test pluggable operators\" when (VT_AND_IMPLICIT (VT_PATTERN (VT_FACT_BINDING $a (VT_FACT (VT_PATTERN_TYPE EventA)))) (VT_PATTERN (VT_FACT_BINDING $b (VT_FACT (VT_PATTERN_TYPE EventB) (VT_FIELD (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT this)) (after [1,10] (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT $a))))))) (VT_PATTERN (VT_FACT_BINDING $c (VT_FACT (VT_PATTERN_TYPE EventC) (VT_FIELD (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT this)) (finishes (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT $b))))))) (VT_PATTERN (VT_FACT_BINDING $d (VT_FACT (VT_PATTERN_TYPE EventD) (VT_FIELD (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT this)) (starts not (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT $a))))))) (VT_PATTERN (VT_FACT_BINDING $e (VT_FACT (VT_PATTERN_TYPE EventE) (VT_FIELD (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT this)) (before not [1, 10] (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT $b)))))))) then\nend))";
 
@@ -1415,8 +1415,8 @@
 	}
 
 	public void testNormal_lhs_block157() throws Exception {
-		// test input: "\n\t\t    $a : EventA()\n\t\t    $b : EventB( this after[1,10] $a )\n\t\t    $c : EventC( this finishes $b )\n\t\t    $d : EventD( this not starts $a )\n\t\t    $e : EventE( this not before [1, 10] $b )\n\t\t\t"
-		Object retval = execParser("normal_lhs_block", "\n\t\t    $a : EventA()\n\t\t    $b : EventB( this after[1,10] $a )\n\t\t    $c : EventC( this finishes $b )\n\t\t    $d : EventD( this not starts $a )\n\t\t    $e : EventE( this not before [1, 10] $b )\n\t\t\t", false);
+		// test input: "\n\t\t    $a : EventA()\n\t\t    $b : EventB( this `after[1,10] $a )\n\t\t    $c : EventC( this finishes $b )\n\t\t    $d : EventD( this not starts $a )\n\t\t    $e : EventE( this not `before [1, 10] $b )\n\t\t\t"
+		Object retval = execParser("normal_lhs_block", "\n\t\t    $a : EventA()\n\t\t    $b : EventB( this `after[1,10] $a )\n\t\t    $c : EventC( this finishes $b )\n\t\t    $d : EventD( this not starts $a )\n\t\t    $e : EventE( this not `before [1, 10] $b )\n\t\t\t", false);
 		Object actual = examineParserExecResult(10, retval);
 		Object expecting = "(VT_AND_IMPLICIT (VT_PATTERN (VT_FACT_BINDING $a (VT_FACT (VT_PATTERN_TYPE EventA)))) (VT_PATTERN (VT_FACT_BINDING $b (VT_FACT (VT_PATTERN_TYPE EventB) (VT_FIELD (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT this)) (after [1,10] (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT $a))))))) (VT_PATTERN (VT_FACT_BINDING $c (VT_FACT (VT_PATTERN_TYPE EventC) (VT_FIELD (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT this)) (finishes (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT $b))))))) (VT_PATTERN (VT_FACT_BINDING $d (VT_FACT (VT_PATTERN_TYPE EventD) (VT_FIELD (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT this)) (starts not (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT $a))))))) (VT_PATTERN (VT_FACT_BINDING $e (VT_FACT (VT_PATTERN_TYPE EventE) (VT_FIELD (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT this)) (before not [1, 10] (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT $b))))))))";
 

Modified: labs/jbossrules/branches/parser-rewrite/drools-compiler/src/test/java/org/drools/lang/TestTree2TestDRL.java
===================================================================
--- labs/jbossrules/branches/parser-rewrite/drools-compiler/src/test/java/org/drools/lang/TestTree2TestDRL.java	2008-06-05 22:19:46 UTC (rev 20345)
+++ labs/jbossrules/branches/parser-rewrite/drools-compiler/src/test/java/org/drools/lang/TestTree2TestDRL.java	2008-06-06 02:31:03 UTC (rev 20346)
@@ -749,8 +749,8 @@
 	}
 
 	public void testCompilation_unit_walks_Compilation_unit83() throws Exception {
-		// test input: "package org.drools;\n\nrule \"test pluggable operators\"\nwhen\n    $a : EventA()\n    $b : EventB( this after[1,10] $a )\n    $c : EventC( this finishes $b )\n    $d : EventD( this not starts $a )\n    $e : EventE( this not before [1, 10] $b )\nthen\nend"
-		Object retval = execTreeParser("compilation_unit", "compilation_unit", "package org.drools;\n\nrule \"test pluggable operators\"\nwhen\n    $a : EventA()\n    $b : EventB( this after[1,10] $a )\n    $c : EventC( this finishes $b )\n    $d : EventD( this not starts $a )\n    $e : EventE( this not before [1, 10] $b )\nthen\nend", false);
+		// test input: "package org.drools;\n\nrule \"test pluggable operators\"\nwhen\n    $a : EventA()\n    $b : EventB( this `after[1,10] $a )\n    $c : EventC( this finishes $b )\n    $d : EventD( this not starts $a )\n    $e : EventE( this not `before [1, 10] $b )\nthen\nend"
+		Object retval = execTreeParser("compilation_unit", "compilation_unit", "package org.drools;\n\nrule \"test pluggable operators\"\nwhen\n    $a : EventA()\n    $b : EventB( this `after[1,10] $a )\n    $c : EventC( this finishes $b )\n    $d : EventD( this not starts $a )\n    $e : EventE( this not `before [1, 10] $b )\nthen\nend", false);
 		Object actual = examineParserExecResult(27, retval);
 		Object expecting = "OK";
 		
@@ -1379,8 +1379,8 @@
 	}
 
 	public void testLhs_block_walks_Normal_lhs_block153() throws Exception {
-		// test input: "\n\t\t    $a : EventA()\n\t\t    $b : EventB( this after[1,10] $a )\n\t\t    $c : EventC( this finishes $b )\n\t\t    $d : EventD( this not starts $a )\n\t\t    $e : EventE( this not before [1, 10] $b )\n\t\t\t"
-		Object retval = execTreeParser("lhs_block", "normal_lhs_block", "\n\t\t    $a : EventA()\n\t\t    $b : EventB( this after[1,10] $a )\n\t\t    $c : EventC( this finishes $b )\n\t\t    $d : EventD( this not starts $a )\n\t\t    $e : EventE( this not before [1, 10] $b )\n\t\t\t", false);
+		// test input: "\n\t\t    $a : EventA()\n\t\t    $b : EventB( this `after[1,10] $a )\n\t\t    $c : EventC( this finishes $b )\n\t\t    $d : EventD( this not starts $a )\n\t\t    $e : EventE( this not `before [1, 10] $b )\n\t\t\t"
+		Object retval = execTreeParser("lhs_block", "normal_lhs_block", "\n\t\t    $a : EventA()\n\t\t    $b : EventB( this `after[1,10] $a )\n\t\t    $c : EventC( this finishes $b )\n\t\t    $d : EventD( this not starts $a )\n\t\t    $e : EventE( this not `before [1, 10] $b )\n\t\t\t", false);
 		Object actual = examineParserExecResult(27, retval);
 		Object expecting = "OK";
 		

Modified: labs/jbossrules/branches/parser-rewrite/drools-compiler/src/test/java/org/drools/lang/gUnitTest.testsuite
===================================================================
--- labs/jbossrules/branches/parser-rewrite/drools-compiler/src/test/java/org/drools/lang/gUnitTest.testsuite	2008-06-05 22:19:46 UTC (rev 20345)
+++ labs/jbossrules/branches/parser-rewrite/drools-compiler/src/test/java/org/drools/lang/gUnitTest.testsuite	2008-06-06 02:31:03 UTC (rev 20346)
@@ -1425,10 +1425,10 @@
 rule "test pluggable operators"
 when
     $a : EventA()
-    $b : EventB( this after[1,10] $a )
+    $b : EventB( this `after[1,10] $a )
     $c : EventC( this finishes $b )
     $d : EventD( this not starts $a )
-    $e : EventE( this not before [1, 10] $b )
+    $e : EventE( this not `before [1, 10] $b )
 then
 end>>
 		-> (VT_COMPILATION_UNIT (package (VT_PACKAGE_ID org drools)) (rule "test pluggable operators" when (VT_AND_IMPLICIT (VT_PATTERN (VT_FACT_BINDING $a (VT_FACT (VT_PATTERN_TYPE EventA)))) (VT_PATTERN (VT_FACT_BINDING $b (VT_FACT (VT_PATTERN_TYPE EventB) (VT_FIELD (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT this)) (after [1,10] (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT $a))))))) (VT_PATTERN (VT_FACT_BINDING $c (VT_FACT (VT_PATTERN_TYPE EventC) (VT_FIELD (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT this)) (finishes (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT $b))))))) (VT_PATTERN (VT_FACT_BINDING $d (VT_FACT (VT_PATTERN_TYPE EventD) (VT_FIELD (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT this)) (starts not (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT $a))))))) (VT_PATTERN (VT_FACT_BINDING $e (VT_FACT (VT_PATTERN_TYPE EventE) (VT_FIELD (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT this)) (before not [1, 10] (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT $b)))))))) then
@@ -1865,10 +1865,10 @@
 
 			<<
 		    $a : EventA()
-		    $b : EventB( this after[1,10] $a )
+		    $b : EventB( this `after[1,10] $a )
 		    $c : EventC( this finishes $b )
 		    $d : EventD( this not starts $a )
-		    $e : EventE( this not before [1, 10] $b )
+		    $e : EventE( this not `before [1, 10] $b )
 			>>
 				-> (VT_AND_IMPLICIT (VT_PATTERN (VT_FACT_BINDING $a (VT_FACT (VT_PATTERN_TYPE EventA)))) (VT_PATTERN (VT_FACT_BINDING $b (VT_FACT (VT_PATTERN_TYPE EventB) (VT_FIELD (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT this)) (after [1,10] (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT $a))))))) (VT_PATTERN (VT_FACT_BINDING $c (VT_FACT (VT_PATTERN_TYPE EventC) (VT_FIELD (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT this)) (finishes (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT $b))))))) (VT_PATTERN (VT_FACT_BINDING $d (VT_FACT (VT_PATTERN_TYPE EventD) (VT_FIELD (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT this)) (starts not (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT $a))))))) (VT_PATTERN (VT_FACT_BINDING $e (VT_FACT (VT_PATTERN_TYPE EventE) (VT_FIELD (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT this)) (before not [1, 10] (VT_ACCESSOR_PATH (VT_ACCESSOR_ELEMENT $b))))))))
 

Modified: labs/jbossrules/branches/parser-rewrite/drools-compiler/src/test/java/org/drools/lang/gUnitTreeWalkerTest.testsuite
===================================================================
--- labs/jbossrules/branches/parser-rewrite/drools-compiler/src/test/java/org/drools/lang/gUnitTreeWalkerTest.testsuite	2008-06-05 22:19:46 UTC (rev 20345)
+++ labs/jbossrules/branches/parser-rewrite/drools-compiler/src/test/java/org/drools/lang/gUnitTreeWalkerTest.testsuite	2008-06-06 02:31:03 UTC (rev 20346)
@@ -1216,10 +1216,10 @@
 rule "test pluggable operators"
 when
     $a : EventA()
-    $b : EventB( this after[1,10] $a )
+    $b : EventB( this `after[1,10] $a )
     $c : EventC( this finishes $b )
     $d : EventD( this not starts $a )
-    $e : EventE( this not before [1, 10] $b )
+    $e : EventE( this not `before [1, 10] $b )
 then
 end>>
 		OK
@@ -1622,10 +1622,10 @@
 
 			<<
 		    $a : EventA()
-		    $b : EventB( this after[1,10] $a )
+		    $b : EventB( this `after[1,10] $a )
 		    $c : EventC( this finishes $b )
 		    $d : EventD( this not starts $a )
-		    $e : EventE( this not before [1, 10] $b )
+		    $e : EventE( this not `before [1, 10] $b )
 			>>
 				OK
 




More information about the jboss-svn-commits mailing list