public void testExpandDRLUsingInjectedExpander() throws Exception {
String dsl = "[condition]Something=Something()" + NL + "[then]another=another();";
String drl = "rule 'foo' " + NL + " when " + NL + " Something " + NL + " then " + NL + " another " + NL + "end";
DefaultExpanderResolver resolver = new DefaultExpanderResolver(new StringReader(dsl));
final DSLMappingFile file = new DSLTokenizedMappingFile();
if ( file.parseAndLoad( new StringReader(dsl) ) ) {
final Expander expander = new DefaultExpander();
expander.addDSLMapping( file.getMapping() );
resolver.addExpander("*", expander);
} else {
throw new RuntimeException( "Error parsing and loading DSL file." + file.getErrors() );
}
DrlParser parser = new DrlParser(LanguageLevelOption.DRL5);