[jboss-svn-commits] JBL Code SVN: r13276 - labs/jbossrules/branches/mvel-tooling-2007-06-30/drools-eclipse/drools-eclipse-test/src/test/java/org/drools/eclipse/editors/completion.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Jul 9 17:42:15 EDT 2007
Author: pombredanne
Date: 2007-07-09 17:42:15 -0400 (Mon, 09 Jul 2007)
New Revision: 13276
Modified:
labs/jbossrules/branches/mvel-tooling-2007-06-30/drools-eclipse/drools-eclipse-test/src/test/java/org/drools/eclipse/editors/completion/LocationDeterminatorTest.java
Log:
Splitted failing test on location determination to isolate failure
Modified: labs/jbossrules/branches/mvel-tooling-2007-06-30/drools-eclipse/drools-eclipse-test/src/test/java/org/drools/eclipse/editors/completion/LocationDeterminatorTest.java
===================================================================
--- labs/jbossrules/branches/mvel-tooling-2007-06-30/drools-eclipse/drools-eclipse-test/src/test/java/org/drools/eclipse/editors/completion/LocationDeterminatorTest.java 2007-07-09 21:41:36 UTC (rev 13275)
+++ labs/jbossrules/branches/mvel-tooling-2007-06-30/drools-eclipse/drools-eclipse-test/src/test/java/org/drools/eclipse/editors/completion/LocationDeterminatorTest.java 2007-07-09 21:42:15 UTC (rev 13276)
@@ -7,7 +7,7 @@
/**
* Test to check the location determination when doing code completion inside
* rule condtions.
- *
+ *
* @author <a href="mailto:kris_verlaenen at hotmail.com">kris verlaenen </a>
*
*/
@@ -54,39 +54,39 @@
assertTrue(LocationDeterminator.PATTERN_PATTERN_COMPARATOR_ARGUMENT.matcher("( property == otherProp").matches());
assertTrue(LocationDeterminator.PATTERN_PATTERN_COMPARATOR_ARGUMENT.matcher("(property==otherProp").matches());
}
-
+
public void testCheckLHSLocationDetermination() {
- String input =
+ String input =
"rule MyRule \n" +
" when \n" +
" ";
Location location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class( condition == true ) \n" +
" ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" class: Class( condition == true, condition2 == null ) \n" +
" ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Cl";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class( condition == true ) \n" +
@@ -94,14 +94,14 @@
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" class: Cl";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" class:Cl";
@@ -109,15 +109,15 @@
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
/** Inside of condition: start */
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class (";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( na";
@@ -125,8 +125,8 @@
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("na", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( name.subProperty['test'].subsu";
@@ -134,24 +134,24 @@
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("name.subProperty['test'].subsu", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( condition == true, ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( condition == true, na";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( \n" +
@@ -159,8 +159,8 @@
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( condition == true, \n" +
@@ -168,8 +168,8 @@
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( c: condition, \n" +
@@ -177,33 +177,33 @@
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( name : ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( name: ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( name:";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
-
+
/** Inside of condition: Operator */
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property ";
@@ -211,8 +211,8 @@
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_OPERATOR, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class(property ";
@@ -220,8 +220,8 @@
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_OPERATOR, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( name : property ";
@@ -230,7 +230,7 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class (name:property ";
@@ -239,7 +239,7 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class (name:property ";
@@ -248,7 +248,7 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( name1 : property1, name : property ";
@@ -257,7 +257,7 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( name1 : property1 == \"value\", name : property ";
@@ -266,7 +266,7 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( name1 : property1 == \"value\",property ";
@@ -275,10 +275,10 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
- " Class ( name1 : property1, \n" +
+ " Class ( name1 : property1, \n" +
" name : property ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_OPERATOR, location.getType());
@@ -286,7 +286,7 @@
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
/** Inside of condition: argument */
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property == ";
@@ -295,8 +295,8 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
assertEquals("==", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property== ";
@@ -305,8 +305,8 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
assertEquals("==", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( name : property <= ";
@@ -315,8 +315,8 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
assertEquals("<=", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( name:property != ";
@@ -325,8 +325,8 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
assertEquals("!=", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( name1 : property1, property2 == ";
@@ -335,8 +335,8 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property2", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
assertEquals("==", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class (name:property== ";
@@ -345,8 +345,8 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
assertEquals("==", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property == otherPropertyN";
@@ -355,8 +355,8 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
assertEquals("==", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property == \"someth";
@@ -365,8 +365,8 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
assertEquals("==", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property contains ";
@@ -375,8 +375,8 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
assertEquals("contains", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property excludes ";
@@ -385,8 +385,8 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
assertEquals("excludes", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property matches \"prop";
@@ -395,8 +395,8 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
assertEquals("matches", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property in ";
@@ -405,24 +405,24 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
assertEquals("in", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property in ('1', '2') ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_END, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property in ('1', '2'), ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property not in ";
@@ -431,24 +431,24 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
assertEquals("in", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property not in ('1', '2') ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_END, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property not in ('1', '2'), ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property memberOf ";
@@ -457,24 +457,24 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
assertEquals("memberOf", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property memberOf collection ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_END, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property memberOf collection, ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property not memberOf ";
@@ -483,68 +483,68 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
assertEquals("memberOf", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property not memberOf collection ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_END, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property not memberOf collection, ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
-
-
+
+
/** EXISTS */
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" exists ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_EXISTS, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" exists ( ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_EXISTS, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" exists(";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_EXISTS, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" exists Cl";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_EXISTS, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" exists ( Cl";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_EXISTS, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" exists ( name : Cl";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_EXISTS, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" exists Class (";
@@ -552,7 +552,7 @@
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" exists Class ( ) \n" +
@@ -561,35 +561,35 @@
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
/** NOT */
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" not ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_NOT, location.getType());
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" not Cl";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_NOT, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" not exists ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_EXISTS, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" not exists Cl";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_EXISTS, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" not Class (";
@@ -597,8 +597,8 @@
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
- // TODO
- input =
+ // TODO
+ input =
"rule MyRule \n" +
" when \n" +
" not exists Class (";
@@ -606,7 +606,7 @@
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" not exists name : Class (";
@@ -614,73 +614,73 @@
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" not Class () \n" +
" ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
-
+
/** AND */
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( ) and ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_AND_OR, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( ) && ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_AND_OR, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class () and ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_AND_OR, location.getType());
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" name : Class ( name: property ) and ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_AND_OR, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
- " Class ( name: property ) \n" +
+ " Class ( name: property ) \n" +
" and ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_AND_OR, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( ) and Cl";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_AND_OR, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( ) and name : Cl";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_AND_OR, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( ) && name : Cl";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_AND_OR, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( ) and Class ( ) \n" +
@@ -688,7 +688,7 @@
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( ) and not Class ( ) \n" +
@@ -696,7 +696,7 @@
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( ) and exists Class ( ) \n" +
@@ -704,14 +704,14 @@
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( ) and Class ( ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( ) and Class ( name ";
@@ -719,28 +719,28 @@
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_OPERATOR, location.getType());
assertEquals("name", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( ) and Class ( name == ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_ARGUMENT, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" exists Class ( ) and not ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_NOT, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" exists Class ( ) and exists ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_EXISTS, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( ) and not Class ( ) \n" +
@@ -749,64 +749,64 @@
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
/** OR */
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( ) or ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_AND_OR, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( ) || ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_AND_OR, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class () or ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_AND_OR, location.getType());
-
- input =
+
+ input =
"rule MyRule \n" +
" when \n" +
" name : Class ( name: property ) or ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_AND_OR, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
- " Class ( name: property ) \n" +
+ " Class ( name: property ) \n" +
" or ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_AND_OR, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( ) or Cl";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_AND_OR, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( ) or name : Cl";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_AND_OR, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( ) || name : Cl";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_AND_OR, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( ) or Class ( ) \n" +
@@ -814,14 +814,14 @@
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( ) or Class ( ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( ) or Class ( name ";
@@ -829,21 +829,21 @@
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_OPERATOR, location.getType());
assertEquals("name", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( ) or Class ( name == ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_ARGUMENT, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" exists Class ( ) or not ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_NOT, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" exists Class ( ) or exists ";
@@ -851,7 +851,7 @@
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_EXISTS, location.getType());
/** EVAL */
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" eval ( ";
@@ -859,7 +859,7 @@
assertEquals(Location.LOCATION_LHS_INSIDE_EVAL, location.getType());
assertEquals("", location.getProperty(Location.LOCATION_EVAL_CONTENT));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" eval(";
@@ -867,7 +867,7 @@
assertEquals(Location.LOCATION_LHS_INSIDE_EVAL, location.getType());
assertEquals("", location.getProperty(Location.LOCATION_EVAL_CONTENT));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" eval( myCla";
@@ -875,7 +875,7 @@
assertEquals(Location.LOCATION_LHS_INSIDE_EVAL, location.getType());
assertEquals("myCla", location.getProperty(Location.LOCATION_EVAL_CONTENT));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" eval( param.getMetho";
@@ -883,7 +883,7 @@
assertEquals(Location.LOCATION_LHS_INSIDE_EVAL, location.getType());
assertEquals("param.getMetho", location.getProperty(Location.LOCATION_EVAL_CONTENT));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" eval( param.getMethod(";
@@ -891,7 +891,7 @@
assertEquals(Location.LOCATION_LHS_INSIDE_EVAL, location.getType());
assertEquals("param.getMethod(", location.getProperty(Location.LOCATION_EVAL_CONTENT));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" eval( param.getMethod().get";
@@ -899,7 +899,7 @@
assertEquals(Location.LOCATION_LHS_INSIDE_EVAL, location.getType());
assertEquals("param.getMethod().get", location.getProperty(Location.LOCATION_EVAL_CONTENT));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" eval( param.getMethod(\"someStringWith)))\").get";
@@ -907,7 +907,7 @@
assertEquals(Location.LOCATION_LHS_INSIDE_EVAL, location.getType());
assertEquals("param.getMethod(\"someStringWith)))\").get", location.getProperty(Location.LOCATION_EVAL_CONTENT));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" eval( param.getMethod(\"someStringWith(((\").get";
@@ -915,28 +915,28 @@
assertEquals(Location.LOCATION_LHS_INSIDE_EVAL, location.getType());
assertEquals("param.getMethod(\"someStringWith(((\").get", location.getProperty(Location.LOCATION_EVAL_CONTENT));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" eval( true )";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" eval( param.getProperty(name).isTrue() )";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" eval( param.getProperty(\"someStringWith(((\").isTrue() )";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" eval( param.getProperty((((String) s) )";
@@ -944,14 +944,14 @@
assertEquals(Location.LOCATION_LHS_INSIDE_EVAL, location.getType());
assertEquals("param.getProperty((((String) s) )", location.getProperty(Location.LOCATION_EVAL_CONTENT));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" eval( param.getProperty((((String) s))))";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" eval( true ) \n" +
@@ -961,7 +961,7 @@
/** MULTIPLE RESTRICTIONS */
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 && ";
@@ -969,7 +969,7 @@
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_OPERATOR, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( name : property1, property2 > 0 && ";
@@ -978,7 +978,7 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property2", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property1 < 20, property2 > 0 && ";
@@ -987,7 +987,7 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property2", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 && < ";
@@ -997,7 +997,7 @@
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
assertEquals("<", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 && < 10 ";
@@ -1005,7 +1005,7 @@
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_END, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 && < 10, ";
@@ -1013,7 +1013,7 @@
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 || ";
@@ -1022,7 +1022,7 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 || \n" +
@@ -1032,7 +1032,7 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( name : property1, property2 > 0 || ";
@@ -1041,7 +1041,7 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property2", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property1 < 20, property2 > 0 || ";
@@ -1050,14 +1050,14 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property2", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_END, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 \n" +
@@ -1065,21 +1065,21 @@
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_END, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 && < 10 ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_END, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 || < 10 ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_END, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property == \"test\" || == \"test2\" ";
@@ -1087,21 +1087,21 @@
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_END, location.getType());
/** FROM */
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 ) ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 ) fr";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 ) from ";
@@ -1109,7 +1109,7 @@
assertEquals(Location.LOCATION_LHS_FROM, location.getType());
assertEquals("", location.getProperty(Location.LOCATION_FROM_CONTENT));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 ) from myGlob";
@@ -1117,7 +1117,7 @@
assertEquals(Location.LOCATION_LHS_FROM, location.getType());
assertEquals("myGlob", location.getProperty(Location.LOCATION_FROM_CONTENT));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 ) from myGlobal.get";
@@ -1125,7 +1125,7 @@
assertEquals(Location.LOCATION_LHS_FROM, location.getType());
assertEquals("myGlobal.get", location.getProperty(Location.LOCATION_FROM_CONTENT));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 ) from myGlobal.getList() \n" +
@@ -1133,7 +1133,7 @@
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 ) from getDroolsFunction() \n" +
@@ -1142,21 +1142,21 @@
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
/** FROM ACCUMULATE */
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 ) from accumulate ( ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_FROM_ACCUMULATE, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 ) from accumulate(";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_FROM_ACCUMULATE, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 ) from accumulate( \n" +
@@ -1169,7 +1169,7 @@
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 ) from accumulate( \n" +
@@ -1179,7 +1179,7 @@
assertEquals(Location.LOCATION_LHS_FROM_ACCUMULATE_INIT_INSIDE, location.getType());
assertEquals("", location.getProperty(Location.LOCATION_PROPERTY_FROM_ACCUMULATE_INIT_CONTENT));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 ) from accumulate( \n" +
@@ -1191,7 +1191,7 @@
assertEquals(" int total = 0; ", location.getProperty(Location.LOCATION_PROPERTY_FROM_ACCUMULATE_INIT_CONTENT));
assertEquals("", location.getProperty(Location.LOCATION_PROPERTY_FROM_ACCUMULATE_ACTION_CONTENT));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 ) from accumulate( \n" +
@@ -1205,7 +1205,7 @@
assertEquals(" total += $cheese.getPrice(); ", location.getProperty(Location.LOCATION_PROPERTY_FROM_ACCUMULATE_ACTION_CONTENT));
assertEquals("", location.getProperty(Location.LOCATION_PROPERTY_FROM_ACCUMULATE_RESULT_CONTENT));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 ) from accumulate( \n" +
@@ -1215,7 +1215,7 @@
assertEquals(Location.LOCATION_LHS_FROM_ACCUMULATE_INIT_INSIDE, location.getType());
assertEquals("int total =", location.getProperty(Location.LOCATION_PROPERTY_FROM_ACCUMULATE_INIT_CONTENT));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 ) from accumulate( \n" +
@@ -1227,7 +1227,7 @@
assertEquals(" int total = 0; ", location.getProperty(Location.LOCATION_PROPERTY_FROM_ACCUMULATE_INIT_CONTENT));
assertEquals("total += $ch", location.getProperty(Location.LOCATION_PROPERTY_FROM_ACCUMULATE_ACTION_CONTENT));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 ) from accumulate( \n" +
@@ -1241,7 +1241,7 @@
assertEquals(" total += $cheese.getPrice(); ", location.getProperty(Location.LOCATION_PROPERTY_FROM_ACCUMULATE_ACTION_CONTENT));
assertEquals("new Integer( tot", location.getProperty(Location.LOCATION_PROPERTY_FROM_ACCUMULATE_RESULT_CONTENT));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 ) from accumulate( \n" +
@@ -1250,7 +1250,7 @@
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
assertEquals("Cheese", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 ) from accumulate( \n" +
@@ -1260,7 +1260,7 @@
assertEquals("Cheese", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("type", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 ) from accumulate( \n" +
@@ -1271,21 +1271,21 @@
assertEquals("type", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
/** FROM COLLECT */
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 ) from collect ( ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_FROM_COLLECT, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 ) from collect(";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_FROM_COLLECT, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 ) from collect ( \n" +
@@ -1295,7 +1295,7 @@
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 ) from collect ( \n" +
@@ -1304,7 +1304,7 @@
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
assertEquals("Cheese", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 ) from collect ( \n" +
@@ -1314,7 +1314,7 @@
assertEquals("Cheese", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("type", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" Class ( property > 0 ) from collect ( \n" +
@@ -1323,59 +1323,60 @@
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_ARGUMENT, location.getType());
assertEquals("Cheese", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("type", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
-
+
/** NESTED FROM */
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" ArrayList(size > 50) from collect( Person( disabled == \"yes\", income > 100000 ) ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" ArrayList(size > 50) from collect( Person( disabled == \"yes\", income > 100000 ) from ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_FROM, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" ArrayList(size > 50) from collect( Person( disabled == \"yes\", income > 100000 ) from town.getPersons() )";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" ArrayList(size > 50) from accumulate( Person( disabled == \"yes\", income > 100000 ) ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" ArrayList(size > 50) from accumulate( Person( disabled == \"yes\", income > 100000 ) from ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_FROM, location.getType());
- input =
- "rule MyRule \n" +
- " when \n" +
- " ArrayList(size > 50) from accumulate( Person( disabled == \"yes\", income > 100000 ) from town.getPersons() )";
- location = LocationDeterminator.getLocation(input);
- assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
+// See test method testCheckLHSLocationDetermination2 for this failing test
+// input =
+// "rule MyRule \n" +
+// " when \n" +
+// " ArrayList(size > 50) from accumulate( Person( disabled == \"yes\", income > 100000 ) from town.getPersons() )";
+// location = LocationDeterminator.getLocation(input);
+// assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
/** FORALL */
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" forall ( ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" forall ( " +
@@ -1385,7 +1386,7 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("pr", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" forall ( " +
@@ -1395,7 +1396,7 @@
assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" forall ( " +
@@ -1406,7 +1407,7 @@
assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
assertEquals("==", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
- input =
+ input =
"rule MyRule \n" +
" when \n" +
" forall ( " +
@@ -1415,9 +1416,20 @@
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
}
-
+
+ public void testCheckLHSLocationDetermination2() {
+ String input ;
+ input =
+ "rule MyRule \n" +
+ " when \n" +
+ " ArrayList(size > 50) from accumulate( Person( disabled == \"yes\", income > 100000 ) from town.getPersons() )";
+ Location location = LocationDeterminator.getLocation(input);
+ assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
+
+ }
+
public void testCheckRHSLocationDetermination() {
- String input =
+ String input =
"rule MyRule \n" +
" when\n" +
" Class ( )\n" +
@@ -1426,8 +1438,8 @@
Location location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_RHS, location.getType());
assertEquals("", location.getProperty(Location.LOCATION_RHS_CONTENT));
-
- input =
+
+ input =
"rule MyRule \n" +
" when\n" +
" Class ( )\n" +
@@ -1438,7 +1450,7 @@
assertEquals(Location.LOCATION_RHS, location.getType());
assertEquals("assert(null);\n ", location.getProperty(Location.LOCATION_RHS_CONTENT));
- input =
+ input =
"rule MyRule \n" +
" when\n" +
" Class ( )\n" +
@@ -1448,45 +1460,45 @@
assertEquals(Location.LOCATION_RHS, location.getType());
assertEquals("meth", location.getProperty(Location.LOCATION_RHS_CONTENT));
}
-
+
public void testCheckRuleHeaderLocationDetermination() {
- String input =
+ String input =
"rule MyRule ";
Location location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_RULE_HEADER, location.getType());
-
- input =
+
+ input =
"rule MyRule \n" +
" salience 12 activation-group \"my";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_RULE_HEADER, location.getType());
// KRISV: still can't make this work... apparently, ANTLR is trying to recover from
- // the error (unkown token) by deleting the token. I don't know why it continues to
+ // the error (unkown token) by deleting the token. I don't know why it continues to
// execute actions though, if the EOF is found.
-// input =
+// input =
// "rule \"Hello World\" ruleflow-group \"hello\" s";
// location = LocationDeterminator.getLocation(input);
// assertEquals(Location.LOCATION_RULE_HEADER, location.getType());
}
-
+
public void testCheckQueryLocationDetermination() {
- String input =
+ String input =
"query MyQuery ";
Location location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_RULE_HEADER, location.getType());
-
- input =
+
+ input =
"query \"MyQuery\" ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_RULE_HEADER, location.getType());
-
- input =
+
+ input =
"query MyQuery() ";
location = LocationDeterminator.getLocation(input);
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, location.getType());
-
- input =
+
+ input =
"query MyQuery \n" +
" Class (";
location = LocationDeterminator.getLocation(input);
More information about the jboss-svn-commits
mailing list