This repository was archived by the owner on Dec 15, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-50
lines changed Expand file tree Collapse file tree 3 files changed +10
-50
lines changed Original file line number Diff line number Diff line change 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 >
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
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 >
Original file line number Diff line number Diff line change 99@ Import ({
1010 org .chare .service .Config .class ,
1111 org .chare .otherService .Config .class
12- }
13- )
14-
12+ })
1513public class Config {
1614
1715}
Original file line number Diff line number Diff line change 11package org .chare ;
22
3- import static org .junit .Assert .*;
4-
5- import java .util .ArrayList ;
6- import java .util .List ;
7-
83import org .chare .service .Service ;
94import org .junit .Test ;
10- import org .springframework .context .annotation .Configuration ;
5+ import org .springframework .context .annotation .AnnotationConfigApplicationContext ;
116import org .springframework .context .support .AbstractApplicationContext ;
12- import org .springframework .web .context .support .AnnotationConfigWebApplicationContext ;
7+
8+ import static org .junit .Assert .*;
139
1410public 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}
You can’t perform that action at this time.
0 commit comments