Skip to content

Commit 249d837

Browse files
jhoellerunknown
authored andcommitted
Polishing
(cherry picked from commit aa6e6c1)
1 parent bfcfbe4 commit 249d837

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

spring-context/src/test/java/org/springframework/context/annotation/AbstractCircularImportDetectionTests.java

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,19 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.context.annotation;
1716

18-
import static org.junit.Assert.*;
17+
package org.springframework.context.annotation;
1918

2019
import org.junit.Test;
21-
import org.springframework.beans.factory.parsing.BeanDefinitionParsingException;
22-
import org.springframework.context.annotation.Bean;
23-
import org.springframework.context.annotation.ConfigurationClassParser;
24-
import org.springframework.context.annotation.Import;
2520

21+
import org.springframework.beans.factory.parsing.BeanDefinitionParsingException;
2622
import org.springframework.tests.sample.beans.TestBean;
2723

24+
import static org.junit.Assert.*;
2825

2926
/**
30-
* TCK-style unit tests for handling circular use of the {@link Import} annotation. Explore
31-
* subclass hierarchy for specific concrete implementations.
27+
* TCK-style unit tests for handling circular use of the {@link Import} annotation.
28+
* Explore the subclass hierarchy for specific concrete implementations.
3229
*
3330
* @author Chris Beams
3431
*/
@@ -38,23 +35,23 @@ public abstract class AbstractCircularImportDetectionTests {
3835

3936
protected abstract String loadAsConfigurationSource(Class<?> clazz) throws Exception;
4037

38+
4139
@Test
4240
public void simpleCircularImportIsDetected() throws Exception {
4341
boolean threw = false;
4442
try {
4543
newParser().parse(loadAsConfigurationSource(A.class), "A");
46-
} catch (BeanDefinitionParsingException ex) {
44+
}
45+
catch (BeanDefinitionParsingException ex) {
4746
assertTrue("Wrong message. Got: " + ex.getMessage(),
4847
ex.getMessage().contains(
4948
"Illegal attempt by @Configuration class 'AbstractCircularImportDetectionTests.B' " +
5049
"to import class 'AbstractCircularImportDetectionTests.A'"));
5150
threw = true;
5251
}
53-
5452
assertTrue(threw);
5553
}
5654

57-
5855
@Test
5956
public void complexCircularImportIsDetected() throws Exception {
6057
boolean threw = false;
@@ -68,10 +65,10 @@ public void complexCircularImportIsDetected() throws Exception {
6865
"to import class 'AbstractCircularImportDetectionTests.Z'"));
6966
threw = true;
7067
}
71-
7268
assertTrue(threw);
7369
}
7470

71+
7572
@Configuration
7673
@Import(B.class)
7774
static class A {

spring-context/src/test/java/org/springframework/context/annotation/AsmCircularImportDetectionTests.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.springframework.context.annotation;
1718

1819
import org.springframework.beans.factory.parsing.FailFastProblemReporter;
@@ -22,12 +23,12 @@
2223
import org.springframework.core.type.classreading.CachingMetadataReaderFactory;
2324

2425
/**
25-
* Unit test proving that ASM-based {@link ConfigurationClassParser} correctly detects circular use of
26-
* the {@link Import @Import} annotation.
26+
* Unit test proving that ASM-based {@link ConfigurationClassParser} correctly detects circular
27+
* use of the {@link Import @Import} annotation.
2728
*
28-
* <p>While this test is the only subclass of {@link AbstractCircularImportDetectionTests}, the
29-
* hierarchy remains in place in case a JDT-based ConfigurationParser implementation needs to be
30-
* developed.
29+
* <p>While this test is the only subclass of {@link AbstractCircularImportDetectionTests},
30+
* the hierarchy remains in place in case a JDT-based ConfigurationParser implementation
31+
* needs to be developed.
3132
*
3233
* @author Chris Beams
3334
*/

0 commit comments

Comments
 (0)