public class DecimalTest extends TestCase {
public void testDecimal(){
GetHistoricNavResponse getHistoricNavResponse = new GetHistoricNavResponse();
ArrayOfDecimal arrayOfDecimal = new ArrayOfDecimal();
getHistoricNavResponse.setOut(arrayOfDecimal);
arrayOfDecimal.addDecimal(null);
arrayOfDecimal.addDecimal(null);
arrayOfDecimal.addDecimal(new BigDecimal("111.38"));
arrayOfDecimal.addDecimal(new BigDecimal("111.38"));
arrayOfDecimal.addDecimal(new BigDecimal("111.38"));
arrayOfDecimal.addDecimal(new BigDecimal("111.54"));
try {
OMElement omElement = getHistoricNavResponse.getOMElement(GetHistoricNavResponse.MY_QNAME,
OMAbstractFactory.getOMFactory());
String omElementString = omElement.toStringWithConsume();
System.out.println("OM String ==> " + omElementString);
XMLStreamReader xmlReader =
StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
GetHistoricNavResponse result = GetHistoricNavResponse.Factory.parse(xmlReader);
assertEquals(result.getOut().getDecimal()[0], null);
assertEquals(result.getOut().getDecimal()[1], null);
assertEquals(result.getOut().getDecimal()[2].toString(), "111.38");
assertEquals(result.getOut().getDecimal()[3].toString(), "111.38");
assertEquals(result.getOut().getDecimal()[4].toString(), "111.38");
assertEquals(result.getOut().getDecimal()[5].toString(), "111.54");
} catch (ADBException e) {
fail();
} catch (XMLStreamException e) {
fail();
} catch (Exception e) {