MCPcopy Create free account
hub / github.com/amazon-ion/ion-java / testBigDecimals

Method testBigDecimals

src/test/java/com/amazon/ion/IntTest.java:210–222  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

208 }
209
210 @Test
211 public void testBigDecimals() {
212 BigDecimal big = new BigDecimal(SUPER_BIG.multiply(BigInteger.TEN), 1);
213 IonInt val = system().newInt(big);
214 assertEquals(SUPER_BIG, val.bigIntegerValue());
215 assertEquals(SUPER_BIG_TRUNC_64, val.longValue());
216 assertEquals(SUPER_BIG_TRUNC_32, val.intValue());
217
218 assertEquals(SUPER_BIG.hashCode(), val.hashCode());
219
220 IonNumber result = (IonNumber) reload(val);
221 assertEquals(0, big.compareTo(result.bigDecimalValue()));
222 }
223
224 @Test
225 public void testSetLongAfterSetBig() {

Callers

nothing calls this directly

Calls 10

bigIntegerValueMethod · 0.95
longValueMethod · 0.95
intValueMethod · 0.95
bigDecimalValueMethod · 0.95
compareToMethod · 0.80
newIntMethod · 0.65
hashCodeMethod · 0.65
systemMethod · 0.45
assertEqualsMethod · 0.45
reloadMethod · 0.45

Tested by

no test coverage detected