use of org.drools.drl.parser.DrlParser in project drools by kiegroup.
the class DRLIncompleteCodeTest method testIncompleteCode10.
@Test
@Ignore
public void testIncompleteCode10() throws DroolsParserException, RecognitionException {
String input = "package a.b.c import a.b.c.*" + " rule MyRule xxxxx Class ( property memberOf " + " query MyQuery Class ( property memberOf collection ) end ";
DrlParser parser = new DrlParser(LanguageLevelOption.DRL5);
PackageDescr descr = parser.parse(true, input);
assertEquals("a.b.c", descr.getNamespace());
assertEquals("a.b.c.*", descr.getImports().get(0).getTarget());
assertEquals(0, descr.getRules().size());
}
use of org.drools.drl.parser.DrlParser in project drools by kiegroup.
the class DRLIncompleteCodeTest method testIncompleteCode9.
@Test
@Ignore
public void testIncompleteCode9() throws DroolsParserException, RecognitionException {
String input = "package a.b.c import a.b.c.*" + " rule MyRule xxxxx Class ( property memberOf collection ) then end " + " query MyQuery Class ( property memberOf collection ) end ";
DrlParser parser = new DrlParser(LanguageLevelOption.DRL5);
PackageDescr descr = parser.parse(true, input);
assertEquals("a.b.c", descr.getNamespace());
assertEquals("a.b.c.*", descr.getImports().get(0).getTarget());
assertEquals(1, descr.getRules().size());
assertEquals("MyQuery", descr.getRules().get(0).getName());
}
use of org.drools.drl.parser.DrlParser in project drools by kiegroup.
the class DRLIncompleteCodeTest method testIncompleteCode4.
@Test
public void testIncompleteCode4() throws DroolsParserException, RecognitionException {
String input = "package a.b.c import a.b.c.*" + " rule MyRule when Class ( property == collection ) then end " + " query MyQuery Class ( property == collection ) end ";
DrlParser parser = new DrlParser(LanguageLevelOption.DRL5);
PackageDescr descr = parser.parse(true, input);
assertEquals("a.b.c", descr.getNamespace());
assertEquals("a.b.c.*", descr.getImports().get(0).getTarget());
assertNotNull(descr);
assertEquals("MyRule", descr.getRules().get(0).getName());
assertNotNull(descr);
assertEquals("MyQuery", descr.getRules().get(1).getName());
}
use of org.drools.drl.parser.DrlParser in project drools by kiegroup.
the class DRLIncompleteCodeTest method testIncompleteCode2.
@Test
public void testIncompleteCode2() throws DroolsParserException, RecognitionException {
String input = "rule MyRule when Class ( property memberOf collection ";
DrlParser parser = new DrlParser(LanguageLevelOption.DRL5);
PackageDescr descr = parser.parse(true, input);
assertNotNull(descr);
assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_END, getLastIntegerValue(parser.getEditorSentences().get(0).getContent()));
}
use of org.drools.drl.parser.DrlParser in project drools by kiegroup.
the class DRLIncompleteCodeTest method testIncompleteCode5.
@Test
public void testIncompleteCode5() throws DroolsParserException, RecognitionException {
String input = "package a.b.c import a.b.c.*" + " rule MyRule when Class ( property memberOf collection ) then end " + " query MyQuery Class ( property memberOf collection ) end ";
DrlParser parser = new DrlParser(LanguageLevelOption.DRL5);
PackageDescr descr = parser.parse(true, input);
assertNotNull(descr);
}
Aggregations