Package org.drools.compiler.lang

Examples of org.drools.compiler.lang.Location


    public void testCheckLHSLocationDetermination_INSIDE_CONDITION_START1() {
        String input =
            "rule MyRule \n" +
            "    when \n" +
            "        Class (";
        Location location = new CompletionContext(input).getLocation();
        assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
        assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
    }
View Full Code Here


    public void testCheckLHSLocationDetermination_INSIDE_CONDITION_START12() {
        String input =
            "rule MyRule \n" +
            "    when \n" +
            "        Class ( property not in ('1', '2'), ";
        Location location = new CompletionContext(input).getLocation();
        assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
        assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
        }
View Full Code Here

    public void testCheckLHSLocationDetermination_INSIDE_CONDITION_ARGUMENT14() {
        String input =
            "rule MyRule \n" +
            "    when \n" +
            "        Class ( property memberOf ";
        Location location = new CompletionContext(input).getLocation();
        assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_ARGUMENT, location.getType());
        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));
        }
View Full Code Here

    public void testCheckLHSLocationDetermination_INSIDE_CONDITION_END3() {
        String input =
            "rule MyRule \n" +
            "    when \n" +
            "        Class ( property memberOf collection ";
        Location location = new CompletionContext(input).getLocation();
        assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_END, location.getType());
        assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
        }
View Full Code Here

    public void testCheckLHSLocationDetermination_INSIDE_CONDITION_START13() {
        String input =
            "rule MyRule \n" +
            "    when \n" +
            "        Class ( property memberOf collection, ";
        Location location = new CompletionContext(input).getLocation();
        assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
        assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
        }
View Full Code Here

    public void testCheckLHSLocationDetermination_INSIDE_CONDITION_ARGUMENT15() {
        String input =
            "rule MyRule \n" +
            "    when \n" +
            "        Class ( property not memberOf ";
        Location location = new CompletionContext(input).getLocation();
        assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_ARGUMENT, location.getType());
        assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
        assertEquals("property", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
        assertEquals("not memberOf", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
        }
View Full Code Here

    public void testCheckLHSLocationDetermination_INSIDE_CONDITION_END4() {
        String input =
            "rule MyRule \n" +
            "    when \n" +
            "        Class ( property not memberOf collection ";
        Location location = new CompletionContext(input).getLocation();
        assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_END, location.getType());
        assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
        }
View Full Code Here

    public void testCheckLHSLocationDetermination_INSIDE_CONDITION_START14() {
        String input =
            "rule MyRule \n" +
            "    when \n" +
            "        Class ( property not memberOf collection, ";
        Location location = new CompletionContext(input).getLocation();
        assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, location.getType());
        assertEquals("Class", location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
        }
View Full Code Here

    public void testCheckLHSLocationDetermination_BEGIN_OF_CONDITION_EXISTS1() {
        String input =
            "rule MyRule \n" +
            "    when \n" +
            "        exists ";
        Location location = new CompletionContext(input).getLocation();
        assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_EXISTS, location.getType());
        }
View Full Code Here

    public void testCheckLHSLocationDetermination_BEGIN_OF_CONDITION_EXISTS2() {
        String input =
            "rule MyRule \n" +
            "    when \n" +
            "        exists ( ";
        Location location = new CompletionContext(input).getLocation();
        assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_EXISTS, location.getType());
        }
View Full Code Here

TOP

Related Classes of org.drools.compiler.lang.Location

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.