@@ -783,9 +783,9 @@ Framework release.
783
783
784
784
785
785
=== Removed Deprecated Packages and Methods
786
- All deprecated packages, and many deprecated classes and methods have been removed with
787
- version 4.0. If you are upgrading from a previous release of Spring, you should ensure
788
- that you have fixed any deprecated calls that you were making.
786
+ All deprecated packages, and many deprecated classes, methods, and fields have been
787
+ removed with version 4.0. If you are upgrading from a previous release of Spring, you
788
+ should ensure that you have fixed any deprecated calls that you were making.
789
789
790
790
For a complete set of changes, check out the
791
791
http://docs.spring.io/spring-framework/docs/3.2.4.RELEASE_to_4.0.0.RELEASE/[API
@@ -919,8 +919,26 @@ For more information consult the `GroovyBeanDefinitionReader`
919
919
{javadoc-baseurl}/org/springframework/beans/factory/groovy/GroovyBeanDefinitionReader.html[Javadoc].
920
920
921
921
922
+ === Testing Improvements
923
+ In addition to pruning of deprecated code within the `spring-test` module, Spring
924
+ Framework 4.0 introduces several new features for use in unit and integration testing.
922
925
923
-
926
+ * Almost all annotations in the `spring-test` module (e.g., `@ContextConfiguration`,
927
+ `@WebAppConfiguration`, `@ContextHierarchy`, `@ActiveProfiles`, etc.) can now be used
928
+ as <<beans-meta-annotations,meta-annotations>> to create custom _composed annotations_
929
+ and reduce configuration duplication across tests.
930
+ * Active bean definition profiles can now be resolved programmatically, simply by
931
+ implementing a custom <<testcontext-ctx-management-env-profiles-ActiveProfilesResolver,`ActiveProfilesResolver`>>
932
+ and registering it via the `resolver` attribute of `@ActiveProfiles`.
933
+ * A new `SocketUtils` utility class has been introduced in the `spring-core` module
934
+ which enables you to scan for free TCP & UDP server ports on localhost. This
935
+ functionality is not specific to testing but can prove very useful when writing
936
+ integration tests that require the use of sockets, for example tests that start
937
+ an in-memory SMTP server, FTP server, Servlet container, etc.
938
+ * As of Spring 4.0, the set of mocks in the `org.springframework.mock.web` package is
939
+ now compatible with Servlet 3.0. Furthermore, several of the Servlet API mocks
940
+ (e.g., `MockHttpServletRequest`, `MockServletContext`, etc.) have been updated with
941
+ minor enhancements and improved configurability.
924
942
925
943
926
944
@@ -17948,7 +17966,8 @@ should be active when loading an `ApplicationContext` for test classes.
17948
17966
====
17949
17967
`@ActiveProfiles` provides support for __inheriting__ active bean definition profiles
17950
17968
declared by superclasses by default. It is also possible to resolve active bean
17951
- definition profiles programmatically by implementing a custom `ActiveProfilesResolver`
17969
+ definition profiles programmatically by implementing a custom
17970
+ <<testcontext-ctx-management-env-profiles-ActiveProfilesResolver,`ActiveProfilesResolver`>>
17952
17971
and registering it via the `resolver` attribute of `@ActiveProfiles`.
17953
17972
====
17954
17973
@@ -19071,6 +19090,7 @@ disable the inheritance of active profiles.
19071
19090
}
19072
19091
----
19073
19092
19093
+ [[testcontext-ctx-management-env-profiles-ActiveProfilesResolver]]
19074
19094
Furthermore, it is sometimes necessary to resolve active profiles for tests
19075
19095
__programmatically__ instead of declaratively -- for example, based on:
19076
19096
0 commit comments