DefaultGenerator implements
        Generator { public void generate( String templateName, Row row ) { try { CompiledTemplate template = getTemplate( templateName ); VariableResolverFactory factory = new MapVariableResolverFactory(); Map<String, Object> vars = new HashMap<String, Object>(); initializePriorCommaConstraints( vars ); initializeHasPriorJunctionConstraint( vars ); vars.put( "row", row ); for ( Cell cell : row.getCells() ) { cell.addValue( vars ); } String drl = String.valueOf( TemplateRuntime.execute( template, vars, factory, registry ) ); rules.add( drl ); } catch ( Exception e ) { throw new RuntimeException( e ); } } DefaultGenerator( final Map<String, RuleTemplate> t ); void generate( String templateName,
                          Row row ); String getDrl();  }
@Test public void testGenerate() { g.generate("rt2", new Row()); g.generate("rt1", new Row()); String drl = g.getDrl(); assertEquals("Test template 2\n\nTest template 1\n\n", drl); }