Skip to content

Commit f9cbce6

Browse files
committed
Merge branch 'master' of https://github.com/JavaMoney/jsr354-ri
2 parents ba3da0f + c2b0ebc commit f9cbce6

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ http://javamoney.github.io/ri.html
1111

1212
This module is licenced under the the [Apache 2 Licence](https://www.apache.org/licenses/LICENSE-2.0.html).
1313

14-
[![Build Status](https://api.travis-ci.org/JavaMoney/jsr354-ri.png?branch=master)](https://travis-ci.org/JavaMoney/jsr354-ri)
15-
[![Coverage Status](https://coveralls.io/repos/JavaMoney/jsr354-ri/badge.png)](https://coveralls.io/r/JavaMoney/jsr354-ri)
14+
[![Build Status](https://api.travis-ci.org/JavaMoney/jsr354-ri.png?branch=master)](https://travis-ci.org/JavaMoney/jsr354-ri) [![License](http://img.shields.io/badge/license-Apache2-red.svg)](http://opensource.org/licenses/apache-2.0)
1615

1716
[![Built with Maven](http://maven.apache.org/images/logos/maven-feather.png)](http://maven.org/)

src/test/java/org/javamoney/moneta/MoneyTest.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,4 +1167,19 @@ public void testDivide_WrongCurrency() {
11671167
Money m2 = Money.of(BigDecimal.TEN, "CHF");
11681168
m1.subtract(m2);
11691169
}
1170+
1171+
@Test(expectedExceptions = ArithmeticException.class)
1172+
public void testCreatingFromDoubleNan(){
1173+
Money.of(Double.NaN, "XXX");
1174+
}
1175+
1176+
@Test(expectedExceptions = ArithmeticException.class)
1177+
public void testCreatingFromDoublePositiveInfinity(){
1178+
Money.of(Double.POSITIVE_INFINITY, "XXX");
1179+
}
1180+
1181+
@Test(expectedExceptions = ArithmeticException.class)
1182+
public void testCreatingFromDoubleNegativeInfinity(){
1183+
Money.of(Double.NEGATIVE_INFINITY, "XXX");
1184+
}
11701185
}

src/test/java/org/javamoney/moneta/RoundedMoneyTest.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,4 +1109,19 @@ public void testDivide_WrongCurrency() {
11091109
m1.subtract(m2);
11101110
}
11111111

1112+
@Test(expectedExceptions = ArithmeticException.class)
1113+
public void testCreatingFromDoubleNan(){
1114+
RoundedMoney.of(Double.NaN, "XXX");
1115+
}
1116+
1117+
@Test(expectedExceptions = ArithmeticException.class)
1118+
public void testCreatingFromDoublePositiveInfinity(){
1119+
RoundedMoney.of(Double.POSITIVE_INFINITY, "XXX");
1120+
}
1121+
1122+
@Test(expectedExceptions = ArithmeticException.class)
1123+
public void testCreatingFromDoubleNegativeInfinity(){
1124+
RoundedMoney.of(Double.NEGATIVE_INFINITY, "XXX");
1125+
}
1126+
11121127
}

0 commit comments

Comments
 (0)