org.springframework.context.annotation.spr10546.scanpackage.AEnclosingConfig Java Examples

The following examples show how to use org.springframework.context.annotation.spr10546.scanpackage.AEnclosingConfig. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Spr10546Tests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Test
public void enclosingConfigFirstParentDefinesBean() {
	assertLoadsMyBean(AEnclosingConfig.class,AEnclosingConfig.ChildConfig.class);
}
 
Example #2
Source File: Spr10546Tests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Test
public void childConfigFirst() {
	assertLoadsMyBean(AEnclosingConfig.ChildConfig.class, AEnclosingConfig.class);
}
 
Example #3
Source File: Spr10546Tests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Test
public void enclosingConfigOnly() {
	assertLoadsMyBean(AEnclosingConfig.class);
}
 
Example #4
Source File: Spr10546Tests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Test
public void childConfigOnly() {
	assertLoadsMyBean(AEnclosingConfig.ChildConfig.class);
}
 
Example #5
Source File: Spr10546Tests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Test
public void enclosingConfigFirstParentDefinesBean() {
	assertLoadsMyBean(AEnclosingConfig.class,AEnclosingConfig.ChildConfig.class);
}
 
Example #6
Source File: Spr10546Tests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Test
public void childConfigFirst() {
	assertLoadsMyBean(AEnclosingConfig.ChildConfig.class, AEnclosingConfig.class);
}
 
Example #7
Source File: Spr10546Tests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Test
public void enclosingConfigOnly() {
	assertLoadsMyBean(AEnclosingConfig.class);
}
 
Example #8
Source File: Spr10546Tests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Test
public void childConfigOnly() {
	assertLoadsMyBean(AEnclosingConfig.ChildConfig.class);
}
 
Example #9
Source File: Spr10546Tests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Test
public void enclosingConfigFirstParentDefinesBean() {
	assertLoadsMyBean(AEnclosingConfig.class,AEnclosingConfig.ChildConfig.class);
}
 
Example #10
Source File: Spr10546Tests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Test
public void childConfigFirst() {
	assertLoadsMyBean(AEnclosingConfig.ChildConfig.class, AEnclosingConfig.class);
}
 
Example #11
Source File: Spr10546Tests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Test
public void enclosingConfigOnly() {
	assertLoadsMyBean(AEnclosingConfig.class);
}
 
Example #12
Source File: Spr10546Tests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Test
public void childConfigOnly() {
	assertLoadsMyBean(AEnclosingConfig.ChildConfig.class);
}
 
Example #13
Source File: Spr10546Tests.java    From spring-analysis-note with MIT License 3 votes vote down vote up
/**
 * Prior to fixing SPR-10546 this might have succeeded depending on the ordering the
 * classes were picked up. If they are picked up in the same order as
 * {@link #enclosingConfigFirstParentDefinesBean()} then it would fail. This test is
 * mostly for illustration purposes, but doesn't hurt to continue using it.
 *
 * <p>We purposely use the {@link AEnclosingConfig} to make it alphabetically prior to the
 * {@link AEnclosingConfig.ChildConfig} which encourages this to occur with the
 * classpath scanning implementation being used by the author of this test.
 */
@Test
public void enclosingConfigFirstParentDefinesBeanWithScanning() {
	AnnotationConfigApplicationContext ctx= new AnnotationConfigApplicationContext();
	context = ctx;
	ctx.scan(AEnclosingConfig.class.getPackage().getName());
	ctx.refresh();
	assertThat(context.getBean("myBean",String.class), equalTo("myBean"));
}
 
Example #14
Source File: Spr10546Tests.java    From java-technology-stack with MIT License 3 votes vote down vote up
/**
 * Prior to fixing SPR-10546 this might have succeeded depending on the ordering the
 * classes were picked up. If they are picked up in the same order as
 * {@link #enclosingConfigFirstParentDefinesBean()} then it would fail. This test is
 * mostly for illustration purposes, but doesn't hurt to continue using it.
 *
 * <p>We purposely use the {@link AEnclosingConfig} to make it alphabetically prior to the
 * {@link AEnclosingConfig.ChildConfig} which encourages this to occur with the
 * classpath scanning implementation being used by the author of this test.
 */
@Test
public void enclosingConfigFirstParentDefinesBeanWithScanning() {
	AnnotationConfigApplicationContext ctx= new AnnotationConfigApplicationContext();
	context = ctx;
	ctx.scan(AEnclosingConfig.class.getPackage().getName());
	ctx.refresh();
	assertThat(context.getBean("myBean",String.class), equalTo("myBean"));
}
 
Example #15
Source File: Spr10546Tests.java    From spring4-understanding with Apache License 2.0 3 votes vote down vote up
/**
 * Prior to fixing SPR-10546 this might have succeeded depending on the ordering the
 * classes were picked up. If they are picked up in the same order as
 * {@link #enclosingConfigFirstParentDefinesBean()} then it would fail. This test is
 * mostly for illustration purposes, but doesn't hurt to continue using it.
 *
 * <p>We purposely use the {@link AEnclosingConfig} to make it alphabetically prior to the
 * {@link AEnclosingConfig.ChildConfig} which encourages this to occur with the
 * classpath scanning implementation being used by the author of this test.
 */
@Test
public void enclosingConfigFirstParentDefinesBeanWithScanning() {
	AnnotationConfigApplicationContext ctx= new AnnotationConfigApplicationContext();
	context = ctx;
	ctx.scan(AEnclosingConfig.class.getPackage().getName());
	ctx.refresh();
	assertThat(context.getBean("myBean",String.class), equalTo("myBean"));
}