You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For Comparable only two notices appears in section 4.2.2.:
must be comparable
Comparison methods for comparing two arbitrary amounts of the same currency, hereby comparing
based on the (effective) numeric value (e.g. ignoring trailing zeroes).
When I run the TCK I get the following error report:
[FAILED] 4.2.2 For each amount class, test is Comparable.(ModellingMonetaryAmountsTest#testImplementComparable):
java.lang.AssertionError: Section 4.2.2: Comparable failed for: de.jfachwert.bank.Geldbetrag
at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
at org.javamoney.tck.tests.ModellingMonetaryAmountsTest.testImplementComparable(ModellingMonetaryAmountsTest.java:2522)
...
The input values for failed tests are:
amount = "0 XXX"
amount3 = "1 CHF"
The failing assert is assertTrue(amount.compareTo(amount3) > 0), or in other words
"0 XXX" > "1 CHF" should be true.
This is not covered by the specification (see above - or did I miss something?) and also from the semantic view I would expect it the other way around.
The text was updated successfully, but these errors were encountered:
I believe the section of the spec you're referring to refers to the # isGreaterThan#isGreaterThanOrEqualTo, #isLessThan, #isLessThanOrEqualTo and #isEqualTo methods. I understand these methods are supposed to operate on the same currency and throw MonetaryException otherwise.
It is my understanding #equals and #compareTo are supposed to work on different currencies and are not supposed to throw MonetaryException.
For Comparable only two notices appears in section 4.2.2.:
based on the (effective) numeric value (e.g. ignoring trailing zeroes).
When I run the TCK I get the following error report:
The input values for failed tests are:
The failing assert is
assertTrue(amount.compareTo(amount3) > 0)
, or in other wordsThis is not covered by the specification (see above - or did I miss something?) and also from the semantic view I would expect it the other way around.
The text was updated successfully, but these errors were encountered: