()
| 1473 | } |
| 1474 | |
| 1475 | @Test |
| 1476 | public void testSUMFinal() throws Exception { |
| 1477 | String[] sumTypes = {"SUMFinal", "DoubleSumFinal", "LongSumFinal", "IntSumFinal", "FloatSumFinal", "BigDecimalSumFinal", "BigIntegerSumFinal"}; |
| 1478 | for (int k = 0; k < sumTypes.length; k++) { |
| 1479 | EvalFunc<?> sum = evalFuncMap.get(sumTypes[k]); |
| 1480 | String inputType = getInputType(sumTypes[k]); |
| 1481 | Tuple tup = inputMap.get(inputType); |
| 1482 | Object output = sum.exec(tup); |
| 1483 | |
| 1484 | String msg = "[Testing " + sumTypes[k] + " on input type: " + getInputType(sumTypes[k]) + " ( (output) " + |
| 1485 | output + " == " + getExpected(sumTypes[k]) + " (expected) )]"; |
| 1486 | |
| 1487 | if (inputType.equals("Integer") || inputType.equals("Long") || inputType.equals("IntegerAsLong")) { |
| 1488 | assertEquals(msg, (Long)output, (Long)getExpected(sumTypes[k]), 0.00001); |
| 1489 | } |
| 1490 | //Assert Equals does not support BigDecimal or BigInteger. Converting into String |
| 1491 | else if (inputType == "BigDecimal") |
| 1492 | assertEquals(msg, ((BigDecimal) output).toPlainString(), ((BigDecimal)getExpected(sumTypes[k])).toPlainString()); |
| 1493 | else if (inputType == "BigInteger") |
| 1494 | assertEquals(msg, ((BigInteger) output).toString(), ((BigInteger)getExpected(sumTypes[k])).toString()); |
| 1495 | else { |
| 1496 | assertEquals(msg, (Double)output, (Double)getExpected(sumTypes[k]), 0.00001); |
| 1497 | } |
| 1498 | } |
| 1499 | } |
| 1500 | |
| 1501 | @Test |
| 1502 | public void testMIN() throws Exception { |
nothing calls this directly
no test coverage detected