use of org.drools.drl.parser.lang.DRLParser in project drools by kiegroup.
the class DRLContextTest method testCheckLHSLocationDetermination_INSIDE_CONDITION_END6.
@Test(timeout = 10 * 1000)
public void testCheckLHSLocationDetermination_INSIDE_CONDITION_END6() {
String input = "rule MyRule \n" + " when \n" + " Class ( property > 0 && < 10 ";
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_ARGUMENT3.
@Test(timeout = 10 * 1000)
public void testCheckLHSLocationDetermination_INSIDE_CONDITION_ARGUMENT3() {
String input = "rule MyRule \n" + " when \n" + " Class ( name : 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 ErrorsParserTest method testPackageGarbage.
@Test
public void testPackageGarbage() throws Exception {
DRLParser parser = parseResource("package_garbage.drl");
parser.compilationUnit();
assertTrue(parser.hasErrors());
}
use of org.drools.drl.parser.lang.DRLParser in project drools by kiegroup.
the class ErrorsParserTest method testLexicalError.
@Test
public void testLexicalError() throws Exception {
DRLParser parser = parseResource("lex_error.drl");
parser.compilationUnit();
assertTrue(parser.hasErrors());
}
use of org.drools.drl.parser.lang.DRLParser in project drools by kiegroup.
the class ErrorsParserTest method testEvalWithSemicolon.
@Test
public void testEvalWithSemicolon() throws Exception {
DRLParser parser = parseResource("eval_with_semicolon.drl");
parser.compilationUnit();
assertTrue(parser.hasErrors());
assertEquals(1, parser.getErrorMessages().size());
assertEquals("ERR 102", parser.getErrors().get(0).getErrorCode());
}
Aggregations