Commit Graph

10881 Commits

Author SHA1 Message Date
Stephane Nicoll ae9b5c15c8 Merge pull request #857 from kazuki43zoo/SPR-12801
* pr/857:
  Add missing @since tag
2015-08-15 09:08:01 +02:00
Kazuki Shimizu 93919204a1 Add missing @since tag
Issue: SPR-12801
2015-08-15 09:07:37 +02:00
Sam Brannen d4d5e5ce40 Polishing 2015-08-14 22:45:10 +02:00
Sam Brannen 07bb0378b9 Differentiate b/t (in)definite results in JsonPath assertions
Prior to this commit, the exists() method in JsonPathExpectationsHelper
correctly asserted that the evaluated JsonPath expression resulted in a
value (i.e., that a non-null value exists); however, if the value was
an empty array, the exists() method always threw an AssertionError.

The existing behavior makes sense if the JsonPath expression is
'indefinite' -- for example, if the expression uses a filter to select
results based on a predicate for which there is no match in the JSON
document, but the existing behavior is illogical and therefore invalid
if the JsonPath expression is 'definite' (i.e., directly references an
array in the JSON document that exists but happens to be empty). For
example, prior to this commit, the following threw an AssertionError.

    new JsonPathExpectationsHelper("$.arr").exists("{ 'arr': [] }");

Similar arguments can be made for the doesNotExist() method.

After thorough analysis of the status quo, it has become apparent that
the existing specialized treatment of arrays is a result of the fact
that the JsonPath library always returns an empty list if the path is
an 'indefinite' path that does not evaluate to a specific result.
Consult the discussion on "What is Returned When?" in the JsonPath
documentation for details:

    https://github.com/jayway/JsonPath#what-is-returned-when

This commit addresses these issues by ensuring that empty arrays are
considered existent if the JsonPath expression is definite but
nonexistent if the expression is indefinite.

Issue: SPR-13351
2015-08-14 22:07:03 +02:00
Sam Brannen d2503340e7 Polish assertion msgs in JsonPathExpectationsHelper 2015-08-14 20:38:50 +02:00
Sam Brannen af8d9eab59 Polish Javadoc for JsonPathExpectationsHelper 2015-08-14 17:59:12 +02:00
Sam Brannen 5a05cdbedb Consider empty arrays as existent in JsonPath assertions
Prior to this commit, a JsonPath assertion that a path expression
evaluated to an array in JsonPathExpectationsHelper (and therefore
indirectly in JsonPathResultMatchers in Spring MVC Test) would
incorrectly fail if the array was present in the JSON content but empty.

This commit fixes this issue by removing the "not empty" check for
arrays and lists.

Issue: SPR-13320
2015-08-14 17:20:07 +02:00
Sam Brannen 8afea1bc78 Add tests to JsonPathExpectationsHelperTests 2015-08-14 17:10:28 +02:00
Sam Brannen 0dbbbce8d5 Polish JsonPathResultMatchersTests 2015-08-14 17:07:23 +02:00
Sam Brannen ecb15ac58b Polish assertion msgs in JsonPathExpectationsHelper 2015-08-14 17:04:34 +02:00
Stephane Nicoll bad57f752a Merge pull request #856 from kazuki43zoo/SPR-13350
* pr/856:
  Fix default value of CommonsPool2TargetSource#maxWait
2015-08-14 16:34:58 +02:00
Kazuki Shimizu 9524f96405 Fix default value of CommonsPool2TargetSource#maxWait
Issue: SPR-13350
2015-08-14 16:34:32 +02:00
Sam Brannen 44a7c78753 Overhaul CauchoRemotingTests & reinstate SimpleHessianServiceExporter test 2015-08-13 21:27:49 +02:00
Sam Brannen 2c120d0d28 Clean up warnings in spring-web tests 2015-08-13 16:04:52 +02:00
Sam Brannen be2f56262b Make FormHttpMessageConverterTests more robust 2015-08-13 15:06:39 +02:00
Rossen Stoyanchev 7defbfc18b Ensure concurrent WebSocketSession wrapper is used
Issue: SPR-13326
2015-08-13 08:00:24 -04:00
Rossen Stoyanchev 257cc63141 Restore order in AllEncompassingFormHttpMessageConverter
Issue: SPR-13309
2015-08-13 07:45:25 -04:00
Rossen Stoyanchev 28a42d1482 Polish FromHttpMessageConverterTests 2015-08-13 07:30:09 -04:00
Juergen Hoeller 3a5cc3df80 JCacheEhCache3Tests enforces EhCache 3.0's CachingProvider
Issue: SPR-13342
2015-08-12 23:09:16 +02:00
Rossen Stoyanchev f5210ce0c8 Ensure headers committed immediately for SseEmitter
Issue: SPR-13341
2015-08-12 15:05:29 -04:00
Juergen Hoeller 4dd6b789ef Upgrade to Objenesis 2.2
Issue: SPR-13228
2015-08-12 19:54:43 +02:00
Sam Brannen f47bbb0d9e Polish tests 2015-08-12 19:35:45 +02:00
Gary Russell f15140415a Properly detect available port on localhost in SocketUtils
SocketUtils is used to find available ports on localhost; however,
prior to this commit, SocketUtils incorrectly reported a port as
available on localhost if another process was already bound to
localhost on the given port but not to other network interfaces. In
other words, SocketUtils determined that a given port was available for
some interface though not necessarily for the loopback interface.

This commit addresses this issue by refactoring SocketUtils so that it
tests the loopback interface to ensure that the port is actually
available for localhost.

Issue: SPR-13321
2015-08-12 18:45:52 +02:00
Juergen Hoeller e0f012f32d Removal of redundant JdkVersion checks in the test suite
Issue: SPR-13312
2015-08-12 18:42:36 +02:00
Rossen Stoyanchev 6e1567b4b0 Add WebSphereRequestUpgradeStrategy
Tested with Aug 2015 WAS Liberty Beta for the upcoming 8.5.5.7 release.

Issue: SPR-12367
2015-08-12 11:49:58 -04:00
Juergen Hoeller a369fc8afd Introduce SmartMessageConverter interface with conversionHint arguments
Issue: SPR-13343
2015-08-12 17:45:46 +02:00
Juergen Hoeller 5e9a96817b Completely remove JdkVersion check from Jaxb2Marshaller
Issue: SPR-13312
2015-08-12 17:45:37 +02:00
Sam Brannen acb44f9d46 Suppress warnings regarding deprecated JdkVersion
Issue: SPR-13312
2015-08-12 17:36:28 +02:00
Sam Brannen 27e9db8c8c Fix regression in Jaxb2Marshaller regarding JdkVersion
Issue: SPR-13312
2015-08-12 17:35:03 +02:00
Juergen Hoeller d8794a1edc Test against EhCache 3.0 M2 (as a JCache provider)
Includes latest dependency updates (Jackson 2.6.1, Jetty 9.3.2, Undertow 1.2.10)

Issue: SPR-13342
2015-08-12 16:16:25 +02:00
Juergen Hoeller bec3b0fa1a Deprecate JdkVersion (for optimistic compatibility with newer JDK generations)
Issue: SPR-13312
2015-08-12 16:14:43 +02:00
Sam Brannen e20b47c3bc Ensure local aliases don't override meta-annotation
This commit introduces an additional test case to ensure that explicit
local attribute aliases (configured via @AliasFor) do not accidentally
override attributes of the same names in meta-annotations (i.e., by
convention).

Issue: SPR-13325
2015-08-12 14:38:01 +02:00
Sam Brannen 4317e76e79 Polish AnnotationUtilsTests 2015-08-12 14:36:54 +02:00
Sam Brannen b5a6707137 Fix layout in What's New section 2015-08-11 23:48:15 +02:00
Juergen Hoeller e841cad577 Deprecation polishing 2015-08-11 13:59:31 +02:00
Juergen Hoeller f88ad8dd7a Upgrade to Hibernate ORM 4.3.11 and 5.0 RC4 2015-08-11 13:58:42 +02:00
Sam Brannen 3cd5210b94 Polish usage of global versions in Gradle build 2015-08-10 17:41:26 +02:00
Sam Brannen a22dd68646 Upgrade HSQL & Selenium dependencies 2015-08-10 17:26:05 +02:00
Sam Brannen 5deeaf348a Polish SynthesizedAnnotation support classes 2015-08-10 15:40:25 +02:00
Sam Brannen f17173f6d5 Synthesize nested maps into annotations
Prior to this commit, attempting to synthesize an annotation from a map
of annotation attributes that contained nested maps instead of nested
annotations would result in an exception.

This commit addresses this issue by properly synthesizing nested maps
and nested arrays of maps into nested annotations and nested arrays of
annotations, respectively.

Issue: SPR-13338
2015-08-10 14:55:54 +02:00
Sam Brannen 8289036165 Throw exception if required meta-annotation is not present
It is a configuration error if an alias is declared via @AliasFor for
an attribute in a meta-annotation and the meta-annotation is not
meta-present. However, prior to this commit, the support for validating
the configuration of @AliasFor in AnnotationUtils currently silently
ignored such errors.

This commit fixes this by throwing an AnnotationConfigurationException
whenever a required meta-annotation is not present or meta-present on
an annotation that declares an explicit alias for an attribute in the
meta-annotation.

Issue: SPR-13335
2015-08-09 19:14:29 +02:00
Sam Brannen 78ff4ff542 Polish AnnotationUtilsTests 2015-08-09 16:48:38 +02:00
Sam Brannen f3da7b810b Polish HtmlUnitRequestBuilder 2015-08-08 00:27:00 +02:00
Sam Brannen 93c07e76bc Return null instead of empty cookies array in Spring MVC Test
Prior to this commit, MockHttpServletRequestBuilder always supplied an
array of cookies to the MockHttpServletRequest that it built, even if
the array was empty.

However, this violates the contract of HttpServletRequest. According to
the Servlet API, the getCookies() method "returns null if no cookies
were sent."

This commit ensures that MockHttpServletRequestBuilder no longer
configures an empty array of cookies in the mock request that it builds.

Issue: SPR-13314
2015-08-07 01:00:12 +02:00
Sam Brannen 35dd3078ef Merge pull request #854 from candrews/SPR-13320
* SPR-13320:
  Introduce additional JsonPath matchers in Spring MVC Test
2015-08-07 00:25:33 +02:00
Craig Andrews fffdd1e9e9 Introduce additional JsonPath matchers in Spring MVC Test
This commit introduces the following methods in JsonPathResultMatchers
in the Spring MVC Test framework.

- isString()
- isBoolean()
- isNumber()
- isMap()

In addition, this commit overhauls the Javadoc in
JsonPathResultMatchers and JsonPathExpectationsHelper.

Issue: SPR-13320
2015-08-06 22:08:24 +02:00
Sam Brannen 48b965ad33 Improve performance of NumberUtils
This commit aims to improve the space and time performance of
NumberUtils by invoking valueOf() factory methods instead of the
corresponding constructors when converting a number to a target class.
2015-08-06 19:42:03 +02:00
Sam Brannen e0392d9da5 Polish NumberUtilsTests 2015-08-06 19:31:44 +02:00
Sam Brannen 15033c1cc9 Polish Javadoc for NumberUtils 2015-08-06 19:21:02 +02:00
Sam Brannen c8d604bf05 Ensure @AliasFor overrides attribute in correct meta-annotation
Prior to this commit, an explicit override for an attribute in a
meta-annotation configured via @AliasFor could potentially result in an
incorrect override of an attribute of the same name but in the wrong
meta-annotation.

This commit fixes the algorithm in getAliasedAttributeName(Method,
Class) in AnnotationUtils by ensuring that an explicit attribute
override is only applied to the configured target meta-annotation
(i.e., configured via the 'annotation' attribute in @AliasFor).

Issue: SPR-13325
2015-08-06 19:04:08 +02:00