Commit Graph

118 Commits

Author SHA1 Message Date
Phillip Webb 86ce60593b Relax logging tests for CI 2013-07-10 10:50:04 -07:00
Phillip Webb fbc68fe145 Tweak EmbeddedServletContainerCustomizer javadoc
Make it a little clearer that a
EmbeddedServletContainerCustomizerBeanPostProcessor is usually involved.

Issue: #53029445
2013-07-10 09:02:04 -07:00
Phillip Webb 3ba700a861 Revert accidentally changed logging.properties 2013-07-09 13:15:43 -07:00
Phillip Webb 02ae46d40e Further attempt to fix CI log test failures 2013-07-08 21:35:00 -07:00
Phillip Webb 83d3b508a8 Revert "@Ignore logging tests that fail on CI"
This reverts commit 2630aa732f.
2013-07-08 20:27:40 -07:00
Phillip Webb dbd29f36ec Protect against malformed logging.config
Ensure that any user specified logging.config exists. Required for
CI build as bamboo sets a "LOGGING_CONFIG" environment variable.
2013-07-08 19:30:34 -07:00
Phillip Webb 2630aa732f @Ignore logging tests that fail on CI 2013-07-08 17:56:23 -07:00
Phillip Webb abad5aa8e4 Attempt to fix logging tests that fail in CI 2013-07-08 17:45:27 -07:00
Phillip Webb c52972ceec Polish 2013-07-08 16:38:15 -07:00
Phillip Webb 0b863611d9 Package restructure 2013-07-08 13:42:46 -07:00
Phillip Webb cd51f357a3 Further maven module restructure 2013-07-08 13:42:44 -07:00
Phillip Webb 40bf334871 Restructure projects layout 2013-07-08 13:42:39 -07:00
Dave Syer 3996353e35 Make logging config come after config file
...otherwise you can't control the log configuration from
application.properties.
2013-07-08 12:32:32 +01:00
Dave Syer 7e579d3652 Revert strange looking DataSource chamge 2013-07-05 12:03:58 +01:00
Phillip Webb 510e16a809 Don't consider system ClassLoader in Tomcat
Modify TomcatEmbeddedServletContainerFactory to ensure that the
system ClassLoader is not considered when loading classes.

This is required to fix issues when working with executable JARs
created with the maven plugin.
2013-07-04 22:37:58 -07:00
Dave Syer f3cb6d46ce Add test for Spring integration tests 2013-07-01 09:14:52 +01:00
Greg Turnquist db05637e06 Add MultipartAutoConfigure to spring.factories
Update META-INF/spring.factories to include MultipartAutoConfigure.
Also tweaked the class @Conditionals and Javadoc.

Issue: BS-157
2013-06-20 15:29:03 -07:00
Greg Turnquist 9ab2f98df0 Tune expected exceptions to support more platforms
It appears that some machines break when looking for ConnectionException,
but not SocketException, both of which are IOExceptions. This seems to make
tests pass on more machines without compromising the intentions of the API.

[BS-162]
2013-06-17 18:44:10 -07:00
Greg Turnquist f8c20919f9 [BS-157] Fix misnamed method
Fix typo in EmbeddedServletContainerFactory.
e enter the commit message for your changes. Lines starting
2013-06-17 10:33:27 -07:00
Phillip Webb 018231d20a Polish 2013-06-17 10:29:44 -07:00
Dave Syer 7bf3e35249 Remove some try/catch blocks from test methods 2013-06-15 07:29:31 +01:00
Greg Turnquist 4b1c58d736 [BS-157] Add MultipartConfig support
Use Servlet 3.0 features to autodetect a MultipartConfigElement and
hence autowire multipart support in the servlet container.
2013-06-15 07:23:28 +01:00
Dave Syer 697c210155 Add cacheable switch to Thymeleaf template resolver
User can set spring.template.cache=false to change the behaviour
2013-06-13 13:46:21 +01:00
Dave Syer e1bac589fb Use available Converters for @ConfigurationProperties binding 2013-06-13 06:54:11 +01:00
Phillip Webb 9782747027 Use SpringZero Banner 2013-06-12 15:46:20 -07:00
Phillip Webb 8c347fc99b Numerous changes to actuator
Numerous changes to the actuator project, including:
- Specific Endpoint interface
- Spring MVC/Enpoint adapter
- Management server context changes
- Consistent auto-configuration class naming
- Auto-configuration ordering
- Javadoc, code formatting and tests
2013-06-12 15:42:56 -07:00
Phillip Webb dd69d0f660 Polish and Fixup
Polish and fixup:
- Ordered auto-configuration
- @ConditionalOnBean default on @Bean methods
- Improved separation of auto-configure classes
- Consistent naming
- Javadoc, code formatting and tests
2013-06-12 15:42:55 -07:00
Phillip Webb 2f84df66b6 Always store @ComponentScan details
Refactor JpaComponentScanDetector to a more general use utility and
ensure that details are always stored.
2013-06-12 15:42:55 -07:00
Phillip Webb b572d98cbf Support ordering of auto-configuration classes
Update EnableAutoConfigurationImportSelector to sort auto-configuration
classes based on @Order and @AutoConfigureAfter annotations.
2013-06-12 15:42:55 -07:00
Phillip Webb 3536fc68f5 Update On(Missing)Bean Condition logic
Update OnBeanCondition and OnMissingBeanCondition to work better
with @Configuration classes and to support an optional considerHierarchy
annotation value.

The class value for conditions can now also be inferred when used on
@Bean methods.
2013-06-12 15:42:55 -07:00
Phillip Webb 6a2f36a68a Obtain ServletContextInitializer beans later
Update EmbeddedWebApplicationContext to obtain ServletContextInitializer
beans after self initialization. Allows @Configuration beans to be
ServletContextAware.
2013-06-12 15:42:54 -07:00
Dave Syer 20cce0c69c [bs-52] Added support for SpringApplication in a ServletContextInitializer
WAR applications should extend SpringServletInitializer to take advantage
of Servlet 3.0 initialization and SpringApplication context loading features.

[#48386505] [bs-52] Support for running "traditional" webapps in place
2013-06-11 07:40:33 +01:00
Dave Syer e011312c68 [bs-138] Make it easy to secure only the management endpoints
Example: web UI with publicly available static assets

    # application.properties:
    security.ignored: /css/**,/script/**

Example: web UI with publicly available everything, but secure
management endpoints.

    # application.properties:
    # Empty path for basic security (default is /**)
    security.basic.path=

[Fixes #50721675]
2013-06-06 22:10:20 +01:00
Dave Syer fc021fc86a Some javadocs 2013-06-05 06:58:35 +01:00
Dave Syer e60efc7e55 [bs-17], [bs-146] Add some ApplicationContextInitializers
* One for Cloud Foundry and one for the application context ID
* If app runs in Cloud Foundry vcap.application.* and vcap.services.*
will be populated in the Environment
* The ApplicationContext ID is set to something supposedly unique
(e.g. name:index in a Cloud Foundry app)

[#50968415] [#48153639]
2013-06-04 16:33:20 +01:00
Dave Syer e0d7fc2240 Tweaks to config file intializer 2013-06-04 10:51:11 +01:00
Dave Syer c99d7a0a09 Use ResourceLoader from condition context if avilable 2013-06-03 09:41:15 +01:00
Phillip Webb aded15227f [bs-36] Add Tomcat/Jett MVC integration tests
Add integration tests to check that embedded Jetty and Tomcat containers
can run full Spring MVC applications.
2013-06-02 12:28:15 -07:00
Phillip Webb a4aef0e0e9 [bs-52] Allow war files to run in place
Update AbstractEmbeddedServletContainerFactory to detect the document
root from a classically packaged war file.

[#48386505] [bs-52] Support for running "traditional" webapps in place
2013-06-02 12:24:51 -07:00
Dave Syer 3c34326208 [bs-141] Add Bootstrap WebApplicationInitializer got traditional wars
[#50806851] [bs-141] First class escape hatch from jar to war for web applications
2013-06-01 14:43:55 +01:00
Phillip Webb 7e3c158f3a Polish 2013-05-31 12:26:30 -07:00
Dave Syer 969c7d6fa1 Make sure ThymeleafAutoConfiguration works if imported directly
Before this change if Layout dialect not available then the nested class is
loaded and barfs because it depended on the layout dialect (in a
@ConditionalOnClass annotation).
2013-05-31 16:18:03 +01:00
Dave Syer 990627b328 [bs-144] Make EmbedddedContainerConfiguration an import selector
Previously EmbedddedContainerConfiguration cannot be imported directly.
This change ensures that the nested classes are not loaded automatically
so there can be no issues with the annotation parameters.

There might be a case for a change in Spring here since the framework
itself could just be more cautious when processing nested classes.

[Fixes #50880927]
2013-05-31 13:24:04 +01:00
Dave Syer 6c22e0ab6e [bs-140] Extract framework-provided @ConfigurationProperties into @Bean
Allows @ConfigurationProperties beans to be declared explicitly (to set default values)

[#50804109]
2013-05-31 13:02:30 +01:00
Dave Syer cf201ffd80 [bs-142] Add @AssertMissingBean
Example usage is to fail fast if trying to provide
a @ConfigurationProperties bean and it was already
defined

[Fixes #50812235]
2013-05-30 14:15:06 +01:00
Dave Syer 8023a862c3 Add test for @ConfigurationProperties
Various parent context topologies are tried to ensure that the properties
are bound sensibly.

[#50804109] Allow @ConfigurationProperties beans to be declared
explicitly (to set default values)
2013-05-30 11:22:03 +01:00
Dave Syer 3ba5f56808 [bs-138] Add @OnManagementContext for management beans
User adds @OnManagementContext to a bean or @Configuration and
it should be included in the management context (if there is one)
whether it is the main context or a child.

Makes it easy to secure the management endpoints and keep
the rest open (see actuator-ui-sample).

[#50721675]
2013-05-30 08:43:50 +01:00
Dave Syer 729cfe813b [bs-22] Add more unit tests 2013-05-29 09:37:31 +01:00
Dave Syer aabff1a774 [bs-61] Allow non-default servlets and filters to be registered
* The RegistrationBean (ServletInitializer) now exposes a registration
target object, and this is used to prevent double registration of those
objects.
* If there is a Servlet with bean id "dispatcherServlet" it is mapped to
"/" (unless already registered as a ServletRegistrationBean).

[Fixes #48645559]
2013-05-29 07:41:48 +01:00
Dave Syer b7c0e3279e [bs-22] Add loads of actuator tests
Discovered a few issues along the way and refactored
accordingly.

[#48127729] [bs-22] Add missing unit tests
2013-05-23 18:37:48 +01:00