Browse Source

Consistent license header

pull/1031/head
Juergen Hoeller 10 years ago
parent
commit
537193a4e0
  1. 21
      spring-context/src/main/java/org/springframework/cache/annotation/EnableCaching.java
  2. 17
      spring-context/src/main/java/org/springframework/context/annotation/Bean.java
  3. 69
      spring-context/src/main/java/org/springframework/context/annotation/Configuration.java
  4. 9
      spring-context/src/main/java/org/springframework/context/annotation/EnableAspectJAutoProxy.java
  5. 25
      spring-context/src/main/java/org/springframework/context/annotation/EnableLoadTimeWeaving.java
  6. 5
      spring-context/src/main/java/org/springframework/context/annotation/PropertySource.java
  7. 13
      spring-context/src/main/java/org/springframework/scheduling/annotation/EnableAsync.java
  8. 9
      spring-context/src/main/java/org/springframework/scheduling/annotation/EnableScheduling.java
  9. 16
      spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerProxyTargetClassTests.java
  10. 16
      spring-context/src/test/java/org/springframework/jmx/IJmxTestBean.java
  11. 16
      spring-context/src/test/java/org/springframework/jmx/JmxTestBean.java
  12. 17
      spring-context/src/test/java/org/springframework/jmx/access/MBeanClientInterceptorTests.java
  13. 20
      spring-context/src/test/java/org/springframework/jmx/access/RemoteMBeanClientInterceptorTests.java
  14. 16
      spring-context/src/test/java/org/springframework/jmx/export/CustomDateEditorRegistrar.java
  15. 16
      spring-context/src/test/java/org/springframework/jmx/export/CustomEditorConfigurerTests.java
  16. 16
      spring-context/src/test/java/org/springframework/jmx/export/DateRange.java
  17. 16
      spring-context/src/test/java/org/springframework/jmx/export/ExceptionOnInitBean.java
  18. 16
      spring-context/src/test/java/org/springframework/jmx/export/LazyInitMBeanTests.java
  19. 16
      spring-context/src/test/java/org/springframework/jmx/export/PropertyPlaceholderConfigurerTests.java
  20. 22
      spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationLazyInitMBeanTests.java
  21. 16
      spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationTestBean.java
  22. 16
      spring-context/src/test/java/org/springframework/jmx/export/annotation/JmxUtilsAnnotationTests.java
  23. 20
      spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractAutodetectTests.java
  24. 16
      spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractJmxAssemblerTests.java
  25. 16
      spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerAutodetectTests.java
  26. 16
      spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerTests.java
  27. 16
      spring-context/src/test/java/org/springframework/jmx/export/assembler/ICustomBase.java
  28. 16
      spring-context/src/test/java/org/springframework/jmx/export/assembler/ICustomJmxBean.java
  29. 17
      spring-context/src/test/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssemblerCustomTests.java
  30. 16
      spring-context/src/test/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssemblerTests.java
  31. 17
      spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerMappedTests.java
  32. 17
      spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerTests.java
  33. 20
      spring-context/src/test/java/org/springframework/jmx/export/assembler/ReflectiveAssemblerTests.java
  34. 20
      spring-context/src/test/java/org/springframework/jmx/export/naming/AbstractNamingStrategyTests.java
  35. 17
      spring-context/src/test/java/org/springframework/jmx/export/naming/KeyNamingStrategyTests.java
  36. 16
      spring-context/src/test/java/org/springframework/jmx/export/naming/PropertiesFileNamingStrategyTests.java
  37. 17
      spring-context/src/test/java/org/springframework/jmx/export/naming/PropertiesNamingStrategyTests.java
  38. 19
      spring-context/src/test/java/org/springframework/jmx/support/ConnectorServerFactoryBeanTests.java
  39. 35
      spring-context/src/test/java/org/springframework/jmx/support/JmxUtilsTests.java
  40. 17
      spring-context/src/test/java/org/springframework/jmx/support/MBeanServerFactoryBeanTests.java
  41. 34
      spring-core/src/main/java/org/springframework/core/env/CommandLinePropertySource.java
  42. 14
      spring-core/src/main/java/org/springframework/util/Assert.java
  43. 16
      spring-jdbc/src/main/java/org/springframework/jdbc/object/BatchSqlUpdate.java
  44. 24
      spring-jms/src/main/java/org/springframework/jms/annotation/EnableJms.java
  45. 16
      spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/DelegatingWebConnection.java
  46. 16
      spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/ForwardRequestPostProcessor.java
  47. 16
      spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/HostRequestMatcher.java
  48. 16
      spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/HtmlUnitRequestBuilder.java
  49. 16
      spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebClientBuilder.java
  50. 14
      spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnection.java
  51. 14
      spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnectionBuilderSupport.java
  52. 16
      spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockWebResponseBuilder.java
  53. 22
      spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/UrlRegexRequestMatcher.java
  54. 16
      spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/WebRequestMatcher.java
  55. 26
      spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/webdriver/MockMvcHtmlUnitDriverBuilder.java
  56. 54
      spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/webdriver/WebConnectionHtmlUnitDriver.java
  57. 15
      spring-test/src/main/java/org/springframework/test/web/servlet/setup/PatternMappingFilterProxy.java
  58. 16
      spring-test/src/test/java/org/springframework/mock/web/MockFilterChainTests.java
  59. 16
      spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/AbstractWebRequestMatcherTests.java
  60. 38
      spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/DelegatingWebConnectionTests.java
  61. 16
      spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/ForwardController.java
  62. 16
      spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/HelloController.java
  63. 16
      spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/HostRequestMatcherTests.java
  64. 20
      spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebClientBuilderTests.java
  65. 25
      spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnectionTests.java
  66. 29
      spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockWebResponseBuilderTests.java
  67. 16
      spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/UrlRegexRequestMatcherTests.java
  68. 22
      spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/webdriver/MockMvcHtmlUnitDriverBuilderTests.java
  69. 27
      spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/webdriver/WebConnectionHtmlUnitDriverTests.java
  70. 15
      spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/FilterTests.java
  71. 16
      spring-test/src/test/java/org/springframework/test/web/servlet/setup/ConditionalDelegatingFilterProxyTests.java
  72. 16
      spring-test/src/test/java/org/springframework/test/web/servlet/setup/DefaultMockMvcBuilderTests.java
  73. 18
      spring-tx/src/main/java/org/springframework/transaction/annotation/EnableTransactionManagement.java
  74. 16
      spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/EnableWebMvc.java
  75. 16
      spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/EnableWebSocket.java
  76. 19
      spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/EnableWebSocketMessageBroker.java

21
spring-context/src/main/java/org/springframework/cache/annotation/EnableCaching.java vendored

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -27,14 +27,16 @@ import org.springframework.context.annotation.Import;
import org.springframework.core.Ordered; import org.springframework.core.Ordered;
/** /**
* Enables Spring's annotation-driven cache management capability, similar to * Enables Spring's annotation-driven cache management capability, similar to the
* the support found in Spring's {@code <cache:*>} XML namespace. To be used together * support found in Spring's {@code <cache:*>} XML namespace. To be used together
* with @{@link org.springframework.context.annotation.Configuration Configuration} * with @{@link org.springframework.context.annotation.Configuration Configuration}
* classes as follows: * classes as follows:
*
* <pre class="code"> * <pre class="code">
* &#064;Configuration * &#064;Configuration
* &#064;EnableCaching * &#064;EnableCaching
* public class AppConfig { * public class AppConfig {
*
* &#064;Bean * &#064;Bean
* public MyService myService() { * public MyService myService() {
* // configure and return a class having &#064;Cacheable methods * // configure and return a class having &#064;Cacheable methods
@ -52,11 +54,15 @@ import org.springframework.core.Ordered;
* *
* <p>For reference, the example above can be compared to the following Spring XML * <p>For reference, the example above can be compared to the following Spring XML
* configuration: * configuration:
*
* <pre class="code"> * <pre class="code">
* {@code * {@code
* <beans> * <beans>
*
* <cache:annotation-driven/> * <cache:annotation-driven/>
*
* <bean id="myService" class="com.foo.MyService"/> * <bean id="myService" class="com.foo.MyService"/>
*
* <bean id="cacheManager" class="org.springframework.cache.support.SimpleCacheManager"> * <bean id="cacheManager" class="org.springframework.cache.support.SimpleCacheManager">
* <property name="caches"> * <property name="caches">
* <set> * <set>
@ -66,8 +72,10 @@ import org.springframework.core.Ordered;
* </set> * </set>
* </property> * </property>
* </bean> * </bean>
*
* </beans> * </beans>
* }</pre> * }</pre>
*
* In both of the scenarios above, {@code @EnableCaching} and {@code * In both of the scenarios above, {@code @EnableCaching} and {@code
* <cache:annotation-driven/>} are responsible for registering the necessary Spring * <cache:annotation-driven/>} are responsible for registering the necessary Spring
* components that power annotation-driven cache management, such as the * components that power annotation-driven cache management, such as the
@ -90,12 +98,14 @@ import org.springframework.core.Ordered;
* *
* <p>For those that wish to establish a more direct relationship between * <p>For those that wish to establish a more direct relationship between
* {@code @EnableCaching} and the exact cache manager bean to be used, * {@code @EnableCaching} and the exact cache manager bean to be used,
* the {@link CachingConfigurer} callback interface may be implemented - notice the * the {@link CachingConfigurer} callback interface may be implemented.
* the {@code @Override}-annotated methods below: * Notice the the {@code @Override}-annotated methods below:
*
* <pre class="code"> * <pre class="code">
* &#064;Configuration * &#064;Configuration
* &#064;EnableCaching * &#064;EnableCaching
* public class AppConfig extends CachingConfigurerSupport { * public class AppConfig extends CachingConfigurerSupport {
*
* &#064;Bean * &#064;Bean
* public MyService myService() { * public MyService myService() {
* // configure and return a class having &#064;Cacheable methods * // configure and return a class having &#064;Cacheable methods
@ -118,6 +128,7 @@ import org.springframework.core.Ordered;
* return new MyKeyGenerator(); * return new MyKeyGenerator();
* } * }
* }</pre> * }</pre>
*
* This approach may be desirable simply because it is more explicit, or it may be * This approach may be desirable simply because it is more explicit, or it may be
* necessary in order to distinguish between two {@code CacheManager} beans present in the * necessary in order to distinguish between two {@code CacheManager} beans present in the
* same container. * same container.

17
spring-context/src/main/java/org/springframework/context/annotation/Bean.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2014 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -39,7 +39,8 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition;
* public MyBean myBean() { * public MyBean myBean() {
* // instantiate and configure MyBean obj * // instantiate and configure MyBean obj
* return obj; * return obj;
* }</pre> * }
* </pre>
* *
* <h3>Bean Names</h3> * <h3>Bean Names</h3>
* *
@ -55,7 +56,8 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition;
* public MyBean myBean() { * public MyBean myBean() {
* // instantiate and configure MyBean obj * // instantiate and configure MyBean obj
* return obj; * return obj;
* }</pre> * }
* </pre>
* *
* <h3>Scope, DependsOn, Primary, and Lazy</h3> * <h3>Scope, DependsOn, Primary, and Lazy</h3>
* *
@ -70,7 +72,8 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition;
* public MyBean myBean() { * public MyBean myBean() {
* // instantiate and configure MyBean obj * // instantiate and configure MyBean obj
* return obj; * return obj;
* }</pre> * }
* </pre>
* *
* <h3>{@code @Bean} Methods in {@code @Configuration} Classes</h3> * <h3>{@code @Bean} Methods in {@code @Configuration} Classes</h3>
* *
@ -87,14 +90,17 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition;
* <pre class="code"> * <pre class="code">
* &#064;Configuration * &#064;Configuration
* public class AppConfig { * public class AppConfig {
*
* &#064;Bean * &#064;Bean
* public FooService fooService() { * public FooService fooService() {
* return new FooService(fooRepository()); * return new FooService(fooRepository());
* } * }
*
* &#064;Bean * &#064;Bean
* public FooRepository fooRepository() { * public FooRepository fooRepository() {
* return new JdbcFooRepository(dataSource()); * return new JdbcFooRepository(dataSource());
* } * }
*
* // ... * // ...
* }</pre> * }</pre>
* *
@ -152,7 +158,8 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition;
* &#064;Bean * &#064;Bean
* public static PropertyPlaceholderConfigurer ppc() { * public static PropertyPlaceholderConfigurer ppc() {
* // instantiate, configure and return ppc ... * // instantiate, configure and return ppc ...
* }</pre> * }
* </pre>
* *
* By marking this method as {@code static}, it can be invoked without causing instantiation of its * By marking this method as {@code static}, it can be invoked without causing instantiation of its
* declaring {@code @Configuration} class, thus avoiding the above-mentioned lifecycle conflicts. * declaring {@code @Configuration} class, thus avoiding the above-mentioned lifecycle conflicts.

69
spring-context/src/main/java/org/springframework/context/annotation/Configuration.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2014 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -27,12 +27,14 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/** /**
* Indicates that a class declares one or more {@link Bean @Bean} methods and may be processed * Indicates that a class declares one or more {@link Bean @Bean} methods and
* by the Spring container to generate bean definitions and service requests for those * may be processed by the Spring container to generate bean definitions and
* beans at runtime, for example: * service requests for those beans at runtime, for example:
*
* <pre class="code"> * <pre class="code">
* &#064;Configuration * &#064;Configuration
* public class AppConfig { * public class AppConfig {
*
* &#064;Bean * &#064;Bean
* public MyBean myBean() { * public MyBean myBean() {
* // instantiate, configure and return bean ... * // instantiate, configure and return bean ...
@ -40,25 +42,28 @@ import org.springframework.stereotype.Component;
* }</pre> * }</pre>
* *
* <h2>Bootstrapping {@code @Configuration} classes</h2> * <h2>Bootstrapping {@code @Configuration} classes</h2>
*
* <h3>Via {@code AnnotationConfigApplicationContext}</h3> * <h3>Via {@code AnnotationConfigApplicationContext}</h3>
*
* {@code @Configuration} classes are typically bootstrapped using either * {@code @Configuration} classes are typically bootstrapped using either
* {@link AnnotationConfigApplicationContext} or its web-capable variant, * {@link AnnotationConfigApplicationContext} or its web-capable variant,
* {@link org.springframework.web.context.support.AnnotationConfigWebApplicationContext * {@link org.springframework.web.context.support.AnnotationConfigWebApplicationContext
* AnnotationConfigWebApplicationContext}. * AnnotationConfigWebApplicationContext}. A simple example with the former follows:
* A simple example with the former follows: *
* <pre class="code"> * <pre class="code">
* AnnotationConfigApplicationContext ctx = * AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
* new AnnotationConfigApplicationContext();
* ctx.register(AppConfig.class); * ctx.register(AppConfig.class);
* ctx.refresh(); * ctx.refresh();
* MyBean myBean = ctx.getBean(MyBean.class); * MyBean myBean = ctx.getBean(MyBean.class);
* // use myBean ...</pre> * // use myBean ...
* </pre>
* *
* See {@link AnnotationConfigApplicationContext} Javadoc for further details and see * See {@link AnnotationConfigApplicationContext} Javadoc for further details and see
* {@link org.springframework.web.context.support.AnnotationConfigWebApplicationContext * {@link org.springframework.web.context.support.AnnotationConfigWebApplicationContext
* AnnotationConfigWebApplicationContext} for {@code web.xml} configuration instructions. * AnnotationConfigWebApplicationContext} for {@code web.xml} configuration instructions.
* *
* <h3>Via Spring {@code <beans>} XML</h3> * <h3>Via Spring {@code <beans>} XML</h3>
*
* <p>As an alternative to registering {@code @Configuration} classes directly against an * <p>As an alternative to registering {@code @Configuration} classes directly against an
* {@code AnnotationConfigApplicationContext}, {@code @Configuration} classes may be * {@code AnnotationConfigApplicationContext}, {@code @Configuration} classes may be
* declared as normal {@code <bean>} definitions within Spring XML files: * declared as normal {@code <bean>} definitions within Spring XML files:
@ -74,6 +79,7 @@ import org.springframework.stereotype.Component;
* post processors that facilitate handling {@code @Configuration} classes. * post processors that facilitate handling {@code @Configuration} classes.
* *
* <h3>Via component scanning</h3> * <h3>Via component scanning</h3>
*
* <p>{@code @Configuration} is meta-annotated with {@link Component @Component}, therefore * <p>{@code @Configuration} is meta-annotated with {@link Component @Component}, therefore
* {@code @Configuration} classes are candidates for component scanning (typically using * {@code @Configuration} classes are candidates for component scanning (typically using
* Spring XML's {@code <context:component-scan/>} element) and therefore may also take * Spring XML's {@code <context:component-scan/>} element) and therefore may also take
@ -82,6 +88,7 @@ import org.springframework.stereotype.Component;
* <p>{@code @Configuration} classes may not only be bootstrapped using * <p>{@code @Configuration} classes may not only be bootstrapped using
* component scanning, but may also themselves <em>configure</em> component scanning using * component scanning, but may also themselves <em>configure</em> component scanning using
* the {@link ComponentScan @ComponentScan} annotation: * the {@link ComponentScan @ComponentScan} annotation:
*
* <pre class="code"> * <pre class="code">
* &#064;Configuration * &#064;Configuration
* &#064;ComponentScan("com.acme.app.services") * &#064;ComponentScan("com.acme.app.services")
@ -89,18 +96,20 @@ import org.springframework.stereotype.Component;
* // various &#064;Bean definitions ... * // various &#064;Bean definitions ...
* }</pre> * }</pre>
* *
* See {@link ComponentScan @ComponentScan} Javadoc for details. * See the {@link ComponentScan @ComponentScan} javadoc for details.
*
* *
* <h2>Working with externalized values</h2> * <h2>Working with externalized values</h2>
*
* <h3>Using the {@code Environment} API</h3> * <h3>Using the {@code Environment} API</h3>
*
* Externalized values may be looked up by injecting the Spring * Externalized values may be looked up by injecting the Spring
* {@link org.springframework.core.env.Environment Environment} into a * {@link org.springframework.core.env.Environment} into a {@code @Configuration}
* {@code @Configuration} class using the {@code @Autowired} or the {@code @Inject} * class using the {@code @Autowired} or the {@code @Inject} annotation:
* annotation: *
* <pre class="code"> * <pre class="code">
* &#064;Configuration * &#064;Configuration
* public class AppConfig { * public class AppConfig {
*
* &#064Inject Environment env; * &#064Inject Environment env;
* *
* &#064;Bean * &#064;Bean
@ -115,10 +124,12 @@ import org.springframework.stereotype.Component;
* source" objects, and {@code @Configuration} classes may contribute property sources to * source" objects, and {@code @Configuration} classes may contribute property sources to
* the {@code Environment} object using * the {@code Environment} object using
* the {@link org.springframework.core.env.PropertySources @PropertySources} annotation: * the {@link org.springframework.core.env.PropertySources @PropertySources} annotation:
*
* <pre class="code"> * <pre class="code">
* &#064;Configuration * &#064;Configuration
* &#064;PropertySource("classpath:/com/acme/app.properties") * &#064;PropertySource("classpath:/com/acme/app.properties")
* public class AppConfig { * public class AppConfig {
*
* &#064Inject Environment env; * &#064Inject Environment env;
* *
* &#064;Bean * &#064;Bean
@ -131,12 +142,15 @@ import org.springframework.stereotype.Component;
* and {@link PropertySource @PropertySource} Javadoc for further details. * and {@link PropertySource @PropertySource} Javadoc for further details.
* *
* <h3>Using the {@code @Value} annotation</h3> * <h3>Using the {@code @Value} annotation</h3>
*
* Externalized values may be 'wired into' {@code @Configuration} classes using * Externalized values may be 'wired into' {@code @Configuration} classes using
* the {@link Value @Value} annotation: * the {@link Value @Value} annotation:
*
* <pre class="code"> * <pre class="code">
* &#064;Configuration * &#064;Configuration
* &#064;PropertySource("classpath:/com/acme/app.properties") * &#064;PropertySource("classpath:/com/acme/app.properties")
* public class AppConfig { * public class AppConfig {
*
* &#064Value("${bean.name}") String beanName; * &#064Value("${bean.name}") String beanName;
* *
* &#064;Bean * &#064;Bean
@ -155,14 +169,18 @@ import org.springframework.stereotype.Component;
* {@code PropertySourcesPlaceholderConfigurer}. * {@code PropertySourcesPlaceholderConfigurer}.
* *
* <h2>Composing {@code @Configuration} classes</h2> * <h2>Composing {@code @Configuration} classes</h2>
*
* <h3>With the {@code @Import} annotation</h3> * <h3>With the {@code @Import} annotation</h3>
*
* <p>{@code @Configuration} classes may be composed using the {@link Import @Import} annotation, * <p>{@code @Configuration} classes may be composed using the {@link Import @Import} annotation,
* not unlike the way that {@code <import>} works in Spring XML. Because * not unlike the way that {@code <import>} works in Spring XML. Because
* {@code @Configuration} objects are managed as Spring beans within the container, * {@code @Configuration} objects are managed as Spring beans within the container,
* imported configurations may be injected using {@code @Autowired} or {@code @Inject}: * imported configurations may be injected using {@code @Autowired} or {@code @Inject}:
*
* <pre class="code"> * <pre class="code">
* &#064;Configuration * &#064;Configuration
* public class DatabaseConfig { * public class DatabaseConfig {
*
* &#064;Bean * &#064;Bean
* public DataSource dataSource() { * public DataSource dataSource() {
* // instantiate, configure and return DataSource * // instantiate, configure and return DataSource
@ -172,6 +190,7 @@ import org.springframework.stereotype.Component;
* &#064;Configuration * &#064;Configuration
* &#064;Import(DatabaseConfig.class) * &#064;Import(DatabaseConfig.class)
* public class AppConfig { * public class AppConfig {
*
* &#064Inject DatabaseConfig dataConfig; * &#064Inject DatabaseConfig dataConfig;
* *
* &#064;Bean * &#064;Bean
@ -188,13 +207,15 @@ import org.springframework.stereotype.Component;
* new AnnotationConfigApplicationContext(AppConfig.class);</pre> * new AnnotationConfigApplicationContext(AppConfig.class);</pre>
* *
* <h3>With the {@code @Profile} annotation</h3> * <h3>With the {@code @Profile} annotation</h3>
*
* {@code @Configuration} classes may be marked with the {@link Profile @Profile} annotation to * {@code @Configuration} classes may be marked with the {@link Profile @Profile} annotation to
* indicate they should be processed only if a given profile or profiles are * indicate they should be processed only if a given profile or profiles are <em>active</em>:
* <em>active</em>: *
* <pre class="code"> * <pre class="code">
* &#064;Profile("embedded") * &#064;Profile("embedded")
* &#064;Configuration * &#064;Configuration
* public class EmbeddedDatabaseConfig { * public class EmbeddedDatabaseConfig {
*
* &#064;Bean * &#064;Bean
* public DataSource dataSource() { * public DataSource dataSource() {
* // instantiate, configure and return embedded DataSource * // instantiate, configure and return embedded DataSource
@ -204,25 +225,29 @@ import org.springframework.stereotype.Component;
* &#064;Profile("production") * &#064;Profile("production")
* &#064;Configuration * &#064;Configuration
* public class ProductionDatabaseConfig { * public class ProductionDatabaseConfig {
*
* &#064;Bean * &#064;Bean
* public DataSource dataSource() { * public DataSource dataSource() {
* // instantiate, configure and return production DataSource * // instantiate, configure and return production DataSource
* } * }
* }</pre> * }</pre>
* *
* See {@link Profile @Profile} and {@link org.springframework.core.env.Environment Environment} * See the {@link Profile @Profile} and {@link org.springframework.core.env.Environment}
* Javadoc for further details. * javadocs for further details.
* *
* <h3>With Spring XML using the {@code @ImportResource} annotation</h3> * <h3>With Spring XML using the {@code @ImportResource} annotation</h3>
*
* As mentioned above, {@code @Configuration} classes may be declared as regular Spring * As mentioned above, {@code @Configuration} classes may be declared as regular Spring
* {@code <bean>} definitions within Spring XML files. It is also possible to * {@code <bean>} definitions within Spring XML files. It is also possible to
* import Spring XML configuration files into {@code @Configuration} classes using * import Spring XML configuration files into {@code @Configuration} classes using
* the {@link ImportResource @ImportResource} annotation. Bean definitions imported from XML can be * the {@link ImportResource @ImportResource} annotation. Bean definitions imported from XML can be
* injected using {@code @Autowired} or {@code @Inject}: * injected using {@code @Autowired} or {@code @Inject}:
*
* <pre class="code"> * <pre class="code">
* &#064;Configuration * &#064;Configuration
* &#064;ImportResource("classpath:/com/acme/database-config.xml") * &#064;ImportResource("classpath:/com/acme/database-config.xml")
* public class AppConfig { * public class AppConfig {
*
* &#064Inject DataSource dataSource; // from XML * &#064Inject DataSource dataSource; // from XML
* *
* &#064;Bean * &#064;Bean
@ -233,10 +258,13 @@ import org.springframework.stereotype.Component;
* }</pre> * }</pre>
* *
* <h3>With nested {@code @Configuration} classes</h3> * <h3>With nested {@code @Configuration} classes</h3>
*
* {@code @Configuration} classes may be nested within one another as follows: * {@code @Configuration} classes may be nested within one another as follows:
*
* <pre class="code"> * <pre class="code">
* &#064;Configuration * &#064;Configuration
* public class AppConfig { * public class AppConfig {
*
* &#064;Inject DataSource dataSource; * &#064;Inject DataSource dataSource;
* *
* &#064;Bean * &#064;Bean
@ -264,6 +292,7 @@ import org.springframework.stereotype.Component;
* enclosing {@code @Configuration} class. * enclosing {@code @Configuration} class.
* *
* <h2>Configuring lazy initialization</h2> * <h2>Configuring lazy initialization</h2>
*
* <p>By default, {@code @Bean} methods will be <em>eagerly instantiated</em> at container * <p>By default, {@code @Bean} methods will be <em>eagerly instantiated</em> at container
* bootstrap time. To avoid this, {@code @Configuration} may be used in conjunction with * bootstrap time. To avoid this, {@code @Configuration} may be used in conjunction with
* the {@link Lazy @Lazy} annotation to indicate that all {@code @Bean} methods declared within * the {@link Lazy @Lazy} annotation to indicate that all {@code @Bean} methods declared within
@ -271,9 +300,11 @@ import org.springframework.stereotype.Component;
* individual {@code @Bean} methods as well. * individual {@code @Bean} methods as well.
* *
* <h2>Testing support for {@code @Configuration} classes</h2> * <h2>Testing support for {@code @Configuration} classes</h2>
*
* The Spring <em>TestContext framework</em> available in the {@code spring-test} module * The Spring <em>TestContext framework</em> available in the {@code spring-test} module
* provides the {@code @ContextConfiguration} annotation, which as of Spring 3.1 can * provides the {@code @ContextConfiguration} annotation, which as of Spring 3.1 can
* accept an array of {@code @Configuration} {@code Class} objects: * accept an array of {@code @Configuration} {@code Class} objects:
*
* <pre class="code"> * <pre class="code">
* &#064;RunWith(SpringJUnit4ClassRunner.class) * &#064;RunWith(SpringJUnit4ClassRunner.class)
* &#064;ContextConfiguration(classes={AppConfig.class, DatabaseConfig.class}) * &#064;ContextConfiguration(classes={AppConfig.class, DatabaseConfig.class})
@ -292,6 +323,7 @@ import org.springframework.stereotype.Component;
* See TestContext framework reference documentation for details. * See TestContext framework reference documentation for details.
* *
* <h2>Enabling built-in Spring features using {@code @Enable} annotations</h2> * <h2>Enabling built-in Spring features using {@code @Enable} annotations</h2>
*
* Spring features such as asynchronous method execution, scheduled task execution, * Spring features such as asynchronous method execution, scheduled task execution,
* annotation driven transaction management, and even Spring MVC can be enabled and * annotation driven transaction management, and even Spring MVC can be enabled and
* configured from {@code @Configuration} * configured from {@code @Configuration}
@ -304,6 +336,7 @@ import org.springframework.stereotype.Component;
* for details. * for details.
* *
* <h2>Constraints when authoring {@code @Configuration} classes</h2> * <h2>Constraints when authoring {@code @Configuration} classes</h2>
*
* <ul> * <ul>
* <li>&#064;Configuration classes must be non-final * <li>&#064;Configuration classes must be non-final
* <li>&#064;Configuration classes must be non-local (may not be declared within a method) * <li>&#064;Configuration classes must be non-local (may not be declared within a method)

9
spring-context/src/main/java/org/springframework/context/annotation/EnableAspectJAutoProxy.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2011 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -31,6 +31,7 @@ import java.lang.annotation.Target;
* &#064;Configuration * &#064;Configuration
* &#064;EnableAspectJAutoProxy * &#064;EnableAspectJAutoProxy
* public class AppConfig { * public class AppConfig {
*
* &#064;Bean * &#064;Bean
* public FooService fooService() { * public FooService fooService() {
* return new FooService(); * return new FooService();
@ -47,12 +48,14 @@ import java.lang.annotation.Target;
* *
* <pre class="code"> * <pre class="code">
* public class FooService { * public class FooService {
*
* // various methods * // various methods
* }</pre> * }</pre>
* *
* <pre class="code"> * <pre class="code">
* &#064;Aspect * &#064;Aspect
* public class MyAspect { * public class MyAspect {
*
* &#064;Before("execution(* FooService+.*(..))") * &#064;Before("execution(* FooService+.*(..))")
* public void advice() { * public void advice() {
* // advise FooService methods as appropriate * // advise FooService methods as appropriate
@ -66,6 +69,7 @@ import java.lang.annotation.Target;
* <p>Users can control the type of proxy that gets created for {@code FooService} using * <p>Users can control the type of proxy that gets created for {@code FooService} using
* the {@link #proxyTargetClass()} attribute. The following enables CGLIB-style 'subclass' * the {@link #proxyTargetClass()} attribute. The following enables CGLIB-style 'subclass'
* proxies as opposed to the default interface-based JDK proxy approach. * proxies as opposed to the default interface-based JDK proxy approach.
*
* <pre class="code"> * <pre class="code">
* &#064;Configuration * &#064;Configuration
* &#064;EnableAspectJAutoProxy(proxyTargetClass=true) * &#064;EnableAspectJAutoProxy(proxyTargetClass=true)
@ -75,6 +79,7 @@ import java.lang.annotation.Target;
* *
* <p>Note that {@code @Aspect} beans may be component-scanned like any other. Simply * <p>Note that {@code @Aspect} beans may be component-scanned like any other. Simply
* mark the aspect with both {@code @Aspect} and {@code @Component}: * mark the aspect with both {@code @Aspect} and {@code @Component}:
*
* <pre class="code"> * <pre class="code">
* package com.foo; * package com.foo;
* *
@ -86,11 +91,13 @@ import java.lang.annotation.Target;
* public class MyAspect { ... }</pre> * public class MyAspect { ... }</pre>
* *
* Then use the @{@link ComponentScan} annotation to pick both up: * Then use the @{@link ComponentScan} annotation to pick both up:
*
* <pre class="code"> * <pre class="code">
* &#064;Configuration * &#064;Configuration
* &#064;ComponentScan("com.foo") * &#064;ComponentScan("com.foo")
* &#064;EnableAspectJAutoProxy * &#064;EnableAspectJAutoProxy
* public class AppConfig { * public class AppConfig {
*
* // no explicit &#064Bean definitions required * // no explicit &#064Bean definitions required
* }</pre> * }</pre>
* *

25
spring-context/src/main/java/org/springframework/context/annotation/EnableLoadTimeWeaving.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -29,22 +29,28 @@ import org.springframework.instrument.classloading.LoadTimeWeaver;
* Activates a Spring {@link LoadTimeWeaver} for this application context, available as * Activates a Spring {@link LoadTimeWeaver} for this application context, available as
* a bean with the name "loadTimeWeaver", similar to the {@code <context:load-time-weaver>} * a bean with the name "loadTimeWeaver", similar to the {@code <context:load-time-weaver>}
* element in Spring XML. * element in Spring XML.
* To be used *
* on @{@link org.springframework.context.annotation.Configuration Configuration} classes; * <p>To be used on @{@link org.springframework.context.annotation.Configuration Configuration} classes;
* the simplest possible example of which follows: * the simplest possible example of which follows:
*
* <pre class="code"> * <pre class="code">
* &#064;Configuration * &#064;Configuration
* &#064;EnableLoadTimeWeaving * &#064;EnableLoadTimeWeaving
* public class AppConfig { * public class AppConfig {
*
* // application-specific &#064;Bean definitions ... * // application-specific &#064;Bean definitions ...
* }</pre> * }</pre>
* *
* The example above is equivalent to the following Spring XML configuration: * The example above is equivalent to the following Spring XML configuration:
*
* <pre class="code"> * <pre class="code">
* {@code * {@code
* <beans> * <beans>
*
* <context:load-time-weaver/> * <context:load-time-weaver/>
*
* <!-- application-specific <bean> definitions --> * <!-- application-specific <bean> definitions -->
*
* </beans> * </beans>
* }</pre> * }</pre>
* *
@ -61,10 +67,12 @@ import org.springframework.instrument.classloading.LoadTimeWeaver;
* {@code @EnableLoadTimeWeaving} may also implement the {@link LoadTimeWeavingConfigurer} * {@code @EnableLoadTimeWeaving} may also implement the {@link LoadTimeWeavingConfigurer}
* interface and return a custom {@code LoadTimeWeaver} instance through the * interface and return a custom {@code LoadTimeWeaver} instance through the
* {@code #getLoadTimeWeaver} method: * {@code #getLoadTimeWeaver} method:
*
* <pre class="code"> * <pre class="code">
* &#064;Configuration * &#064;Configuration
* &#064;EnableLoadTimeWeaving * &#064;EnableLoadTimeWeaving
* public class AppConfig implements LoadTimeWeavingConfigurer { * public class AppConfig implements LoadTimeWeavingConfigurer {
*
* &#064;Override * &#064;Override
* public LoadTimeWeaver getLoadTimeWeaver() { * public LoadTimeWeaver getLoadTimeWeaver() {
* MyLoadTimeWeaver ltw = new MyLoadTimeWeaver(); * MyLoadTimeWeaver ltw = new MyLoadTimeWeaver();
@ -75,10 +83,13 @@ import org.springframework.instrument.classloading.LoadTimeWeaver;
* }</pre> * }</pre>
* *
* <p>The example above can be compared to the following Spring XML configuration: * <p>The example above can be compared to the following Spring XML configuration:
*
* <pre class="code"> * <pre class="code">
* {@code * {@code
* <beans> * <beans>
*
* <context:load-time-weaver weaverClass="com.acme.MyLoadTimeWeaver"/> * <context:load-time-weaver weaverClass="com.acme.MyLoadTimeWeaver"/>
*
* </beans> * </beans>
* }</pre> * }</pre>
* *
@ -94,6 +105,7 @@ import org.springframework.instrument.classloading.LoadTimeWeaver;
* be registered through {@link LoadTimeWeaver#addTransformer}. AspectJ weaving will be * be registered through {@link LoadTimeWeaver#addTransformer}. AspectJ weaving will be
* activated by default if a "META-INF/aop.xml" resource is present on the classpath. * activated by default if a "META-INF/aop.xml" resource is present on the classpath.
* Example: * Example:
*
* <pre class="code"> * <pre class="code">
* &#064;Configuration * &#064;Configuration
* &#064;EnableLoadTimeWeaving(aspectjWeaving=ENABLED) * &#064;EnableLoadTimeWeaving(aspectjWeaving=ENABLED)
@ -101,10 +113,13 @@ import org.springframework.instrument.classloading.LoadTimeWeaver;
* }</pre> * }</pre>
* *
* <p>The example above can be compared to the following Spring XML configuration: * <p>The example above can be compared to the following Spring XML configuration:
*
* <pre class="code"> * <pre class="code">
* {@code * {@code
* <beans> * <beans>
*
* <context:load-time-weaver aspectj-weaving="on"/> * <context:load-time-weaver aspectj-weaving="on"/>
*
* </beans> * </beans>
* }</pre> * }</pre>
* *
@ -131,7 +146,8 @@ public @interface EnableLoadTimeWeaving {
*/ */
AspectJWeaving aspectjWeaving() default AspectJWeaving.AUTODETECT; AspectJWeaving aspectjWeaving() default AspectJWeaving.AUTODETECT;
public enum AspectJWeaving {
enum AspectJWeaving {
/** /**
* Switches on Spring-based AspectJ load-time weaving. * Switches on Spring-based AspectJ load-time weaving.
@ -151,4 +167,5 @@ public @interface EnableLoadTimeWeaving {
*/ */
AUTODETECT; AUTODETECT;
} }
} }

5
spring-context/src/main/java/org/springframework/context/annotation/PropertySource.java

@ -32,6 +32,7 @@ import org.springframework.core.io.support.PropertySourceFactory;
* conjunction with @{@link Configuration} classes. * conjunction with @{@link Configuration} classes.
* *
* <h3>Example usage</h3> * <h3>Example usage</h3>
*
* <p>Given a file {@code app.properties} containing the key/value pair * <p>Given a file {@code app.properties} containing the key/value pair
* {@code testbean.name=myTestBean}, the following {@code @Configuration} class * {@code testbean.name=myTestBean}, the following {@code @Configuration} class
* uses {@code @PropertySource} to contribute {@code app.properties} to the * uses {@code @PropertySource} to contribute {@code app.properties} to the
@ -58,6 +59,7 @@ import org.springframework.core.io.support.PropertySourceFactory;
* the configuration above, a call to {@code testBean.getName()} will return "myTestBean". * the configuration above, a call to {@code testBean.getName()} will return "myTestBean".
* *
* <h3>Resolving ${...} placeholders in {@code <bean>} and {@code @Value} annotations</h3> * <h3>Resolving ${...} placeholders in {@code <bean>} and {@code @Value} annotations</h3>
*
* In order to resolve ${...} placeholders in {@code <bean>} definitions or {@code @Value} * In order to resolve ${...} placeholders in {@code <bean>} definitions or {@code @Value}
* annotations using properties from a {@code PropertySource}, one must register * annotations using properties from a {@code PropertySource}, one must register
* a {@code PropertySourcesPlaceholderConfigurer}. This happens automatically when using * a {@code PropertySourcesPlaceholderConfigurer}. This happens automatically when using
@ -68,9 +70,11 @@ import org.springframework.core.io.support.PropertySourceFactory;
* for details and examples. * for details and examples.
* *
* <h3>Resolving ${...} placeholders within {@code @PropertySource} resource locations</h3> * <h3>Resolving ${...} placeholders within {@code @PropertySource} resource locations</h3>
*
* Any ${...} placeholders present in a {@code @PropertySource} {@linkplain #value() * Any ${...} placeholders present in a {@code @PropertySource} {@linkplain #value()
* resource location} will be resolved against the set of property sources already * resource location} will be resolved against the set of property sources already
* registered against the environment. For example: * registered against the environment. For example:
*
* <pre class="code"> * <pre class="code">
* &#064;Configuration * &#064;Configuration
* &#064;PropertySource("classpath:/com/${my.placeholder:default/path}/app.properties") * &#064;PropertySource("classpath:/com/${my.placeholder:default/path}/app.properties")
@ -94,6 +98,7 @@ import org.springframework.core.io.support.PropertySourceFactory;
* IllegalArgumentException} will be thrown. * IllegalArgumentException} will be thrown.
* *
* <h3>A note on property overriding with @PropertySource</h3> * <h3>A note on property overriding with @PropertySource</h3>
*
* In cases where a given property key exists in more than one {@code .properties} * In cases where a given property key exists in more than one {@code .properties}
* file, the last {@code @PropertySource} annotation processed will 'win' and override. * file, the last {@code @PropertySource} annotation processed will 'win' and override.
* *

13
spring-context/src/main/java/org/springframework/scheduling/annotation/EnableAsync.java

@ -64,8 +64,7 @@ import org.springframework.core.Ordered;
* {@code void} return type cannot transmit any exception back to the caller. By default, * {@code void} return type cannot transmit any exception back to the caller. By default,
* such uncaught exceptions are only logged. * such uncaught exceptions are only logged.
* *
* <p>To customize all this, implement {@link AsyncConfigurer} and * <p>To customize all this, implement {@link AsyncConfigurer} and provide:
* provide:
* <ul> * <ul>
* <li>your own {@link java.util.concurrent.Executor Executor} through the * <li>your own {@link java.util.concurrent.Executor Executor} through the
* {@link AsyncConfigurer#getAsyncExecutor getAsyncExecutor()} method, and</li> * {@link AsyncConfigurer#getAsyncExecutor getAsyncExecutor()} method, and</li>
@ -114,13 +113,19 @@ import org.springframework.core.Ordered;
* *
* <p>For reference, the example above can be compared to the following Spring XML * <p>For reference, the example above can be compared to the following Spring XML
* configuration: * configuration:
*
* <pre class="code"> * <pre class="code">
* {@code * {@code
* <beans> * <beans>
*
* <task:annotation-driven executor="myExecutor" exception-handler="exceptionHandler"/> * <task:annotation-driven executor="myExecutor" exception-handler="exceptionHandler"/>
*
* <task:executor id="myExecutor" pool-size="7-42" queue-capacity="11"/> * <task:executor id="myExecutor" pool-size="7-42" queue-capacity="11"/>
*
* <bean id="asyncBean" class="com.foo.MyAsyncBean"/> * <bean id="asyncBean" class="com.foo.MyAsyncBean"/>
*
* <bean id="exceptionHandler" class="com.foo.MyAsyncUncaughtExceptionHandler"/> * <bean id="exceptionHandler" class="com.foo.MyAsyncUncaughtExceptionHandler"/>
*
* </beans> * </beans>
* }</pre> * }</pre>
* *
@ -148,8 +153,8 @@ public @interface EnableAsync {
/** /**
* Indicate the 'async' annotation type to be detected at either class * Indicate the 'async' annotation type to be detected at either class
* or method level. * or method level.
* <p>By default, both Spring's @{@link Async} annotation and the EJB * <p>By default, both Spring's @{@link Async} annotation and the EJB 3.1
* 3.1 {@code @javax.ejb.Asynchronous} annotation will be detected. * {@code @javax.ejb.Asynchronous} annotation will be detected.
* <p>This attribute exists so that developers can provide their own * <p>This attribute exists so that developers can provide their own
* custom annotation type to indicate that a method (or all methods of * custom annotation type to indicate that a method (or all methods of
* a given class) should be invoked asynchronously. * a given class) should be invoked asynchronously.

9
spring-context/src/main/java/org/springframework/scheduling/annotation/EnableScheduling.java

@ -163,18 +163,25 @@ import org.springframework.scheduling.config.ScheduledTaskRegistrar;
* *
* <p>For reference, the example above can be compared to the following Spring XML * <p>For reference, the example above can be compared to the following Spring XML
* configuration: * configuration:
*
* <pre class="code"> * <pre class="code">
* {@code * {@code
* <beans> * <beans>
*
* <task:annotation-driven scheduler="taskScheduler"/> * <task:annotation-driven scheduler="taskScheduler"/>
*
* <task:scheduler id="taskScheduler" pool-size="42"/> * <task:scheduler id="taskScheduler" pool-size="42"/>
*
* <task:scheduled-tasks scheduler="taskScheduler"> * <task:scheduled-tasks scheduler="taskScheduler">
* <task:scheduled ref="myTask" method="work" fixed-rate="1000"/> * <task:scheduled ref="myTask" method="work" fixed-rate="1000"/>
* </task:scheduled-tasks> * </task:scheduled-tasks>
*
* <bean id="myTask" class="com.foo.MyTask"/> * <bean id="myTask" class="com.foo.MyTask"/>
*
* </beans> * </beans>
* }</pre> * }</pre>
* the examples are equivalent save that in XML a <em>fixed-rate</em> period is used *
* The examples are equivalent save that in XML a <em>fixed-rate</em> period is used
* instead of a custom <em>{@code Trigger}</em> implementation; this is because the * instead of a custom <em>{@code Trigger}</em> implementation; this is because the
* {@code task:} namespace {@code scheduled} cannot easily expose such support. This is * {@code task:} namespace {@code scheduled} cannot easily expose such support. This is
* but one demonstration how the code-based approach allows for maximum configurability * but one demonstration how the code-based approach allows for maximum configurability

16
spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerProxyTargetClassTests.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.aop.config; package org.springframework.aop.config;

16
spring-context/src/test/java/org/springframework/jmx/IJmxTestBean.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx; package org.springframework.jmx;

16
spring-context/src/test/java/org/springframework/jmx/JmxTestBean.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx; package org.springframework.jmx;

17
spring-context/src/test/java/org/springframework/jmx/access/MBeanClientInterceptorTests.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.access; package org.springframework.jmx.access;
@ -22,7 +22,6 @@ import java.lang.reflect.Method;
import java.net.BindException; import java.net.BindException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import javax.management.Descriptor; import javax.management.Descriptor;
import javax.management.MBeanServerConnection; import javax.management.MBeanServerConnection;
import javax.management.remote.JMXConnectorServer; import javax.management.remote.JMXConnectorServer;

20
spring-context/src/test/java/org/springframework/jmx/access/RemoteMBeanClientInterceptorTests.java

@ -1,24 +1,23 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.access; package org.springframework.jmx.access;
import java.net.BindException; import java.net.BindException;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import javax.management.MBeanServerConnection; import javax.management.MBeanServerConnection;
import javax.management.remote.JMXConnector; import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory; import javax.management.remote.JMXConnectorFactory;
@ -43,6 +42,7 @@ import org.springframework.util.SocketUtils;
public class RemoteMBeanClientInterceptorTests extends MBeanClientInterceptorTests { public class RemoteMBeanClientInterceptorTests extends MBeanClientInterceptorTests {
private static final int SERVICE_PORT; private static final int SERVICE_PORT;
private static final String SERVICE_URL; private static final String SERVICE_URL;
static { static {
@ -50,10 +50,12 @@ public class RemoteMBeanClientInterceptorTests extends MBeanClientInterceptorTes
SERVICE_URL = "service:jmx:jmxmp://localhost:" + SERVICE_PORT; SERVICE_URL = "service:jmx:jmxmp://localhost:" + SERVICE_PORT;
} }
private JMXConnectorServer connectorServer; private JMXConnectorServer connectorServer;
private JMXConnector connector; private JMXConnector connector;
@Override @Override
public void onSetUp() throws Exception { public void onSetUp() throws Exception {
runTests = false; runTests = false;

16
spring-context/src/test/java/org/springframework/jmx/export/CustomDateEditorRegistrar.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.export; package org.springframework.jmx.export;

16
spring-context/src/test/java/org/springframework/jmx/export/CustomEditorConfigurerTests.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.export; package org.springframework.jmx.export;

16
spring-context/src/test/java/org/springframework/jmx/export/DateRange.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.export; package org.springframework.jmx.export;

16
spring-context/src/test/java/org/springframework/jmx/export/ExceptionOnInitBean.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.export; package org.springframework.jmx.export;

16
spring-context/src/test/java/org/springframework/jmx/export/LazyInitMBeanTests.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.export; package org.springframework.jmx.export;

16
spring-context/src/test/java/org/springframework/jmx/export/PropertyPlaceholderConfigurerTests.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.export; package org.springframework.jmx.export;

22
spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationLazyInitMBeanTests.java

@ -1,32 +1,32 @@
/* /*
* Copyright 2002-2008 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.export.annotation; package org.springframework.jmx.export.annotation;
import org.junit.Test;
import javax.management.MBeanServer; import javax.management.MBeanServer;
import javax.management.ObjectName; import javax.management.ObjectName;
import static org.junit.Assert.*; import org.junit.Test;
import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jmx.support.ObjectNameManager; import org.springframework.jmx.support.ObjectNameManager;
import static org.junit.Assert.*;
/** /**
* @author Rob Harrop * @author Rob Harrop
* @author Juergen Hoeller * @author Juergen Hoeller

16
spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationTestBean.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.export.annotation; package org.springframework.jmx.export.annotation;

16
spring-context/src/test/java/org/springframework/jmx/export/annotation/JmxUtilsAnnotationTests.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.export.annotation; package org.springframework.jmx.export.annotation;

20
spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractAutodetectTests.java

@ -1,27 +1,27 @@
/* /*
* Copyright 2002-2005 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.export.assembler; package org.springframework.jmx.export.assembler;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.*;
import org.springframework.jmx.JmxTestBean; import org.springframework.jmx.JmxTestBean;
import static org.junit.Assert.*;
/** /**
* @author Rob Harrop * @author Rob Harrop
*/ */

16
spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractJmxAssemblerTests.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.export.assembler; package org.springframework.jmx.export.assembler;

16
spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerAutodetectTests.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.export.assembler; package org.springframework.jmx.export.assembler;

16
spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerTests.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.export.assembler; package org.springframework.jmx.export.assembler;

16
spring-context/src/test/java/org/springframework/jmx/export/assembler/ICustomBase.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2005 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.export.assembler; package org.springframework.jmx.export.assembler;

16
spring-context/src/test/java/org/springframework/jmx/export/assembler/ICustomJmxBean.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.export.assembler; package org.springframework.jmx.export.assembler;

17
spring-context/src/test/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssemblerCustomTests.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.export.assembler; package org.springframework.jmx.export.assembler;
@ -31,6 +31,7 @@ public class InterfaceBasedMBeanInfoAssemblerCustomTests extends AbstractJmxAsse
protected static final String OBJECT_NAME = "bean:name=testBean5"; protected static final String OBJECT_NAME = "bean:name=testBean5";
@Override @Override
protected String getObjectName() { protected String getObjectName() {
return OBJECT_NAME; return OBJECT_NAME;

16
spring-context/src/test/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssemblerTests.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.export.assembler; package org.springframework.jmx.export.assembler;

17
spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerMappedTests.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.export.assembler; package org.springframework.jmx.export.assembler;
@ -33,6 +33,7 @@ public class MethodNameBasedMBeanInfoAssemblerMappedTests extends AbstractJmxAss
protected static final String OBJECT_NAME = "bean:name=testBean4"; protected static final String OBJECT_NAME = "bean:name=testBean4";
@Test @Test
public void testGetAgeIsReadOnly() throws Exception { public void testGetAgeIsReadOnly() throws Exception {
ModelMBeanInfo info = getMBeanInfoFromAssembler(); ModelMBeanInfo info = getMBeanInfoFromAssembler();

17
spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerTests.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.export.assembler; package org.springframework.jmx.export.assembler;
@ -33,6 +33,7 @@ public class MethodNameBasedMBeanInfoAssemblerTests extends AbstractJmxAssembler
protected static final String OBJECT_NAME = "bean:name=testBean5"; protected static final String OBJECT_NAME = "bean:name=testBean5";
@Override @Override
protected String getObjectName() { protected String getObjectName() {
return OBJECT_NAME; return OBJECT_NAME;

20
spring-context/src/test/java/org/springframework/jmx/export/assembler/ReflectiveAssemblerTests.java

@ -1,24 +1,21 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.export.assembler; package org.springframework.jmx.export.assembler;
/** /**
* @author Rob Harrop * @author Rob Harrop
*/ */
@ -26,6 +23,7 @@ public class ReflectiveAssemblerTests extends AbstractJmxAssemblerTests {
protected static final String OBJECT_NAME = "bean:name=testBean1"; protected static final String OBJECT_NAME = "bean:name=testBean1";
@Override @Override
protected String getObjectName() { protected String getObjectName() {
return OBJECT_NAME; return OBJECT_NAME;

20
spring-context/src/test/java/org/springframework/jmx/export/naming/AbstractNamingStrategyTests.java

@ -1,25 +1,25 @@
/* /*
* Copyright 2002-2005 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.export.naming; package org.springframework.jmx.export.naming;
import org.junit.Test;
import javax.management.ObjectName; import javax.management.ObjectName;
import org.junit.Test;
import static org.junit.Assert.*; import static org.junit.Assert.*;
/** /**

17
spring-context/src/test/java/org/springframework/jmx/export/naming/KeyNamingStrategyTests.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.export.naming; package org.springframework.jmx.export.naming;
@ -23,6 +23,7 @@ public class KeyNamingStrategyTests extends AbstractNamingStrategyTests {
private static final String OBJECT_NAME = "spring:name=test"; private static final String OBJECT_NAME = "spring:name=test";
@Override @Override
protected ObjectNamingStrategy getStrategy() throws Exception { protected ObjectNamingStrategy getStrategy() throws Exception {
return new KeyNamingStrategy(); return new KeyNamingStrategy();

16
spring-context/src/test/java/org/springframework/jmx/export/naming/PropertiesFileNamingStrategyTests.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.export.naming; package org.springframework.jmx.export.naming;

17
spring-context/src/test/java/org/springframework/jmx/export/naming/PropertiesNamingStrategyTests.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.export.naming; package org.springframework.jmx.export.naming;
@ -26,6 +26,7 @@ public class PropertiesNamingStrategyTests extends AbstractNamingStrategyTests {
private static final String OBJECT_NAME = "bean:name=namingTest"; private static final String OBJECT_NAME = "bean:name=namingTest";
@Override @Override
protected ObjectNamingStrategy getStrategy() throws Exception { protected ObjectNamingStrategy getStrategy() throws Exception {
KeyNamingStrategy strat = new KeyNamingStrategy(); KeyNamingStrategy strat = new KeyNamingStrategy();

19
spring-context/src/test/java/org/springframework/jmx/support/ConnectorServerFactoryBeanTests.java

@ -1,24 +1,23 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.support; package org.springframework.jmx.support;
import java.io.IOException; import java.io.IOException;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import javax.management.InstanceNotFoundException; import javax.management.InstanceNotFoundException;
import javax.management.MBeanServer; import javax.management.MBeanServer;
import javax.management.MBeanServerConnection; import javax.management.MBeanServerConnection;
@ -49,6 +48,7 @@ public class ConnectorServerFactoryBeanTests extends AbstractMBeanServerTests {
private static final String OBJECT_NAME = "spring:type=connector,name=test"; private static final String OBJECT_NAME = "spring:type=connector,name=test";
@Override @Override
protected void onSetUp() throws Exception { protected void onSetUp() throws Exception {
Assume.group(TestGroup.JMXMP); Assume.group(TestGroup.JMXMP);
@ -60,6 +60,7 @@ public class ConnectorServerFactoryBeanTests extends AbstractMBeanServerTests {
Assume.group(TestGroup.JMXMP, () -> super.tearDown()); Assume.group(TestGroup.JMXMP, () -> super.tearDown());
} }
@Test @Test
public void startupWithLocatedServer() throws Exception { public void startupWithLocatedServer() throws Exception {
ConnectorServerFactoryBean bean = new ConnectorServerFactoryBean(); ConnectorServerFactoryBean bean = new ConnectorServerFactoryBean();

35
spring-context/src/test/java/org/springframework/jmx/support/JmxUtilsTests.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.support; package org.springframework.jmx.support;
@ -193,7 +193,7 @@ public class JmxUtilsTests {
} }
public static interface FooMBean { public interface FooMBean {
String getName(); String getName();
} }
@ -208,7 +208,7 @@ public class JmxUtilsTests {
} }
public static interface FooMXBean { public interface FooMXBean {
String getName(); String getName();
} }
@ -224,37 +224,30 @@ public class JmxUtilsTests {
public static class Bar extends Foo { public static class Bar extends Foo {
} }
public static class Abc extends Bar { public static class Abc extends Bar {
} }
private static interface JmxInterfaceMBean { private interface JmxInterfaceMBean {
} }
private static interface JmxInterface extends JmxInterfaceMBean { private interface JmxInterface extends JmxInterfaceMBean {
} }
private static interface SpecializedJmxInterface extends JmxInterface { private interface SpecializedJmxInterface extends JmxInterface {
} }
private static interface JmxClassMBean { private interface JmxClassMBean {
} }
private static class JmxClass implements JmxClassMBean { private static class JmxClass implements JmxClassMBean {
} }
} }

17
spring-context/src/test/java/org/springframework/jmx/support/MBeanServerFactoryBeanTests.java

@ -1,24 +1,23 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jmx.support; package org.springframework.jmx.support;
import java.lang.management.ManagementFactory; import java.lang.management.ManagementFactory;
import java.util.List; import java.util.List;
import javax.management.MBeanServer; import javax.management.MBeanServer;
import javax.management.MBeanServerFactory; import javax.management.MBeanServerFactory;

34
spring-core/src/main/java/org/springframework/core/env/CommandLinePropertySource.java vendored

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2014 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -29,6 +29,7 @@ import org.springframework.util.StringUtils;
* {@code OptionSet} in the case of {@link JOptCommandLinePropertySource}. * {@code OptionSet} in the case of {@link JOptCommandLinePropertySource}.
* *
* <h3>Purpose and General Usage</h3> * <h3>Purpose and General Usage</h3>
*
* For use in standalone Spring-based applications, i.e. those that are bootstrapped via * For use in standalone Spring-based applications, i.e. those that are bootstrapped via
* a traditional {@code main} method accepting a {@code String[]} of arguments from the * a traditional {@code main} method accepting a {@code String[]} of arguments from the
* command line. In many cases, processing command-line arguments directly within the * command line. In many cases, processing command-line arguments directly within the
@ -38,6 +39,7 @@ import org.springframework.util.StringUtils;
* will typically be added to the {@link Environment} of the Spring * will typically be added to the {@link Environment} of the Spring
* {@code ApplicationContext}, at which point all command line arguments become available * {@code ApplicationContext}, at which point all command line arguments become available
* through the {@link Environment#getProperty(String)} family of methods. For example: * through the {@link Environment#getProperty(String)} family of methods. For example:
*
* <pre class="code"> * <pre class="code">
* public static void main(String[] args) { * public static void main(String[] args) {
* CommandLinePropertySource clps = ...; * CommandLinePropertySource clps = ...;
@ -46,11 +48,14 @@ import org.springframework.util.StringUtils;
* ctx.register(AppConfig.class); * ctx.register(AppConfig.class);
* ctx.refresh(); * ctx.refresh();
* }</pre> * }</pre>
*
* With the bootstrap logic above, the {@code AppConfig} class may {@code @Inject} the * With the bootstrap logic above, the {@code AppConfig} class may {@code @Inject} the
* Spring {@code Environment} and query it directly for properties: * Spring {@code Environment} and query it directly for properties:
*
* <pre class="code"> * <pre class="code">
* &#064;Configuration * &#064;Configuration
* public class AppConfig { * public class AppConfig {
*
* &#064;Inject Environment env; * &#064;Inject Environment env;
* *
* &#064;Bean * &#064;Bean
@ -63,6 +68,7 @@ import org.springframework.util.StringUtils;
* return dataSource; * return dataSource;
* } * }
* }</pre> * }</pre>
*
* Because the {@code CommandLinePropertySource} was added to the {@code Environment}'s * Because the {@code CommandLinePropertySource} was added to the {@code Environment}'s
* set of {@link MutablePropertySources} using the {@code #addFirst} method, it has * set of {@link MutablePropertySources} using the {@code #addFirst} method, it has
* highest search precedence, meaning that while "db.hostname" and other properties may * highest search precedence, meaning that while "db.hostname" and other properties may
@ -75,9 +81,11 @@ import org.springframework.util.StringUtils;
* annotation may be used to inject these properties, given that a {@link * annotation may be used to inject these properties, given that a {@link
* PropertySourcesPropertyResolver} bean has been registered, either directly or through * PropertySourcesPropertyResolver} bean has been registered, either directly or through
* using the {@code <context:property-placeholder>} element. For example: * using the {@code <context:property-placeholder>} element. For example:
*
* <pre class="code"> * <pre class="code">
* &#064;Component * &#064;Component
* public class MyComponent { * public class MyComponent {
*
* &#064;Value("my.property:defaultVal") * &#064;Value("my.property:defaultVal")
* private String myProperty; * private String myProperty;
* *
@ -94,10 +102,12 @@ import org.springframework.util.StringUtils;
* {@link PropertySource#getProperty(String)} and * {@link PropertySource#getProperty(String)} and
* {@link PropertySource#containsProperty(String)} methods. For example, given the * {@link PropertySource#containsProperty(String)} methods. For example, given the
* following command line: * following command line:
* <pre class="code"> *
* --o1=v1 --o2</pre> * <pre class="code">--o1=v1 --o2</pre>
*
* 'o1' and 'o2' are treated as "option arguments", and the following assertions would * 'o1' and 'o2' are treated as "option arguments", and the following assertions would
* evaluate true: * evaluate true:
*
* <pre class="code"> * <pre class="code">
* CommandLinePropertySource<?> ps = ... * CommandLinePropertySource<?> ps = ...
* assert ps.containsProperty("o1") == true; * assert ps.containsProperty("o1") == true;
@ -105,7 +115,8 @@ import org.springframework.util.StringUtils;
* assert ps.containsProperty("o3") == false; * assert ps.containsProperty("o3") == false;
* assert ps.getProperty("o1").equals("v1"); * assert ps.getProperty("o1").equals("v1");
* assert ps.getProperty("o2").equals(""); * assert ps.getProperty("o2").equals("");
* assert ps.getProperty("o3") == null;</pre> * assert ps.getProperty("o3") == null;
* </pre>
* *
* Note that the 'o2' option has no argument, but {@code getProperty("o2")} resolves to * Note that the 'o2' option has no argument, but {@code getProperty("o2")} resolves to
* empty string ({@code ""}) as opposed to {@code null}, while {@code getProperty("o3")} * empty string ({@code ""}) as opposed to {@code null}, while {@code getProperty("o3")}
@ -129,11 +140,13 @@ import org.springframework.util.StringUtils;
* CommandLinePropertySource} and at the same time lends itself to conversion when used * CommandLinePropertySource} and at the same time lends itself to conversion when used
* in conjunction with the Spring {@link Environment} and its built-in {@code * in conjunction with the Spring {@link Environment} and its built-in {@code
* ConversionService}. Consider the following example: * ConversionService}. Consider the following example:
* <pre class="code"> *
* --o1=v1 --o2=v2 /path/to/file1 /path/to/file2</pre> * <pre class="code">--o1=v1 --o2=v2 /path/to/file1 /path/to/file2</pre>
*
* In this example, "o1" and "o2" would be considered "option arguments", while the two * In this example, "o1" and "o2" would be considered "option arguments", while the two
* filesystem paths qualify as "non-option arguments". As such, the following assertions * filesystem paths qualify as "non-option arguments". As such, the following assertions
* will evaluate true: * will evaluate true:
*
* <pre class="code"> * <pre class="code">
* CommandLinePropertySource<?> ps = ... * CommandLinePropertySource<?> ps = ...
* assert ps.containsProperty("o1") == true; * assert ps.containsProperty("o1") == true;
@ -141,22 +154,26 @@ import org.springframework.util.StringUtils;
* assert ps.containsProperty("nonOptionArgs") == true; * assert ps.containsProperty("nonOptionArgs") == true;
* assert ps.getProperty("o1").equals("v1"); * assert ps.getProperty("o1").equals("v1");
* assert ps.getProperty("o2").equals("v2"); * assert ps.getProperty("o2").equals("v2");
* assert ps.getProperty("nonOptionArgs").equals("/path/to/file1,/path/to/file2");</pre> * assert ps.getProperty("nonOptionArgs").equals("/path/to/file1,/path/to/file2");
* </pre>
* *
* <p>As mentioned above, when used in conjunction with the Spring {@code Environment} * <p>As mentioned above, when used in conjunction with the Spring {@code Environment}
* abstraction, this comma-delimited string may easily be converted to a String array or * abstraction, this comma-delimited string may easily be converted to a String array or
* list: * list:
*
* <pre class="code"> * <pre class="code">
* Environment env = applicationContext.getEnvironment(); * Environment env = applicationContext.getEnvironment();
* String[] nonOptionArgs = env.getProperty("nonOptionArgs", String[].class); * String[] nonOptionArgs = env.getProperty("nonOptionArgs", String[].class);
* assert nonOptionArgs[0].equals("/path/to/file1"); * assert nonOptionArgs[0].equals("/path/to/file1");
* assert nonOptionArgs[1].equals("/path/to/file2");</pre> * assert nonOptionArgs[1].equals("/path/to/file2");
* </pre>
* *
* <p>The name of the special "non-option arguments" property may be customized through * <p>The name of the special "non-option arguments" property may be customized through
* the {@link #setNonOptionArgsPropertyName(String)} method. Doing so is recommended as * the {@link #setNonOptionArgsPropertyName(String)} method. Doing so is recommended as
* it gives proper semantic value to non-option arguments. For example, if filesystem * it gives proper semantic value to non-option arguments. For example, if filesystem
* paths are being specified as non-option arguments, it is likely preferable to refer to * paths are being specified as non-option arguments, it is likely preferable to refer to
* these as something like "file.locations" than the default of "nonOptionArgs": * these as something like "file.locations" than the default of "nonOptionArgs":
*
* <pre class="code"> * <pre class="code">
* public static void main(String[] args) { * public static void main(String[] args) {
* CommandLinePropertySource clps = ...; * CommandLinePropertySource clps = ...;
@ -169,6 +186,7 @@ import org.springframework.util.StringUtils;
* }</pre> * }</pre>
* *
* <h3>Limitations</h3> * <h3>Limitations</h3>
*
* This abstraction is not intended to expose the full power of underlying command line * This abstraction is not intended to expose the full power of underlying command line
* parsing APIs such as JOpt or Commons CLI. It's intent is rather just the opposite: to * parsing APIs such as JOpt or Commons CLI. It's intent is rather just the opposite: to
* provide the simplest possible abstraction for accessing command line arguments * provide the simplest possible abstraction for accessing command line arguments

14
spring-core/src/main/java/org/springframework/util/Assert.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.util; package org.springframework.util;

16
spring-jdbc/src/main/java/org/springframework/jdbc/object/BatchSqlUpdate.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.jdbc.object; package org.springframework.jdbc.object;

24
spring-jms/src/main/java/org/springframework/jms/annotation/EnableJms.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2014 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -35,6 +35,7 @@ import org.springframework.context.annotation.Import;
* &#064;Configuration * &#064;Configuration
* &#064;EnableJms * &#064;EnableJms
* public class AppConfig { * public class AppConfig {
*
* &#064;Bean * &#064;Bean
* public DefaultJmsListenerContainerFactory myJmsListenerContainerFactory() { * public DefaultJmsListenerContainerFactory myJmsListenerContainerFactory() {
* DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory(); * DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
@ -43,6 +44,7 @@ import org.springframework.context.annotation.Import;
* factory.setConcurrency("5"); * factory.setConcurrency("5");
* return factory; * return factory;
* } * }
*
* // other &#064;Bean definitions * // other &#064;Bean definitions
* }</pre> * }</pre>
* *
@ -59,6 +61,7 @@ import org.springframework.context.annotation.Import;
* package com.acme.foo; * package com.acme.foo;
* *
* public class MyService { * public class MyService {
*
* &#064;JmsListener(containerFactory = "myJmsListenerContainerFactory", destination="myQueue") * &#064;JmsListener(containerFactory = "myJmsListenerContainerFactory", destination="myQueue")
* public void process(String msg) { * public void process(String msg) {
* // process incoming message * // process incoming message
@ -78,6 +81,7 @@ import org.springframework.context.annotation.Import;
* &#064;Configuration * &#064;Configuration
* &#064;EnableJms * &#064;EnableJms
* public class AppConfig { * public class AppConfig {
*
* &#064;Bean * &#064;Bean
* public MyService myService() { * public MyService myService() {
* return new MyService(); * return new MyService();
@ -112,10 +116,9 @@ import org.springframework.context.annotation.Import;
* // process incoming message * // process incoming message
* }</pre> * }</pre>
* *
* These features are abstracted by the {@link org.springframework.messaging.handler.annotation.support.MessageHandlerMethodFactory * These features are abstracted by the {@link org.springframework.messaging.handler.annotation.support.MessageHandlerMethodFactory}
* MessageHandlerMethodFactory} that is responsible to build the necessary invoker to process * that is responsible to build the necessary invoker to process the annotated method. By default,
* the annotated method. By default, {@link org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory * {@link org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory} is used.
* DefaultMessageHandlerMethodFactory} is used.
* *
* <p>When more control is desired, a {@code @Configuration} class may implement * <p>When more control is desired, a {@code @Configuration} class may implement
* {@link JmsListenerConfigurer}. This allows access to the underlying * {@link JmsListenerConfigurer}. This allows access to the underlying
@ -127,6 +130,7 @@ import org.springframework.context.annotation.Import;
* &#064;Configuration * &#064;Configuration
* &#064;EnableJms * &#064;EnableJms
* public class AppConfig implements JmsListenerConfigurer { * public class AppConfig implements JmsListenerConfigurer {
*
* &#064;Override * &#064;Override
* public void configureJmsListeners(JmsListenerEndpointRegistrar registrar) { * public void configureJmsListeners(JmsListenerEndpointRegistrar registrar) {
* registrar.setContainerFactory(myJmsListenerContainerFactory()); * registrar.setContainerFactory(myJmsListenerContainerFactory());
@ -145,16 +149,18 @@ import org.springframework.context.annotation.Import;
* *
* For reference, the example above can be compared to the following Spring XML * For reference, the example above can be compared to the following Spring XML
* configuration: * configuration:
*
* <pre class="code"> * <pre class="code">
* {@code <beans> * {@code <beans>
*
* <jms:annotation-driven container-factory="myJmsListenerContainerFactory"/> * <jms:annotation-driven container-factory="myJmsListenerContainerFactory"/>
* *
* <bean id="myJmsListenerContainerFactory" * <bean id="myJmsListenerContainerFactory" class="org.springframework.jms.config.DefaultJmsListenerContainerFactory">
* class="org.springframework.jms.config.DefaultJmsListenerContainerFactory">
* // factory settings * // factory settings
* </bean> * </bean>
* *
* <bean id="myService" class="com.acme.foo.MyService"/> * <bean id="myService" class="com.acme.foo.MyService"/>
*
* </beans> * </beans>
* }</pre> * }</pre>
* *
@ -169,6 +175,7 @@ import org.springframework.context.annotation.Import;
* &#064;Configuration * &#064;Configuration
* &#064;EnableJms * &#064;EnableJms
* public class AppConfig implements JmsListenerConfigurer { * public class AppConfig implements JmsListenerConfigurer {
*
* &#064;Override * &#064;Override
* public void configureJmsListeners(JmsListenerEndpointRegistrar registrar) { * public void configureJmsListeners(JmsListenerEndpointRegistrar registrar) {
* registrar.setEndpointRegistry(myJmsListenerEndpointRegistry()); * registrar.setEndpointRegistry(myJmsListenerEndpointRegistry());
@ -197,6 +204,7 @@ import org.springframework.context.annotation.Import;
* configuration: * configuration:
* <pre class="code"> * <pre class="code">
* {@code <beans> * {@code <beans>
*
* <jms:annotation-driven registry="myJmsListenerEndpointRegistry" * <jms:annotation-driven registry="myJmsListenerEndpointRegistry"
* handler-method-factory="myJmsHandlerMethodFactory"/&gt; * handler-method-factory="myJmsHandlerMethodFactory"/&gt;
* *
@ -211,6 +219,7 @@ import org.springframework.context.annotation.Import;
* </bean> * </bean>
* *
* <bean id="myService" class="com.acme.foo.MyService"/> * <bean id="myService" class="com.acme.foo.MyService"/>
*
* </beans> * </beans>
* }</pre> * }</pre>
* *
@ -222,6 +231,7 @@ import org.springframework.context.annotation.Import;
* &#064;Configuration * &#064;Configuration
* &#064;EnableJms * &#064;EnableJms
* public class AppConfig implements JmsListenerConfigurer { * public class AppConfig implements JmsListenerConfigurer {
*
* &#064;Override * &#064;Override
* public void configureJmsListeners(JmsListenerEndpointRegistrar registrar) { * public void configureJmsListeners(JmsListenerEndpointRegistrar registrar) {
* SimpleJmsListenerEndpoint myEndpoint = new SimpleJmsListenerEndpoint(); * SimpleJmsListenerEndpoint myEndpoint = new SimpleJmsListenerEndpoint();

16
spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/DelegatingWebConnection.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.test.web.servlet.htmlunit; package org.springframework.test.web.servlet.htmlunit;

16
spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/ForwardRequestPostProcessor.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.test.web.servlet.htmlunit; package org.springframework.test.web.servlet.htmlunit;

16
spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/HostRequestMatcher.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.test.web.servlet.htmlunit; package org.springframework.test.web.servlet.htmlunit;

16
spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/HtmlUnitRequestBuilder.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.test.web.servlet.htmlunit; package org.springframework.test.web.servlet.htmlunit;

16
spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebClientBuilder.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.test.web.servlet.htmlunit; package org.springframework.test.web.servlet.htmlunit;

14
spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnection.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.test.web.servlet.htmlunit; package org.springframework.test.web.servlet.htmlunit;

14
spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnectionBuilderSupport.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.test.web.servlet.htmlunit; package org.springframework.test.web.servlet.htmlunit;

16
spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockWebResponseBuilder.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.test.web.servlet.htmlunit; package org.springframework.test.web.servlet.htmlunit;
@ -44,6 +44,7 @@ final class MockWebResponseBuilder {
private static final String DEFAULT_STATUS_MESSAGE = "N/A"; private static final String DEFAULT_STATUS_MESSAGE = "N/A";
private final long startTime; private final long startTime;
private final WebRequest webRequest; private final WebRequest webRequest;
@ -59,6 +60,7 @@ final class MockWebResponseBuilder {
this.response = response; this.response = response;
} }
public WebResponse build() throws IOException { public WebResponse build() throws IOException {
WebResponseData webResponseData = webResponseData(); WebResponseData webResponseData = webResponseData();
long endTime = System.currentTimeMillis(); long endTime = System.currentTimeMillis();

22
spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/UrlRegexRequestMatcher.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.test.web.servlet.htmlunit; package org.springframework.test.web.servlet.htmlunit;
@ -27,7 +27,9 @@ import com.gargoylesoftware.htmlunit.WebRequest;
* <p>For example, if you would like to match on the domain {@code code.jquery.com}, * <p>For example, if you would like to match on the domain {@code code.jquery.com},
* you might want to use the following. * you might want to use the following.
* *
* <pre class="code">WebRequestMatcher cdnMatcher = new UrlRegexRequestMatcher(".*?//code.jquery.com/.*");</pre> * <pre class="code">
* WebRequestMatcher cdnMatcher = new UrlRegexRequestMatcher(".*?//code.jquery.com/.*");
* </pre>
* *
* @author Rob Winch * @author Rob Winch
* @author Sam Brannen * @author Sam Brannen
@ -38,6 +40,7 @@ public final class UrlRegexRequestMatcher implements WebRequestMatcher {
private final Pattern pattern; private final Pattern pattern;
public UrlRegexRequestMatcher(String regex) { public UrlRegexRequestMatcher(String regex) {
this.pattern = Pattern.compile(regex); this.pattern = Pattern.compile(regex);
} }
@ -46,6 +49,7 @@ public final class UrlRegexRequestMatcher implements WebRequestMatcher {
this.pattern = pattern; this.pattern = pattern;
} }
@Override @Override
public boolean matches(WebRequest request) { public boolean matches(WebRequest request) {
String url = request.getUrl().toExternalForm(); String url = request.getUrl().toExternalForm();

16
spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/WebRequestMatcher.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.test.web.servlet.htmlunit; package org.springframework.test.web.servlet.htmlunit;

26
spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/webdriver/MockMvcHtmlUnitDriverBuilder.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.test.web.servlet.htmlunit.webdriver; package org.springframework.test.web.servlet.htmlunit.webdriver;
@ -69,7 +69,7 @@ public class MockMvcHtmlUnitDriverBuilder extends MockMvcWebConnectionBuilderSup
/** /**
* Create a new {@code MockMvcHtmlUnitDriverBuilder} based on the supplied * Create a new {@code MockMvcHtmlUnitDriverBuilder} based on the supplied
* {@link MockMvc} instance. * {@link MockMvc} instance.
* @param mockMvc the {@code MockMvc} instance to use; never {@code null} * @param mockMvc the {@code MockMvc} instance to use (never {@code null})
* @return the MockMvcHtmlUnitDriverBuilder to customize * @return the MockMvcHtmlUnitDriverBuilder to customize
*/ */
public static MockMvcHtmlUnitDriverBuilder mockMvcSetup(MockMvc mockMvc) { public static MockMvcHtmlUnitDriverBuilder mockMvcSetup(MockMvc mockMvc) {
@ -81,7 +81,7 @@ public class MockMvcHtmlUnitDriverBuilder extends MockMvcWebConnectionBuilderSup
* Create a new {@code MockMvcHtmlUnitDriverBuilder} based on the supplied * Create a new {@code MockMvcHtmlUnitDriverBuilder} based on the supplied
* {@link WebApplicationContext}. * {@link WebApplicationContext}.
* @param context the {@code WebApplicationContext} to create a {@link MockMvc} * @param context the {@code WebApplicationContext} to create a {@link MockMvc}
* instance from; never {@code null} * instance from (never {@code null})
* @return the MockMvcHtmlUnitDriverBuilder to customize * @return the MockMvcHtmlUnitDriverBuilder to customize
*/ */
public static MockMvcHtmlUnitDriverBuilder webAppContextSetup(WebApplicationContext context) { public static MockMvcHtmlUnitDriverBuilder webAppContextSetup(WebApplicationContext context) {
@ -93,8 +93,8 @@ public class MockMvcHtmlUnitDriverBuilder extends MockMvcWebConnectionBuilderSup
* Create a new {@code MockMvcHtmlUnitDriverBuilder} based on the supplied * Create a new {@code MockMvcHtmlUnitDriverBuilder} based on the supplied
* {@link WebApplicationContext} and {@link MockMvcConfigurer}. * {@link WebApplicationContext} and {@link MockMvcConfigurer}.
* @param context the {@code WebApplicationContext} to create a {@link MockMvc} * @param context the {@code WebApplicationContext} to create a {@link MockMvc}
* instance from; never {@code null} * instance from (never {@code null})
* @param configurer the {@code MockMvcConfigurer} to apply; never {@code null} * @param configurer the {@code MockMvcConfigurer} to apply (never {@code null})
* @return the MockMvcHtmlUnitDriverBuilder to customize * @return the MockMvcHtmlUnitDriverBuilder to customize
*/ */
public static MockMvcHtmlUnitDriverBuilder webAppContextSetup(WebApplicationContext context, public static MockMvcHtmlUnitDriverBuilder webAppContextSetup(WebApplicationContext context,
@ -122,7 +122,7 @@ public class MockMvcHtmlUnitDriverBuilder extends MockMvcWebConnectionBuilderSup
* {@linkplain #build built} by this builder should delegate to when * {@linkplain #build built} by this builder should delegate to when
* processing non-{@linkplain WebRequestMatcher matching} requests. * processing non-{@linkplain WebRequestMatcher matching} requests.
* @param driver the {@code WebConnectionHtmlUnitDriver} to delegate to * @param driver the {@code WebConnectionHtmlUnitDriver} to delegate to
* for requests that do not match; never {@code null} * for requests that do not match (never {@code null})
* @return this builder for further customizations * @return this builder for further customizations
* @see #build() * @see #build()
*/ */

54
spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/webdriver/WebConnectionHtmlUnitDriver.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.test.web.servlet.htmlunit.webdriver; package org.springframework.test.web.servlet.htmlunit.webdriver;
@ -41,13 +41,14 @@ public class WebConnectionHtmlUnitDriver extends HtmlUnitDriver {
private WebClient webClient; private WebClient webClient;
public WebConnectionHtmlUnitDriver(BrowserVersion browserVersion) {
super(browserVersion);
}
public WebConnectionHtmlUnitDriver() { public WebConnectionHtmlUnitDriver() {
} }
public WebConnectionHtmlUnitDriver(BrowserVersion browserVersion) {
super(browserVersion);
}
public WebConnectionHtmlUnitDriver(boolean enableJavascript) { public WebConnectionHtmlUnitDriver(boolean enableJavascript) {
super(enableJavascript); super(enableJavascript);
} }
@ -58,12 +59,10 @@ public class WebConnectionHtmlUnitDriver extends HtmlUnitDriver {
/** /**
* Modify the supplied {@link WebClient} and retain a reference to it * Modify the supplied {@link WebClient} and retain a reference to it so that its
* so that its {@link WebConnection} is {@linkplain #getWebConnection * {@link WebConnection} is {@linkplain #getWebConnection accessible} for later use.
* accessible} for later use. * <p>Delegates to {@link HtmlUnitDriver#modifyWebClient} for default behavior
* <p>Delegates to {@link HtmlUnitDriver#modifyWebClient(WebClient)} * and to {@link #modifyWebClientInternal} for further customization.
* for default behavior and to {@link #modifyWebClientInternal(WebClient)}
* for further customization.
* @param webClient the client to modify * @param webClient the client to modify
* @return the modified client * @return the modified client
* @see HtmlUnitDriver#modifyWebClient(WebClient) * @see HtmlUnitDriver#modifyWebClient(WebClient)
@ -78,8 +77,7 @@ public class WebConnectionHtmlUnitDriver extends HtmlUnitDriver {
/** /**
* Modify the supplied {@link WebClient}. * Modify the supplied {@link WebClient}.
* <p>The default implementation simply returns the supplied client * <p>The default implementation simply returns the supplied client unmodified.
* unmodified.
* <p>Subclasses can override this method to customize the {@code WebClient} * <p>Subclasses can override this method to customize the {@code WebClient}
* that the {@link HtmlUnitDriver} uses. * that the {@link HtmlUnitDriver} uses.
* @param webClient the client to modify * @param webClient the client to modify
@ -90,16 +88,15 @@ public class WebConnectionHtmlUnitDriver extends HtmlUnitDriver {
} }
/** /**
* Access the current {@link WebConnection} for the {@link WebClient}. * Return the current {@link WebClient}.
* @return the current {@code WebConnection}
*/ */
public WebConnection getWebConnection() { public WebClient getWebClient() {
return this.webClient.getWebConnection(); return this.webClient;
} }
/** /**
* Set the {@link WebConnection} to be used with the {@link WebClient}. * Set the {@link WebConnection} to be used with the {@link WebClient}.
* @param webConnection the {@code WebConnection} to use; never {@code null} * @param webConnection the {@code WebConnection} to use (never {@code null})
*/ */
public void setWebConnection(WebConnection webConnection) { public void setWebConnection(WebConnection webConnection) {
Assert.notNull(webConnection, "WebConnection must not be null"); Assert.notNull(webConnection, "WebConnection must not be null");
@ -107,10 +104,11 @@ public class WebConnectionHtmlUnitDriver extends HtmlUnitDriver {
} }
/** /**
* Gets the current {@link WebClient} * Access the current {@link WebConnection} for the {@link WebClient}.
* @return the current {@link WebClient} * @return the current {@code WebConnection}
*/ */
public WebClient getWebClient() { public WebConnection getWebConnection() {
return this.webClient; return this.webClient.getWebConnection();
} }
} }

15
spring-test/src/main/java/org/springframework/test/web/servlet/setup/PatternMappingFilterProxy.java

@ -1,14 +1,17 @@
/* /*
* Copyright 2002-2014 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * Licensed under the Apache License, Version 2.0 (the "License");
* the License. You may obtain a copy of the License at * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * distributed under the License is distributed on an "AS IS" BASIS,
* specific language governing permissions and limitations under the License. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.springframework.test.web.servlet.setup; package org.springframework.test.web.servlet.setup;

16
spring-test/src/test/java/org/springframework/mock/web/MockFilterChainTests.java

@ -1,15 +1,19 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * Licensed under the Apache License, Version 2.0 (the "License");
* the License. You may obtain a copy of the License at * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * distributed under the License is distributed on an "AS IS" BASIS,
* specific language governing permissions and limitations under the License. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.springframework.mock.web; package org.springframework.mock.web;
import java.io.IOException; import java.io.IOException;

16
spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/AbstractWebRequestMatcherTests.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.test.web.servlet.htmlunit; package org.springframework.test.web.servlet.htmlunit;

38
spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/DelegatingWebConnectionTests.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.test.web.servlet.htmlunit; package org.springframework.test.web.servlet.htmlunit;
@ -19,10 +19,17 @@ package org.springframework.test.web.servlet.htmlunit;
import java.net.URL; import java.net.URL;
import java.util.Collections; import java.util.Collections;
import com.gargoylesoftware.htmlunit.HttpWebConnection;
import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.WebConnection;
import com.gargoylesoftware.htmlunit.WebRequest;
import com.gargoylesoftware.htmlunit.WebResponse;
import com.gargoylesoftware.htmlunit.WebResponseData;
import com.gargoylesoftware.htmlunit.util.NameValuePair;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.mockito.Mock; import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner; import org.mockito.runners.MockitoJUnitRunner;
@ -33,20 +40,11 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.tests.Assume; import org.springframework.tests.Assume;
import org.springframework.tests.TestGroup; import org.springframework.tests.TestGroup;
import com.gargoylesoftware.htmlunit.HttpWebConnection;
import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.WebConnection;
import com.gargoylesoftware.htmlunit.WebRequest;
import com.gargoylesoftware.htmlunit.WebResponse;
import com.gargoylesoftware.htmlunit.WebResponseData;
import com.gargoylesoftware.htmlunit.util.NameValuePair;
import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.sameInstance; import static org.hamcrest.CoreMatchers.sameInstance;
import static org.hamcrest.Matchers.isEmptyString; import static org.hamcrest.Matchers.*;
import static org.hamcrest.core.IsNot.not; import static org.hamcrest.core.IsNot.not;
import static org.junit.Assert.assertThat; import static org.junit.Assert.*;
import static org.mockito.Mockito.*; import static org.mockito.Mockito.*;
/** /**

16
spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/ForwardController.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.test.web.servlet.htmlunit; package org.springframework.test.web.servlet.htmlunit;

16
spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/HelloController.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.test.web.servlet.htmlunit; package org.springframework.test.web.servlet.htmlunit;

16
spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/HostRequestMatcherTests.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.test.web.servlet.htmlunit; package org.springframework.test.web.servlet.htmlunit;

20
spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebClientBuilderTests.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.test.web.servlet.htmlunit; package org.springframework.test.web.servlet.htmlunit;
@ -24,7 +24,6 @@ import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.WebRequest; import com.gargoylesoftware.htmlunit.WebRequest;
import com.gargoylesoftware.htmlunit.WebResponse; import com.gargoylesoftware.htmlunit.WebResponse;
import com.gargoylesoftware.htmlunit.util.Cookie; import com.gargoylesoftware.htmlunit.util.Cookie;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@ -44,9 +43,8 @@ import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.CoreMatchers.not; import static org.junit.Assert.*;
import static org.junit.Assert.assertThat;
/** /**
* Integration tests for {@link MockMvcWebClientBuilder}. * Integration tests for {@link MockMvcWebClientBuilder}.

25
spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnectionTests.java

@ -1,34 +1,33 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.test.web.servlet.htmlunit; package org.springframework.test.web.servlet.htmlunit;
import java.io.IOException; import java.io.IOException;
import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.WebClient;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import com.gargoylesoftware.htmlunit.Page; import static org.hamcrest.CoreMatchers.*;
import com.gargoylesoftware.htmlunit.WebClient; import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;
/** /**
* Integration tests for {@link MockMvcWebConnection}. * Integration tests for {@link MockMvcWebConnection}.

29
spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockWebResponseBuilderTests.java

@ -1,38 +1,35 @@
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.test.web.servlet.htmlunit; package org.springframework.test.web.servlet.htmlunit;
import java.net.URL; import java.net.URL;
import java.util.List; import java.util.List;
import javax.servlet.http.Cookie; import javax.servlet.http.Cookie;
import org.junit.Before;
import org.junit.Test;
import org.springframework.mock.web.MockHttpServletResponse;
import com.gargoylesoftware.htmlunit.WebRequest; import com.gargoylesoftware.htmlunit.WebRequest;
import com.gargoylesoftware.htmlunit.WebResponse; import com.gargoylesoftware.htmlunit.WebResponse;
import com.gargoylesoftware.htmlunit.util.NameValuePair; import com.gargoylesoftware.htmlunit.util.NameValuePair;
import org.junit.Before;
import org.junit.Test;
import org.springframework.mock.web.MockHttpServletResponse;
import static org.hamcrest.CoreMatchers.endsWith; import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.CoreMatchers.equalTo; import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.junit.Assert.assertThat;
/** /**
* Tests for {@link MockWebResponseBuilder}. * Tests for {@link MockWebResponseBuilder}.

16
spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/UrlRegexRequestMatcherTests.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.test.web.servlet.htmlunit; package org.springframework.test.web.servlet.htmlunit;

22
spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/webdriver/MockMvcHtmlUnitDriverBuilderTests.java

@ -1,17 +1,17 @@
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.test.web.servlet.htmlunit.webdriver; package org.springframework.test.web.servlet.htmlunit.webdriver;
@ -40,12 +40,8 @@ import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.CoreMatchers.equalTo; import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.not;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
/** /**
* Integration tests for {@link MockMvcHtmlUnitDriverBuilder}. * Integration tests for {@link MockMvcHtmlUnitDriverBuilder}.

27
spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/webdriver/WebConnectionHtmlUnitDriverTests.java

@ -1,39 +1,36 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * Licensed under the Apache License, Version 2.0 (the "License");
* use this file except in compliance with the License. You may obtain a copy of * you may not use this file except in compliance with the License.
* the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS,
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* License for the specific language governing permissions and limitations under * See the License for the specific language governing permissions and
* the License. * limitations under the License.
*/ */
package org.springframework.test.web.servlet.htmlunit.webdriver; package org.springframework.test.web.servlet.htmlunit.webdriver;
import com.gargoylesoftware.htmlunit.WebConnection;
import com.gargoylesoftware.htmlunit.WebRequest;
import org.junit.Before; import org.junit.Before;
import org.junit.Rule; import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.rules.ExpectedException; import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.mockito.Mock; import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner; import org.mockito.runners.MockitoJUnitRunner;
import com.gargoylesoftware.htmlunit.WebConnection;
import com.gargoylesoftware.htmlunit.WebRequest;
import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.notNullValue;
import static org.mockito.Matchers.any; import static org.mockito.Matchers.any;
import static org.mockito.Mockito.when; import static org.mockito.Mockito.*;
/** /**
* Unit tests for {@link WebConnectionHtmlUnitDriver}. * Unit tests for {@link WebConnectionHtmlUnitDriver}.

15
spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/FilterTests.java

@ -1,14 +1,17 @@
/* /*
* Copyright 2002-2014 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * Licensed under the Apache License, Version 2.0 (the "License");
* the License. You may obtain a copy of the License at * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * distributed under the License is distributed on an "AS IS" BASIS,
* specific language governing permissions and limitations under the License. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.springframework.test.web.servlet.samples.standalone; package org.springframework.test.web.servlet.samples.standalone;

16
spring-test/src/test/java/org/springframework/test/web/servlet/setup/ConditionalDelegatingFilterProxyTests.java

@ -1,15 +1,19 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * Licensed under the Apache License, Version 2.0 (the "License");
* the License. You may obtain a copy of the License at * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * distributed under the License is distributed on an "AS IS" BASIS,
* specific language governing permissions and limitations under the License. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.springframework.test.web.servlet.setup; package org.springframework.test.web.servlet.setup;
import javax.servlet.Filter; import javax.servlet.Filter;

16
spring-test/src/test/java/org/springframework/test/web/servlet/setup/DefaultMockMvcBuilderTests.java

@ -1,15 +1,19 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * Licensed under the Apache License, Version 2.0 (the "License");
* the License. You may obtain a copy of the License at * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * distributed under the License is distributed on an "AS IS" BASIS,
* specific language governing permissions and limitations under the License. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.springframework.test.web.servlet.setup; package org.springframework.test.web.servlet.setup;
import org.junit.Rule; import org.junit.Rule;

18
spring-tx/src/main/java/org/springframework/transaction/annotation/EnableTransactionManagement.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -28,13 +28,15 @@ import org.springframework.core.Ordered;
/** /**
* Enables Spring's annotation-driven transaction management capability, similar to * Enables Spring's annotation-driven transaction management capability, similar to
* the support found in Spring's {@code <tx:*>} XML namespace. To be used * the support found in Spring's {@code <tx:*>} XML namespace. To be used on
* on @{@link org.springframework.context.annotation.Configuration Configuration} classes * @{@link org.springframework.context.annotation.Configuration Configuration} classes
* as follows: * as follows:
*
* <pre class="code"> * <pre class="code">
* &#064;Configuration * &#064;Configuration
* &#064;EnableTransactionManagement * &#064;EnableTransactionManagement
* public class AppConfig { * public class AppConfig {
*
* &#064;Bean * &#064;Bean
* public FooRepository fooRepository() { * public FooRepository fooRepository() {
* // configure and return a class having &#064;Transactional methods * // configure and return a class having &#064;Transactional methods
@ -54,19 +56,26 @@ import org.springframework.core.Ordered;
* *
* <p>For reference, the example above can be compared to the following Spring XML * <p>For reference, the example above can be compared to the following Spring XML
* configuration: * configuration:
*
* <pre class="code"> * <pre class="code">
* {@code * {@code
* <beans> * <beans>
*
* <tx:annotation-driven/> * <tx:annotation-driven/>
*
* <bean id="fooRepository" class="com.foo.JdbcFooRepository"> * <bean id="fooRepository" class="com.foo.JdbcFooRepository">
* <constructor-arg ref="dataSource"/> * <constructor-arg ref="dataSource"/>
* </bean> * </bean>
*
* <bean id="dataSource" class="com.vendor.VendorDataSource"/> * <bean id="dataSource" class="com.vendor.VendorDataSource"/>
*
* <bean id="transactionManager" class="org.sfwk...DataSourceTransactionManager"> * <bean id="transactionManager" class="org.sfwk...DataSourceTransactionManager">
* <constructor-arg ref="dataSource"/> * <constructor-arg ref="dataSource"/>
* </bean> * </bean>
*
* </beans> * </beans>
* }</pre> * }</pre>
*
* In both of the scenarios above, {@code @EnableTransactionManagement} and {@code * In both of the scenarios above, {@code @EnableTransactionManagement} and {@code
* <tx:annotation-driven/>} are responsible for registering the necessary Spring * <tx:annotation-driven/>} are responsible for registering the necessary Spring
* components that power annotation-driven transaction management, such as the * components that power annotation-driven transaction management, such as the
@ -87,10 +96,12 @@ import org.springframework.core.Ordered;
* {@code @EnableTransactionManagement} and the exact transaction manager bean to be used, * {@code @EnableTransactionManagement} and the exact transaction manager bean to be used,
* the {@link TransactionManagementConfigurer} callback interface may be implemented - * the {@link TransactionManagementConfigurer} callback interface may be implemented -
* notice the {@code implements} clause and the {@code @Override}-annotated method below: * notice the {@code implements} clause and the {@code @Override}-annotated method below:
*
* <pre class="code"> * <pre class="code">
* &#064;Configuration * &#064;Configuration
* &#064;EnableTransactionManagement * &#064;EnableTransactionManagement
* public class AppConfig implements TransactionManagementConfigurer { * public class AppConfig implements TransactionManagementConfigurer {
*
* &#064;Bean * &#064;Bean
* public FooRepository fooRepository() { * public FooRepository fooRepository() {
* // configure and return a class having &#064;Transactional methods * // configure and return a class having &#064;Transactional methods
@ -112,6 +123,7 @@ import org.springframework.core.Ordered;
* return txManager(); * return txManager();
* } * }
* }</pre> * }</pre>
*
* This approach may be desirable simply because it is more explicit, or it may be * This approach may be desirable simply because it is more explicit, or it may be
* necessary in order to distinguish between two {@code PlatformTransactionManager} beans * necessary in order to distinguish between two {@code PlatformTransactionManager} beans
* present in the same container. As the name suggests, the * present in the same container. As the name suggests, the

16
spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/EnableWebMvc.java

@ -1,15 +1,19 @@
/* /*
* Copyright 2002-2014 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * Licensed under the Apache License, Version 2.0 (the "License");
* the License. You may obtain a copy of the License at * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * distributed under the License is distributed on an "AS IS" BASIS,
* specific language governing permissions and limitations under the License. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.springframework.web.servlet.config.annotation; package org.springframework.web.servlet.config.annotation;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;

16
spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/EnableWebSocket.java

@ -1,14 +1,17 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * Licensed under the Apache License, Version 2.0 (the "License");
* the License. You may obtain a copy of the License at * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * distributed under the License is distributed on an "AS IS" BASIS,
* specific language governing permissions and limitations under the License. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.springframework.web.socket.config.annotation; package org.springframework.web.socket.config.annotation;
@ -32,6 +35,7 @@ import org.springframework.context.annotation.Import;
* *
* } * }
* </pre> * </pre>
*
* <p>Customize the imported configuration by implementing the * <p>Customize the imported configuration by implementing the
* {@link WebSocketConfigurer} interface: * {@link WebSocketConfigurer} interface:
* *

19
spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/EnableWebSocketMessageBroker.java

@ -1,14 +1,17 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * Licensed under the Apache License, Version 2.0 (the "License");
* the License. You may obtain a copy of the License at * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * distributed under the License is distributed on an "AS IS" BASIS,
* specific language governing permissions and limitations under the License. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.springframework.web.socket.config.annotation; package org.springframework.web.socket.config.annotation;
@ -32,8 +35,8 @@ import org.springframework.context.annotation.Import;
* *
* } * }
* </pre> * </pre>
* <p> *
* Customize the imported configuration by implementing the * <p>Customize the imported configuration by implementing the
* {@link WebSocketMessageBrokerConfigurer} interface or more likely extend the * {@link WebSocketMessageBrokerConfigurer} interface or more likely extend the
* convenient base class {@link AbstractWebSocketMessageBrokerConfigurer}: * convenient base class {@link AbstractWebSocketMessageBrokerConfigurer}:
* *

Loading…
Cancel
Save