Skip to content

Commit f3757ce

Browse files
committed
Polish context caching section
1 parent 4107ddc commit f3757ce

File tree

1 file changed

+9
-8
lines changed
  • framework-docs/modules/ROOT/pages/testing/testcontext-framework/ctx-management

1 file changed

+9
-8
lines changed

framework-docs/modules/ROOT/pages/testing/testcontext-framework/ctx-management/caching.adoc

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ under a key that is based solely on those locations. So, if `TestClassB` also de
3131
`{"app-config.xml", "test-config.xml"}` for its locations (either explicitly or
3232
implicitly through inheritance) but does not define `@WebAppConfiguration`, a different
3333
`ContextLoader`, different active profiles, different context initializers, different
34-
test property sources, or a different parent context, then the same `ApplicationContext`
35-
is shared by both test classes. This means that the setup cost for loading an application
36-
context is incurred only once (per test suite), and subsequent test execution is much
37-
faster.
34+
context customizers, different test or dynamic property sources, or a different parent
35+
context, then the same `ApplicationContext` is shared by both test classes. This means
36+
that the setup cost for loading an application context is incurred only once (per test
37+
suite), and subsequent test execution is much faster.
3838

3939
.Test suites and forked processes
4040
[NOTE]
@@ -71,10 +71,11 @@ the underlying context cache, you can set the log level for the
7171
In the unlikely case that a test corrupts the application context and requires reloading
7272
(for example, by modifying a bean definition or the state of an application object), you
7373
can annotate your test class or test method with `@DirtiesContext` (see the discussion of
74-
`@DirtiesContext` in xref:testing/annotations/integration-spring/annotation-dirtiescontext.adoc[Spring Testing Annotations]
75-
). This instructs Spring to remove the context from the cache and rebuild
76-
the application context before running the next test that requires the same application
77-
context. Note that support for the `@DirtiesContext` annotation is provided by the
74+
`@DirtiesContext` in
75+
xref:testing/annotations/integration-spring/annotation-dirtiescontext.adoc[Spring Testing Annotations]).
76+
This instructs Spring to remove the context from the cache and rebuild the application
77+
context before running the next test that requires the same application context. Note
78+
that support for the `@DirtiesContext` annotation is provided by the
7879
`DirtiesContextBeforeModesTestExecutionListener` and the
7980
`DirtiesContextTestExecutionListener`, which are enabled by default.
8081

0 commit comments

Comments
 (0)