use of org.drools.drl.parser.lang.DRLParser in project drools by kiegroup.
the class DRLContextTest method testCheckRHSLocationDetermination_firstLineOfLHS.
@Test(timeout = 10 * 1000)
public void testCheckRHSLocationDetermination_firstLineOfLHS() {
String input = "rule MyRule \n" + " when\n" + " Class ( )\n" + " then\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_ARGUMENT1.
/**
* Inside of condition: argument
*/
@Test(timeout = 10 * 1000)
public void testCheckLHSLocationDetermination_INSIDE_CONDITION_ARGUMENT1() {
String input = "rule MyRule \n" + " when \n" + " Class ( property == ";
DRLParser parser = getParser(input);
parser.enableEditorInterface();
try {
parser.compilationUnit();
} catch (Exception ex) {
}
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_ARGUMENT, 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_END2.
@Test(timeout = 10 * 1000)
public void testCheckLHSLocationDetermination_INSIDE_CONDITION_END2() {
String input = "rule MyRule \n" + " when \n" + " Class ( property not in ('1', '2') ";
DRLParser parser = getParser(input);
parser.enableEditorInterface();
try {
parser.compilationUnit();
} catch (Exception ex) {
}
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_END, 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_ARGUMENT9b.
@Test(timeout = 10 * 1000)
public void testCheckLHSLocationDetermination_INSIDE_CONDITION_ARGUMENT9b() {
String input = "rule MyRule \n" + " when \n" + " Class ( property not contains ";
DRLParser parser = getParser(input);
parser.enableEditorInterface();
try {
parser.compilationUnit();
} catch (Exception ex) {
}
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_ARGUMENT, 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_CONDITION_NOT.
@Test(timeout = 10 * 1000)
public void testCheckLHSLocationDetermination_BEGIN_OF_CONDITION_NOT() {
String input = "rule MyRule \n" + " when \n" + " exists Class ( ) and not ";
DRLParser parser = getParser(input);
parser.enableEditorInterface();
try {
parser.compilationUnit();
} catch (Exception ex) {
}
assertEquals(Location.LOCATION_LHS_BEGIN_OF_CONDITION_NOT, getLastIntegerValue(parser.getEditorInterface().get(0).getContent()));
}
Aggregations