Skip to content

Commit 4357298

Browse files
author
Dave Syer
committed
Add test for groovy-xml parsing
1 parent 430fb51 commit 4357298

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

spring-boot/pom.xml

+5
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@
7474
<artifactId>groovy</artifactId>
7575
<optional>true</optional>
7676
</dependency>
77+
<dependency>
78+
<groupId>org.codehaus.groovy</groupId>
79+
<artifactId>groovy-xml</artifactId>
80+
<optional>true</optional>
81+
</dependency>
7782
<dependency>
7883
<groupId>org.eclipse.jetty</groupId>
7984
<artifactId>jetty-webapp</artifactId>

spring-boot/src/test/java/org/springframework/boot/BeanDefinitionLoaderTests.java

+11
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,17 @@ public void loadGroovyResource() throws Exception {
7070

7171
}
7272

73+
@Test
74+
public void loadGroovyResourceWithNamespace() throws Exception {
75+
ClassPathResource resource = new ClassPathResource("sample-namespace.groovy",
76+
getClass());
77+
BeanDefinitionLoader loader = new BeanDefinitionLoader(this.registry, resource);
78+
int loaded = loader.load();
79+
assertThat(loaded, equalTo(1));
80+
assertTrue(this.registry.containsBean("myGroovyComponent"));
81+
82+
}
83+
7384
@Test
7485
public void loadPackage() throws Exception {
7586
BeanDefinitionLoader loader = new BeanDefinitionLoader(this.registry,

0 commit comments

Comments
 (0)