JavaMoney/jsr354-ri — pull request #52 by marschall (2014-10-30 20:11:57+00:00)
Title: Tests for Special Doubles

Add Tests for passing the special doubles POSITIVE_INFINITY,
NEGATIVE_INFINITY and NaN to #multiply and #divide.

* multiplying with POSITIVE_INFINITY should throw ArithmeticException
because it overflows
* multiplying with NEGATIVE_INFINITY should throw ArithmeticException
because it overflows
* multiplying with NaN should throw ArithmeticException
* dividing by POSITIVE_INFINITY should return 0
* dividing by NEGATIVE_INFINITY should return 0
* dividing by NaN should throw ArithmeticException

For FastMoney:

* multiplying with POSITIVE_INFINITY returns the biggest possible
FastMoney because Math.round rounds POSITIVE_INFINITY to
Long.MAX_VALUE
* multiplying with NEGATIVE_INFINITY returns the smallest possible
FastMoney because Math.round rounds NEGATIVE_INFINITY to
Long.MIN_VALUE
* dividing by NaN returns 0 because Math.round rounds NaN to 0

For Money:

* multiplying with any of the three throws NumberFormatException
because their string representation can not be parsed
* dividing by any of the three throws NumberFormatException
because their string representation can not be parsed

This commit contains failing tests.

There are still issues untested related to using Math.round in
FastMoney.multiply. For example multiplying 90000000000000L with
90000000000000L will overflow and throw ArithmeticException. However
multiplying 90000000000000L * 90000000000000d will be rounded to
Long.MAX_VALUE.