Commit Graph

726 Commits

Author SHA1 Message Date
Marius Grama 3635c9dbfe Update xmlunit library to version 2.1.0
xmlunit 2.1.0 is the latest release for xmlunit.
Most of the xmlunit functionality used within spring-framework
was done through the xmlunit 1.x helper class
`org.custommonkey.xmlunit.XMLAssert`.

As of xmlunit 2.0.0 most of the XML comparison methods are done
through hamcrest matchers exposed by the xmlunit-matchers
library. In some cases during the migration, the matchers
had to be customized with custom `NodeMatcher` or
`DifferenceEvaluator` instances in order to keep the assertions
correct (they were performed with xmlunit 1.x previously).

Issue: SPR-14043
2016-07-21 15:04:21 +02:00
Juergen Hoeller 99be15f58b Revise encoding steps towards use of JDK Charset and StandardCharsets
Issue: SPR-14492
2016-07-19 23:43:06 +02:00
Juergen Hoeller aaac199e8b Consistently use constructor-based instantiation instead of Class.newInstance / BeanUtils.instantiate
Issue: SPR-14486
2016-07-19 19:21:06 +02:00
Juergen Hoeller f0c397e4e2 Comprehensive Servlet 3.1 support in spring-web and spring-test
Issue: SPR-14467
2016-07-15 22:11:14 +02:00
Sam Brannen fd008405a1 Note in TEL: before/after test exec. callbacks don't work w/ JUnit 4 rules
Issue: SPR-4365
2016-07-14 15:46:54 +02:00
Sam Brannen 3fa88c2b56 Document suppressed exception support in TestContextManager
Issue: SPR-14459
2016-07-14 15:43:18 +02:00
Sam Brannen adfea826cc Configure JUL/log4j for JUnit 5 in spring-test
Issue: SPR-14431
2016-07-13 22:06:46 +02:00
Sam Brannen 833deadddc Ensure test fails for the correct reason
Prior to this commit, a dynamic test in
FailingBeforeAndAfterMethodsSpringExtensionTestCase was failing but for
the wrong reason. Namely, the @Configuration class was private which
resulted in an IllegalStateException being thrown, when in fact
an AssertionFailedError was expected.

This commit addresses this by introducing an explicit check for an
AssertionFailedError.

Issue: SPR-4365
2016-07-13 21:10:47 +02:00
Sam Brannen 7ec85a3c3b Support suppressed exceptions in the TestContext framework
Prior to this commit, if multiple TestExecutionListener 'after' methods
threw an exception, only the first such exception was rethrown.
Subsequent exceptions were logged, but there was no way to access or
process them other than via the log file.

This commit addresses this shortcoming by making use of the support for
suppressed exceptions introduced in Java 7. Specifically, if multiple
TestExecutionListener 'after' methods throw an exception, the first
exception will be rethrown with subsequent exceptions suppressed in the
first one.

Issue: SPR-14459
2016-07-13 20:29:01 +02:00
Sam Brannen 5f176f50d3 Polishing 2016-07-13 18:18:40 +02:00
Sam Brannen 6162e30f3c Clean up warnings in AsyncTests 2016-07-13 16:39:49 +02:00
Rossen Stoyanchev 01a63dd84d Polish AsyncTests 2016-07-12 17:49:55 -04:00
Vladimir L 7da63c57b3 tests for asynchronous processing if controller returns StreamingResponseBody 2016-07-12 17:44:10 -04:00
Sam Brannen 68b3bc0394 Use Supplier<String> support in Assert in spring-test
This commit makes use of the new Supplier<String> variants of utility
methods in org.springframework.util.Assert within the spring-test
module.

Issue: SPR-14450
2016-07-12 16:41:03 +02:00
Sam Brannen 80018c67e7 Introduce before/after test execution support in the SpringExtension
Issue: SPR-4365
2016-07-11 15:44:51 +02:00
Sam Brannen da89332840 Introduce before/after test execution support in SpringJUnit4ClassRunner
Issue: SPR-4365
2016-07-11 15:13:40 +02:00
Sam Brannen 3da5fbe995 Introduce before/after test execution support in AbstractTestNGSpringContextTests
Issue: SPR-4365
2016-07-11 15:13:40 +02:00
Sam Brannen 087efa668c Introduce before/after test execution callbacks in TestContextManager
Issue: SPR-4365
2016-07-11 15:13:40 +02:00
Sam Brannen 5302566cbb Introduce before/after test execution callbacks in TestExecutionListener
Issue: SPR-4365
2016-07-11 15:13:40 +02:00
Sam Brannen 629b95bd5c Ensure TestContextManager always tracks after-class exception
This commit fixes a minor bug introduced in 0adc4921ed.

Issue: SPR-14447
2016-07-10 16:04:00 +02:00
Sam Brannen 966d951329 Remove deprecated @TransactionConfiguration & TxCfgAttributes
Issue: SPR-14430
2016-07-08 18:16:44 +02:00
Sam Brannen 57c43f4273 Delete unused import 2016-07-08 17:40:42 +02:00
Sam Brannen d6d4251550 Utilize default methods in TestExecutionListener
Issue: SPR-14432
2016-07-08 17:38:41 +02:00
Sam Brannen a0cad5c48f Use streams and lambdas in spring-test where feasible
Issue: SPR-13188
2016-07-08 17:38:40 +02:00
Sam Brannen 8fff1c2ac0 Polishing 2016-07-08 17:18:14 +02:00
Sam Brannen 80216c243d Annotate ContextCustomizer[Factory] with @FunctionalInterface
Issue: SPR-14432
2016-07-08 17:17:25 +02:00
Sam Brannen 7e783dd91f Delete temporary MethodParameterFactory solution
SPR-14055 introduced first-class support for the Java 8 Parameter API.

This commit therefore replaces the MethodParameterFactory with use of
the new SynthesizingMethodParameter.forParameter(Parameter) factory
method.

Issue: SPR-13575
2016-07-07 13:02:49 +02:00
Sam Brannen 862fb2af5f Upgrade to JUnit 5.0.0-M1
Issue: SPR-13575
2016-07-07 12:49:46 +02:00
Juergen Hoeller da9c24c41e Polishing 2016-07-06 18:11:33 +02:00
Stephane Nicoll e4b0486c5a Add @FunctionalInterface on candidate interfaces
Issue: SPR-14432
2016-07-06 14:32:13 +02:00
Sam Brannen 1391248ea6 Introduce log4j 2 for Spring's test suite
This commit adds a test runtime dependency on log4j 2 for every project
and migrates all log4j.properties files to log4j2-test.xml files.

Issue: SPR-14431
2016-07-05 19:19:09 +02:00
Sam Brannen 9a9551bf18 Make JUnit Jupiter support classes package private
Issue: SPR-13575
2016-07-05 17:09:18 +02:00
Sam Brannen 045c678622 Clean up warnings in spring-test 2016-07-05 17:09:18 +02:00
Stephane Nicoll 00d2606b00 Explicit type can be replaced by <>
Issue: SPR-13188
2016-07-05 17:00:34 +02:00
Juergen Hoeller b5db5d3aac Broadly remove deprecated core classes and methods
Issue: SPR-14430
2016-07-05 15:52:49 +02:00
Sam Brannen 5f53a60120 Restrict visibility of internal MethodParameterFactory
Issue: SPR-14055
2016-07-05 15:20:01 +02:00
Sam Brannen 016fa0eb39 Upgrade test to Hibernate 5.2 2016-07-05 11:05:23 +02:00
Juergen Hoeller 51252ebbca Avoid defensive checks against Java 8 API (java.util.Optional etc)
This commit also fixes broken javadoc links and code references.

Issue: SPR-13188
2016-07-05 02:09:00 +02:00
Juergen Hoeller 54004e0d78 Upgrade to JPA 2.1+ and Bean Validation 1.1+; remove native support for Hibernate 3.6 and 4.x
Issue: SPR-13481
Issue: SPR-13827
2016-07-04 23:37:23 +02:00
Juergen Hoeller 2b3445df81 Drop Portlet MVC support
This commit also removes the corresponding deprecated Servlet MVC variant and updates DispatcherServlet.properties to point to RequestMappingHandlerMapping/Adapter by default.

Issue: SPR-14129
2016-07-04 23:33:47 +02:00
Sam Brannen 873fc53a2f Introduce support for JUnit 5 in the TestContext framework
This commit introduces initial support for JUnit Jupiter (i.e., the new
programming and extension models in JUnit 5) in the Spring TestContext
Framework.

Specifically, this commit introduces the following.

- SpringExtension: an implementation of multiple extension APIs from
  JUnit Jupiter that provides full support for the existing feature set
  of the Spring TestContext Framework. This support is enabled via
  @ExtendWith(SpringExtension.class).

- @SpringJUnitConfig: a composed annotation that combines
  @ExtendWith(SpringExtension.class) from JUnit Jupiter with
  @ContextConfiguration from the Spring TestContext Framework.

- @SpringJUnitWebConfig: a composed annotation that combines
  @ExtendWith(SpringExtension.class) from JUnit Jupiter with
  @ContextConfiguration and @WebAppConfiguration from the Spring
  TestContext Framework.

Issue: SPR-13575
2016-07-04 22:40:58 +02:00
Sam Brannen 3be0ea9128 Suppress deprecation warning in spring-test 2016-07-04 15:20:52 +02:00
Juergen Hoeller 080dcad218 Add missing package-info file for new test.context.web.socket package
Issue: SPR-14420
2016-07-02 15:46:21 +02:00
Juergen Hoeller b204437cef Polishing 2016-07-02 14:48:15 +02:00
Juergen Hoeller e5122d084a Avoid wrapping in plain RuntimeException in favor of IllegalStateException 2016-07-02 13:03:33 +02:00
Juergen Hoeller dda0942c78 Polishing 2016-06-30 21:39:51 +02:00
Juergen Hoeller 66ec1c1618 Add missing package-info files for common packages
Issue: SPR-14420
2016-06-30 21:39:06 +02:00
Sam Brannen 3dbf25e018 Implement equals() & hashCode() in MockServerContainerContextCustomizer
Issue: SPR-14367
2016-06-23 13:22:10 +02:00
Sam Brannen f7dd757593 Support WebSocket ServletServerContainerFB in the TCF
Prior to this commit, any attempt to include a bean of type
ServletServerContainerFactoryBean in the WebApplicationContext for an
integration test class annotated with @WebAppConfiguration in
conjunction the Spring TestContext Framework (TCF) would have resulted
in an IllegalStateException stating that "A ServletContext is required
to access the javax.websocket.server.ServerContainer instance."

In such scenarios, the MockServletContext was in fact present in the
WebApplicationContext; however there was no WebSocket ServerContainer
stored in the ServletContext.

This commit addresses this issue by introducing the following.

- MockServerContainer: a private mock implementation of the
  javax.websocket.server.ServerContainer interface.

- MockServerContainerContextCustomizer: a ContextCustomizer that
  instantiates a new MockServerContainer and stores it in the
  ServletContext under the attribute named
  "javax.websocket.server.ServerContainer".

- MockServerContainerContextCustomizerFactory: a
  ContextCustomizerFactory which creates a
  MockServerContainerContextCustomizer if WebSocket support is present
  in the classpath and the test class is annotated with
  @WebAppConfiguration. This factory is registered by default via the
  spring.factories mechanism.

Issue: SPR-14367
2016-06-22 22:10:16 +02:00
nkjackzhang 981a748dcc Fix ambiguous static import in TestPropertySourceUtilsTests 2016-06-17 17:18:36 +02:00