@ -919,8 +919,26 @@ For more information consult the `GroovyBeanDefinitionReader`
@@ -919,8 +919,26 @@ For more information consult the `GroovyBeanDefinitionReader`
In addition to pruning of deprecated code within the `spring-test` module, Spring
Framework 4.0 introduces several new features for use in unit and integration testing.
* Almost all annotations in the `spring-test` module (e.g., `@ContextConfiguration`,
`@WebAppConfiguration`, `@ContextHierarchy`, `@ActiveProfiles`, etc.) can now be used
as <<beans-meta-annotations,meta-annotations>> to create custom _composed annotations_
and reduce configuration duplication across tests.
* Active bean definition profiles can now be resolved programmatically, simply by
implementing a custom <<testcontext-ctx-management-env-profiles-ActiveProfilesResolver,`ActiveProfilesResolver`>>
and registering it via the `resolver` attribute of `@ActiveProfiles`.
* A new `SocketUtils` utility class has been introduced in the `spring-core` module
which enables you to scan for free TCP & UDP server ports on localhost. This
functionality is not specific to testing but can prove very useful when writing
integration tests that require the use of sockets, for example tests that start
an in-memory SMTP server, FTP server, Servlet container, etc.
* As of Spring 4.0, the set of mocks in the `org.springframework.mock.web` package is
now compatible with Servlet 3.0. Furthermore, several of the Servlet API mocks
(e.g., `MockHttpServletRequest`, `MockServletContext`, etc.) have been updated with
minor enhancements and improved configurability.
@ -17948,7 +17966,8 @@ should be active when loading an `ApplicationContext` for test classes.
@@ -17948,7 +17966,8 @@ should be active when loading an `ApplicationContext` for test classes.
====
`@ActiveProfiles` provides support for __inheriting__ active bean definition profiles
declared by superclasses by default. It is also possible to resolve active bean
definition profiles programmatically by implementing a custom `ActiveProfilesResolver`
definition profiles programmatically by implementing a custom