for ( int i = 0; it.hasNext( ); )
{
String prefix = "order#" + i;
OrderItemValue value = ( OrderItemValue ) it.next( );
ItemValue item = value.getItem( );
assertNotNull( prefix + ".item", value.getItem( ) );
if ( "EST-1".equals( item.getItemId( ) ) )
{
assertEquals( prefix + ".quantity", 10, value.getQuantity( ) );
assertEquals( prefix + ".unitPrice", 16.5, value.getUnitPrice( ), 0 );
}
else if ( "EST-10".equals( item.getItemId( ) ) )
{
assertEquals( prefix + ".quantity", 1, value.getQuantity( ) );
assertEquals( prefix + ".unitPrice", 28.5, value.getUnitPrice( ), 0 );
}
else
{
fail( prefix + ".id is invalid: " + item.getItemId( ) );
}
}
}
catch ( Exception e )
{