use of org.drools.drl.ast.descr.AnnotationDescr in project drools by kiegroup.
the class RuleParserTest method testMultiValueAnnotationsBackwardCompatibility.
@Test
public void testMultiValueAnnotationsBackwardCompatibility() throws Exception {
// multiple values with no keys are parsed as a single value
final String text = "rule X @ann1( val1, val2 ) @ann2( \"val1\", \"val2\" ) when then end";
RuleDescr rule = (RuleDescr) parse("rule", text);
AnnotationDescr ann = rule.getAnnotation("ann1");
assertNotNull(ann);
assertEquals("val1, val2", ann.getValue());
ann = rule.getAnnotation("ann2");
assertNotNull(ann);
assertEquals("\"val1\", \"val2\"", ann.getValue());
}
Aggregations