Skip to content

Commit 02dfe94

Browse files
committed
[SPR-6128] Verified that claims raised in this issue no longer apply.
1 parent 381d1d5 commit 02dfe94

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
4+
5+
<bean id="foo" class="java.lang.String">
6+
<constructor-arg value="normal" />
7+
</bean>
8+
9+
<bean id="customFoo" class="java.lang.String">
10+
<constructor-arg value="custom" />
11+
</bean>
12+
13+
</beans>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* Copyright 2009 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.test.context.junit4.spr6128;
18+
19+
import static org.hamcrest.core.IsEqual.equalTo;
20+
import static org.junit.Assert.assertThat;
21+
22+
import org.junit.Test;
23+
import org.junit.runner.RunWith;
24+
import org.springframework.beans.factory.annotation.Autowired;
25+
import org.springframework.beans.factory.annotation.Qualifier;
26+
import org.springframework.test.context.ContextConfiguration;
27+
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
28+
29+
/**
30+
* Unit tests to verify claims made in <a
31+
* href="http://jira.springframework.org/browse/SPR-6128"
32+
* target="_blank">SPR-6128</a>.
33+
*
34+
* @author Sam Brannen
35+
* @author Chris Beams
36+
* @since 3.0
37+
*/
38+
@ContextConfiguration
39+
@RunWith(SpringJUnit4ClassRunner.class)
40+
public class AutowiredQualifierTests {
41+
42+
@Autowired
43+
private String foo;
44+
45+
@Autowired
46+
@Qualifier("customFoo")
47+
private String customFoo;
48+
49+
50+
@Test
51+
public void test() {
52+
assertThat(foo, equalTo("normal"));
53+
assertThat(customFoo, equalTo("custom"));
54+
}
55+
56+
}

0 commit comments

Comments
 (0)