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

Commit eeb736b

Browse files
committed
Add repro project for SPR-11842
1 parent 10f26cf commit eeb736b

File tree

5 files changed

+173
-0
lines changed

5 files changed

+173
-0
lines changed

SPR-11842/pom.xml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>org.springframework.issues</groupId>
6+
<artifactId>SPR-11842</artifactId>
7+
<version>1.0-SNAPSHOT</version>
8+
<packaging>jar</packaging>
9+
10+
<properties>
11+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
12+
13+
<java.version>1.7</java.version>
14+
<spring.version>4.0.5.RELEASE</spring.version>
15+
</properties>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>org.springframework</groupId>
20+
<artifactId>spring-context</artifactId>
21+
<version>${spring.version}</version>
22+
</dependency>
23+
<dependency>
24+
<groupId>org.springframework</groupId>
25+
<artifactId>spring-web</artifactId>
26+
<version>${spring.version}</version>
27+
</dependency>
28+
29+
<dependency>
30+
<groupId>junit</groupId>
31+
<artifactId>junit</artifactId>
32+
<version>4.11</version>
33+
<scope>test</scope>
34+
</dependency>
35+
<dependency>
36+
<groupId>org.springframework</groupId>
37+
<artifactId>spring-test</artifactId>
38+
<version>${spring.version}</version>
39+
<scope>test</scope>
40+
</dependency>
41+
</dependencies>
42+
43+
<build>
44+
<plugins>
45+
<plugin>
46+
<groupId>org.apache.maven.plugins</groupId>
47+
<artifactId>maven-compiler-plugin</artifactId>
48+
<version>2.5.1</version>
49+
<configuration>
50+
<source>${java.version}</source>
51+
<target>${java.version}</target>
52+
</configuration>
53+
</plugin>
54+
<plugin>
55+
<groupId>org.apache.maven.plugins</groupId>
56+
<artifactId>maven-surefire-plugin</artifactId>
57+
<version>2.12.4</version>
58+
<configuration>
59+
<includes>
60+
<include>**/*Tests.java</include>
61+
<include>**/*Test.java</include>
62+
</includes>
63+
<excludes>
64+
<exclude>**/*Abstract*.java</exclude>
65+
</excludes>
66+
</configuration>
67+
</plugin>
68+
</plugins>
69+
</build>
70+
</project>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* To change this license header, choose License Headers in Project Properties.
3+
* To change this template file, choose Tools | Templates
4+
* and open the template in the editor.
5+
*/
6+
7+
package org.demo.demo;
8+
9+
import org.springframework.beans.factory.annotation.Autowired;
10+
import org.springframework.context.annotation.DependsOn;
11+
import org.springframework.stereotype.Component;
12+
13+
/**
14+
*
15+
* @author pmr
16+
*/
17+
@Component
18+
//@DependsOn("myService")
19+
public class MyBean {
20+
21+
@Autowired
22+
private MyService service;
23+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* To change this license header, choose License Headers in Project Properties.
3+
* To change this template file, choose Tools | Templates
4+
* and open the template in the editor.
5+
*/
6+
7+
package org.demo.demo;
8+
9+
/**
10+
*
11+
* @author pmr
12+
*/
13+
public interface MyService {
14+
15+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* To change this license header, choose License Headers in Project Properties.
3+
* To change this template file, choose Tools | Templates
4+
* and open the template in the editor.
5+
*/
6+
7+
package org.demo.demo.config;
8+
9+
import org.demo.demo.MyService;
10+
import org.springframework.context.annotation.Bean;
11+
import org.springframework.context.annotation.ComponentScan;
12+
import org.springframework.context.annotation.Configuration;
13+
import org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean;
14+
15+
/**
16+
*
17+
* @author pmr
18+
*/
19+
@Configuration
20+
@ComponentScan("org.demo.demo")
21+
public class ApplicationConfig {
22+
@Bean
23+
public HttpInvokerProxyFactoryBean myService() {
24+
HttpInvokerProxyFactoryBean factory = new HttpInvokerProxyFactoryBean();
25+
factory.setServiceUrl("/svc/dummy");
26+
factory.setServiceInterface(MyService.class);
27+
return factory;
28+
}
29+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* To change this license header, choose License Headers in Project Properties.
3+
* To change this template file, choose Tools | Templates
4+
* and open the template in the editor.
5+
*/
6+
7+
package org.demo.demo;
8+
9+
import static org.junit.Assert.*;
10+
11+
import org.demo.demo.config.ApplicationConfig;
12+
import org.junit.Test;
13+
import org.junit.runner.RunWith;
14+
15+
import org.springframework.beans.factory.annotation.Autowired;
16+
import org.springframework.test.context.ContextConfiguration;
17+
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
18+
19+
/**
20+
*
21+
* @author pmr
22+
*/
23+
@RunWith(SpringJUnit4ClassRunner.class)
24+
@ContextConfiguration(classes = {ApplicationConfig.class})
25+
public class ReproTests {
26+
27+
@Autowired
28+
private MyBean myBean;
29+
30+
@Test
31+
public void testMyBean() {
32+
// Check MyBean @DependsOn annotation
33+
assertNotNull(myBean);
34+
}
35+
36+
}

0 commit comments

Comments
 (0)