Package org.drools.compiler.lang

Examples of org.drools.compiler.lang.Location


    public void testCheckLHSLocationDetermination_INSIDE_CONDITION_ARGUMENT1() {
        String input =
            "rule MyRule \n" +
            "    when \n" +
            "        Class ( property == ";
        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("==", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
    }
View Full Code Here


    public void testCheckLHSLocationDetermination_INSIDE_CONDITION_ARGUMENT2() {
        String input =
            "rule MyRule \n" +
            "    when \n" +
            "        Class ( property== ";
        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("==", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
    }
View Full Code Here

    public void testCheckLHSLocationDetermination_INSIDE_CONDITION_ARGUMENT3() {
        String input =
            "rule MyRule \n" +
            "    when \n" +
            "        Class ( name : property <= ";
        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("<=", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
    }
View Full Code Here

    public void testCheckLHSLocationDetermination_INSIDE_CONDITION_ARGUMENT4() {
        String input =
            "rule MyRule \n" +
            "    when \n" +
            "        Class ( name:property != ";
        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("!=", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
    }
View Full Code Here

    public void testCheckLHSLocationDetermination_INSIDE_CONDITION_ARGUMENT5() {
        String input =
            "rule MyRule \n" +
            "    when \n" +
            "        Class ( name1 : property1, property2 == ";
        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("property2", location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
        assertEquals("==", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
    }
View Full Code Here

    public void testCheckLHSLocationDetermination_INSIDE_CONDITION_ARGUMENT6() {
        String input =
            "rule MyRule \n" +
            "    when \n" +
            "        Class (name:property== ";
        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("==", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
    }
View Full Code Here

    public void testCheckLHSLocationDetermination_INSIDE_CONDITION_ARGUMENT7() {
        String input =
            "rule MyRule \n" +
            "    when \n" +
            "        Class ( property == otherPropertyN";
        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("==", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
    }
View Full Code Here

    public void testCheckLHSLocationDetermination_INSIDE_CONDITION_ARGUMENT8() {
        String input =
            "rule MyRule \n" +
            "    when \n" +
            "        Class ( property == \"someth";
        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("==", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
        }
View Full Code Here

    public void testCheckLHSLocationDetermination_INSIDE_CONDITION_ARGUMENT9() {
        String input =
            "rule MyRule \n" +
            "    when \n" +
            "        Class ( property contains ";
        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("contains", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
        }
View Full Code Here

    public void testCheckLHSLocationDetermination_INSIDE_CONDITION_ARGUMENT10() {
        String input =
            "rule MyRule \n" +
            "    when \n" +
            "        Class ( property excludes ";
        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("excludes", location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
        }
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.