From 537193a4e0a4597e93f461ab36dc359d4cd71d0b Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 11 Apr 2016 20:49:38 +0200 Subject: [PATCH] Consistent license header --- .../cache/annotation/EnableCaching.java | 21 ++++-- .../context/annotation/Bean.java | 17 +++-- .../context/annotation/Configuration.java | 69 ++++++++++++++----- .../annotation/EnableAspectJAutoProxy.java | 9 ++- .../annotation/EnableLoadTimeWeaving.java | 25 +++++-- .../context/annotation/PropertySource.java | 7 +- .../scheduling/annotation/EnableAsync.java | 13 ++-- .../annotation/EnableScheduling.java | 9 ++- ...NamespaceHandlerProxyTargetClassTests.java | 16 ++--- .../org/springframework/jmx/IJmxTestBean.java | 16 ++--- .../org/springframework/jmx/JmxTestBean.java | 16 ++--- .../access/MBeanClientInterceptorTests.java | 17 +++-- .../RemoteMBeanClientInterceptorTests.java | 20 +++--- .../jmx/export/CustomDateEditorRegistrar.java | 16 ++--- .../export/CustomEditorConfigurerTests.java | 16 ++--- .../springframework/jmx/export/DateRange.java | 16 ++--- .../jmx/export/ExceptionOnInitBean.java | 16 ++--- .../jmx/export/LazyInitMBeanTests.java | 16 ++--- .../PropertyPlaceholderConfigurerTests.java | 16 ++--- .../AnnotationLazyInitMBeanTests.java | 22 +++--- .../export/annotation/AnnotationTestBean.java | 16 ++--- .../annotation/JmxUtilsAnnotationTests.java | 16 ++--- .../assembler/AbstractAutodetectTests.java | 20 +++--- .../assembler/AbstractJmxAssemblerTests.java | 16 ++--- ...tractMetadataAssemblerAutodetectTests.java | 16 ++--- .../AbstractMetadataAssemblerTests.java | 16 ++--- .../jmx/export/assembler/ICustomBase.java | 16 ++--- .../jmx/export/assembler/ICustomJmxBean.java | 16 ++--- ...aceBasedMBeanInfoAssemblerCustomTests.java | 17 ++--- ...InterfaceBasedMBeanInfoAssemblerTests.java | 16 ++--- ...ameBasedMBeanInfoAssemblerMappedTests.java | 17 ++--- ...ethodNameBasedMBeanInfoAssemblerTests.java | 17 ++--- .../assembler/ReflectiveAssemblerTests.java | 20 +++--- .../naming/AbstractNamingStrategyTests.java | 20 +++--- .../export/naming/KeyNamingStrategyTests.java | 17 ++--- .../PropertiesFileNamingStrategyTests.java | 16 ++--- .../naming/PropertiesNamingStrategyTests.java | 17 ++--- .../ConnectorServerFactoryBeanTests.java | 19 ++--- .../jmx/support/JmxUtilsTests.java | 35 ++++------ .../support/MBeanServerFactoryBeanTests.java | 17 +++-- .../core/env/CommandLinePropertySource.java | 34 ++++++--- .../java/org/springframework/util/Assert.java | 14 ++-- .../jdbc/object/BatchSqlUpdate.java | 16 ++--- .../jms/annotation/EnableJms.java | 24 +++++-- .../htmlunit/DelegatingWebConnection.java | 16 ++--- .../htmlunit/ForwardRequestPostProcessor.java | 16 ++--- .../servlet/htmlunit/HostRequestMatcher.java | 16 ++--- .../htmlunit/HtmlUnitRequestBuilder.java | 16 ++--- .../htmlunit/MockMvcWebClientBuilder.java | 16 ++--- .../htmlunit/MockMvcWebConnection.java | 14 ++-- .../MockMvcWebConnectionBuilderSupport.java | 14 ++-- .../htmlunit/MockWebResponseBuilder.java | 16 +++-- .../htmlunit/UrlRegexRequestMatcher.java | 22 +++--- .../servlet/htmlunit/WebRequestMatcher.java | 16 ++--- .../MockMvcHtmlUnitDriverBuilder.java | 26 +++---- .../WebConnectionHtmlUnitDriver.java | 54 +++++++-------- .../setup/PatternMappingFilterProxy.java | 15 ++-- .../mock/web/MockFilterChainTests.java | 16 +++-- .../AbstractWebRequestMatcherTests.java | 16 ++--- .../DelegatingWebConnectionTests.java | 38 +++++----- .../servlet/htmlunit/ForwardController.java | 16 ++--- .../web/servlet/htmlunit/HelloController.java | 16 ++--- .../htmlunit/HostRequestMatcherTests.java | 16 ++--- .../MockMvcWebClientBuilderTests.java | 20 +++--- .../htmlunit/MockMvcWebConnectionTests.java | 25 ++++--- .../htmlunit/MockWebResponseBuilderTests.java | 29 ++++---- .../htmlunit/UrlRegexRequestMatcherTests.java | 16 ++--- .../MockMvcHtmlUnitDriverBuilderTests.java | 22 +++--- .../WebConnectionHtmlUnitDriverTests.java | 27 ++++---- .../samples/standalone/FilterTests.java | 15 ++-- ...ConditionalDelegatingFilterProxyTests.java | 16 +++-- .../setup/DefaultMockMvcBuilderTests.java | 16 +++-- .../EnableTransactionManagement.java | 18 ++++- .../config/annotation/EnableWebMvc.java | 52 +++++++------- .../config/annotation/EnableWebSocket.java | 32 +++++---- .../EnableWebSocketMessageBroker.java | 37 +++++----- 76 files changed, 834 insertions(+), 687 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/cache/annotation/EnableCaching.java b/spring-context/src/main/java/org/springframework/cache/annotation/EnableCaching.java index 5086c1a1df4..511e4de60dc 100644 --- a/spring-context/src/main/java/org/springframework/cache/annotation/EnableCaching.java +++ b/spring-context/src/main/java/org/springframework/cache/annotation/EnableCaching.java @@ -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"); * 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; /** - * Enables Spring's annotation-driven cache management capability, similar to - * the support found in Spring's {@code } XML namespace. To be used together + * Enables Spring's annotation-driven cache management capability, similar to the + * support found in Spring's {@code } XML namespace. To be used together * with @{@link org.springframework.context.annotation.Configuration Configuration} * classes as follows: + * *
  * @Configuration
  * @EnableCaching
  * public class AppConfig {
+ *
  *     @Bean
  *     public MyService myService() {
  *         // configure and return a class having @Cacheable methods
@@ -52,11 +54,15 @@ import org.springframework.core.Ordered;
  *
  * 

For reference, the example above can be compared to the following Spring XML * configuration: + * *

  * {@code
  * 
+ *
  *     
+ *
  *     
+ *
  *     
  *         
  *             
@@ -66,8 +72,10 @@ import org.springframework.core.Ordered;
  *             
  *         
  *     
+ *
  * 
  * }
+ * * In both of the scenarios above, {@code @EnableCaching} and {@code * } are responsible for registering the necessary Spring * components that power annotation-driven cache management, such as the @@ -90,12 +98,14 @@ import org.springframework.core.Ordered; * *

For those that wish to establish a more direct relationship between * {@code @EnableCaching} and the exact cache manager bean to be used, - * the {@link CachingConfigurer} callback interface may be implemented - notice the - * the {@code @Override}-annotated methods below: + * the {@link CachingConfigurer} callback interface may be implemented. + * Notice the the {@code @Override}-annotated methods below: + * *

  * @Configuration
  * @EnableCaching
  * public class AppConfig extends CachingConfigurerSupport {
+ *
  *     @Bean
  *     public MyService myService() {
  *         // configure and return a class having @Cacheable methods
@@ -118,6 +128,7 @@ import org.springframework.core.Ordered;
  *         return new MyKeyGenerator();
  *     }
  * }
+ * * 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 * same container. diff --git a/spring-context/src/main/java/org/springframework/context/annotation/Bean.java b/spring-context/src/main/java/org/springframework/context/annotation/Bean.java index 5c0fcd6805c..2763560088f 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/Bean.java +++ b/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"); * 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() { * // instantiate and configure MyBean obj * return obj; - * }
+ * } + * * *

Bean Names

* @@ -55,7 +56,8 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition; * public MyBean myBean() { * // instantiate and configure MyBean obj * return obj; - * } + * } + * * *

Scope, DependsOn, Primary, and Lazy

* @@ -70,7 +72,8 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition; * public MyBean myBean() { * // instantiate and configure MyBean obj * return obj; - * } + * } + * * *

{@code @Bean} Methods in {@code @Configuration} Classes

* @@ -87,14 +90,17 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition; *
  * @Configuration
  * public class AppConfig {
+ *
  *     @Bean
  *     public FooService fooService() {
  *         return new FooService(fooRepository());
  *     }
+ *
  *     @Bean
  *     public FooRepository fooRepository() {
  *         return new JdbcFooRepository(dataSource());
  *     }
+ *
  *     // ...
  * }
* @@ -152,7 +158,8 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition; * @Bean * public static PropertyPlaceholderConfigurer ppc() { * // instantiate, configure and return ppc ... - * } + * } + * * * 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. diff --git a/spring-context/src/main/java/org/springframework/context/annotation/Configuration.java b/spring-context/src/main/java/org/springframework/context/annotation/Configuration.java index c8a8b751248..5d3b67779dc 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/Configuration.java +++ b/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"); * 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; /** - * Indicates that a class declares one or more {@link Bean @Bean} methods and may be processed - * by the Spring container to generate bean definitions and service requests for those - * beans at runtime, for example: + * Indicates that a class declares one or more {@link Bean @Bean} methods and + * may be processed by the Spring container to generate bean definitions and + * service requests for those beans at runtime, for example: + * *
  * @Configuration
  * public class AppConfig {
+ *
  *     @Bean
  *     public MyBean myBean() {
  *         // instantiate, configure and return bean ...
@@ -40,25 +42,28 @@ import org.springframework.stereotype.Component;
  * }
* *

Bootstrapping {@code @Configuration} classes

+ * *

Via {@code AnnotationConfigApplicationContext}

+ * * {@code @Configuration} classes are typically bootstrapped using either * {@link AnnotationConfigApplicationContext} or its web-capable variant, * {@link org.springframework.web.context.support.AnnotationConfigWebApplicationContext - * AnnotationConfigWebApplicationContext}. - * A simple example with the former follows: + * AnnotationConfigWebApplicationContext}. A simple example with the former follows: + * *
- * AnnotationConfigApplicationContext ctx =
- *     new AnnotationConfigApplicationContext();
+ * AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
  * ctx.register(AppConfig.class);
  * ctx.refresh();
  * MyBean myBean = ctx.getBean(MyBean.class);
- * // use myBean ...
+ * // use myBean ... + * * * See {@link AnnotationConfigApplicationContext} Javadoc for further details and see * {@link org.springframework.web.context.support.AnnotationConfigWebApplicationContext * AnnotationConfigWebApplicationContext} for {@code web.xml} configuration instructions. * *

Via Spring {@code } XML

+ * *

As an alternative to registering {@code @Configuration} classes directly against an * {@code AnnotationConfigApplicationContext}, {@code @Configuration} classes may be * declared as normal {@code } definitions within Spring XML files: @@ -74,6 +79,7 @@ import org.springframework.stereotype.Component; * post processors that facilitate handling {@code @Configuration} classes. * *

Via component scanning

+ * *

{@code @Configuration} is meta-annotated with {@link Component @Component}, therefore * {@code @Configuration} classes are candidates for component scanning (typically using * Spring XML's {@code } element) and therefore may also take @@ -82,6 +88,7 @@ import org.springframework.stereotype.Component; *

{@code @Configuration} classes may not only be bootstrapped using * component scanning, but may also themselves configure component scanning using * the {@link ComponentScan @ComponentScan} annotation: + * *

  * @Configuration
  * @ComponentScan("com.acme.app.services")
@@ -89,18 +96,20 @@ import org.springframework.stereotype.Component;
  *     // various @Bean definitions ...
  * }
* - * See {@link ComponentScan @ComponentScan} Javadoc for details. - * + * See the {@link ComponentScan @ComponentScan} javadoc for details. * *

Working with externalized values

+ * *

Using the {@code Environment} API

+ * * Externalized values may be looked up by injecting the Spring - * {@link org.springframework.core.env.Environment Environment} into a - * {@code @Configuration} class using the {@code @Autowired} or the {@code @Inject} - * annotation: + * {@link org.springframework.core.env.Environment} into a {@code @Configuration} + * class using the {@code @Autowired} or the {@code @Inject} annotation: + * *
  * @Configuration
  * public class AppConfig {
+ *
  *     @Inject Environment env;
  *
  *     @Bean
@@ -115,10 +124,12 @@ import org.springframework.stereotype.Component;
  * source" objects, and {@code @Configuration} classes may contribute property sources to
  * the {@code Environment} object using
  * the {@link org.springframework.core.env.PropertySources @PropertySources} annotation:
+ *
  * 
  * @Configuration
  * @PropertySource("classpath:/com/acme/app.properties")
  * public class AppConfig {
+ *
  *     @Inject Environment env;
  *
  *     @Bean
@@ -131,12 +142,15 @@ import org.springframework.stereotype.Component;
  * and {@link PropertySource @PropertySource} Javadoc for further details.
  *
  * 

Using the {@code @Value} annotation

+ * * Externalized values may be 'wired into' {@code @Configuration} classes using * the {@link Value @Value} annotation: + * *
  * @Configuration
  * @PropertySource("classpath:/com/acme/app.properties")
  * public class AppConfig {
+ *
  *     @Value("${bean.name}") String beanName;
  *
  *     @Bean
@@ -155,14 +169,18 @@ import org.springframework.stereotype.Component;
  * {@code PropertySourcesPlaceholderConfigurer}.
  *
  * 

Composing {@code @Configuration} classes

+ * *

With the {@code @Import} annotation

+ * *

{@code @Configuration} classes may be composed using the {@link Import @Import} annotation, * not unlike the way that {@code } works in Spring XML. Because * {@code @Configuration} objects are managed as Spring beans within the container, * imported configurations may be injected using {@code @Autowired} or {@code @Inject}: + * *

  * @Configuration
  * public class DatabaseConfig {
+ *
  *     @Bean
  *     public DataSource dataSource() {
  *         // instantiate, configure and return DataSource
@@ -172,6 +190,7 @@ import org.springframework.stereotype.Component;
  * @Configuration
  * @Import(DatabaseConfig.class)
  * public class AppConfig {
+ *
  *     @Inject DatabaseConfig dataConfig;
  *
  *     @Bean
@@ -188,13 +207,15 @@ import org.springframework.stereotype.Component;
  * new AnnotationConfigApplicationContext(AppConfig.class);
* *

With the {@code @Profile} annotation

+ * * {@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 - * active: + * indicate they should be processed only if a given profile or profiles are active: + * *
  * @Profile("embedded")
  * @Configuration
  * public class EmbeddedDatabaseConfig {
+ *
  *     @Bean
  *     public DataSource dataSource() {
  *         // instantiate, configure and return embedded DataSource
@@ -204,25 +225,29 @@ import org.springframework.stereotype.Component;
  * @Profile("production")
  * @Configuration
  * public class ProductionDatabaseConfig {
+ *
  *     @Bean
  *     public DataSource dataSource() {
  *         // instantiate, configure and return production DataSource
  *     }
  * }
* - * See {@link Profile @Profile} and {@link org.springframework.core.env.Environment Environment} - * Javadoc for further details. + * See the {@link Profile @Profile} and {@link org.springframework.core.env.Environment} + * javadocs for further details. * *

With Spring XML using the {@code @ImportResource} annotation

+ * * As mentioned above, {@code @Configuration} classes may be declared as regular Spring * {@code } definitions within Spring XML files. It is also possible to * import Spring XML configuration files into {@code @Configuration} classes using * the {@link ImportResource @ImportResource} annotation. Bean definitions imported from XML can be * injected using {@code @Autowired} or {@code @Inject}: + * *
  * @Configuration
  * @ImportResource("classpath:/com/acme/database-config.xml")
  * public class AppConfig {
+ *
  *     @Inject DataSource dataSource; // from XML
  *
  *     @Bean
@@ -233,10 +258,13 @@ import org.springframework.stereotype.Component;
  * }
* *

With nested {@code @Configuration} classes

+ * * {@code @Configuration} classes may be nested within one another as follows: + * *
  * @Configuration
  * public class AppConfig {
+ *
  *     @Inject DataSource dataSource;
  *
  *     @Bean
@@ -264,6 +292,7 @@ import org.springframework.stereotype.Component;
  * enclosing {@code @Configuration} class.
  *
  * 

Configuring lazy initialization

+ * *

By default, {@code @Bean} methods will be eagerly instantiated at container * 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 @@ -271,9 +300,11 @@ import org.springframework.stereotype.Component; * individual {@code @Bean} methods as well. * *

Testing support for {@code @Configuration} classes

+ * * The Spring TestContext framework available in the {@code spring-test} module * provides the {@code @ContextConfiguration} annotation, which as of Spring 3.1 can * accept an array of {@code @Configuration} {@code Class} objects: + * *
  * @RunWith(SpringJUnit4ClassRunner.class)
  * @ContextConfiguration(classes={AppConfig.class, DatabaseConfig.class})
@@ -292,6 +323,7 @@ import org.springframework.stereotype.Component;
  * See TestContext framework reference documentation for details.
  *
  * 

Enabling built-in Spring features using {@code @Enable} annotations

+ * * Spring features such as asynchronous method execution, scheduled task execution, * annotation driven transaction management, and even Spring MVC can be enabled and * configured from {@code @Configuration} @@ -304,6 +336,7 @@ import org.springframework.stereotype.Component; * for details. * *

Constraints when authoring {@code @Configuration} classes

+ * *
    *
  • @Configuration classes must be non-final *
  • @Configuration classes must be non-local (may not be declared within a method) diff --git a/spring-context/src/main/java/org/springframework/context/annotation/EnableAspectJAutoProxy.java b/spring-context/src/main/java/org/springframework/context/annotation/EnableAspectJAutoProxy.java index effcec5df91..e2d652c875c 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/EnableAspectJAutoProxy.java +++ b/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"); * you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import java.lang.annotation.Target; * @Configuration * @EnableAspectJAutoProxy * public class AppConfig { + * * @Bean * public FooService fooService() { * return new FooService(); @@ -47,12 +48,14 @@ import java.lang.annotation.Target; * *
      * public class FooService {
    + *
      *     // various methods
      * }
    * *
      * @Aspect
      * public class MyAspect {
    + *
      *     @Before("execution(* FooService+.*(..))")
      *     public void advice() {
      *         // advise FooService methods as appropriate
    @@ -66,6 +69,7 @@ import java.lang.annotation.Target;
      * 

    Users can control the type of proxy that gets created for {@code FooService} using * the {@link #proxyTargetClass()} attribute. The following enables CGLIB-style 'subclass' * proxies as opposed to the default interface-based JDK proxy approach. + * *

      * @Configuration
      * @EnableAspectJAutoProxy(proxyTargetClass=true)
    @@ -75,6 +79,7 @@ import java.lang.annotation.Target;
      *
      * 

    Note that {@code @Aspect} beans may be component-scanned like any other. Simply * mark the aspect with both {@code @Aspect} and {@code @Component}: + * *

      * package com.foo;
      *
    @@ -86,11 +91,13 @@ import java.lang.annotation.Target;
      * public class MyAspect { ... }
    * * Then use the @{@link ComponentScan} annotation to pick both up: + * *
      * @Configuration
      * @ComponentScan("com.foo")
      * @EnableAspectJAutoProxy
      * public class AppConfig {
    + *
      *     // no explicit @Bean definitions required
      * }
    * diff --git a/spring-context/src/main/java/org/springframework/context/annotation/EnableLoadTimeWeaving.java b/spring-context/src/main/java/org/springframework/context/annotation/EnableLoadTimeWeaving.java index eb8776cf9b3..17fda815e0e 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/EnableLoadTimeWeaving.java +++ b/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"); * 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 * a bean with the name "loadTimeWeaver", similar to the {@code } * element in Spring XML. - * To be used - * on @{@link org.springframework.context.annotation.Configuration Configuration} classes; + * + *

    To be used on @{@link org.springframework.context.annotation.Configuration Configuration} classes; * the simplest possible example of which follows: + * *

      * @Configuration
      * @EnableLoadTimeWeaving
      * public class AppConfig {
    + *
      *     // application-specific @Bean definitions ...
      * }
    * * The example above is equivalent to the following Spring XML configuration: + * *
      * {@code
      * 
    + *
      *     
    + *
      *     
    + *
      * 
      * }
    * @@ -61,10 +67,12 @@ import org.springframework.instrument.classloading.LoadTimeWeaver; * {@code @EnableLoadTimeWeaving} may also implement the {@link LoadTimeWeavingConfigurer} * interface and return a custom {@code LoadTimeWeaver} instance through the * {@code #getLoadTimeWeaver} method: + * *
      * @Configuration
      * @EnableLoadTimeWeaving
      * public class AppConfig implements LoadTimeWeavingConfigurer {
    + *
      *     @Override
      *     public LoadTimeWeaver getLoadTimeWeaver() {
      *         MyLoadTimeWeaver ltw = new MyLoadTimeWeaver();
    @@ -75,10 +83,13 @@ import org.springframework.instrument.classloading.LoadTimeWeaver;
      * }
    * *

    The example above can be compared to the following Spring XML configuration: + * *

      * {@code
      * 
    + *
      *     
    + *
      * 
      * }
    * @@ -94,6 +105,7 @@ import org.springframework.instrument.classloading.LoadTimeWeaver; * 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. * Example: + * *
      * @Configuration
      * @EnableLoadTimeWeaving(aspectjWeaving=ENABLED)
    @@ -101,10 +113,13 @@ import org.springframework.instrument.classloading.LoadTimeWeaver;
      * }
    * *

    The example above can be compared to the following Spring XML configuration: + * *

      * {@code
      * 
    + *
      *     
    + *
      * 
      * }
    * @@ -131,7 +146,8 @@ public @interface EnableLoadTimeWeaving { */ AspectJWeaving aspectjWeaving() default AspectJWeaving.AUTODETECT; - public enum AspectJWeaving { + + enum AspectJWeaving { /** * Switches on Spring-based AspectJ load-time weaving. @@ -151,4 +167,5 @@ public @interface EnableLoadTimeWeaving { */ AUTODETECT; } + } diff --git a/spring-context/src/main/java/org/springframework/context/annotation/PropertySource.java b/spring-context/src/main/java/org/springframework/context/annotation/PropertySource.java index 4f9edf755b3..e4237110655 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/PropertySource.java +++ b/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. * *

    Example usage

    + * *

    Given a file {@code app.properties} containing the key/value pair * {@code testbean.name=myTestBean}, the following {@code @Configuration} class * 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". * *

    Resolving ${...} placeholders in {@code } and {@code @Value} annotations

    + * * In order to resolve ${...} placeholders in {@code } definitions or {@code @Value} * annotations using properties from a {@code PropertySource}, one must register * a {@code PropertySourcesPlaceholderConfigurer}. This happens automatically when using @@ -68,9 +70,11 @@ import org.springframework.core.io.support.PropertySourceFactory; * for details and examples. * *

    Resolving ${...} placeholders within {@code @PropertySource} resource locations

    + * * Any ${...} placeholders present in a {@code @PropertySource} {@linkplain #value() * resource location} will be resolved against the set of property sources already - * registered against the environment. For example: + * registered against the environment. For example: + * *
      * @Configuration
      * @PropertySource("classpath:/com/${my.placeholder:default/path}/app.properties")
    @@ -94,6 +98,7 @@ import org.springframework.core.io.support.PropertySourceFactory;
      * IllegalArgumentException} will be thrown.
      *
      * 

    A note on property overriding with @PropertySource

    + * * 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. * diff --git a/spring-context/src/main/java/org/springframework/scheduling/annotation/EnableAsync.java b/spring-context/src/main/java/org/springframework/scheduling/annotation/EnableAsync.java index ef3c396e646..e4910e9f1b9 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/annotation/EnableAsync.java +++ b/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, * such uncaught exceptions are only logged. * - *

    To customize all this, implement {@link AsyncConfigurer} and - * provide: + *

    To customize all this, implement {@link AsyncConfigurer} and provide: *

      *
    • your own {@link java.util.concurrent.Executor Executor} through the * {@link AsyncConfigurer#getAsyncExecutor getAsyncExecutor()} method, and
    • @@ -114,13 +113,19 @@ import org.springframework.core.Ordered; * *

      For reference, the example above can be compared to the following Spring XML * configuration: + * *

        * {@code
        * 
      + *
        *     
      + *
        *     
      + *
        *     
      + *
        *     
      + *
        * 
        * }
      * @@ -148,8 +153,8 @@ public @interface EnableAsync { /** * Indicate the 'async' annotation type to be detected at either class * or method level. - *

      By default, both Spring's @{@link Async} annotation and the EJB - * 3.1 {@code @javax.ejb.Asynchronous} annotation will be detected. + *

      By default, both Spring's @{@link Async} annotation and the EJB 3.1 + * {@code @javax.ejb.Asynchronous} annotation will be detected. *

      This attribute exists so that developers can provide their own * custom annotation type to indicate that a method (or all methods of * a given class) should be invoked asynchronously. diff --git a/spring-context/src/main/java/org/springframework/scheduling/annotation/EnableScheduling.java b/spring-context/src/main/java/org/springframework/scheduling/annotation/EnableScheduling.java index 37e546f7970..9b5b8059946 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/annotation/EnableScheduling.java +++ b/spring-context/src/main/java/org/springframework/scheduling/annotation/EnableScheduling.java @@ -163,18 +163,25 @@ import org.springframework.scheduling.config.ScheduledTaskRegistrar; * *

      For reference, the example above can be compared to the following Spring XML * configuration: + * *

        * {@code
        * 
      + *
        *     
      + *
        *     
      + *
        *     
        *         
        *     
      + *
        *     
      + *
        * 
        * }
      - * the examples are equivalent save that in XML a fixed-rate period is used + * + * The examples are equivalent save that in XML a fixed-rate period is used * instead of a custom {@code Trigger} implementation; this is because the * {@code task:} namespace {@code scheduled} cannot easily expose such support. This is * but one demonstration how the code-based approach allows for maximum configurability diff --git a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerProxyTargetClassTests.java b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerProxyTargetClassTests.java index a6627eb377e..66a54b2e3c4 100644 --- a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerProxyTargetClassTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.aop.config; diff --git a/spring-context/src/test/java/org/springframework/jmx/IJmxTestBean.java b/spring-context/src/test/java/org/springframework/jmx/IJmxTestBean.java index be001e23c4c..ca6a1cd7966 100644 --- a/spring-context/src/test/java/org/springframework/jmx/IJmxTestBean.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx; diff --git a/spring-context/src/test/java/org/springframework/jmx/JmxTestBean.java b/spring-context/src/test/java/org/springframework/jmx/JmxTestBean.java index b1a773128df..005fcf574e6 100644 --- a/spring-context/src/test/java/org/springframework/jmx/JmxTestBean.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx; diff --git a/spring-context/src/test/java/org/springframework/jmx/access/MBeanClientInterceptorTests.java b/spring-context/src/test/java/org/springframework/jmx/access/MBeanClientInterceptorTests.java index 5d32d0a9262..3f30e901e7d 100644 --- a/spring-context/src/test/java/org/springframework/jmx/access/MBeanClientInterceptorTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.access; @@ -22,7 +22,6 @@ import java.lang.reflect.Method; import java.net.BindException; import java.util.HashMap; import java.util.Map; - import javax.management.Descriptor; import javax.management.MBeanServerConnection; import javax.management.remote.JMXConnectorServer; diff --git a/spring-context/src/test/java/org/springframework/jmx/access/RemoteMBeanClientInterceptorTests.java b/spring-context/src/test/java/org/springframework/jmx/access/RemoteMBeanClientInterceptorTests.java index 4c3299bea51..dea449ec92c 100644 --- a/spring-context/src/test/java/org/springframework/jmx/access/RemoteMBeanClientInterceptorTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.access; import java.net.BindException; import java.net.MalformedURLException; - import javax.management.MBeanServerConnection; import javax.management.remote.JMXConnector; import javax.management.remote.JMXConnectorFactory; @@ -43,6 +42,7 @@ import org.springframework.util.SocketUtils; public class RemoteMBeanClientInterceptorTests extends MBeanClientInterceptorTests { private static final int SERVICE_PORT; + private static final String SERVICE_URL; static { @@ -50,10 +50,12 @@ public class RemoteMBeanClientInterceptorTests extends MBeanClientInterceptorTes SERVICE_URL = "service:jmx:jmxmp://localhost:" + SERVICE_PORT; } + private JMXConnectorServer connectorServer; private JMXConnector connector; + @Override public void onSetUp() throws Exception { runTests = false; diff --git a/spring-context/src/test/java/org/springframework/jmx/export/CustomDateEditorRegistrar.java b/spring-context/src/test/java/org/springframework/jmx/export/CustomDateEditorRegistrar.java index e85640fdc55..c7c4f7aea70 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/CustomDateEditorRegistrar.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.export; diff --git a/spring-context/src/test/java/org/springframework/jmx/export/CustomEditorConfigurerTests.java b/spring-context/src/test/java/org/springframework/jmx/export/CustomEditorConfigurerTests.java index ff04ff43c78..3e3efbb32b6 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/CustomEditorConfigurerTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.export; diff --git a/spring-context/src/test/java/org/springframework/jmx/export/DateRange.java b/spring-context/src/test/java/org/springframework/jmx/export/DateRange.java index 64f3f03b897..c3fb705e841 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/DateRange.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.export; diff --git a/spring-context/src/test/java/org/springframework/jmx/export/ExceptionOnInitBean.java b/spring-context/src/test/java/org/springframework/jmx/export/ExceptionOnInitBean.java index a59d950a8d7..89a4fb42df3 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/ExceptionOnInitBean.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.export; diff --git a/spring-context/src/test/java/org/springframework/jmx/export/LazyInitMBeanTests.java b/spring-context/src/test/java/org/springframework/jmx/export/LazyInitMBeanTests.java index 9914be229cb..674d105d9ab 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/LazyInitMBeanTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.export; diff --git a/spring-context/src/test/java/org/springframework/jmx/export/PropertyPlaceholderConfigurerTests.java b/spring-context/src/test/java/org/springframework/jmx/export/PropertyPlaceholderConfigurerTests.java index 47091ef0cfe..4f334afff9d 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/PropertyPlaceholderConfigurerTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.export; diff --git a/spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationLazyInitMBeanTests.java b/spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationLazyInitMBeanTests.java index 93f54eadf4a..334dd7d5cf1 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationLazyInitMBeanTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.export.annotation; -import org.junit.Test; - import javax.management.MBeanServer; import javax.management.ObjectName; -import static org.junit.Assert.*; +import org.junit.Test; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.jmx.support.ObjectNameManager; +import static org.junit.Assert.*; + /** * @author Rob Harrop * @author Juergen Hoeller diff --git a/spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationTestBean.java b/spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationTestBean.java index fbdf9e30fbf..92479607b81 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationTestBean.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.export.annotation; diff --git a/spring-context/src/test/java/org/springframework/jmx/export/annotation/JmxUtilsAnnotationTests.java b/spring-context/src/test/java/org/springframework/jmx/export/annotation/JmxUtilsAnnotationTests.java index 75052e84d6c..8ed38cb6fd3 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/annotation/JmxUtilsAnnotationTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.export.annotation; diff --git a/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractAutodetectTests.java b/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractAutodetectTests.java index a5234fd0a1e..80ad217dda4 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractAutodetectTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.export.assembler; import org.junit.Test; -import static org.junit.Assert.*; - import org.springframework.jmx.JmxTestBean; +import static org.junit.Assert.*; + /** * @author Rob Harrop */ diff --git a/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractJmxAssemblerTests.java b/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractJmxAssemblerTests.java index bbb35f56ed1..4a9a45b0b48 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractJmxAssemblerTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.export.assembler; diff --git a/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerAutodetectTests.java b/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerAutodetectTests.java index 68811d712a8..69c11603ef9 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerAutodetectTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.export.assembler; diff --git a/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerTests.java b/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerTests.java index 6919ff676cc..4bcbdc57afa 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.export.assembler; diff --git a/spring-context/src/test/java/org/springframework/jmx/export/assembler/ICustomBase.java b/spring-context/src/test/java/org/springframework/jmx/export/assembler/ICustomBase.java index 808168de687..5b7f01e8737 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/assembler/ICustomBase.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.export.assembler; diff --git a/spring-context/src/test/java/org/springframework/jmx/export/assembler/ICustomJmxBean.java b/spring-context/src/test/java/org/springframework/jmx/export/assembler/ICustomJmxBean.java index 311b7c67a51..37841ac5af4 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/assembler/ICustomJmxBean.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.export.assembler; diff --git a/spring-context/src/test/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssemblerCustomTests.java b/spring-context/src/test/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssemblerCustomTests.java index e7bb1d68c9e..024b647b790 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssemblerCustomTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.export.assembler; @@ -31,6 +31,7 @@ public class InterfaceBasedMBeanInfoAssemblerCustomTests extends AbstractJmxAsse protected static final String OBJECT_NAME = "bean:name=testBean5"; + @Override protected String getObjectName() { return OBJECT_NAME; diff --git a/spring-context/src/test/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssemblerTests.java b/spring-context/src/test/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssemblerTests.java index 76b8ad5639e..3f49e70f921 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssemblerTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.export.assembler; diff --git a/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerMappedTests.java b/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerMappedTests.java index 3dd58bf546e..21efe0ba529 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerMappedTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.export.assembler; @@ -33,6 +33,7 @@ public class MethodNameBasedMBeanInfoAssemblerMappedTests extends AbstractJmxAss protected static final String OBJECT_NAME = "bean:name=testBean4"; + @Test public void testGetAgeIsReadOnly() throws Exception { ModelMBeanInfo info = getMBeanInfoFromAssembler(); diff --git a/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerTests.java b/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerTests.java index d85f42b508e..3b51e92bc8d 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.export.assembler; @@ -33,6 +33,7 @@ public class MethodNameBasedMBeanInfoAssemblerTests extends AbstractJmxAssembler protected static final String OBJECT_NAME = "bean:name=testBean5"; + @Override protected String getObjectName() { return OBJECT_NAME; diff --git a/spring-context/src/test/java/org/springframework/jmx/export/assembler/ReflectiveAssemblerTests.java b/spring-context/src/test/java/org/springframework/jmx/export/assembler/ReflectiveAssemblerTests.java index 729e784464b..4b52c9127cb 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/assembler/ReflectiveAssemblerTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.export.assembler; - - - /** * @author Rob Harrop */ @@ -26,6 +23,7 @@ public class ReflectiveAssemblerTests extends AbstractJmxAssemblerTests { protected static final String OBJECT_NAME = "bean:name=testBean1"; + @Override protected String getObjectName() { return OBJECT_NAME; diff --git a/spring-context/src/test/java/org/springframework/jmx/export/naming/AbstractNamingStrategyTests.java b/spring-context/src/test/java/org/springframework/jmx/export/naming/AbstractNamingStrategyTests.java index 3be1715b4ec..9ec912daf08 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/naming/AbstractNamingStrategyTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.export.naming; -import org.junit.Test; - import javax.management.ObjectName; +import org.junit.Test; + import static org.junit.Assert.*; /** diff --git a/spring-context/src/test/java/org/springframework/jmx/export/naming/KeyNamingStrategyTests.java b/spring-context/src/test/java/org/springframework/jmx/export/naming/KeyNamingStrategyTests.java index df11e8b4bba..2893e7644d8 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/naming/KeyNamingStrategyTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.export.naming; @@ -23,6 +23,7 @@ public class KeyNamingStrategyTests extends AbstractNamingStrategyTests { private static final String OBJECT_NAME = "spring:name=test"; + @Override protected ObjectNamingStrategy getStrategy() throws Exception { return new KeyNamingStrategy(); diff --git a/spring-context/src/test/java/org/springframework/jmx/export/naming/PropertiesFileNamingStrategyTests.java b/spring-context/src/test/java/org/springframework/jmx/export/naming/PropertiesFileNamingStrategyTests.java index 3050b6f8e87..958b5f1128a 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/naming/PropertiesFileNamingStrategyTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.export.naming; diff --git a/spring-context/src/test/java/org/springframework/jmx/export/naming/PropertiesNamingStrategyTests.java b/spring-context/src/test/java/org/springframework/jmx/export/naming/PropertiesNamingStrategyTests.java index 3521619c224..f8b6038433a 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/naming/PropertiesNamingStrategyTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.export.naming; @@ -26,6 +26,7 @@ public class PropertiesNamingStrategyTests extends AbstractNamingStrategyTests { private static final String OBJECT_NAME = "bean:name=namingTest"; + @Override protected ObjectNamingStrategy getStrategy() throws Exception { KeyNamingStrategy strat = new KeyNamingStrategy(); diff --git a/spring-context/src/test/java/org/springframework/jmx/support/ConnectorServerFactoryBeanTests.java b/spring-context/src/test/java/org/springframework/jmx/support/ConnectorServerFactoryBeanTests.java index 34bbb739e2f..3fbbde43792 100644 --- a/spring-context/src/test/java/org/springframework/jmx/support/ConnectorServerFactoryBeanTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.support; import java.io.IOException; import java.net.MalformedURLException; - import javax.management.InstanceNotFoundException; import javax.management.MBeanServer; import javax.management.MBeanServerConnection; @@ -49,6 +48,7 @@ public class ConnectorServerFactoryBeanTests extends AbstractMBeanServerTests { private static final String OBJECT_NAME = "spring:type=connector,name=test"; + @Override protected void onSetUp() throws Exception { Assume.group(TestGroup.JMXMP); @@ -60,6 +60,7 @@ public class ConnectorServerFactoryBeanTests extends AbstractMBeanServerTests { Assume.group(TestGroup.JMXMP, () -> super.tearDown()); } + @Test public void startupWithLocatedServer() throws Exception { ConnectorServerFactoryBean bean = new ConnectorServerFactoryBean(); diff --git a/spring-context/src/test/java/org/springframework/jmx/support/JmxUtilsTests.java b/spring-context/src/test/java/org/springframework/jmx/support/JmxUtilsTests.java index 30b00834616..99a1e6f0122 100644 --- a/spring-context/src/test/java/org/springframework/jmx/support/JmxUtilsTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.support; @@ -193,7 +193,7 @@ public class JmxUtilsTests { } - public static interface FooMBean { + public interface FooMBean { String getName(); } @@ -208,7 +208,7 @@ public class JmxUtilsTests { } - public static interface FooMXBean { + public interface FooMXBean { String getName(); } @@ -224,37 +224,30 @@ public class JmxUtilsTests { public static class Bar extends Foo { - } 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 { - } } diff --git a/spring-context/src/test/java/org/springframework/jmx/support/MBeanServerFactoryBeanTests.java b/spring-context/src/test/java/org/springframework/jmx/support/MBeanServerFactoryBeanTests.java index f8d0bf740c6..4dbeccb1468 100644 --- a/spring-context/src/test/java/org/springframework/jmx/support/MBeanServerFactoryBeanTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jmx.support; import java.lang.management.ManagementFactory; import java.util.List; - import javax.management.MBeanServer; import javax.management.MBeanServerFactory; diff --git a/spring-core/src/main/java/org/springframework/core/env/CommandLinePropertySource.java b/spring-core/src/main/java/org/springframework/core/env/CommandLinePropertySource.java index c71630fdbb8..1a47e0ebb5b 100644 --- a/spring-core/src/main/java/org/springframework/core/env/CommandLinePropertySource.java +++ b/spring-core/src/main/java/org/springframework/core/env/CommandLinePropertySource.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"); * 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}. * *

      Purpose and General Usage

      + * * 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 * 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 * {@code ApplicationContext}, at which point all command line arguments become available * through the {@link Environment#getProperty(String)} family of methods. For example: + * *
        * public static void main(String[] args) {
        *     CommandLinePropertySource clps = ...;
      @@ -46,11 +48,14 @@ import org.springframework.util.StringUtils;
        *     ctx.register(AppConfig.class);
        *     ctx.refresh();
        * }
      + * * With the bootstrap logic above, the {@code AppConfig} class may {@code @Inject} the * Spring {@code Environment} and query it directly for properties: + * *
        * @Configuration
        * public class AppConfig {
      + *
        *     @Inject Environment env;
        *
        *     @Bean
      @@ -63,6 +68,7 @@ import org.springframework.util.StringUtils;
        *         return dataSource;
        *     }
        * }
      + * * Because the {@code CommandLinePropertySource} was added to the {@code Environment}'s * set of {@link MutablePropertySources} using the {@code #addFirst} method, it has * 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 * PropertySourcesPropertyResolver} bean has been registered, either directly or through * using the {@code } element. For example: + * *
        * @Component
        * public class MyComponent {
      + *
        *     @Value("my.property:defaultVal")
        *     private String myProperty;
        *
      @@ -94,10 +102,12 @@ import org.springframework.util.StringUtils;
        * {@link PropertySource#getProperty(String)} and
        * {@link PropertySource#containsProperty(String)} methods. For example, given the
        * following command line:
      - * 
      - * --o1=v1 --o2
      + * + *
      --o1=v1 --o2
      + * * 'o1' and 'o2' are treated as "option arguments", and the following assertions would * evaluate true: + * *
        * CommandLinePropertySource ps = ...
        * assert ps.containsProperty("o1") == true;
      @@ -105,7 +115,8 @@ import org.springframework.util.StringUtils;
        * assert ps.containsProperty("o3") == false;
        * assert ps.getProperty("o1").equals("v1");
        * assert ps.getProperty("o2").equals("");
      - * assert ps.getProperty("o3") == null;
      + * assert ps.getProperty("o3") == null; + *
      * * 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")} @@ -129,11 +140,13 @@ import org.springframework.util.StringUtils; * CommandLinePropertySource} and at the same time lends itself to conversion when used * in conjunction with the Spring {@link Environment} and its built-in {@code * ConversionService}. Consider the following example: - *
      - * --o1=v1 --o2=v2 /path/to/file1 /path/to/file2
      + * + *
      --o1=v1 --o2=v2 /path/to/file1 /path/to/file2
      + * * 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 * will evaluate true: + * *
        * CommandLinePropertySource ps = ...
        * assert ps.containsProperty("o1") == true;
      @@ -141,22 +154,26 @@ import org.springframework.util.StringUtils;
        * assert ps.containsProperty("nonOptionArgs") == true;
        * assert ps.getProperty("o1").equals("v1");
        * assert ps.getProperty("o2").equals("v2");
      - * assert ps.getProperty("nonOptionArgs").equals("/path/to/file1,/path/to/file2");
      + * assert ps.getProperty("nonOptionArgs").equals("/path/to/file1,/path/to/file2"); + *
    * *

    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 * list: + * *

      * Environment env = applicationContext.getEnvironment();
      * String[] nonOptionArgs = env.getProperty("nonOptionArgs", String[].class);
      * assert nonOptionArgs[0].equals("/path/to/file1");
    - * assert nonOptionArgs[1].equals("/path/to/file2");
    + * assert nonOptionArgs[1].equals("/path/to/file2"); + *
    * *

    The name of the special "non-option arguments" property may be customized through * the {@link #setNonOptionArgsPropertyName(String)} method. Doing so is recommended as * 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 * these as something like "file.locations" than the default of "nonOptionArgs": + * *

      * public static void main(String[] args) {
      *     CommandLinePropertySource clps = ...;
    @@ -169,6 +186,7 @@ import org.springframework.util.StringUtils;
      * }
    * *

    Limitations

    + * * 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 * provide the simplest possible abstraction for accessing command line arguments diff --git a/spring-core/src/main/java/org/springframework/util/Assert.java b/spring-core/src/main/java/org/springframework/util/Assert.java index 1d7c4770902..76b45186be7 100644 --- a/spring-core/src/main/java/org/springframework/util/Assert.java +++ b/spring-core/src/main/java/org/springframework/util/Assert.java @@ -1,17 +1,17 @@ /* * 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 the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.util; diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/object/BatchSqlUpdate.java b/spring-jdbc/src/main/java/org/springframework/jdbc/object/BatchSqlUpdate.java index 6372990866d..c8b0484652b 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/object/BatchSqlUpdate.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.jdbc.object; diff --git a/spring-jms/src/main/java/org/springframework/jms/annotation/EnableJms.java b/spring-jms/src/main/java/org/springframework/jms/annotation/EnableJms.java index a896e5f49bc..a8767010c65 100644 --- a/spring-jms/src/main/java/org/springframework/jms/annotation/EnableJms.java +++ b/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"); * you may not use this file except in compliance with the License. @@ -35,6 +35,7 @@ import org.springframework.context.annotation.Import; * @Configuration * @EnableJms * public class AppConfig { + * * @Bean * public DefaultJmsListenerContainerFactory myJmsListenerContainerFactory() { * DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory(); @@ -43,6 +44,7 @@ import org.springframework.context.annotation.Import; * factory.setConcurrency("5"); * return factory; * } + * * // other @Bean definitions * }
    * @@ -59,6 +61,7 @@ import org.springframework.context.annotation.Import; * package com.acme.foo; * * public class MyService { + * * @JmsListener(containerFactory = "myJmsListenerContainerFactory", destination="myQueue") * public void process(String msg) { * // process incoming message @@ -78,6 +81,7 @@ import org.springframework.context.annotation.Import; * @Configuration * @EnableJms * public class AppConfig { + * * @Bean * public MyService myService() { * return new MyService(); @@ -112,10 +116,9 @@ import org.springframework.context.annotation.Import; * // process incoming message * }
* - * 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 - * the annotated method. By default, {@link org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory - * DefaultMessageHandlerMethodFactory} is used. + * These features are abstracted by the {@link org.springframework.messaging.handler.annotation.support.MessageHandlerMethodFactory} + * that is responsible to build the necessary invoker to process the annotated method. By default, + * {@link org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory} is used. * *

When more control is desired, a {@code @Configuration} class may implement * {@link JmsListenerConfigurer}. This allows access to the underlying @@ -127,6 +130,7 @@ import org.springframework.context.annotation.Import; * @Configuration * @EnableJms * public class AppConfig implements JmsListenerConfigurer { + * * @Override * public void configureJmsListeners(JmsListenerEndpointRegistrar registrar) { * 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 * configuration: + * *

  * {@code 
+ *
  *     
  *
- *     
+ *     
  *           // factory settings
  *     
  *
  *     
+ *
  * 
  * }
* @@ -169,6 +175,7 @@ import org.springframework.context.annotation.Import; * @Configuration * @EnableJms * public class AppConfig implements JmsListenerConfigurer { + * * @Override * public void configureJmsListeners(JmsListenerEndpointRegistrar registrar) { * registrar.setEndpointRegistry(myJmsListenerEndpointRegistry()); @@ -197,6 +204,7 @@ import org.springframework.context.annotation.Import; * configuration: *
  * {@code 
+ *
  *     
  *
  *     
+ *
  * 
  * }
* @@ -222,6 +231,7 @@ import org.springframework.context.annotation.Import; * @Configuration * @EnableJms * public class AppConfig implements JmsListenerConfigurer { + * * @Override * public void configureJmsListeners(JmsListenerEndpointRegistrar registrar) { * SimpleJmsListenerEndpoint myEndpoint = new SimpleJmsListenerEndpoint(); diff --git a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/DelegatingWebConnection.java b/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/DelegatingWebConnection.java index 50f6fa95a79..1f64c74e34d 100644 --- a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/DelegatingWebConnection.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.htmlunit; diff --git a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/ForwardRequestPostProcessor.java b/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/ForwardRequestPostProcessor.java index f6bc2231404..d8d69d94c16 100644 --- a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/ForwardRequestPostProcessor.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.htmlunit; diff --git a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/HostRequestMatcher.java b/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/HostRequestMatcher.java index e6cee1e665a..28f9f0b4fa7 100644 --- a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/HostRequestMatcher.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.htmlunit; diff --git a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/HtmlUnitRequestBuilder.java b/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/HtmlUnitRequestBuilder.java index 3cd0218a133..771e8c542af 100644 --- a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/HtmlUnitRequestBuilder.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.htmlunit; diff --git a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebClientBuilder.java b/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebClientBuilder.java index 94cc1ea8653..597ac8f4f50 100644 --- a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebClientBuilder.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.htmlunit; diff --git a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnection.java b/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnection.java index f57d4b69036..f69995b9f7a 100644 --- a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnection.java +++ b/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. * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.htmlunit; diff --git a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnectionBuilderSupport.java b/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnectionBuilderSupport.java index baef40419bd..13a368e6d6f 100644 --- a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnectionBuilderSupport.java +++ b/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. * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.htmlunit; diff --git a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockWebResponseBuilder.java b/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockWebResponseBuilder.java index de9f1ec478a..4606712d2fa 100644 --- a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockWebResponseBuilder.java +++ b/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. * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.htmlunit; @@ -44,6 +44,7 @@ final class MockWebResponseBuilder { private static final String DEFAULT_STATUS_MESSAGE = "N/A"; + private final long startTime; private final WebRequest webRequest; @@ -59,6 +60,7 @@ final class MockWebResponseBuilder { this.response = response; } + public WebResponse build() throws IOException { WebResponseData webResponseData = webResponseData(); long endTime = System.currentTimeMillis(); diff --git a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/UrlRegexRequestMatcher.java b/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/UrlRegexRequestMatcher.java index 13d6b6e5463..9ab67364481 100644 --- a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/UrlRegexRequestMatcher.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.htmlunit; @@ -27,7 +27,9 @@ import com.gargoylesoftware.htmlunit.WebRequest; *

For example, if you would like to match on the domain {@code code.jquery.com}, * you might want to use the following. * - *

WebRequestMatcher cdnMatcher = new UrlRegexRequestMatcher(".*?//code.jquery.com/.*");
+ *
+ * WebRequestMatcher cdnMatcher = new UrlRegexRequestMatcher(".*?//code.jquery.com/.*");
+ * 
* * @author Rob Winch * @author Sam Brannen @@ -38,6 +40,7 @@ public final class UrlRegexRequestMatcher implements WebRequestMatcher { private final Pattern pattern; + public UrlRegexRequestMatcher(String regex) { this.pattern = Pattern.compile(regex); } @@ -46,6 +49,7 @@ public final class UrlRegexRequestMatcher implements WebRequestMatcher { this.pattern = pattern; } + @Override public boolean matches(WebRequest request) { String url = request.getUrl().toExternalForm(); diff --git a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/WebRequestMatcher.java b/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/WebRequestMatcher.java index e022528cf31..9f34a449de7 100644 --- a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/WebRequestMatcher.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.htmlunit; diff --git a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/webdriver/MockMvcHtmlUnitDriverBuilder.java b/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/webdriver/MockMvcHtmlUnitDriverBuilder.java index f8b88512bfe..9a5ab8ac7b4 100644 --- a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/webdriver/MockMvcHtmlUnitDriverBuilder.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.htmlunit.webdriver; @@ -69,7 +69,7 @@ public class MockMvcHtmlUnitDriverBuilder extends MockMvcWebConnectionBuilderSup /** * Create a new {@code MockMvcHtmlUnitDriverBuilder} based on the supplied * {@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 */ public static MockMvcHtmlUnitDriverBuilder mockMvcSetup(MockMvc mockMvc) { @@ -81,7 +81,7 @@ public class MockMvcHtmlUnitDriverBuilder extends MockMvcWebConnectionBuilderSup * Create a new {@code MockMvcHtmlUnitDriverBuilder} based on the supplied * {@link WebApplicationContext}. * @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 */ public static MockMvcHtmlUnitDriverBuilder webAppContextSetup(WebApplicationContext context) { @@ -93,8 +93,8 @@ public class MockMvcHtmlUnitDriverBuilder extends MockMvcWebConnectionBuilderSup * Create a new {@code MockMvcHtmlUnitDriverBuilder} based on the supplied * {@link WebApplicationContext} and {@link MockMvcConfigurer}. * @param context the {@code WebApplicationContext} to create a {@link MockMvc} - * instance from; never {@code null} - * @param configurer the {@code MockMvcConfigurer} to apply; never {@code null} + * instance from (never {@code null}) + * @param configurer the {@code MockMvcConfigurer} to apply (never {@code null}) * @return the MockMvcHtmlUnitDriverBuilder to customize */ 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 * processing non-{@linkplain WebRequestMatcher matching} requests. * @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 * @see #build() */ diff --git a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/webdriver/WebConnectionHtmlUnitDriver.java b/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/webdriver/WebConnectionHtmlUnitDriver.java index ba7a91752ea..fec8010c0f2 100644 --- a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/webdriver/WebConnectionHtmlUnitDriver.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.htmlunit.webdriver; @@ -41,13 +41,14 @@ public class WebConnectionHtmlUnitDriver extends HtmlUnitDriver { private WebClient webClient; - public WebConnectionHtmlUnitDriver(BrowserVersion browserVersion) { - super(browserVersion); - } public WebConnectionHtmlUnitDriver() { } + public WebConnectionHtmlUnitDriver(BrowserVersion browserVersion) { + super(browserVersion); + } + public WebConnectionHtmlUnitDriver(boolean enableJavascript) { super(enableJavascript); } @@ -58,12 +59,10 @@ public class WebConnectionHtmlUnitDriver extends HtmlUnitDriver { /** - * Modify the supplied {@link WebClient} and retain a reference to it - * so that its {@link WebConnection} is {@linkplain #getWebConnection - * accessible} for later use. - *

Delegates to {@link HtmlUnitDriver#modifyWebClient(WebClient)} - * for default behavior and to {@link #modifyWebClientInternal(WebClient)} - * for further customization. + * Modify the supplied {@link WebClient} and retain a reference to it so that its + * {@link WebConnection} is {@linkplain #getWebConnection accessible} for later use. + *

Delegates to {@link HtmlUnitDriver#modifyWebClient} for default behavior + * and to {@link #modifyWebClientInternal} for further customization. * @param webClient the client to modify * @return the modified client * @see HtmlUnitDriver#modifyWebClient(WebClient) @@ -78,8 +77,7 @@ public class WebConnectionHtmlUnitDriver extends HtmlUnitDriver { /** * Modify the supplied {@link WebClient}. - *

The default implementation simply returns the supplied client - * unmodified. + *

The default implementation simply returns the supplied client unmodified. *

Subclasses can override this method to customize the {@code WebClient} * that the {@link HtmlUnitDriver} uses. * @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 {@code WebConnection} + * Return the current {@link WebClient}. */ - public WebConnection getWebConnection() { - return this.webClient.getWebConnection(); + public WebClient getWebClient() { + return this.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) { Assert.notNull(webConnection, "WebConnection must not be null"); @@ -107,10 +104,11 @@ public class WebConnectionHtmlUnitDriver extends HtmlUnitDriver { } /** - * Gets the current {@link WebClient} - * @return the current {@link WebClient} + * Access the current {@link WebConnection} for the {@link WebClient}. + * @return the current {@code WebConnection} */ - public WebClient getWebClient() { - return this.webClient; + public WebConnection getWebConnection() { + return this.webClient.getWebConnection(); } + } diff --git a/spring-test/src/main/java/org/springframework/test/web/servlet/setup/PatternMappingFilterProxy.java b/spring-test/src/main/java/org/springframework/test/web/servlet/setup/PatternMappingFilterProxy.java index 0b72aafa5f8..7ae98a634bc 100644 --- a/spring-test/src/main/java/org/springframework/test/web/servlet/setup/PatternMappingFilterProxy.java +++ b/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 - * the License. You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, 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. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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; diff --git a/spring-test/src/test/java/org/springframework/mock/web/MockFilterChainTests.java b/spring-test/src/test/java/org/springframework/mock/web/MockFilterChainTests.java index e31aec3b8b6..d008751f05c 100644 --- a/spring-test/src/test/java/org/springframework/mock/web/MockFilterChainTests.java +++ b/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 - * the License. You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, 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. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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; import java.io.IOException; diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/AbstractWebRequestMatcherTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/AbstractWebRequestMatcherTests.java index e3fae7c1bbe..9ca8fe50cc5 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/AbstractWebRequestMatcherTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.htmlunit; diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/DelegatingWebConnectionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/DelegatingWebConnectionTests.java index 1b4f3e1abdd..bf347eed50f 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/DelegatingWebConnectionTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.htmlunit; @@ -19,10 +19,17 @@ package org.springframework.test.web.servlet.htmlunit; import java.net.URL; 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.Test; import org.junit.runner.RunWith; - import org.mockito.Mock; 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.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.sameInstance; -import static org.hamcrest.Matchers.isEmptyString; +import static org.hamcrest.Matchers.*; import static org.hamcrest.core.IsNot.not; -import static org.junit.Assert.assertThat; +import static org.junit.Assert.*; import static org.mockito.Mockito.*; /** diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/ForwardController.java b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/ForwardController.java index 367b7177385..9ab342bcd5d 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/ForwardController.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.htmlunit; diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/HelloController.java b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/HelloController.java index 8180898a03e..f016a380401 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/HelloController.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.htmlunit; diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/HostRequestMatcherTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/HostRequestMatcherTests.java index 081b94d090f..6fa082ee354 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/HostRequestMatcherTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.htmlunit; diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebClientBuilderTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebClientBuilderTests.java index 7d82bdc6bb1..2f881724b1f 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebClientBuilderTests.java +++ b/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. * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.htmlunit; @@ -24,7 +24,6 @@ import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.WebRequest; import com.gargoylesoftware.htmlunit.WebResponse; import com.gargoylesoftware.htmlunit.util.Cookie; - import org.junit.Before; import org.junit.Test; 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.servlet.config.annotation.EnableWebMvc; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.not; -import static org.junit.Assert.assertThat; +import static org.hamcrest.CoreMatchers.*; +import static org.junit.Assert.*; /** * Integration tests for {@link MockMvcWebClientBuilder}. diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnectionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnectionTests.java index 78e207b2e15..1b3ba8ce427 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnectionTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.htmlunit; import java.io.IOException; +import com.gargoylesoftware.htmlunit.Page; +import com.gargoylesoftware.htmlunit.WebClient; import org.junit.Before; import org.junit.Test; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; -import com.gargoylesoftware.htmlunit.Page; -import com.gargoylesoftware.htmlunit.WebClient; - -import static org.hamcrest.CoreMatchers.equalTo; -import static org.junit.Assert.assertThat; +import static org.hamcrest.CoreMatchers.*; +import static org.junit.Assert.*; /** * Integration tests for {@link MockMvcWebConnection}. diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockWebResponseBuilderTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockWebResponseBuilderTests.java index bdae1ce9984..39ac99fc289 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockWebResponseBuilderTests.java +++ b/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. * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.htmlunit; import java.net.URL; import java.util.List; - 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.WebResponse; 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.equalTo; -import static org.hamcrest.CoreMatchers.startsWith; -import static org.junit.Assert.assertThat; +import static org.hamcrest.CoreMatchers.*; +import static org.junit.Assert.*; /** * Tests for {@link MockWebResponseBuilder}. diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/UrlRegexRequestMatcherTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/UrlRegexRequestMatcherTests.java index 2baab695217..acabeef40dc 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/UrlRegexRequestMatcherTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.htmlunit; diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/webdriver/MockMvcHtmlUnitDriverBuilderTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/webdriver/MockMvcHtmlUnitDriverBuilderTests.java index 85ff5e3ec4b..f60e1a768f6 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/webdriver/MockMvcHtmlUnitDriverBuilderTests.java +++ b/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. * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.htmlunit.webdriver; @@ -40,12 +40,8 @@ import org.springframework.web.bind.annotation.RestController; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.not; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.hamcrest.CoreMatchers.*; +import static org.junit.Assert.*; /** * Integration tests for {@link MockMvcHtmlUnitDriverBuilder}. diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/webdriver/WebConnectionHtmlUnitDriverTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/webdriver/WebConnectionHtmlUnitDriverTests.java index 45118ce49e6..5bed444fea3 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/webdriver/WebConnectionHtmlUnitDriverTests.java +++ b/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 - * use this file except in compliance with the License. You may obtain a copy of - * the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, 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. + * distributed under the License is distributed on an "AS IS" BASIS, + * 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.htmlunit.webdriver; +import com.gargoylesoftware.htmlunit.WebConnection; +import com.gargoylesoftware.htmlunit.WebRequest; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; - import org.mockito.Mock; 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.MatcherAssert.assertThat; +import static org.hamcrest.MatcherAssert.*; import static org.hamcrest.Matchers.notNullValue; - import static org.mockito.Matchers.any; -import static org.mockito.Mockito.when; +import static org.mockito.Mockito.*; /** * Unit tests for {@link WebConnectionHtmlUnitDriver}. diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/FilterTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/FilterTests.java index cc04fb6be27..e122f717600 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/FilterTests.java +++ b/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 - * the License. You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, 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. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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; diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/setup/ConditionalDelegatingFilterProxyTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/setup/ConditionalDelegatingFilterProxyTests.java index fa3857e860e..6231898a539 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/setup/ConditionalDelegatingFilterProxyTests.java +++ b/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 - * the License. You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, 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. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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; import javax.servlet.Filter; diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/setup/DefaultMockMvcBuilderTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/setup/DefaultMockMvcBuilderTests.java index bf07bb9e3ad..d30ad4180ae 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/setup/DefaultMockMvcBuilderTests.java +++ b/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 - * the License. You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, 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. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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; import org.junit.Rule; diff --git a/spring-tx/src/main/java/org/springframework/transaction/annotation/EnableTransactionManagement.java b/spring-tx/src/main/java/org/springframework/transaction/annotation/EnableTransactionManagement.java index 565e857f15e..5e3e2294630 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/annotation/EnableTransactionManagement.java +++ b/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"); * 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 - * the support found in Spring's {@code } XML namespace. To be used - * on @{@link org.springframework.context.annotation.Configuration Configuration} classes + * the support found in Spring's {@code } XML namespace. To be used on + * @{@link org.springframework.context.annotation.Configuration Configuration} classes * as follows: + * *

  * @Configuration
  * @EnableTransactionManagement
  * public class AppConfig {
+ *
  *     @Bean
  *     public FooRepository fooRepository() {
  *         // configure and return a class having @Transactional methods
@@ -54,19 +56,26 @@ import org.springframework.core.Ordered;
  *
  * 

For reference, the example above can be compared to the following Spring XML * configuration: + * *

  * {@code
  * 
+ *
  *     
+ *
  *     
  *         
  *     
+ *
  *     
+ *
  *     
  *         
  *     
+ *
  * 
  * }
+ * * In both of the scenarios above, {@code @EnableTransactionManagement} and {@code * } are responsible for registering the necessary Spring * 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, * the {@link TransactionManagementConfigurer} callback interface may be implemented - * notice the {@code implements} clause and the {@code @Override}-annotated method below: + * *
  * @Configuration
  * @EnableTransactionManagement
  * public class AppConfig implements TransactionManagementConfigurer {
+ *
  *     @Bean
  *     public FooRepository fooRepository() {
  *         // configure and return a class having @Transactional methods
@@ -112,6 +123,7 @@ import org.springframework.core.Ordered;
  *         return txManager();
  *     }
  * }
+ * * 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 * present in the same container. As the name suggests, the diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/EnableWebMvc.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/EnableWebMvc.java index 02cfa98b720..8de751cc153 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/EnableWebMvc.java +++ b/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 - * the License. You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, 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. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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; import java.lang.annotation.Documented; @@ -43,17 +47,17 @@ import org.springframework.context.annotation.Import; * @ComponentScan(basePackageClasses = { MyConfiguration.class }) * public class MyConfiguration extends WebMvcConfigurerAdapter { * - * @Override - * public void addFormatters(FormatterRegistry formatterRegistry) { - * formatterRegistry.addConverter(new MyConverter()); - * } + * @Override + * public void addFormatters(FormatterRegistry formatterRegistry) { + * formatterRegistry.addConverter(new MyConverter()); + * } * - * @Override - * public void configureMessageConverters(List<HttpMessageConverter<?>> converters) { - * converters.add(new MyHttpMessageConverter()); - * } + * @Override + * public void configureMessageConverters(List<HttpMessageConverter<?>> converters) { + * converters.add(new MyHttpMessageConverter()); + * } * - * // More overridden methods ... + * // More overridden methods ... * } *
* @@ -67,16 +71,16 @@ import org.springframework.context.annotation.Import; * @ComponentScan(basePackageClasses = { MyConfiguration.class }) * public class MyConfiguration extends WebMvcConfigurationSupport { * - * @Override - * public void addFormatters(FormatterRegistry formatterRegistry) { - * formatterRegistry.addConverter(new MyConverter()); - * } + * @Override + * public void addFormatters(FormatterRegistry formatterRegistry) { + * formatterRegistry.addConverter(new MyConverter()); + * } * - * @Bean - * public RequestMappingHandlerAdapter requestMappingHandlerAdapter() { - * // Create or delegate to "super" to create and - * // customize properties of RequestMappingHandlerAdapter - * } + * @Bean + * public RequestMappingHandlerAdapter requestMappingHandlerAdapter() { + * // Create or delegate to "super" to create and + * // customize properties of RequestMappingHandlerAdapter + * } * } *
* diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/EnableWebSocket.java b/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/EnableWebSocket.java index d695cfad8fd..af8d056dfc0 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/EnableWebSocket.java +++ b/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 - * the License. You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, 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. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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; @@ -32,6 +35,7 @@ import org.springframework.context.annotation.Import; * * } *
+ * *

Customize the imported configuration by implementing the * {@link WebSocketConfigurer} interface: * @@ -40,15 +44,15 @@ import org.springframework.context.annotation.Import; * @EnableWebSocket * public class MyConfiguration implements WebSocketConfigurer { * - * @Override - * public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) { - * registry.addHandler(echoWebSocketHandler(), "/echo").withSockJS(); - * } + * @Override + * public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) { + * registry.addHandler(echoWebSocketHandler(), "/echo").withSockJS(); + * } * - * @Bean - * public WebSocketHandler echoWebSocketHandler() { - * return new EchoWebSocketHandler(); - * } + * @Bean + * public WebSocketHandler echoWebSocketHandler() { + * return new EchoWebSocketHandler(); + * } * } *

* diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/EnableWebSocketMessageBroker.java b/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/EnableWebSocketMessageBroker.java index dfed7660b48..716489ee261 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/EnableWebSocketMessageBroker.java +++ b/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 - * the License. You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, 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. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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; @@ -32,8 +35,8 @@ import org.springframework.context.annotation.Import; * * } *
- *

- * Customize the imported configuration by implementing the + * + *

Customize the imported configuration by implementing the * {@link WebSocketMessageBrokerConfigurer} interface or more likely extend the * convenient base class {@link AbstractWebSocketMessageBrokerConfigurer}: * @@ -42,16 +45,16 @@ import org.springframework.context.annotation.Import; * @EnableWebSocketMessageBroker * public class MyConfiguration extends AbstractWebSocketMessageBrokerConfigurer { * - * @Override - * public void registerStompEndpoints(StompEndpointRegistry registry) { - * registry.addEndpoint("/portfolio").withSockJS(); - * } + * @Override + * public void registerStompEndpoints(StompEndpointRegistry registry) { + * registry.addEndpoint("/portfolio").withSockJS(); + * } * - * @Bean - * public void configureMessageBroker(MessageBrokerRegistry registry) { - * registry.enableStompBrokerRelay("/queue/", "/topic/"); - * registry.setApplicationDestinationPrefixes("/app/"); - * } + * @Bean + * public void configureMessageBroker(MessageBrokerRegistry registry) { + * registry.enableStompBrokerRelay("/queue/", "/topic/"); + * registry.setApplicationDestinationPrefixes("/app/"); + * } * } * *