use of org.thymeleaf.engine.OutputTemplateHandler in project thymeleaf-tests by thymeleaf.
the class HtmlBlockSelectorMarkupHandlerTest method check.
private static void check(final HTMLTemplateParser parser, final IEngineConfiguration templateEngineContext, final String templateName, final String input, final String output, final Set<String> blockSelectors) throws Exception {
final StringWriter writer = new StringWriter();
final ITemplateHandler handler = new OutputTemplateHandler(writer);
parser.parseStandalone(templateEngineContext, templateName, templateName, blockSelectors, new StringTemplateResource(input), TemplateMode.HTML, false, handler);
assertEquals("Test failed for file: " + templateName, output, writer.toString());
}
use of org.thymeleaf.engine.OutputTemplateHandler in project thymeleaf-tests by thymeleaf.
the class HtmlBlockSelectorMarkupHandlerTest method check.
private static void check(final HTMLTemplateParser parser, final IEngineConfiguration templateEngineContext, final String templateName, final String input, final String output, final String[] blockSelectors) throws Exception {
final StringWriter writer = new StringWriter();
final ITemplateHandler handler = new OutputTemplateHandler(writer);
handler.setProcessingContext(StandardProcessingContextFactory.build(TEMPLATE_ENGINE_CONFIGURATION, templateName, TemplateMode.HTML, new Context(Locale.US)));
parser.parse(templateEngineContext, TemplateMode.HTML, new StringResource(templateName, input), blockSelectors, handler);
assertEquals("Test failed for file: " + templateName, output, writer.toString());
}
Aggregations