public void testExpandDRLUsingInjectedExpander() throws Exception {
String dsl = "[condition]Something=Something()\n[then]another=another();";
String drl = "rule 'foo' \n when \n Something \n then \n another \nend";
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 RuntimeDroolsException( "Error parsing and loading DSL file." + file.getErrors() );
}
DrlParser parser = new DrlParser(LanguageLevelOption.DRL5);