* Test to insure that a JAX-RPC Value Type works correctly. PreferredStockInvestment
* subclasses StockInvestment and should pass data members in both the Investment,
* StockInvestment, and PreferredStockInvestment classes across the wire correctly.
*/
public void testPreferredStockInvestment() throws RemoteException {
PreferredStockInvestment oldStock = new PreferredStockInvestment();
oldStock.setName("SOAP Inc.");
oldStock.setId(202);
oldStock.setTradeExchange("NASDAQ");
oldStock.setLastTradePrice(10.50F);
oldStock.setDividendsInArrears(100.44D);
oldStock.setPreferredYield(new BigDecimal("7.00"));
PreferredStockInvestment newStock = binding.getDividends(oldStock);
assertEquals("The expected and actual values did not match.",
newStock.getName(),
"AXIS Inc.");
assertEquals("The expected and actual values did not match.",
203,
newStock.getId());
assertEquals("The expected and actual values did not match.",
"NASDAQ",
newStock.getTradeExchange());
assertEquals("The expected and actual values did not match.",
101.44D,
newStock.getDividendsInArrears(),
DOUBLE_DELTA);
assertEquals("The expected and actual values did not match.",
new BigDecimal("8.00"),
newStock.getPreferredYield());
assertEquals("The expected and actual values did not match.",
11.50F,
newStock.getLastTradePrice(),
FLOAT_DELTA);
} // testPreferredStockInvestment