Search in sources :

Example 11 with WTemplate

use of com.github.bordertech.wcomponents.WTemplate in project wcomponents by BorderTech.

the class WTemplateRenderer_Test method testPlainTextInlineTemplate.

@Test
public void testPlainTextInlineTemplate() throws IOException, SAXException, XpathException {
    String inline = "Hello from plain text.";
    WTemplate template = new WTemplate();
    setupTemplate(template);
    template.setEngineName(TemplateRendererFactory.TemplateEngine.PLAINTEXT);
    template.setInlineTemplate(inline);
    String output = toXHtml(template);
    Assert.assertTrue("Text not in output", output.contains(inline));
}
Also used : WTemplate(com.github.bordertech.wcomponents.WTemplate) Test(org.junit.Test)

Aggregations

WTemplate (com.github.bordertech.wcomponents.WTemplate)11 Test (org.junit.Test)10 TemplateRenderer (com.github.bordertech.wcomponents.template.TemplateRenderer)1 HashMap (java.util.HashMap)1