Skip to content

Commit 19cdd55

Browse files
committed
Improved Jaxb2Marshaller.supports()
1 parent 58f63f6 commit 19cdd55

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

org.springframework.oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2MarshallerTests.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,19 @@ public boolean matches(Method method) {
236236
});
237237
}
238238

239+
@Test
240+
public void supportsXmlRootElement() throws Exception {
241+
marshaller = new Jaxb2Marshaller();
242+
marshaller.setClassesToBeBound(new Class[]{DummyRootElement.class, DummyType.class});
243+
marshaller.afterPropertiesSet();
244+
assertTrue("Jaxb2Marshaller does not support XmlRootElement class", marshaller.supports(DummyRootElement.class));
245+
assertTrue("Jaxb2Marshaller does not support XmlRootElement generic type", marshaller.supports((Type)DummyRootElement.class));
246+
247+
assertFalse("Jaxb2Marshaller supports DummyType class", marshaller.supports(DummyType.class));
248+
assertFalse("Jaxb2Marshaller supports DummyType type", marshaller.supports((Type)DummyType.class));
249+
}
250+
251+
239252
@Test
240253
public void marshalAttachments() throws Exception {
241254
marshaller = new Jaxb2Marshaller();

0 commit comments

Comments
 (0)