This repository has been archived by the owner on Dec 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
181 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.springframework.issues</groupId> | ||
<artifactId>SPR-9795</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-context</artifactId> | ||
<version>3.3.0.BUILD-SNAPSHOT</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-webmvc</artifactId> | ||
<version>3.3.0.BUILD-SNAPSHOT</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>log4j</groupId> | ||
<artifactId>log4j</artifactId> | ||
<version>1.2.16</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.8</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<repositories> | ||
<!-- | ||
<repository> | ||
<id>s2-release</id> | ||
<url>http://repo.springsource.org/release</url> | ||
</repository> | ||
<repository> | ||
<id>s2-milestone</id> | ||
<url>http://repo.springsource.org/milestone</url> | ||
</repository> | ||
<repository> | ||
<id>s2-staging</id> | ||
<url>http://repo.springsource.org/libs-staging-local</url> | ||
</repository> | ||
--> | ||
<repository> | ||
<id>s2-snapshot</id> | ||
<url>http://repo.springsource.org/snapshot</url> | ||
<snapshots><enabled>true</enabled></snapshots> | ||
</repository> | ||
</repositories> | ||
<properties> | ||
<project.build.sourceEncoding>UTF8</project.build.sourceEncoding> | ||
</properties> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>2.3.2</version> | ||
<configuration> | ||
<source>1.6</source> | ||
<target>1.6</target> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>2.7.2</version> | ||
<configuration> | ||
<includes> | ||
<include>**/*Tests.java</include> | ||
</includes> | ||
<excludes> | ||
<exclude>**/*Abstract*.java</exclude> | ||
</excludes> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> | ||
|
14 changes: 14 additions & 0 deletions
14
SPR-9795/src/main/java/org/springframework/issues/ApplicationConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.springframework.issues; | ||
|
||
import org.springframework.context.annotation.ComponentScan; | ||
import org.springframework.context.annotation.ComponentScan.Filter; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.FilterType; | ||
import org.springframework.stereotype.Controller; | ||
|
||
@Configuration | ||
@ComponentScan(useDefaultFilters = true, excludeFilters = { @Filter(Controller.class), | ||
@Filter(type = FilterType.ASSIGNABLE_TYPE, value = DispatcherConfig.class) }) | ||
public class ApplicationConfig { | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
SPR-9795/src/main/java/org/springframework/issues/DispatcherConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.springframework.issues; | ||
|
||
import org.springframework.context.annotation.ComponentScan; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.ComponentScan.Filter; | ||
import org.springframework.stereotype.Controller; | ||
|
||
@Configuration | ||
@ComponentScan(useDefaultFilters=false, includeFilters={@Filter(Controller.class)}) | ||
public class DispatcherConfig { | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
SPR-9795/src/main/java/org/springframework/issues/FooBean.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.springframework.issues; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class FooBean { | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
SPR-9795/src/main/java/org/springframework/issues/FooController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.springframework.issues; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Controller; | ||
|
||
@Controller | ||
public class FooController { | ||
|
||
@Autowired | ||
private FooBean bean; | ||
|
||
public FooBean getBean() { | ||
return bean; | ||
} | ||
} |
Empty file.
31 changes: 31 additions & 0 deletions
31
SPR-9795/src/test/java/org/springframework/issues/ReproTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.springframework.issues; | ||
|
||
import static org.junit.Assert.assertFalse; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
import org.junit.Test; | ||
import org.springframework.context.annotation.AnnotationConfigApplicationContext; | ||
|
||
/** | ||
* Unit test that reproduces an issue reported against SPR JIRA. @Test methods within | ||
* need not pass with the green bar! Rather they should fail in such a way that | ||
* demonstrates the reported issue. | ||
*/ | ||
public class ReproTests { | ||
|
||
@Test | ||
public void repro() { | ||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(ApplicationConfig.class); | ||
AnnotationConfigApplicationContext dispatcherCtx = new AnnotationConfigApplicationContext(); | ||
dispatcherCtx.setParent(ctx); | ||
dispatcherCtx.register(DispatcherConfig.class); | ||
dispatcherCtx.refresh(); | ||
|
||
assertTrue(ctx.containsLocalBean("fooBean")); | ||
assertFalse(ctx.containsLocalBean("fooController")); | ||
|
||
assertFalse(dispatcherCtx.containsLocalBean("fooBean")); | ||
assertTrue(dispatcherCtx.containsLocalBean("fooController")); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
log4j.rootCategory=ERROR, stdout | ||
|
||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender | ||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout | ||
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n | ||
|
||
log4j.category.org.springframework=WARN |
14 changes: 14 additions & 0 deletions
14
SPR-9795/src/test/resources/org/springframework/issues/ReproTests-context.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="ISO-8859-1"?> | ||
<beans xmlns="http://www.springframework.org/schema/beans" | ||
xmlns:context="http://www.springframework.org/schema/context" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.springframework.org/schema/beans | ||
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"> | ||
|
||
<bean id="foo" class="org.springframework.issues.Foo"> | ||
<constructor-arg ref="bar"/> | ||
</bean> | ||
|
||
<bean id="bar" class="org.springframework.issues.Bar"/> | ||
|
||
</beans> |