- 17 5月, 2015 2 次提交
-
-
由 Sam Brannen 提交于
* SPR-7731: Introduce JUnit Rule alternative to SpringJUnit4ClassRunner
-
由 Sam Brannen 提交于
Since Spring Framework 2.5, support for integrating the Spring TestContext Framework (TCF) into JUnit 4 based tests has been provided via the SpringJUnit4ClassRunner, but this approach precludes the ability for tests to be run with alternative runners like JUnit's Parameterized or third-party runners such as the MockitoJUnitRunner. This commit remedies this situation by introducing @ClassRule and @Rule based alternatives to the SpringJUnit4ClassRunner. These rules are independent of any Runner and can therefore be combined with alternative runners. Due to the limitations of JUnit's implementation of rules, as of JUnit 4.12 it is currently impossible to create a single rule that can be applied both at the class level and at the method level (with access to the test instance). Consequently, this commit introduces the following two rules that must be used together. - SpringClassRule: a JUnit TestRule that provides the class-level functionality of the TCF to JUnit-based tests - SpringMethodRule: a JUnit MethodRule that provides the instance-level and method-level functionality of the TCF to JUnit-based tests In addition, this commit also introduces the following new JUnit Statements for use with rules: - RunPrepareTestInstanceCallbacks - ProfileValueChecker Issue: SPR-7731
-
- 16 5月, 2015 2 次提交
-
-
由 Sebastien Deleuze 提交于
This commit adds JavaConfig based global CORS configuration capabilities to Spring MVC. It is now possible to specify multiple CORS configurations, each mapped on a path pattern, by overriding WebMvcConfigurerAdapter#configureCrossOrigin(CrossOriginConfigurer). It is also possible to combine global and @CrossOrigin based CORS configuration. Issue: SPR-12933
-
由 Rossen Stoyanchev 提交于
Issue: SPR-12732
-
- 15 5月, 2015 6 次提交
-
-
由 Stephane Nicoll 提交于
Provide Converter implementations for Charset, Currency and TimeZone as related PropertyEditors are available for those. Issue: SPR-13020
-
由 Stephane Nicoll 提交于
Use BeanUtils.instantiate(Class<?>) instead of a raw call to type.newInstance() as the former has more checks. Issue: SPR-12520
-
由 Stephane Nicoll 提交于
Update SimpleJdbcCall to offer a way to use named parameters binding instead of the simple `?` binding it offers thus far. Issue: SPR-12801
-
由 Sam Brannen 提交于
Prior to this commit, the documentation in AnnotationUtils was inconsistent, and at times even misleading, with regard to finding annotations that are "present" or "directly present" on annotated elements. This commit defines the terminology used within AnnotationUtils and introduces the explicit notion of "meta-present" to denote that annotations are present within annotation hierarchies above annotated elements. Issue: SPR-13030
-
由 Rossen Stoyanchev 提交于
Issue: SPR-12750, SPR-12942
-
由 Rossen Stoyanchev 提交于
This change introduces a strategy for expanding a URI template into a URI and makes it a property of the RestTemplate and AsyncRestTemplate so that they can be pre-configured with such a strategy. The DefaultUriTemplateHandler relies on UriComponentsBuilder internally and provides functionality equivalent to using the UriTemplate. A DefaultUriTemplateHandler can also be configured to parse the path of a URI template into path segments in order to allow expanding URI variables according to path segment encoding rules. Issue: SPR-12750
-
- 14 5月, 2015 3 次提交
-
-
由 Rossen Stoyanchev 提交于
Issue: SPR-12750
-
由 Rossen Stoyanchev 提交于
Issue: SPR-12984
-
由 Sam Brannen 提交于
This commit updates code that previously used getAnnotationAttributes() in AnnotatedElementUtils to use findAnnotationAttributes(), where appropriate. Issue: SPR-12738
-
- 13 5月, 2015 13 次提交
-
-
由 Sam Brannen 提交于
This commit updates the "get semantics" search algorithm used in `AnnotatedElementUtils` so that locally declared 'composed annotations' are favored over inherited annotations. Specifically, the internal `searchWithGetSemantics()` method now searches locally declared annotations before searching inherited annotations. All TODOs in `AnnotatedElementUtilsTests` have been completed, and all ignored tests have been reinstated. Issue: SPR-11598
-
由 Sam Brannen 提交于
Issue: SPR-11598
-
由 Juergen Hoeller 提交于
Issue: SPR-7773
-
由 Juergen Hoeller 提交于
Issue: SPR-13023
-
由 Juergen Hoeller 提交于
-
由 Juergen Hoeller 提交于
Issue: SPR-13021
-
由 Juergen Hoeller 提交于
Issue: SPR-13019
-
由 Brian Clozel 提交于
Prior to this commit, the ResourceUrlEncodingFilter would fail with a StringIndexOutOfBoundsException when: * the current request has a servlet context * the URL to encode is relative and is shorter than the context value This change defensively checks for those lengths and delegates to the parent implementation if necessary. Issue: SPR-13018
-
由 Juergen Hoeller 提交于
DataBinder allows for adding custom Formatters as alternative to PropertyEditors (including per-field formatters) Includes a generic FormatterPropertyEditorAdapter plus Number conversion support in TypeConverterDelegate. Issue: SPR-7773 Issue: SPR-6069
-
由 Juergen Hoeller 提交于
Issue: SPR-12696
-
由 Juergen Hoeller 提交于
Issue: SPR-13016
-
由 Rossen Stoyanchev 提交于
This change introduces SimpUserRegistry exposing an API to access information about connected users, their sessions, and subscriptions with STOMP/WebSocket messaging. Provides are methods to access users as well as a method to find subscriptions given a Matcher strategy. The DefaultSimpUserRegistry implementation is also a SmartApplicationListener which listesn for ApplicationContext events when users connect, disconnect, subscribe, and unsubscribe to destinations. The MultiServerUserRegistry implementation is a composite that aggregates user information from the local SimpUserRegistry as well as snapshots of user on remote application servers. UserRegistryMessageHandler is used with MultiServerUserRegistry. It broadcats user registry information through the broker and listens for similar broadcasts from other servers. This must be enabled explicitly when configuring the STOMP broker relay. The existing UserSessionRegistry which was primiarly used internally to resolve a user name to session id's has been deprecated and is no longer used. If an application configures a custom UserSessionRegistr still, it will be adapted accordingly to SimpUserRegistry but the effect is rather limited (comparable to pre-existing functionality) and will not work in multi-server scenarios. Issue: SPR-12029
-
由 Sam Brannen 提交于
This commit improves the documentation for AnnotationUtils and AnnotatedElementUtils by explaining that the scope of most annotation searches is limited to finding the first such annotation, resulting in additional such annotations being silently ignored. Issue: SPR-13015
-
- 12 5月, 2015 4 次提交
-
-
由 Juergen Hoeller 提交于
(cherry picked from commit 9e925aa8)
-
由 Juergen Hoeller 提交于
(cherry picked from commit a8f75399)
-
由 Brian Clozel 提交于
Spring Framework's build is using a custom MergePlugin in order to merge a project into another one and share/override configuration and dependencies. Prior to this commit, two projects merged into a third one could trigger dependency conflicts when exporting the project definition into a POM. When trying to define the scope for a given dependency, those two projects would compete for this with the same priority, resulting in a Gradle exception. One could trigger this issue by running: ./gradlew :spring-orm:install -x javadoc Because `spring-orm-hibernate4` and `spring-orm-hibernate5` get merged into `spring-orm` and both define optional/test dependencies to spring-mvc, etc. This commit makes sure that two projects, when defining dependency scopes, don't use the same priority value; the MergePlugin now adds the index of the current subproject to the priority value. So when two projects compete for this, the one defined in last will define the dependency scope. Issue: SPR-13013
-
由 Sam Brannen 提交于
-
- 11 5月, 2015 4 次提交
-
-
由 Juergen Hoeller 提交于
-
由 Juergen Hoeller 提交于
Issue: SPR-13010
-
由 Sam Brannen 提交于
-
由 Brian Clozel 提交于
-
- 10 5月, 2015 6 次提交
-
-
由 Sam Brannen 提交于
Issue: SPR-13007
-
由 Sam Brannen 提交于
* SPR-13007: Avoid eager formatting in pre-condition checks
-
由 Philippe Marschall 提交于
In general, the Spring Framework aims to construct error message strings only if an actual error has occurred. This seems to be the common pattern in the codebase and saves both CPU and memory. However, there are some places where eager error message formatting occurs unnecessarily. This commit addresses this issue in the following classes: AdviceModeImportSelector, AnnotationAttributes, and ReadOnlySystemAttributesMap. The change in ReadOnlySystemAttributesMap also avoids a potential NullPointerException. Issue: SPR-13007
-
由 Sam Brannen 提交于
Issue: SPR-13005
-
由 Sam Brannen 提交于
This commit introduces support in the spring-test module for obtaining a reference to the underlying target object hidden behind one or more proxies. Specifically this commit introduces AopTestUtils with two methods: - getTargetObject(Object) - getUltimateTargetObject(Object) Issue: SPR-13005
-
由 Sam Brannen 提交于
-