Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

Commit 189ba5b

Browse files
committed
Merge pull request #21 from wilkinsona/SPR-9255
[SPR-9255] Illustrate part of the problem. Test fails 100% of the time w...
2 parents 55ed933 + 6fa97fa commit 189ba5b

File tree

9 files changed

+164
-0
lines changed

9 files changed

+164
-0
lines changed

SPR-9255/pom.xml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>org.springframework.issues</groupId>
5+
<artifactId>SPR-9255</artifactId>
6+
<version>1.0-SNAPSHOT</version>
7+
<packaging>jar</packaging>
8+
<dependencies>
9+
<dependency>
10+
<groupId>org.springframework</groupId>
11+
<artifactId>spring-context</artifactId>
12+
<version>3.2.0.BUILD-SNAPSHOT</version>
13+
</dependency>
14+
<dependency>
15+
<groupId>log4j</groupId>
16+
<artifactId>log4j</artifactId>
17+
<version>1.2.16</version>
18+
</dependency>
19+
<dependency>
20+
<groupId>junit</groupId>
21+
<artifactId>junit</artifactId>
22+
<version>4.8</version>
23+
<scope>test</scope>
24+
</dependency>
25+
</dependencies>
26+
<repositories>
27+
<repository>
28+
<id>spring-maven-snapshot</id>
29+
<name>Springframework Maven Snapshot Repository</name>
30+
<url>http://repo.springsource.org/snapshot</url>
31+
<snapshots><enabled>true</enabled></snapshots>
32+
</repository>
33+
</repositories>
34+
<properties>
35+
<project.build.sourceEncoding>UTF8</project.build.sourceEncoding>
36+
</properties>
37+
<build>
38+
<plugins>
39+
<plugin>
40+
<artifactId>maven-compiler-plugin</artifactId>
41+
<version>2.3.2</version>
42+
<configuration>
43+
<source>1.6</source>
44+
<target>1.6</target>
45+
</configuration>
46+
</plugin>
47+
<plugin>
48+
<artifactId>maven-surefire-plugin</artifactId>
49+
<version>2.7.2</version>
50+
<configuration>
51+
<includes>
52+
<include>**/*Tests.java</include>
53+
</includes>
54+
<excludes>
55+
<exclude>**/*Abstract*.java</exclude>
56+
</excludes>
57+
</configuration>
58+
</plugin>
59+
</plugins>
60+
</build>
61+
</project>
62+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package org.springframework.issues;
2+
3+
public class Alpha {
4+
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package org.springframework.issues;
2+
3+
import org.springframework.beans.factory.FactoryBean;
4+
import org.springframework.beans.factory.annotation.Autowired;
5+
6+
public final class AlphaFactoryBean implements FactoryBean<Alpha> {
7+
8+
private final Alpha alpha = new Alpha();
9+
10+
@Autowired
11+
public AlphaFactoryBean(Bravo bravo) {
12+
13+
}
14+
15+
@Override
16+
public Alpha getObject() throws Exception {
17+
return this.alpha;
18+
}
19+
20+
@Override
21+
public Class<?> getObjectType() {
22+
return Alpha.class;
23+
}
24+
25+
@Override
26+
public boolean isSingleton() {
27+
return true;
28+
}
29+
30+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package org.springframework.issues;
2+
3+
import org.springframework.beans.factory.annotation.Autowired;
4+
import org.springframework.stereotype.Component;
5+
6+
@Component
7+
public final class Bravo {
8+
9+
@Autowired
10+
public Bravo(Charlie charlie) {
11+
12+
}
13+
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package org.springframework.issues;
2+
3+
import org.springframework.beans.factory.annotation.Autowired;
4+
import org.springframework.stereotype.Component;
5+
6+
@Component
7+
public class Charlie {
8+
9+
@Autowired
10+
public Charlie() {
11+
}
12+
13+
}

SPR-9255/src/main/resources/.gitignore

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package org.springframework.issues;
2+
3+
import org.junit.Test;
4+
import org.springframework.context.support.GenericXmlApplicationContext;
5+
6+
/**
7+
* Unit test that reproduces an issue reported against SPR JIRA. @Test methods within
8+
* need not pass with the green bar! Rather they should fail in such a way that
9+
* demonstrates the reported issue.
10+
*/
11+
public class ReproTests {
12+
13+
@Test
14+
public void repro() {
15+
GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
16+
ctx.load("classpath:org/springframework/issues/ReproTests-context.xml");
17+
ctx.refresh();
18+
}
19+
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
log4j.rootCategory=ERROR, stdout
2+
3+
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
4+
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
5+
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
6+
7+
log4j.category.org.springframework=WARN
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<beans xmlns="http://www.springframework.org/schema/beans"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns:context="http://www.springframework.org/schema/context"
5+
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
6+
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
7+
8+
<context:component-scan base-package="org.springframework.issues"/>
9+
<context:annotation-config/>
10+
11+
<bean class="org.springframework.issues.AlphaFactoryBean"/>
12+
13+
</beans>

0 commit comments

Comments
 (0)