Search in sources :

Example 6 with TemplateEngine

use of groovy.text.TemplateEngine in project spring-framework by spring-projects.

the class GroovyMarkupViewTests method customTemplateEngine.

@Test
public void customTemplateEngine() throws Exception {
    GroovyMarkupView view = new GroovyMarkupView();
    view.setTemplateEngine(new TestTemplateEngine());
    view.setApplicationContext(this.webAppContext);
    DirectFieldAccessor accessor = new DirectFieldAccessor(view);
    TemplateEngine engine = (TemplateEngine) accessor.getPropertyValue("engine");
    assertThat(engine).isNotNull();
    assertThat(engine.getClass()).isEqualTo(TestTemplateEngine.class);
}
Also used : MarkupTemplateEngine(groovy.text.markup.MarkupTemplateEngine) TemplateEngine(groovy.text.TemplateEngine) DirectFieldAccessor(org.springframework.beans.DirectFieldAccessor) Test(org.junit.jupiter.api.Test)

Aggregations

TemplateEngine (groovy.text.TemplateEngine)6 MarkupTemplateEngine (groovy.text.markup.MarkupTemplateEngine)5 Test (org.junit.jupiter.api.Test)5 TemplateConfiguration (groovy.text.markup.TemplateConfiguration)2 DirectFieldAccessor (org.springframework.beans.DirectFieldAccessor)2 Writable (groovy.lang.Writable)1 GStringTemplateEngine (groovy.text.GStringTemplateEngine)1 URISyntaxException (java.net.URISyntaxException)1 URL (java.net.URL)1 UnknownHostException (java.net.UnknownHostException)1 ApplicationSettingsException (org.apache.airavata.common.exception.ApplicationSettingsException)1 TException (org.apache.thrift.TException)1