Commit Graph

11 Commits

Author SHA1 Message Date
Dave Syer
10c333ea10 [bs-73] Tweak algorithm for detecting anonymous classes
@Bean definitions in Groovy that contain closures have the bean name in
the class name.  Ugh.  Added regex match to catch that.

[#48718891]
2013-04-26 12:02:49 +01:00
Dave Syer
ec351e5f7d Add test for custom context initializer
[#48127729] [bs-22] Add missing unit tests
2013-04-26 11:05:17 +01:00
Dave Syer
4ca26058fa [bs-73] Tweak configuration class detection algorithm some more
This looks like becoming a recurring theme. Unfortunately it's
not very easy to test if a class might eventually be instantiatable
by Spring.

This change fixes the main bootstrap SpringApplicationTests
which were failing because they used non-static inner classes
for test configurations.
2013-04-26 10:45:17 +01:00
Dave Syer
d6a670e13e [bs-47] Add default command line args to SpringApplication
* See SpringApplication.setDefaultCommandLineArgs
* Assumes command line is in "simple" form (TODO: if we
need JOpt etc. support then the command line args parsing from
Spring needs to be exposed)
* If defaults are provided the command line might be re-ordered
slightly (non-option args come after option args)
* Allows custom application.properties file names to be specified
as a side effect (--spring.config.name=... or
--spring.config.location=...}.

[Fixes #48284369]
2013-04-26 10:45:08 +01:00
Dave Syer
bcf86b320e [bs-72], [bs-75] Add Batch plugin features
* Auto config in main bootstrap jar
* Compiler enhancements in groovy cli
* Sample script in cli samples

[Fixes #48716881], [Fixes #48788313]
2013-04-26 07:01:37 +01:00
Dave Syer
83e0ea22c1 [bs-19] Add samples and CLI support for Spring Integration
$ cd spring-bootstrap-cli
    $ export SPRING_HOME=target
    $ src/main/scripts/spring run samples/integration.groovy

The big disadvantage at the moment is that there is no goo way to
detect Spring Integration in the AST (at least not as good as @Enable*).
So for now we are looking for @MessageEndpoint or a class name with
SpringIntegration in it.

[#48151147]
2013-04-25 17:15:05 +01:00
Dave Syer
d82c50804f [bs-73] Tweak algorithm for detecting anonymous classes
Apparently an anonymous class in Groovy is no anonymous in the compiled code,
so we need another heuristic.  We now check for non-existence of public
constructors (if there are none then there's no point regsistering that
class with an application context).

[#48718891]
2013-04-25 17:12:01 +01:00
Dave Syer
a2d328ae3a [bs-73] Anonymous classes cannot be used in @Bean definitions in .groovy scripts
* Added a test for each of the classes loaded by the SpringApplication
* If it's an anonymous class or looks like a Groovy closure we ignore it
* The CLI sample job.groovy also modified to take advantage

[Fixes #48718891]
2013-04-25 16:02:44 +01:00
Dave Syer
38f0cf1ed2 [bs-62] Add integration tests for CLI samples
[Fixes #48658503]
2013-04-24 16:09:17 +01:00
Dave Syer
8a4b50e289 [bs-14] Ensure all servlet context initializers are called
Misuse of TreeSet in EmbeddedWebApplicationContext corrected
(use List and Comparator instead of TreeSet).

[Fixes #48055339]
2013-04-24 10:14:22 +01:00
Dave Syer
fb6b224470 Fast forward existing prototype work 2013-04-24 10:02:07 +01:00