Skip to content

Commit 89e81e1

Browse files
committed
copy test and correct dependencies
1 parent bf5e605 commit 89e81e1

17 files changed

+5584
-12
lines changed

pom.xml

Lines changed: 48 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,54 @@
3333
<artifactId>spring-jcl</artifactId>
3434
<version>5.0.4.RELEASE</version>
3535
</dependency>
36-
<dependency>
37-
<groupId>org.jetbrains.kotlin</groupId>
38-
<artifactId>kotlin-stdlib</artifactId>
39-
<version>1.2.21</version>
40-
<optional>true</optional>
41-
</dependency>
42-
<dependency>
43-
<groupId>org.jetbrains.kotlin</groupId>
44-
<artifactId>kotlin-reflect</artifactId>
45-
<version>1.2.21</version>
46-
<optional>true</optional>
47-
</dependency>
36+
<dependency>
37+
<groupId>org.jetbrains.kotlin</groupId>
38+
<artifactId>kotlin-stdlib</artifactId>
39+
<version>1.2.21</version>
40+
<optional>true</optional>
41+
</dependency>
42+
<dependency>
43+
<groupId>org.jetbrains.kotlin</groupId>
44+
<artifactId>kotlin-reflect</artifactId>
45+
<version>1.2.21</version>
46+
<optional>true</optional>
47+
</dependency>
48+
<dependency>
49+
<groupId>org.springframework</groupId>
50+
<artifactId>spring-context</artifactId>
51+
<version>5.0.4.RELEASE</version>
52+
<scope>test</scope>
53+
</dependency>
54+
<dependency>
55+
<groupId>org.hamcrest</groupId>
56+
<artifactId>hamcrest-all</artifactId>
57+
<version>1.3</version>
58+
<scope>test</scope>
59+
</dependency>
60+
<dependency>
61+
<groupId>io.projectreactor</groupId>
62+
<artifactId>reactor-test</artifactId>
63+
<version>3.1.5.RELEASE</version>
64+
<scope>test</scope>
65+
</dependency>
66+
<dependency>
67+
<groupId>javax.xml.bind</groupId>
68+
<artifactId>jaxb-api</artifactId>
69+
<version>2.3.0</version>
70+
<scope>test</scope>
71+
</dependency>
72+
<dependency>
73+
<groupId>org.apache.tomcat.embed</groupId>
74+
<artifactId>tomcat-embed-core</artifactId>
75+
<version>9.0.1</version>
76+
<scope>test</scope>
77+
</dependency>
78+
<dependency>
79+
<groupId>com.fasterxml.woodstox</groupId>
80+
<artifactId>woodstox-core</artifactId>
81+
<version>5.0.3</version>
82+
<scope>test</scope>
83+
</dependency>
4884
</dependencies>
4985

5086
<developers>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* Copyright 2002-2015 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.core.annotation;
18+
19+
import java.lang.annotation.Annotation;
20+
import java.lang.reflect.Method;
21+
22+
import org.junit.Test;
23+
24+
import org.springframework.core.annotation.AnnotationUtilsTests.GroovyImplicitAliasesContextConfigClass;
25+
import org.springframework.core.annotation.AnnotationUtilsTests.ImplicitAliasesContextConfig;
26+
import org.springframework.core.annotation.AnnotationUtilsTests.Location1ImplicitAliasesContextConfigClass;
27+
import org.springframework.core.annotation.AnnotationUtilsTests.Location2ImplicitAliasesContextConfigClass;
28+
import org.springframework.core.annotation.AnnotationUtilsTests.Location3ImplicitAliasesContextConfigClass;
29+
import org.springframework.core.annotation.AnnotationUtilsTests.ValueImplicitAliasesContextConfigClass;
30+
import org.springframework.core.annotation.AnnotationUtilsTests.XmlImplicitAliasesContextConfigClass;
31+
32+
import static org.hamcrest.CoreMatchers.*;
33+
import static org.junit.Assert.*;
34+
35+
/**
36+
* Abstract base class for tests involving concrete implementations of
37+
* {@link AbstractAliasAwareAnnotationAttributeExtractor}.
38+
*
39+
* @author Sam Brannen
40+
* @since 4.2.1
41+
*/
42+
public abstract class AbstractAliasAwareAnnotationAttributeExtractorTestCase {
43+
44+
@Test
45+
public void getAttributeValueForImplicitAliases() throws Exception {
46+
assertGetAttributeValueForImplicitAliases(GroovyImplicitAliasesContextConfigClass.class, "groovyScript");
47+
assertGetAttributeValueForImplicitAliases(XmlImplicitAliasesContextConfigClass.class, "xmlFile");
48+
assertGetAttributeValueForImplicitAliases(ValueImplicitAliasesContextConfigClass.class, "value");
49+
assertGetAttributeValueForImplicitAliases(Location1ImplicitAliasesContextConfigClass.class, "location1");
50+
assertGetAttributeValueForImplicitAliases(Location2ImplicitAliasesContextConfigClass.class, "location2");
51+
assertGetAttributeValueForImplicitAliases(Location3ImplicitAliasesContextConfigClass.class, "location3");
52+
}
53+
54+
private void assertGetAttributeValueForImplicitAliases(Class<?> clazz, String expected) throws Exception {
55+
Method xmlFile = ImplicitAliasesContextConfig.class.getDeclaredMethod("xmlFile");
56+
Method groovyScript = ImplicitAliasesContextConfig.class.getDeclaredMethod("groovyScript");
57+
Method value = ImplicitAliasesContextConfig.class.getDeclaredMethod("value");
58+
59+
AnnotationAttributeExtractor<?> extractor = createExtractorFor(clazz, expected, ImplicitAliasesContextConfig.class);
60+
61+
assertThat(extractor.getAttributeValue(value), is(expected));
62+
assertThat(extractor.getAttributeValue(groovyScript), is(expected));
63+
assertThat(extractor.getAttributeValue(xmlFile), is(expected));
64+
}
65+
66+
protected abstract AnnotationAttributeExtractor<?> createExtractorFor(Class<?> clazz, String expected, Class<? extends Annotation> annotationType);
67+
68+
}

0 commit comments

Comments
 (0)