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

Commit 88f748a

Browse files
committed
Reproduce SPR-9243
- Simplify @configuration usage - Upgrade to 3.2.0.BUILD-SNAPSHOT and demonstrate failure
1 parent 7a10945 commit 88f748a

File tree

3 files changed

+10
-50
lines changed

3 files changed

+10
-50
lines changed

SPR-9243/pom.xml

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<!-- FIXME change to this version to pass the test
1212
<org.springframework-version>3.1.0.RELEASE</org.springframework-version>
1313
-->
14-
<org.springframework-version>3.1.1.RELEASE</org.springframework-version>
14+
<org.springframework-version>3.2.0.BUILD-SNAPSHOT</org.springframework-version>
1515
<org.slf4j-version>1.5.10</org.slf4j-version>
1616
</properties>
1717
<dependencies>
@@ -25,7 +25,7 @@
2525
</dependency>
2626
<dependency>
2727
<groupId>org.springframework</groupId>
28-
<artifactId>org.springframework.web</artifactId>
28+
<artifactId>spring-web</artifactId>
2929
<version>${org.springframework-version}</version>
3030
</dependency>
3131

@@ -65,21 +65,10 @@
6565
<repositories>
6666

6767
<repository>
68-
<id>spring.maven.milestone</id>
69-
<name>Spring Milestone Maven Repo</name>
70-
<url>http://repository.springsource.com/maven/bundles/milestone</url>
68+
<id>repo.springsource.org</id>
69+
<name>SpringSource Repository</name>
70+
<url>http://repo.springsource.org/libs-snapshot</url>
7171
</repository>
72-
<repository>
73-
<id>spring.maven.release</id>
74-
<name>Spring Release Maven Repo</name>
75-
<url>http://repository.springsource.com/maven/bundles/release</url>
76-
</repository>
77-
<repository>
78-
<id>com.springsource.repository.bundles.external</id>
79-
<name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
80-
<url>http://repository.springsource.com/maven/bundles/external</url>
81-
</repository>
82-
8372
</repositories>
8473
<build>
8574
<plugins>

SPR-9243/src/main/java/org/chare/Config.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
@Import({
1010
org.chare.service.Config.class,
1111
org.chare.otherService.Config.class
12-
}
13-
)
14-
12+
})
1513
public class Config {
1614

1715
}
Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,19 @@
11
package org.chare;
22

3-
import static org.junit.Assert.*;
4-
5-
import java.util.ArrayList;
6-
import java.util.List;
7-
83
import org.chare.service.Service;
94
import org.junit.Test;
10-
import org.springframework.context.annotation.Configuration;
5+
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
116
import org.springframework.context.support.AbstractApplicationContext;
12-
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
7+
8+
import static org.junit.Assert.*;
139

1410
public class ConfigTest {
1511

1612
@Test
1713
public void testConfig() throws Exception {
18-
AbstractApplicationContext context = createContext(Config.class, DependencyConfig.class);
14+
AbstractApplicationContext context = new AnnotationConfigApplicationContext(Config.class);
1915
assertNotNull(context.getBean(Service.class));
2016
context.close();
2117
}
2218

23-
@Configuration
24-
static class DependencyConfig {
25-
26-
}
27-
28-
29-
public static AnnotationConfigWebApplicationContext createContext(final Class<?> ... configClasses) {
30-
AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext() {
31-
@Override
32-
public String[] getConfigLocations() {
33-
return convertToConfigLocations(configClasses);
34-
}
35-
};
36-
context.refresh();
37-
return context;
38-
}
39-
40-
public static String[] convertToConfigLocations(Class<?>... configClasses) {
41-
List<String> names = new ArrayList<String>();
42-
for (Class<?> configClass : configClasses)
43-
names.add(configClass.getName());
44-
return names.toArray(new String [] {});
45-
}
4619
}

0 commit comments

Comments
 (0)