use of org.drools.drl.parser.lang.DRLParser in project drools by kiegroup.
the class DRLContextTest method testCheckLHSLocationDetermination_BEGIN_OF_CONDITION_AND_OR3.
@Test(timeout = 10 * 1000)
public void testCheckLHSLocationDetermination_BEGIN_OF_CONDITION_AND_OR3() {
String input = "rule MyRule \n" + " when \n" + " Class () and ";
DRLParser parser = getParser(input);
parser.enableEditorInterface();
try {
parser.compilationUnit();
} catch (Exception ex) {
}
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_AND_OR, getLastIntegerValue(parser.getEditorInterface().get(0).getContent()));
}
use of org.drools.drl.parser.lang.DRLParser in project drools by kiegroup.
the class DRLContextTest method testCheckRHSLocationDetermination_startOfNewlINE.
@Test(timeout = 10 * 1000)
public void testCheckRHSLocationDetermination_startOfNewlINE() {
String input = "rule MyRule \n" + " when\n" + " Class ( )\n" + " then\n" + " assert(null);\n" + " ";
DRLParser parser = getParser(input);
parser.enableEditorInterface();
try {
parser.compilationUnit();
} catch (Exception ex) {
}
assertEquals(Location.LOCATION_RHS, getLastIntegerValue(parser.getEditorInterface().get(0).getContent()));
}
use of org.drools.drl.parser.lang.DRLParser in project drools by kiegroup.
the class DRLContextTest method testCheckLHSLocationDetermination_INSIDE_CONDITION_START40.
@Test(timeout = 10 * 1000)
public void testCheckLHSLocationDetermination_INSIDE_CONDITION_START40() {
String input = "rule MyRule \n" + " when \n" + " Class ( ) or Class ( ";
DRLParser parser = getParser(input);
parser.enableEditorInterface();
try {
parser.compilationUnit();
} catch (Exception ex) {
}
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_START, getLastIntegerValue(parser.getEditorInterface().get(0).getContent()));
}
use of org.drools.drl.parser.lang.DRLParser in project drools by kiegroup.
the class DRLContextTest method testCheckLHSLocationDetermination_BEGIN_OF_CONDITION71.
@Test(timeout = 10 * 1000)
public void testCheckLHSLocationDetermination_BEGIN_OF_CONDITION71() {
String input = "rule MyRule \n" + " when \n" + " Class ( property > 0 ) from getDroolsFunction() \n" + " ";
DRLParser parser = getParser(input);
parser.enableEditorInterface();
try {
parser.compilationUnit();
} catch (Exception ex) {
}
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION, getLastIntegerValue(parser.getEditorInterface().get(0).getContent()));
}
use of org.drools.drl.parser.lang.DRLParser in project drools by kiegroup.
the class DRLContextTest method testCheckQueryLocationDetermination_RULE_HEADER2.
@Test(timeout = 10 * 1000)
public void testCheckQueryLocationDetermination_RULE_HEADER2() {
String input = "query \"MyQuery\" ";
DRLParser parser = getParser(input);
parser.enableEditorInterface();
try {
parser.compilationUnit();
} catch (Exception ex) {
}
assertEquals(Location.LOCATION_RULE_HEADER, getLastIntegerValue(parser.getEditorInterface().get(0).getContent()));
}
Aggregations