Browse Source

Polishing

(cherry picked from commit 5db4495)
pull/1127/head
Juergen Hoeller 10 years ago
parent
commit
fbf3807af1
  1. 19
      spring-context/src/test/java/org/springframework/context/annotation/AbstractCircularImportDetectionTests.java
  2. 10
      spring-context/src/test/java/org/springframework/context/annotation/AsmCircularImportDetectionTests.java

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -72,58 +72,71 @@ public abstract class AbstractCircularImportDetectionTests { @@ -72,58 +72,71 @@ public abstract class AbstractCircularImportDetectionTests {
@Configuration
@Import(B.class)
static class A {
@Bean
TestBean b1() {
return new TestBean();
}
}
@Configuration
@Import(A.class)
static class B {
@Bean
TestBean b2() {
return new TestBean();
}
}
@Configuration
@Import( { Y.class, Z.class })
@Import({Y.class, Z.class})
class X {
@Bean
TestBean x() {
return new TestBean();
}
}
@Configuration
class Y {
@Bean
TestBean y() {
return new TestBean();
}
}
@Configuration
@Import( { Z1.class, Z2.class })
@Import({Z1.class, Z2.class})
class Z {
@Bean
TestBean z() {
return new TestBean();
}
}
@Configuration
class Z1 {
@Bean
TestBean z1() {
return new TestBean();
}
}
@Configuration
@Import(Z.class)
class Z2 {
@Bean
TestBean z2() {
return new TestBean();

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -23,12 +23,8 @@ import org.springframework.core.io.DefaultResourceLoader; @@ -23,12 +23,8 @@ import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.type.classreading.CachingMetadataReaderFactory;
/**
* Unit test proving that ASM-based {@link ConfigurationClassParser} correctly detects circular
* use of the {@link Import @Import} annotation.
*
* <p>While this test is the only subclass of {@link AbstractCircularImportDetectionTests},
* the hierarchy remains in place in case a JDT-based ConfigurationParser implementation
* needs to be developed.
* Unit test proving that ASM-based {@link ConfigurationClassParser} correctly detects
* circular use of the {@link Import @Import} annotation.
*
* @author Chris Beams
*/

Loading…
Cancel
Save