Add support for groovy utilities in "spring jar"

Also an integration test that uses the (new)
@EnableGroovyTemplates to switch on the template conveniences
in a non-webapp

Fixes gh-990
This commit is contained in:
Dave Syer
2014-05-29 18:21:27 +01:00
parent 3c6dfb72c5
commit 48c1228253
8 changed files with 111 additions and 1 deletions

View File

@@ -80,5 +80,7 @@ public class JarCommandIT {
assertThat(invocation.getStandardOutput(), containsString("/static/static.txt"));
assertThat(invocation.getStandardOutput(),
containsString("/templates/template.txt"));
assertThat(invocation.getStandardOutput(),
containsString("Goodbye Mama"));
}
}

View File

@@ -1,5 +1,6 @@
package org.test
@EnableGroovyTemplates
@Component
class Example implements CommandLineRunner {
@@ -12,6 +13,7 @@ class Example implements CommandLineRunner {
println getClass().getResource('/resources/resource.txt')
println getClass().getResource('/static/static.txt')
println getClass().getResource('/templates/template.txt')
println template('template.txt', [world:'Mama'])
}
}

View File

@@ -0,0 +1 @@
Goodbye ${world}