Add support for beans{} in CLI scripts

User can add (a single) beans{} DSL declaration (see GroovyBeanDefinitionReader
in Spring 4 for more detail) anywhere at the top level of an application source
file. It will be compiled to a closure and fed in to the application context
through a GroovyBeanDefinitionReader. Cool!

The example spring-boot-cli/samples/beans.groovy runs in an integration test
and passes (see SampleIntegrationTests).
This commit is contained in:
Dave Syer
2013-12-18 22:22:18 +00:00
parent 72ae5d5a97
commit 75af18df7d
6 changed files with 221 additions and 3 deletions

View File

@@ -54,6 +54,13 @@ public class SampleIntegrationTests {
output.contains("Hello World! From " + scriptUri));
}
@Test
public void beansSample() throws Exception {
this.cli.run("beans.groovy");
String output = this.cli.getHttpOutput();
assertTrue("Wrong output: " + output, output.contains("Hello World!"));
}
@Test
public void templateSample() throws Exception {
String output = this.cli.run("template.groovy");