public void testPerform() throws Exception {
Template tm = new BasicTemplate();
TemplateActionHandlerStub tahs = new TemplateActionHandlerStub();
PropertySet ps = new PropertySet();
ps.load( Tools.findRelativeSystemPath( "conf/system.conf" ) );
TextualTransformManagerTable ttmt = new TextualTransformManagerTable( ps );
BasicUnitList bul = new BasicUnitList();
SectionDirective sd = new SectionDirective();
assertTrue( "section".equals( sd.getName() ) );
tahs.clear();
tahs.setDefaultSection( "foo" );
sd.perform( "section", " ", bul, tahs, ps, ttmt, tm );
assertTrue( Section.NAME_body.equals( tahs.getDefaultSectionName() ) );
tahs.clear();
sd.perform( "section", " foo ", bul, tahs, ps, ttmt, tm );
assertTrue( "foo".equals( tahs.getDefaultSectionName() ) );
tahs.clear();
sd.perform( "section", " foo bar;", bul, tahs, ps, ttmt, tm );
assertTrue( "foo".equals( tahs.getDefaultSectionName() ) );
assertTrue( " bar;".equals( tahs.getLastAppendedContent() ) );
}