use of org.thymeleaf.TemplateSpec in project thymeleaf-tests by thymeleaf.
the class TemplateResolverAttributesTest method testTemplateResolutionAttributes02.
@Test
public void testTemplateResolutionAttributes02() throws Exception {
final AttributeTesterTemplateResolver templateResolver = new AttributeTesterTemplateResolver(EXPECTED_ATTRIBUTES2);
final TemplateEngine templateEngine = new TemplateEngine();
templateEngine.setTemplateResolver(templateResolver);
final TemplateSpec templateSpec = new TemplateSpec("temp", EXPECTED_ATTRIBUTES2);
final String output = templateEngine.process(templateSpec, new Context());
Assert.assertTrue(templateResolver.tempCalled);
Assert.assertTrue(templateResolver.fragCalled);
Assert.assertEquals(EXPECTED_OUTPUT, output);
}
use of org.thymeleaf.TemplateSpec in project thymeleaf-tests by thymeleaf.
the class TemplateResolverAttributesTest method testTemplateResolutionAttributes01.
@Test
public void testTemplateResolutionAttributes01() throws Exception {
final AttributeTesterTemplateResolver templateResolver = new AttributeTesterTemplateResolver(EXPECTED_ATTRIBUTES1);
final TemplateEngine templateEngine = new TemplateEngine();
templateEngine.setTemplateResolver(templateResolver);
final TemplateSpec templateSpec = new TemplateSpec("temp", EXPECTED_ATTRIBUTES1);
final String output = templateEngine.process(templateSpec, new Context());
Assert.assertTrue(templateResolver.tempCalled);
Assert.assertTrue(templateResolver.fragCalled);
Assert.assertEquals(EXPECTED_OUTPUT, output);
}
use of org.thymeleaf.TemplateSpec in project thymeleaf-tests by thymeleaf.
the class TemplateResolverAttributesTest method testTemplateResolutionAttributes03.
@Test
public void testTemplateResolutionAttributes03() throws Exception {
final AttributeTesterTemplateResolver templateResolver = new AttributeTesterTemplateResolver(EXPECTED_ATTRIBUTES3);
final TemplateEngine templateEngine = new TemplateEngine();
templateEngine.setTemplateResolver(templateResolver);
final TemplateSpec templateSpec = new TemplateSpec("temp", EXPECTED_ATTRIBUTES3);
final String output = templateEngine.process(templateSpec, new Context());
Assert.assertTrue(templateResolver.tempCalled);
Assert.assertTrue(templateResolver.fragCalled);
Assert.assertEquals(EXPECTED_OUTPUT, output);
}
Aggregations