@Test
public void testParseTemplate() {

    InputStream is = DefaultTemplateContainerTest.class.getResourceAsStream( "/templates/test_template_simple.drl" );
    DefaultTemplateContainer t = new DefaultTemplateContainer( is );
    assertEquals( "package This_is_a_ruleset;\n", t.getHeader() );
    assertEquals( 1, t.getColumns().length );
    assertEquals( "name", t.getColumns()[ 0 ].getName() );
    Map<String, RuleTemplate> templates = t.getTemplates();
    assertEquals( 1, templates.size() );
    RuleTemplate template = templates.get( "template1" );
    assertNotNull( template );
    List<TemplateColumn> columns = template.getColumns();
    assertEquals( 1, columns.size() );
    TemplateColumn column = (TemplateColumn) columns.get( 0 );
    assertEquals( "name", column.getName() );
    String contents = template.getContents();
    assertTrue( contents.startsWith( "rule \"How cool is @{name} @{row.rowNumber}\"" ) );
    assertTrue( contents.endsWith( "then\nend\n" ) );
}