[jboss-svn-commits] JBL Code SVN: r14697 - in labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources: org and 2 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Aug 28 04:31:12 EDT 2007


Author: Rikkola
Date: 2007-08-28 04:31:12 -0400 (Tue, 28 Aug 2007)
New Revision: 14697

Added:
   labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/
   labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/
   labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/
   labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/MissingRangesForDates.drl
   labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/MissingRangesForDoubles.drl
   labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/MissingRangesForInts.drl
   labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/MissingRangesForVariables.drl
   labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/PatternRedundancyTest.drl
   labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/RedundancyLiteralRestrictionTest.drl
   labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/RuleRedundancyTest.drl
   labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/SubsumptionVariableRestrictionTest.drl
Log:
New test resources

Added: labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/MissingRangesForDates.drl
===================================================================
--- labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/MissingRangesForDates.drl	                        (rev 0)
+++ labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/MissingRangesForDates.drl	2007-08-28 08:31:12 UTC (rev 14697)
@@ -0,0 +1,345 @@
+package com.sample
+
+import com.sample.DroolsTest.Message;
+
+#
+# These rules have gaps
+#
+rule "Date range 1a, has gap"
+	when
+		    Foo1( value > "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 2a, has gap"
+	when
+		    Foo2( value >= "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 3a, has gap"
+	when
+		    Foo3( value < "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 4a, has gap"
+	when
+		    Foo4( value <= "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 5a, has gap"
+	when
+		    Foo5( value > "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 5b, has gap"
+	when
+		    Foo5( value == "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 6a, has gap"
+	when
+		    Foo6( value < "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 6b, has gap"
+	when
+		    Foo6( value == "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 7a, has gap"
+	when
+		    Foo7( value < "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 7b, has gap"
+	when
+		    Foo7( value > "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 8a, has gap"
+	when
+		    Foo8( value < "03-Oct-2002" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 8b, has gap"
+	when
+		    Foo8( value > "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 9a, has gap"
+	when
+		    Foo9( value <= "03-Oct-2002" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 9b, has gap"
+	when
+		    Foo9( value > "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 10a, has gap"
+	when
+		    Foo10( value < "03-Oct-2002" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 10b, has gap"
+	when
+		    Foo10( value >= "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 11a, has gap"
+	when
+		    Foo11( value <= "03-Oct-2002" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 11b, has gap"
+	when
+		    Foo11( value >= "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+#
+# Not rules that have gaps.
+#
+
+rule "Date range 12a, has gap"
+	when
+		    not Foo12( value > "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 13a, has gap"
+	when
+		    not Foo13( value >= "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 14a, has gap"
+	when
+		    not Foo14( value < "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 15a, has gap"
+	when
+		    not Foo15( value <= "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 16a, has gap"
+	when
+		    not Foo16( value > "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 16b, has gap"
+	when
+		    not Foo16( value == "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 17a, has gap"
+	when
+		    not Foo17( value < "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 17b, has gap"
+	when
+		    not Foo17( value == "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 18a, has gap"
+	when
+		    not Foo18( value < "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 18b, has gap"
+	when
+		    not Foo18( value > "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 19a, has gap"
+	when
+		    not Foo19( value < "03-Oct-2002" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 19b, has gap"
+	when
+		    not Foo19( value > "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 20a, has gap"
+	when
+		    not Foo20( value <= "03-Oct-2002" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 20b, has gap"
+	when
+		    not Foo20( value > "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 21a, has gap"
+	when
+		    not Foo21( value < "03-Oct-2002" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 21b, has gap"
+	when
+		    not Foo21( value >= "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 22a, has gap"
+	when
+		    not Foo22( value <= "03-Oct-2002" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 22b, has gap"
+	when
+		    not Foo22( value >= "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+#
+# No gaps
+#
+
+rule "Date range 23a, no gap"
+	when
+		    Foo23( value >= "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 23b, no gap"
+	when
+		    Foo23( value < "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 24a, no gap"
+	when
+		    Foo24( value > "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 24b, no gap"
+	when
+		    Foo24( value <= 27-Oct-2007 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 25a, no gap"
+	when
+		    Foo25( value >= "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 25b, no gap"
+	when
+		    Foo25( value <= "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 25a, no gap"
+	when
+		    Foo25( value > "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 25b, no gap"
+	when
+		    Foo25( value == "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 25c, no gap"
+	when
+		    Foo25( value < "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+/* TODO: Rules to cover these kind of situations.
+rule "Date range 26a, no gap"
+	when
+		    Foo26( value > "03-Oct-2002" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Date range 26b, no gap"
+	when
+		    Foo26( value < "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+*/
+

Added: labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/MissingRangesForDoubles.drl
===================================================================
--- labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/MissingRangesForDoubles.drl	                        (rev 0)
+++ labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/MissingRangesForDoubles.drl	2007-08-28 08:31:12 UTC (rev 14697)
@@ -0,0 +1,365 @@
+package com.sample
+
+import com.sample.DroolsTest.Message;
+
+#
+# These rules have gaps
+#
+rule "Double range 1a, has gap"
+	when
+		    Foo1( value > 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 2a, has gap"
+	when
+		    Foo2( value >= 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 3a, has gap"
+	when
+		    Foo3( value < 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 4a, has gap"
+	when
+		    Foo4( value <= 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 5a, has gap"
+	when
+		    Foo5( value > 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 5b, has gap"
+	when
+		    Foo5( value == 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 6a, has gap"
+	when
+		    Foo6( value < 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 6b, has gap"
+	when
+		    Foo6( value == 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 7a, has gap"
+	when
+		    Foo7( value < 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 7b, has gap"
+	when
+		    Foo7( value > 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 8a, has gap"
+	when
+		    Foo8( value < 40.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 8b, has gap"
+	when
+		    Foo8( value > 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 9a, has gap"
+	when
+		    Foo9( value <= 40.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 9b, has gap"
+	when
+		    Foo9( value > 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 10a, has gap"
+	when
+		    Foo10( value < 40.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 10b, has gap"
+	when
+		    Foo10( value >= 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 11a, has gap"
+	when
+		    Foo11( value <= 40.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 11b, has gap"
+	when
+		    Foo11( value >= 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+#
+# Not rules that have gaps.
+#
+
+rule "Double range 12a, has gap"
+	when
+		    not Foo12( value > 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 13a, has gap"
+	when
+		    not Foo13( value >= 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 14a, has gap"
+	when
+		    not Foo14( value < 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 15a, has gap"
+	when
+		    not Foo15( value <= 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 16a, has gap"
+	when
+		    not Foo16( value > 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 16b, has gap"
+	when
+		    not Foo16( value == 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 17a, has gap"
+	when
+		    not Foo17( value < 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 17b, has gap"
+	when
+		    not Foo17( value == 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 18a, has gap"
+	when
+		    not Foo18( value < 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 18b, has gap"
+	when
+		    not Foo18( value > 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 19a, has gap"
+	when
+		    not Foo19( value < 40.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 19b, has gap"
+	when
+		    not Foo19( value > 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 20a, has gap"
+	when
+		    not Foo20( value <= 40.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 20b, has gap"
+	when
+		    not Foo20( value > 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 21a, has gap"
+	when
+		    not Foo21( value < 40.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 21b, has gap"
+	when
+		    not Foo21( value >= 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 22a, has gap"
+	when
+		    not Foo22( value <= 40.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 22b, has gap"
+	when
+		    not Foo22( value >= 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+#
+# No gaps
+#
+
+rule "Double range 23a, no gap"
+	when
+		    Foo23( value >= 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 23b, no gap"
+	when
+		    Foo23( value < 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 24a, no gap"
+	when
+		    Foo24( value > 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 24b, no gap"
+	when
+		    Foo24( value <= 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 25a, no gap"
+	when
+		    Foo25( value >= 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 25b, no gap"
+	when
+		    Foo25( value <= 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 25a, no gap"
+	when
+		    Foo25( value > 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 25b, no gap"
+	when
+		    Foo25( value == 42.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 25c, no gap"
+	when
+		    Foo25( value < 42.0 )
+	then
+		System.out.println( "Test" );
+end
+/* TODO: Rules to cover these kind of situations.
+rule "Double range 26a, no gap"
+	when
+		    Foo26( value > 40.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 26b, no gap"
+	when
+		    Foo26( value < 42.0 )
+	then
+		System.out.println( "Test" );
+end
+*/
+rule "Double range 27a, no gap"
+	when
+		    Foo27( value > 0.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 27b, no gap"
+	when
+		    Foo27( value == 0.0 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Double range 27c, no gap"
+	when
+		    Foo27( value < 0.0 )
+	then
+		System.out.println( "Test" );
+end
+

Added: labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/MissingRangesForInts.drl
===================================================================
--- labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/MissingRangesForInts.drl	                        (rev 0)
+++ labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/MissingRangesForInts.drl	2007-08-28 08:31:12 UTC (rev 14697)
@@ -0,0 +1,360 @@
+package com.sample
+
+import com.sample.DroolsTest.Message;
+
+#
+# These rules have gaps
+#
+rule "Missing int range 1a, warning"
+	when
+		    Foo1warning( value > 42 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing int range 1b, warning"
+	when
+		    Foo1warning( value < 42 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing int range 2a, warning"
+	when
+		    Foo2warning( value > 42 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing int range 2b, warning"
+	when
+		    Foo2warning( value < 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing int range 3a, warning"
+	when
+		    Foo3warning( value >= 42 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing int range 3b, warning"
+	when
+		    Foo3warning( value < 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing int range 4a, warning"
+	when
+		    Foo4warning( value > 42 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing int range 4b, warning"
+	when
+		    Foo4warning( value <= 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing int range 5a, warning"
+	when
+		    Foo5warning( value > 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing int range 5b, warning"
+	when
+		    Foo5warning( value == 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing int range 6a, warning"
+	when
+		    Foo6warning( value < 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing int range 6b, warning"
+	when
+		    Foo6warning( value == 40 )
+	then
+		System.out.println( "Test" );
+end
+
+#
+# These rules have gaps
+#
+rule "Missing not int range 7a, warning"
+	when
+		    not Foo7warning( value > 42 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing not int range 7b, warning"
+	when
+		    not Foo7warning( value < 42 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing not int range 8a, warning"
+	when
+		    not Foo8warning( value > 42 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing not int range 8b, warning"
+	when
+		    not Foo8warning( value < 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing not int range 9a, warning"
+	when
+		    not Foo9warning( value >= 42 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing not int range 9b, warning"
+	when
+		    not Foo9warning( value < 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing not int range 10a, warning"
+	when
+		    not Foo10warning( value > 42 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing not int range 10b, warning"
+	when
+		    not Foo10warning( value <= 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing not int range 11a, warning"
+	when
+		    not Foo11warning( value > 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing not int range 11b, warning"
+	when
+		    not Foo11warning( value == 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing not int range 12a, warning"
+	when
+		    not Foo12warning( value < 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing not int range 12b, warning"
+	when
+		    not Foo12warning( value == 40 )
+	then
+		System.out.println( "Test" );
+end
+
+#
+# These rules do not have gaps
+#
+rule "Missing int range 1a, ok"
+	when
+		    Foo1ok( value >= 42 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing int range 1b, ok"
+	when
+		    Foo1ok( value < 42 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing int range 2a, ok"
+	when
+		    Foo2ok( value > 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing int range 2b, ok"
+	when
+		    Foo2ok( value <= 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing int range 3a, ok"
+	when
+		    Foo3ok( value > 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing int range 3b, ok"
+	when
+		    Foo3ok( value == 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing int range 3c, ok"
+	when
+		    Foo3ok( value < 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing int range 4a, ok"
+	when
+		    Foo4ok( value == 40 )
+	then
+		System.out.println( "Test" );
+end
+rule "Missing int range 4b, ok"
+	when
+		    Foo4ok( value == 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing int range 5a, ok"
+	when
+		    Foo5ok( value > 41 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing int range 5b, ok"
+	when
+		    Foo5ok( value == 41 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing int range 5c, ok"
+	when
+		    Foo5ok( value == 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing int range 5d, ok"
+	when
+		    Foo5ok( value < 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing not int range 6a, ok"
+	when
+		    not Foo6ok( value >= 42 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing not int range 6b, ok"
+	when
+		    not Foo6ok( value < 42 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing not int range 7a, ok"
+	when
+		    not Foo7ok( value > 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing not int range 7b, ok"
+	when
+		    not Foo7ok( value <= 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing not int range 8a, ok"
+	when
+		    not Foo8ok( value > 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing not int range 8b, ok"
+	when
+		    not Foo8ok( value == 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing not int range 8c, ok"
+	when
+		    not Foo8ok( value < 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing not int range 9a, ok"
+	when
+		    not Foo4ok( value == 40 )
+	then
+		System.out.println( "Test" );
+end
+rule "Missing not int range 9b, ok"
+	when
+		    not Foo4ok( value == 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing not int range 10a, ok"
+	when
+		    not Foo10ok( value > 41 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing not int range 10b, ok"
+	when
+		    not Foo10ok( value == 41 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing not int range 10c, ok"
+	when
+		    not Foo10ok( value == 40 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing not int range 10d, ok"
+	when
+		    not Foo10ok( value < 40 )
+	then
+		System.out.println( "Test" );
+end
\ No newline at end of file

Added: labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/MissingRangesForVariables.drl
===================================================================
--- labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/MissingRangesForVariables.drl	                        (rev 0)
+++ labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/MissingRangesForVariables.drl	2007-08-28 08:31:12 UTC (rev 14697)
@@ -0,0 +1,145 @@
+package com.sample
+
+import com.sample.DroolsTest.Message;
+/*
+#
+# These rules have gaps
+#
+rule "Missing variable range 1a, warning"
+	when
+		    $s :Something( )
+		    Foo1w( value > $s.a.b.c.d )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing variable range 1b, warning"
+	when
+		    $s :Something( )
+		    Foo1w( value < $s.a.b.c.d )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing variable range 2a, warning"
+	when
+		    $s :Something( )
+		    Foo2w( value > $s.bar )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing variable range 2b, warning"
+	when
+		    $s :Something( )
+		    Foo2w( value < $s.bar )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing variable range 3a, warning"
+	when
+		    Something( $bar :bar)
+		    Foo3w( value > $bar )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing variable range 3b, warning"
+	when
+		    Something( $bar :bar)
+		    Foo3w( value < $bar )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing variable range 4a, warning"
+	when
+		    Something( $bar :bar)
+		    Foo4w( value > $bar )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing variable range 4b, warning"
+	when
+		    Something( $bar :bar)
+		    Foo4w( value == $bar )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing variable range 5a, warning"
+	when
+		    Something( $bar :bar)
+		    Foo5w( value < $bar )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing variable range 5b, warning"
+	when
+		    Something( $bar :bar)
+		    Foo5w( value == $bar )
+	then
+		System.out.println( "Test" );
+end
+*/
+#
+# These rules have no gaps
+#
+rule "Missing variable range 1a, covers all"
+	when
+		    $s :Something( )
+		    Foo1a( value >= $s.a.b.c.d )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing variable range 1b, covers all"
+	when
+		    $s :Something()
+		    Foo1a( value < $s.a.b.c.d )
+	then
+		System.out.println( "Test" );
+end
+/*
+rule "Missing variable range 2a, covers all"
+	when
+		    $s :Something()
+		    Foo2a( value > $s.bar )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing variable range 2b, covers all"
+	when
+		    $s :Something( )
+		    Foo2a( value =< $s.bar )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing variable range 3a, covers all"
+	when
+		    Something( $bar :bar)
+		    Foo3a( value > $bar )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Missing variable range 3b, covers all"
+	when
+		    Something( $bar :bar)
+		    Foo3a( value == $bar )
+	then
+		System.out.println( "Test" );
+end
+rule "Missing variable range 3c, covers all"
+	when
+		    Something( $bar :bar)
+		    Foo3a( value < $bar )
+	then
+		System.out.println( "Test" );
+end
+*/
\ No newline at end of file

Added: labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/PatternRedundancyTest.drl
===================================================================
--- labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/PatternRedundancyTest.drl	                        (rev 0)
+++ labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/PatternRedundancyTest.drl	2007-08-28 08:31:12 UTC (rev 14697)
@@ -0,0 +1,59 @@
+package com.sample
+
+import com.sample.DroolsTest.Message;
+
+rule "Pattern redundancy 1a"
+	when
+		    Foo1()
+	then
+		System.out.println( "Test" );
+end
+
+rule "Pattern redundancy 1b"
+	when
+		    Foo1()
+	then
+		System.out.println( "Test" );
+end
+
+rule "Pattern redundancy 2a"
+	when
+		    not Foo2()
+	then
+		System.out.println( "Test" );
+end
+
+rule "Pattern redundancy 2b"
+	when
+		    not Foo2()
+	then
+		System.out.println( "Test" );
+end
+
+rule "Pattern redundancy 3a"
+	when
+		    exists Foo3()
+	then
+		System.out.println( "Test" );
+end
+
+rule "Pattern redundancy 3b"
+	when
+		    exists Foo3()
+	then
+		System.out.println( "Test" );
+end
+
+rule "Pattern redundancy 4a"
+	when
+		    forall( Foo4() )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Pattern redundancy 4b"
+	when
+		    forall( Foo4() )
+	then
+		System.out.println( "Test" );
+end

Added: labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/RedundancyLiteralRestrictionTest.drl
===================================================================
--- labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/RedundancyLiteralRestrictionTest.drl	                        (rev 0)
+++ labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/RedundancyLiteralRestrictionTest.drl	2007-08-28 08:31:12 UTC (rev 14697)
@@ -0,0 +1,87 @@
+package com.sample
+
+import com.sample.DroolsTest.Message;
+
+rule "Redundant 1a"
+	when
+		    Foo1( bar == "baz" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Redundant 1b"
+	when
+		    Foo1( bar == "baz" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Redundant 2a"
+	when
+		    Foo2( bar == 123 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Redundant 2b"
+	when
+		    Foo2( bar == 123 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Redundant 3a"
+	when
+		    Foo3( bar == "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Redundant 3b"
+	when
+		    Foo3( bar == "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Redundant 4a"
+	when
+		    Foo4( bar != "baz" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Redundant 4b"
+	when
+		    Foo4( bar != "baz" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Redundant 5a"
+	when
+		    Foo5( bar > 123 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Redundant 5b"
+	when
+		    Foo5( bar > 123 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Redundant 6a"
+	when
+		    Foo6( bar < "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Redundant 6b"
+	when
+		    Foo6( bar < "27-Oct-2007" )
+	then
+		System.out.println( "Test" );
+end
\ No newline at end of file

Added: labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/RuleRedundancyTest.drl
===================================================================
--- labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/RuleRedundancyTest.drl	                        (rev 0)
+++ labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/RuleRedundancyTest.drl	2007-08-28 08:31:12 UTC (rev 14697)
@@ -0,0 +1,67 @@
+package com.sample
+
+import com.sample.DroolsTest.Message;
+
+rule "Rule redundancy 1a"
+	when
+		    Foo1()
+	then
+		System.out.println( "Test" );
+end
+
+rule "Rule redundancy 1b"
+	when
+		    Foo1()
+	then
+		System.out.println( "Test" );
+end
+
+rule "Rule redundancy 2a"
+	salience 100
+	when
+		    Foo2()
+	then
+		System.out.println( "Test" );
+end
+
+rule "Rule redundancy 2b"
+	salience 100
+	when
+		    Foo2()
+	then
+		System.out.println( "Test" );
+end
+
+rule "Rule redundancy 3a"
+	agenda-group "group 1"
+	when
+		    Foo3()
+	then
+		System.out.println( "Test" );
+end
+
+rule "Rule redundancy 3b"
+	agenda-group "group 1"
+	when
+		    Foo3()
+	then
+		System.out.println( "Test" );
+end
+
+rule "Rule redundancy 4a"
+	salience 200
+	agenda-group "group 2"
+	when
+		    Foo4()
+	then
+		System.out.println( "Test" );
+end
+
+rule "Rule redundancy 4b"
+	salience 200
+	agenda-group "group 2"
+	when
+		    Foo4()
+	then
+		System.out.println( "Test" );
+end
\ No newline at end of file

Added: labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/SubsumptionVariableRestrictionTest.drl
===================================================================
--- labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/SubsumptionVariableRestrictionTest.drl	                        (rev 0)
+++ labs/jbossrules/trunk/experimental/drools-analytics/src/test/resources/org/drools/analytics/SubsumptionVariableRestrictionTest.drl	2007-08-28 08:31:12 UTC (rev 14697)
@@ -0,0 +1,37 @@
+package com.sample
+
+import com.sample.DroolsTest.Message;
+
+rule "Redundant 1a"
+	when
+		    $f :Foo1()
+		    Bar1( foo == $f )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Redundant 1b"
+	when
+		    $f :Foo1()
+		    Bar1( foo == $f )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Redundant 2a"
+	when
+		    $f :Foo2()
+		    Bar2( foo == $f && xyz == 123 )
+		    or 
+		    Bar2( foo == $f && xyz == 321 )
+	then
+		System.out.println( "Test" );
+end
+
+rule "Not Redundant 1a"
+	when
+		    $f :Foo1a()
+		    Bar1a( foo == $f && xyz == 123 )
+	then
+		System.out.println( "Test" );
+end




More information about the jboss-svn-commits mailing list