use of org.springframework.oxm.jaxb.Jaxb2Marshaller in project citrus-samples by christophd.
the class EndpointConfig method marshaller.
@Bean
public Marshaller marshaller() {
Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
marshaller.setContextPath("com.consol.citrus.samples.todolist.model");
return marshaller;
}
use of org.springframework.oxm.jaxb.Jaxb2Marshaller in project cia by Hack23.
the class XmlAgentImplITest method unmarshallXmlMissingNamespaceSuccessTest.
/**
* Unmarshall xml missing namespace success test.
*
* @throws XmlAgentException
* the xml agent exception
*/
@Test
public void unmarshallXmlMissingNamespaceSuccessTest() throws XmlAgentException {
final Jaxb2Marshaller jaxb2Marshaller = new Jaxb2Marshaller();
jaxb2Marshaller.setClassesToBeBound(SimpleXml.class);
final SimpleXml simpleXml = (SimpleXml) xmlAgent.unmarshallXml(jaxb2Marshaller, XmlAgentImplITest.class.getResource("/simplexml-missing-namespace.xml").toString(), "com.hack23.cia.service.external.common.impl.test", null, null);
assertEquals(new SimpleXml("abc123"), simpleXml);
}
use of org.springframework.oxm.jaxb.Jaxb2Marshaller in project cia by Hack23.
the class XmlAgentImplITest method unmarshallXmlSuccessTest.
/**
* Unmarshall xml success test.
*
* @throws XmlAgentException
* the xml agent exception
*/
@Test
public void unmarshallXmlSuccessTest() throws XmlAgentException {
final Jaxb2Marshaller jaxb2Marshaller = new Jaxb2Marshaller();
jaxb2Marshaller.setClassesToBeBound(SimpleXml.class);
final SimpleXml simpleXml = (SimpleXml) xmlAgent.unmarshallXml(jaxb2Marshaller, XmlAgentImplITest.class.getResource("/simplexml.xml").toString());
assertEquals(new SimpleXml("abc123"), simpleXml);
}
use of org.springframework.oxm.jaxb.Jaxb2Marshaller in project cia by Hack23.
the class XmlAgentImplITest method unmarshallXmlMissingNamespaceAndReplaceSuccessTest.
/**
* Unmarshall xml missing namespace and replace success test.
*
* @throws XmlAgentException
* the xml agent exception
*/
@Test
public void unmarshallXmlMissingNamespaceAndReplaceSuccessTest() throws XmlAgentException {
final Jaxb2Marshaller jaxb2Marshaller = new Jaxb2Marshaller();
jaxb2Marshaller.setClassesToBeBound(SimpleXml.class);
final SimpleXml simpleXml = (SimpleXml) xmlAgent.unmarshallXml(jaxb2Marshaller, XmlAgentImplITest.class.getResource("/simplexml-missing-namespace.xml").toString(), "com.hack23.cia.service.external.common.impl.test", "abc123", "ABC123");
assertEquals(new SimpleXml("ABC123"), simpleXml);
}
use of org.springframework.oxm.jaxb.Jaxb2Marshaller in project nextprot-api by calipho-sib.
the class SiteMapMarshaller method afterPropertiesSet.
@Override
public void afterPropertiesSet() throws Exception {
Jaxb2Marshaller m = new Jaxb2Marshaller();
m.setClassesToBeBound(SitemapUrlSet.class, SitemapUrl.class);
this.setMarshaller(m);
}
Aggregations