Example usage for org.springframework.batch.item.xml.domain QualifiedTrade QualifiedTrade

List of usage examples for org.springframework.batch.item.xml.domain QualifiedTrade QualifiedTrade

Introduction

In this page you can find the example usage for org.springframework.batch.item.xml.domain QualifiedTrade QualifiedTrade.

Prototype

public QualifiedTrade(String isin, long quantity, BigDecimal price, String customer) 

Source Link

Usage

From source file:org.springframework.batch.item.xml.Jaxb2NamespaceMarshallingTests.java

protected Marshaller getMarshaller() throws Exception {

    Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
    marshaller.setClassesToBeBound(new Class<?>[] { QualifiedTrade.class });
    marshaller.afterPropertiesSet();/*from  w  ww .  j  ava  2s .  com*/

    StringWriter string = new StringWriter();
    marshaller.marshal(new QualifiedTrade("FOO", 100, BigDecimal.valueOf(10.), "bar"),
            new StreamResult(string));
    String content = string.toString();
    assertTrue("Wrong content: " + content, content.contains("<customer>bar</customer>"));
    return marshaller;
}