Improved Jaxb2Marshaller.supports()

master
Arjen Poutsma 15 years ago
parent 58f63f6142
commit 19cdd558d3
  1. 13
      org.springframework.oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2MarshallerTests.java

@ -236,6 +236,19 @@ public class Jaxb2MarshallerTests extends AbstractMarshallerTests {
}); });
} }
@Test
public void supportsXmlRootElement() throws Exception {
marshaller = new Jaxb2Marshaller();
marshaller.setClassesToBeBound(new Class[]{DummyRootElement.class, DummyType.class});
marshaller.afterPropertiesSet();
assertTrue("Jaxb2Marshaller does not support XmlRootElement class", marshaller.supports(DummyRootElement.class));
assertTrue("Jaxb2Marshaller does not support XmlRootElement generic type", marshaller.supports((Type)DummyRootElement.class));
assertFalse("Jaxb2Marshaller supports DummyType class", marshaller.supports(DummyType.class));
assertFalse("Jaxb2Marshaller supports DummyType type", marshaller.supports((Type)DummyType.class));
}
@Test @Test
public void marshalAttachments() throws Exception { public void marshalAttachments() throws Exception {
marshaller = new Jaxb2Marshaller(); marshaller = new Jaxb2Marshaller();

Loading…
Cancel
Save