use of org.thymeleaf.cache.NonCacheableCacheEntryValidity in project thymeleaf-tests by thymeleaf.
the class TestTemplateResolver method resolveTemplate.
public TemplateResolution resolveTemplate(final IEngineConfiguration configuration, final String ownerTemplate, final String template, final Map<String, Object> templateResolutionAttributes) {
final int placeholderPos = this.template.indexOf("{%%}");
final String resource = this.template.substring(0, placeholderPos) + template + this.template.substring(placeholderPos + 4);
final ITemplateResource templateResource = new StringTemplateResource(resource);
final TemplateResolution templateResolution = new TemplateResolution(templateResource, // For the sake of these tests, considering resource existence verified is fine
true, TemplateMode.HTML, false, new NonCacheableCacheEntryValidity());
return templateResolution;
}
use of org.thymeleaf.cache.NonCacheableCacheEntryValidity in project thymeleaf-tests by thymeleaf.
the class TemplateParserTest method createOutput.
private String createOutput(final Document document) throws IOException {
final TemplateProcessingParameters templateProcessingParameters = new TemplateProcessingParameters(this.configuration, "test", new Context());
final TemplateResolution templateResolution = new TemplateResolution("test", "test", new ClassLoaderResourceResolver(), "UTF-8", "XHTML", new NonCacheableCacheEntryValidity());
final Arguments arguments = new Arguments(new TemplateEngine(), templateProcessingParameters, templateResolution, new TemplateRepository(this.configuration), document);
final StringWriter stringWriter = new StringWriter();
final ITemplateWriter templateWriter = this.configuration.getTemplateModeHandler("XHTML").getTemplateWriter();
templateWriter.write(arguments, stringWriter, document);
return stringWriter.toString();
}
use of org.thymeleaf.cache.NonCacheableCacheEntryValidity in project thymeleaf-tests by thymeleaf.
the class TestTemplateResolver method resolveTemplate.
public TemplateResolution resolveTemplate(final TemplateProcessingParameters templateProcessingParameters) {
final String templateName = templateProcessingParameters.getTemplateName();
final int placeholderPos = this.template.indexOf("{%%}");
final String result = this.template.substring(0, placeholderPos) + templateName + this.template.substring(placeholderPos + 4);
final IResourceResolver resourceResolver = new TestResourceResolver(result);
final TemplateResolution templateResolution = new TemplateResolution(templateName, "TEST", resourceResolver, "UTF-8", "HTML5", new NonCacheableCacheEntryValidity());
return templateResolution;
}
Aggregations