Examples of QualifiedTrade


Examples of org.springframework.batch.item.xml.domain.QualifiedTrade

    Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
    marshaller.setClassesToBeBound(new Class<?>[] { QualifiedTrade.class });
    marshaller.afterPropertiesSet();
   
    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;
  }
View Full Code Here

Examples of org.springframework.batch.item.xml.domain.QualifiedTrade

    reader.open(new ExecutionContext());
  }

  @Test
  public void testUnmarshal() throws Exception {
    QualifiedTrade trade = (QualifiedTrade) getUnmarshaller().unmarshal(
        new StreamSource(new StringReader(TRADE_XML)));
    assertEquals("XYZ0001", trade.getIsin());
    assertEquals(5, trade.getQuantity());
    assertEquals(new BigDecimal("11.39"), trade.getPrice());
    assertEquals("Customer1", trade.getCustomer());
  }
View Full Code Here

Examples of org.springframework.batch.item.xml.domain.QualifiedTrade

    assertEquals("Customer1", trade.getCustomer());
  }

  @Test
  public void testRead() throws Exception {
    QualifiedTrade result;
    List<QualifiedTrade> results = new ArrayList<QualifiedTrade>();
    while ((result = reader.read()) != null) {
      results.add(result);
    }
    checkResults(results);
View Full Code Here

Examples of org.springframework.batch.item.xml.domain.QualifiedTrade

   * @param results list of domain objects returned by input source
   */
  protected void checkResults(List<QualifiedTrade> results) {
    assertEquals(3, results.size());

    QualifiedTrade trade1 = results.get(0);
    assertEquals("XYZ0001", trade1.getIsin());
    assertEquals(5, trade1.getQuantity());
    assertEquals(new BigDecimal("11.39"), trade1.getPrice());
    assertEquals("Customer1", trade1.getCustomer());

    QualifiedTrade trade2 = results.get(1);
    assertEquals("XYZ0002", trade2.getIsin());
    assertEquals(2, trade2.getQuantity());
    assertEquals(new BigDecimal("72.99"), trade2.getPrice());
    assertEquals("Customer2", trade2.getCustomer());

    QualifiedTrade trade3 = results.get(2);
    assertEquals("XYZ0003", trade3.getIsin());
    assertEquals(9, trade3.getQuantity());
    assertEquals(new BigDecimal("99.99"), trade3.getPrice());
    assertEquals("Customer3", trade3.getCustomer());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.