Skip to content

Commit 4a608e9

Browse files
committed
Cross reference @NestedTestConfiguration and supported annotations
See gh-19930
1 parent 74c2df4 commit 4a608e9

13 files changed

+79
-14
lines changed

Diff for: spring-test/src/main/java/org/springframework/test/annotation/Commit.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -44,6 +44,11 @@
4444
* {@code @Commit} and {@code @Rollback} on the same test method or on the
4545
* same test class is unsupported and may lead to unpredictable results.
4646
*
47+
* <p>As of Spring Framework 5.3, this annotation will be inherited from an
48+
* enclosing test class by default. See
49+
* {@link org.springframework.test.context.NestedTestConfiguration @NestedTestConfiguration}
50+
* for details.
51+
*
4752
* @author Sam Brannen
4853
* @since 4.2
4954
* @see Rollback

Diff for: spring-test/src/main/java/org/springframework/test/annotation/DirtiesContext.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -43,6 +43,11 @@
4343
* <p>This annotation may be used as a <em>meta-annotation</em> to create custom
4444
* <em>composed annotations</em>.
4545
*
46+
* <p>As of Spring Framework 5.3, this annotation will be inherited from an
47+
* enclosing test class by default. See
48+
* {@link org.springframework.test.context.NestedTestConfiguration @NestedTestConfiguration}
49+
* for details.
50+
*
4651
* <h3>Supported Test Phases</h3>
4752
* <ul>
4853
* <li><strong>Before current test class</strong>: when declared at the class

Diff for: spring-test/src/main/java/org/springframework/test/annotation/Rollback.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -49,6 +49,11 @@
4949
* custom <em>composed annotations</em>. Consult the source code for
5050
* {@link Commit @Commit} for a concrete example.
5151
*
52+
* <p>As of Spring Framework 5.3, this annotation will be inherited from an
53+
* enclosing test class by default. See
54+
* {@link org.springframework.test.context.NestedTestConfiguration @NestedTestConfiguration}
55+
* for details.
56+
*
5257
* @author Sam Brannen
5358
* @since 2.5
5459
* @see Commit

Diff for: spring-test/src/main/java/org/springframework/test/context/ActiveProfiles.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -34,6 +34,10 @@
3434
* <p>This annotation may be used as a <em>meta-annotation</em> to create custom
3535
* <em>composed annotations</em>.
3636
*
37+
* <p>As of Spring Framework 5.3, this annotation will be inherited from an
38+
* enclosing test class by default. See
39+
* {@link NestedTestConfiguration @NestedTestConfiguration} for details.
40+
*
3741
* @author Sam Brannen
3842
* @since 3.1
3943
* @see SmartContextLoader

Diff for: spring-test/src/main/java/org/springframework/test/context/BootstrapWith.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -33,6 +33,10 @@
3333
* present</em> on the current test class) will override any meta-present
3434
* declarations of {@code @BootstrapWith}.
3535
*
36+
* <p>As of Spring Framework 5.3, this annotation will be inherited from an
37+
* enclosing test class by default. See
38+
* {@link NestedTestConfiguration @NestedTestConfiguration} for details.
39+
*
3640
* @author Sam Brannen
3741
* @since 4.1
3842
* @see BootstrapContext

Diff for: spring-test/src/main/java/org/springframework/test/context/ContextConfiguration.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -75,6 +75,10 @@
7575
* <p>This annotation may be used as a <em>meta-annotation</em> to create custom
7676
* <em>composed annotations</em>.
7777
*
78+
* <p>As of Spring Framework 5.3, this annotation will be inherited from an
79+
* enclosing test class by default. See
80+
* {@link NestedTestConfiguration @NestedTestConfiguration} for details.
81+
*
7882
* @author Sam Brannen
7983
* @since 2.5
8084
* @see org.springframework.test.context.junit.jupiter.SpringJUnitConfig @SpringJUnitConfig

Diff for: spring-test/src/main/java/org/springframework/test/context/ContextHierarchy.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -134,6 +134,10 @@
134134
* <p>This annotation may be used as a <em>meta-annotation</em> to create custom
135135
* <em>composed annotations</em>.
136136
*
137+
* <p>As of Spring Framework 5.3, this annotation will be inherited from an
138+
* enclosing test class by default. See
139+
* {@link NestedTestConfiguration @NestedTestConfiguration} for details.
140+
*
137141
* @author Sam Brannen
138142
* @since 3.2.2
139143
* @see ContextConfiguration

Diff for: spring-test/src/main/java/org/springframework/test/context/NestedTestConfiguration.java

+18-4
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,28 @@
6060
* classes in JUnit Jupiter; however, there may be other testing frameworks with
6161
* support for nested test classes that could also make use of this annotation.
6262
*
63+
* <h3>Supported Annotations</h3>
64+
* <p>The <em>Spring TestContext Framework</em> honors {@code @NestedTestConfiguration}
65+
* semantics for the following annotations.
66+
* <ul>
67+
* <li>{@link BootstrapWith @BootstrapWith}</li>
68+
* <li>{@link TestExecutionListeners @TestExecutionListeners}</li>
69+
* <li>{@link ContextConfiguration @ContextConfiguration}</li>
70+
* <li>{@link ContextHierarchy @ContextHierarchy}</li>
71+
* <li>{@link org.springframework.test.context.web.WebAppConfiguration @WebAppConfiguration}</li>
72+
* <li>{@link ActiveProfiles @ActiveProfiles}</li>
73+
* <li>{@link TestPropertySource @TestPropertySource}</li>
74+
* <li>{@link org.springframework.test.annotation.DirtiesContext @DirtiesContext}</li>
75+
* <li>{@link org.springframework.transaction.annotation.Transactional @Transactional}</li>
76+
* <li>{@link org.springframework.test.annotation.Rollback @Rollback}</li>
77+
* <li>{@link org.springframework.test.annotation.Commit @Commit}</li>
78+
* <li>{@link TestConstructor @TestConstructor}</li>
79+
* </ul>
80+
*
6381
* @author Sam Brannen
6482
* @since 5.3
6583
* @see EnclosingConfiguration#INHERIT
6684
* @see EnclosingConfiguration#OVERRIDE
67-
* @see ContextConfiguration @ContextConfiguration
68-
* @see ContextHierarchy @ContextHierarchy
69-
* @see ActiveProfiles @ActiveProfiles
70-
* @see TestPropertySource @TestPropertySource
7185
*/
7286
@Target(ElementType.TYPE)
7387
@Retention(RetentionPolicy.RUNTIME)

Diff for: spring-test/src/main/java/org/springframework/test/context/TestConstructor.java

+4
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@
5353
* {@link org.springframework.test.context.junit.jupiter.web.SpringJUnitWebConfig @SpringJUnitWebConfig}
5454
* or various test-related annotations from Spring Boot Test.
5555
*
56+
* <p>As of Spring Framework 5.3, this annotation will be inherited from an
57+
* enclosing test class by default. See
58+
* {@link NestedTestConfiguration @NestedTestConfiguration} for details.
59+
*
5660
* @author Sam Brannen
5761
* @since 5.2
5862
* @see org.springframework.beans.factory.annotation.Autowired @Autowired

Diff for: spring-test/src/main/java/org/springframework/test/context/TestExecutionListeners.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -36,6 +36,10 @@
3636
* <p>This annotation may be used as a <em>meta-annotation</em> to create custom
3737
* <em>composed annotations</em>.
3838
*
39+
* <p>As of Spring Framework 5.3, this annotation will be inherited from an
40+
* enclosing test class by default. See
41+
* {@link NestedTestConfiguration @NestedTestConfiguration} for details.
42+
*
3943
* @author Sam Brannen
4044
* @since 2.5
4145
* @see TestExecutionListener

Diff for: spring-test/src/main/java/org/springframework/test/context/TestPropertySource.java

+3
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@
7878
* annotation since the {@code locations} and {@code inheritLocations} attributes
7979
* of both annotations can lead to ambiguity during the attribute resolution
8080
* process.</li>
81+
* <li>As of Spring Framework 5.3, this annotation will be inherited from an
82+
* enclosing test class by default. See
83+
* {@link NestedTestConfiguration @NestedTestConfiguration} for details.</li>
8184
* </ul>
8285
*
8386
* @author Sam Brannen

Diff for: spring-test/src/main/java/org/springframework/test/context/TestPropertySources.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -31,6 +31,10 @@
3131
* completely optional since {@code @TestPropertySource} is a
3232
* {@linkplain java.lang.annotation.Repeatable repeatable} annotation.
3333
*
34+
* <p>As of Spring Framework 5.3, this annotation will be inherited from an
35+
* enclosing test class by default. See
36+
* {@link NestedTestConfiguration @NestedTestConfiguration} for details.
37+
*
3438
* @author Anatoliy Korovin
3539
* @author Sam Brannen
3640
* @since 5.2

Diff for: spring-test/src/main/java/org/springframework/test/context/web/WebAppConfiguration.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -41,6 +41,11 @@
4141
* <p>This annotation may be used as a <em>meta-annotation</em> to create custom
4242
* <em>composed annotations</em>.
4343
*
44+
* <p>As of Spring Framework 5.3, this annotation will be inherited from an
45+
* enclosing test class by default. See
46+
* {@link org.springframework.test.context.NestedTestConfiguration @NestedTestConfiguration}
47+
* for details.
48+
*
4449
* @author Sam Brannen
4550
* @since 3.2
4651
* @see org.springframework.web.context.WebApplicationContext

0 commit comments

Comments
 (0)