JSR 354 Money and Currency TCK Coverage

1.0.0

Contents

Chapter Summary
Section Summary
Coverage Detail
Unmatched Tests
Unversioned Tests
Test Group Summary

Coverage Distribution

 
 
 
 
 
 
 
 
 
 

Chapter Summary

Chapter Assertions Testable Total Tested Total Tests Tested
(problematic)
Tested
(working)
Coverage %
0 TCK Setup111001100.00%
1 Introduction, Use Cases, Requirements (no tests)000000
2 Use Cases000000
3 Requirements000000
4 Specification1681661662410166100.00%
5 Meta-Data Contexts and Query Models000000
6 Implementation Recommendations000000
7 Examples000000
Total1691671672410167100.00%

Section Summary

SectionAssertionsTestableTotal TestedTested
(problematic)
Tested
(working)
Coverage %
0 TCK Setup11101100.00%
1 Introduction, Use Cases, Requirements (no tests)00000
2 Use Cases00000
3 Requirements00000
3.1 Core Requirements00000
3.2 Formatting Requirements00000
3.3 EE and ME Support00000
3.4 Non Functional Requirements00000
4 Specification00000
4.1 Package and Project Structure00000
4.1.1 Package Overview00000
4.1.2 Module/Repository Overview00000
4.2 Money and Currency Core API00000
4.2.1 Modelling of Currencies109909100.00%
4.2.2 Modeling of Monetary Amounts605959059100.00%
4.2.3 Externalizing the Numeric Value of an Amount323232032100.00%
4.2.4 Functional Extension Points11101100.00%
4.2.5 The Monetary Context00000
4.2.6 Creating Monetary Amount Instances181818018100.00%
4.2.7 Accessing Currencies, Amounts and Roundings141414014100.00%
4.2.8 Additional Functional Support00000
4.2.9 Exception Types00000
4.3 Currency Conversion00000
4.3.1 Accessing Monetary Conversions77707100.00%
4.3.2 Converting Amounts44404100.00%
4.3.3 Exchange Rates and Rate Providers33303100.00%
4.3.4 ExchangeRateProvider Chains33303100.00%
4.4 Money and Currency Formatting API00000
4.4.1 Formatting of Monetary Amounts44404100.00%
4.4.2 Configuring a Monetary Amount Formatter11101100.00%
4.4.3 MonetaryFormats Accessor Singleton33303100.00%
4.4.4 Formatting Exceptions00000
4.5 Money and Currency SPI00000
4.5.1 Core SPI55505100.00%
4.5.2 Currency Conversion SPI22202100.00%
4.5.3 Formatting SPI11101100.00%
4.5.4 The Bootstrapping Mechanism00000
5 Meta-Data Contexts and Query Models00000
5.1 Overview00000
5.2 AbstractContext00000
5.3 AbstractQueryBuilder00000
6 Implementation Recommendations00000
6.1 Overview00000
6.2 Monetary Arithmetic00000
6.3 Numeric Precision00000
7 Examples00000

Coverage Detail

Colour Key
Assertion is covered
Assertion is not covered
Assertion test is unimplemented
Assertion is untestable

Section 0 - TCK Setup

Tests the correct setup of the TCK

Setup)

Ensure an implementation of org.javamoney.tck.JSR354TestConfiguration is registered using the java.util.ServiceLoader.

Coverage

org.javamoney.tck.tests
TCKSetupTest.testTestSetup()
TCKSetupTest.testTestAmountConfiguration()

Section 4.2.1 - Modelling of Currencies

A. Managing the Currency code

421-A1)

Ensure at least one javax.money.CurrencyUnit implementation is available and registered/accessible from MonetaryCurrencies.

Coverage

org.javamoney.tck.tests
ModellingCurrenciesTest.testEnsureCurrencyUnit()
421-A2)

Test that currencies returned for same ISO currency code are equal, ensure when listing all available currencies, that the code is unique.

Coverage

org.javamoney.tck.tests
ModellingCurrenciesTest.testEqualISOCurrencies()
421-A3)

Ensure all ISO 3-letters codes as defined by the JDK are also available from MonetaryCurrencies.

Coverage

org.javamoney.tck.tests
ModellingCurrenciesTest.testEnforce3LetterCode4ISO()
421-A4)

Test that JDK currencies returned match the values of corresponding JDK Currency (code, numeric code, default fraction digits).

Coverage

org.javamoney.tck.tests
ModellingCurrenciesTest.testISOCodes()

B. Currency Unit Implementation Requirements

421-B1)

CurrencyUnit must implement hashCode.

Coverage

org.javamoney.tck.tests
ModellingCurrenciesTest.testCurrencyClassesEqualsHashcode()
421-B2)

CurrencyUnit must implement equals.

Coverage

org.javamoney.tck.tests
ModellingCurrenciesTest.testImplementsEquals()
421-B3)

CurrencyUnit implementation must be Comparable.

Coverage

org.javamoney.tck.tests
ModellingCurrenciesTest.testCurrencyClassesComparable()
421-B4)

CurrencyUnit implementation must be immutable.

Coverage

org.javamoney.tck.tests
ModellingCurrenciesTest.testIsImmutable()
421-B5)

CurrencyUnit implementation must be thread safe.

421-B6)

CurrencyUnit implementation must be serializable.

Coverage

org.javamoney.tck.tests
ModellingCurrenciesTest.testImplementsSerializable()

Section 4.2.2 - Modeling of Monetary Amounts

Preconditions

422-0)

Ensure at least one javax.money.MonetaryAmount implementation is registered, by calling MonetaryAmounts.getAmountTypes();

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testEnsureMonetaryAmount()

A. Data Interoperability

422-A1)

For each MonetaryAmount implementation: Ensure getCurrencyCode returns correct results.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testCurrencyCode()
422-A2)

For each MonetaryAmount implementation: Ensure getNumber() returns correct results.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testGetNumber()
422-A3)

For each MonetaryAmount implementation: Ensure getMonetaryContext() returns correct results.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testGetMonetaryContext()
422-A4)

For each MonetaryAmount implementation: Ensure isNegative() returns correct results.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testIsNegative()
422-A5)

For each MonetaryAmount implementation: Ensure isPositive() returns correct results.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testIsPositive()
422-A6)

For each MonetaryAmount implementation: Ensure isZero() returns correct results (-0, +0 == 0).

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testIsZero()
ModellingMonetaryAmountsTest.testIsZeroAdvanced()
422-A7)

For each MonetaryAmount implementation: signum() function is implemented correctly.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testSignum()
422-A8)

For each MonetaryAmount implementation: Ensure isNegativeOrZero() returns correct results.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testIsNegativeOrZero()
422-A9)

For each MonetaryAmount implementation: Ensure isPositiveOrZero() returns correct results.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testIsPositiveOrZero()

B. Prototyping Support

422-B1)

Ensure getFactory returns a MonetaryAmountFactory and that instances created are of the same type.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testMonetaryAmountFactories()
422-B2)

Call getFactory(), create a new MonetaryAmount instance, with same input. The instances must be equal (or even be identical!).

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testMonetaryAmountFactories_InstancesMustBeEqual()
422-B3)

Call getFactory(), create a new MonetaryAmount instance with a new number value. The instances must be non equal and have the according numeric value.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testMonetaryAmountFactories_InstantesMustBeNotEqual()
422-B4)

Call getFactory(), create a new MonetaryAmount instance with a new currency value. The instances must be non equal and have the according currency value. Do this by code and by passing a CurrencyUnit.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testMonetaryAmountFactories_CreateWithCurrencies()
422-B5)

Call getFactory(), create a new MonetaryAmount instance with a new monetary context (if possible - check the max context). The instances must be non equal and have the same currency and number value.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testMonetaryAmountFactories_CreateWithMonetaryContext()
422-B6)

Call getFactory(), create a new MonetaryAmount instance with a new monetary context, a new number and a new currency. The instances must be non equal.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testMonetaryAmountFactories_CreateWithMonetaryContextNumberAndCurrency()

C. Comparison Methods

422-C1)

The isGreaterThan() implemented correctly.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testMonetaryAmount_isGreaterThan()
422-C2)

The isGreaterThanOrEqals() implemented correctly, regardless of trailing zeroes.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testMonetaryAmount_isGreaterThanOrEquals()
422-C3)

The isLessThan() implemented correctly.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testMonetaryAmount_isLessThan()
422-C4)

The isLessThanOrEqals() implemented correctly, regardless of trailing zeroes.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testMonetaryAmount_isLessThanOrEqualTo()
422-C5)

For two amounts with same numeric value and currency: isEqualTo() return true, regardless of trailing zeroes.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testMonetaryAmount_isEqualTo()
422-C6)

For two amounts with same numeric value and currency: isEqualTo() return true, regardless of MonetaryContext.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testMonetaryAmount_isEqualToRegardlessMonetaryContext()
422-C7)

For two amounts with same numeric value and currency: isEqualTo() return true, regardless of Implementation Type.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testMonetaryAmount_isEqualToRegardlessType()

D. Basic Arithmetic Operations

422-D1)

Tests that add() correctly adds two values.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testAddPositiveIntegers()
ModellingMonetaryAmountsTest.testAddNegativeIntegers()
ModellingMonetaryAmountsTest.testAddPositiveFractions()
ModellingMonetaryAmountsTest.testAddMixedIntegers()
ModellingMonetaryAmountsTest.testAddMixedFractions()
422-D2)

Tests that add() with non matching currencies throws a MonetaryException.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testAdd_IncompatibleCurrencies()
422-D3)

Tests that add(0) should return itself.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testAdd_Zero()
422-D4)

Tests that add() which results in an amount exceeding the max MonetaryContext throws a MonetaryException.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testAdd_ExceedsCapabilities()
422-D5)

Tests that add(null) throws an NullPointerException.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testAdd_Null()
422-D6)

subtract() must subtract a value from another.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testSubtractPositiveIntegers()
ModellingMonetaryAmountsTest.testSubtractNegativeIntegers()
ModellingMonetaryAmountsTest.testSubtractPositiveFractions()
ModellingMonetaryAmountsTest.testSubtractMixedIntegers()
ModellingMonetaryAmountsTest.testSubtractMixedFractions()
422-D7)

subtract(0) should return itself.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testSubtract_Zero()
422-D8)

subtract() with non matching currencies must throw a MonetaryException.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testSubtract_IncompatibleCurrencies()
422-D9)

subtract() which results in an amount exceeding the max MonetaryContext must throw a MonetaryException.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testSubtract_ExceedsCapabilities()
422-D10)

subtract(null) must throw an NullPointerException.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testSubtract_Null()
422-D11)

multiply() allow to multiply numbers.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testMultiply_Integral()
ModellingMonetaryAmountsTest.testMultiply_Decimals()
422-D12)

multiply(1) should return itself.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testMultiplyOne()
422-D13)

multiply() which results in an amount exceeding the max MonetaryContext must throw a MonetaryException.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testMultiplyExceedsCapabilities()
422-D14)

multiply(null) must throw an NullPointerException.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testMultiplyNull()
ModellingMonetaryAmountsTest.testMultiply_DoubleNaN()
ModellingMonetaryAmountsTest.testMultiply_DoublePOSITIVE_INFINITY()
ModellingMonetaryAmountsTest.testMultiply_DoubleNEGATIVE_INFINITY()
422-D15)

divide() function allow to divide numbers.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testDivide()
ModellingMonetaryAmountsTest.testDivideToIntegralValue()
422-D16)

divide(0) function must throw an ArithmeticException.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testDivideZero()
ModellingMonetaryAmountsTest.testDivideDoubleNaN()
ModellingMonetaryAmountsTest.testDivideDoublePOSITIVE_INFINITY()
ModellingMonetaryAmountsTest.testDivideDoubleNEGATIVE_INFINITY()
422-D17)

divide(1) should return itself.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testDivideOne()
422-D18)

divide(null) must throw an NullPointerException.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testDivideNull()
422-D19)

remainder() allow to calculate the remainder.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testRemainder()
422-D20)

remainder(0) must throw an ArithmeticException.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testRemainderZero_Double()
ModellingMonetaryAmountsTest.testRemainderZero_Long()
ModellingMonetaryAmountsTest.testRemainderZero_Number()
422-D21)

remainder(null) must throw an NullPointerException.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testRemainderNull()
ModellingMonetaryAmountsTest.testRemainder_DoubleNaN()
ModellingMonetaryAmountsTest.testRemainder_DoublePOSITIVE_INFINITY()
ModellingMonetaryAmountsTest.testRemainder_DoubleNEGATIVE_INFINITY()
422-D22)

divideAndRemainder() allow to divide/remind numbers.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testDivideAndRemainder()
422-D23)

divideAndRemainder(0) must throw an ArithmeticException.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testDivideAndRemainderZero()
422-D24)

divideAndRemainder(null) must throw an NullPointerException.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testDivideAndRemainderNull()
ModellingMonetaryAmountsTest.testDivideAndRemainderDoubleNaN()
ModellingMonetaryAmountsTest.testDivideAndRemainderDoublePOSITIVE_INFINITY()
ModellingMonetaryAmountsTest.testDivideAndRemainderDoubleNEGATIVE_INFINITY()
422-D25)

divideAndRemainder(1) must retzrn -8itself, 0).

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testDivideAndRemainderOne()
422-D26)

scaleByPowerOfTen() allow to scale by power of 10.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testScaleByPowerOfTen()
422-D27)

abs() allow to calculate the absolute value.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testAbsolute()
422-D28)

negate() function allow to negate the value.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testNegate()

E. Functional Extension Points

422-E1)

Ensure with(MonetaryOperator) can be called and produces amounts of the same type and correct value.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testWith()
ModellingMonetaryAmountsTest.testWith4ProvidedOperators()
422-E2)

When an invalid operator is passed (throwing any exception), a MonetaryException must be thrown. When null is passed, an NPE must be thrown.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testWithInvalidOperator()
ModellingMonetaryAmountsTest.testWithNull()
ModellingMonetaryAmountsTest.testWithNull4ProvidedOperators()
422-E3)

Ensure query(MonetaryQUery) can be called and produces valuable results.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testQuery()
422-E4)

When an invalid query is passed (throwing any exception), a MonetaryException must be thrown. When null is passed, an NPE must be thrown.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testQueryInvalidQuery()
ModellingMonetaryAmountsTest.testQueryNull()

F. Monetary Amount Implementation Requirements

422-F1)

Implementations of MonetaryAmount must implement hashCode, considering number, currency and implementation type, monetary context.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testImplementsHashCode()
422-F2)

Implementations of MonetaryAmount must implement equals, considering number, currency and implementation type, monetary context.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testImplementsEquals()
422-F3)

Implementations of MonetaryAmount must be Comparable.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testImplementComparable()
422-F4)

Implementations of MonetaryAmount must be immutable.

Coverage

org.javamoney.tck.tests
ModellingMonetaryAmountsTest.testImmutable()
422-F5)

Implementations of MonetaryAmount should be thread-safe.

Section 4.2.3 - Externalizing the Numeric Value of an Amount

A. Testing Numeric Externalization for positive values

423-A1)

Checks if number type is not null and returning a concrete (no abstract class or interface).

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testReturningNumberValueIsNotNull()
423-A2)

Check if a correct integer value is returned, no truncation is allowed to be performed.

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testValidInteger()
423-A3)

Check if a correct long value is returned, no truncation is allowed to be performed.

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testValidLong()
423-A4)

Check if a correct double value is returned, no truncation is allowed to be performed.

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testValidDouble()
423-A5)

Check if a correct number value is returned, no truncation is allowed to be performed. Check should be done for every JDK type supported.

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testValidNumberBD()
ExternalizingNumericValueTest.testValidNumberBI()
423-A6)

Check if a correct integer value is returned, truncation is allowed to be performed.

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testValidIntegerWithTruncation()
423-A7)

Check if a correct long value is returned, truncation is allowed to be performed.

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testValidLongWithTruncation()
423-A8)

Check if a correct double value is returned, truncation is allowed to be performed.

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testValidDoubleWithTruncation()
423-A9)

Check if a correct number value is returned, truncation is allowed to be performed. Check should be done for every JDK type supported.

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testValidNumberWithTruncation_Byte()
ExternalizingNumericValueTest.testValidNumberWithTruncation_Short()
ExternalizingNumericValueTest.testValidNumberWithTruncation_Float()
ExternalizingNumericValueTest.testValidNumberWithTruncation_Double()
ExternalizingNumericValueTest.testValidNumberWithTruncation_Integer()
423-A10)

Test correct precision values, including border cases.

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testPrecisionValues()
423-A11)

Test correct scale values, including border cases.

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testScaleValues()

B. Testing Numeric Externalization for negative values

423-B1)

Checks if number type is not null and returning a concrete (no abstract class or interface).

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testNumberTypeNegative()
423-B2)

Check if a correct integer value is returned, no truncation is allowed to be performed.

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testIntegerNegative()
423-B3)

Check if a correct long value is returned, no truncation is allowed to be performed.

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testLongNegative()
423-B4)

Check if a correct double value is returned, no truncation is allowed to be performed.

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testDoubleNegative()
423-B5)

Check if a correct number value is returned, no truncation is allowed to be performed. Check should be done for every JDK type supported.

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testNumberWithTruncationNegative()
423-B6)

Check if a correct integer value is returned, truncation is allowed to be performed.

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testIntegerWithTruncationNegative()
423-B7)

Check if a correct long value is returned, truncation is allowed to be performed.

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testLongWithTruncationNegative()
423-B8)

Check if a correct double value is returned, truncation is allowed to be performed.

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testDoubleWithTruncationNegative()
423-B9)

Check if a correct number value is returned, truncation is allowed to be performed. Check should be done for every JDK type supported.

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testNumberValueWithTruncationNegative()
ExternalizingNumericValueTest.testNumberValueWithTruncationNegative_Short()
ExternalizingNumericValueTest.testNumberValueWithTruncationNegative_Integer()
ExternalizingNumericValueTest.testNumberValueWithTruncationNegative_Long()
ExternalizingNumericValueTest.testNumberValueWithTruncationNegative_Float()
ExternalizingNumericValueTest.testNumberValueWithTruncationNegative_Double()
423-B10)

Test correct precision values, including border cases.

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testPrecisionNegative()
423-B11)

Test correct scale values, including border cases.

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testScaleNegative()

C. Testing Numeric Externalization for zero values

423-C1)

Checks if number type is not null and returning a concrete (no abstract class or interface).

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testNumberTypeZero()
423-C2)

Check if a correct integer value is returned, no truncation is allowed to be performed.

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testIntegerZero()
423-C3)

Check if a correct long value is returned, no truncation is allowed to be performed.

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testLongZero()
423-C4)

Check if a correct number value is returned, no truncation is allowed to be performed. Check should be done for every JDK type supported.

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testNumberValueZero()
423-C5)

Check if a correct integer value is returned, truncation is allowed to be performed (but is not necessary).

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testIntegerValueWithTruncationZero()
423-C6)

Check if a correct long value is returned, truncation is allowed to be performed (but is not necessary).

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testLongValueWithTruncationZero()
423-C7)

Check if a correct double value is returned, truncation is allowed to be performed (but is not necessary).

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testDoubleValueWithTruncationZero()
423-C8)

Check if a correct number value is returned, truncation is allowed to be performed (but is not necessary). Check should be done for every JDK type supported.

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testNumberValueWithTruncationZero()
423-C9)

Test correct precision values, including border cases.

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testPrecisionZero()
423-C10)

Test correct scale values, including border cases.

Coverage

org.javamoney.tck.tests
ExternalizingNumericValueTest.testScaleZero()

Section 4.2.4 - Functional Extension Points

A. Monetary Operator Implementation Requirements

424-A1)

The return type of apply must be the same type as the parameter (amount.getClass() == result.getClass()).

Coverage

org.javamoney.tck.tests
FunctionalExtensionPointsTest.testOperatorReturnTypeEqualsParameter()

Section 4.2.6 - Creating Monetary Amount Instances

A. Accessing MonetaryAmount Factories

426-A1)

Access a MonetaryAmountFactory for each registered type.

Coverage

org.javamoney.tck.tests
CreatingMonetaryAmountsTest.testAccessToMonetaryAmountFactory()
426-A2)

Checks if getAmountType returns the correct type.

Coverage

org.javamoney.tck.tests
CreatingMonetaryAmountsTest.testMonetaryAmountFactoryReturnsCorrectType()
426-A3)

Checks for default and max MonetaryContext.

Coverage

org.javamoney.tck.tests
CreatingMonetaryAmountsTest.testMonetaryAmountFactoryMinMaxCapabilities()
426-A4)

Checks if capabilities of default MonetaryContext are less than Max MonetaryContext.

Coverage

org.javamoney.tck.tests
CreatingMonetaryAmountsTest.testMonetaryAmountFactoryMinMaxCapabilities_Compare()

B. Testing Creation of Amounts with zero values

426-B1)

For each MonetaryAmount Factory: Create zero amounts from a factory with currencies.

Coverage

org.javamoney.tck.tests
CreatingMonetaryAmountsTest.testMonetaryAmountFactoryCreateZeroAmountsWithDiffCurrencies()
426-B2)

For each MonetaryAmount Factory: Create zero amounts from a factory with monetary contexts.

Coverage

org.javamoney.tck.tests
CreatingMonetaryAmountsTest.testMonetaryAmountFactoryCreateZeroAmountsWithDiffContexts()
CreatingMonetaryAmountsTest.testMonetaryAmountFactoryCreateZeroAmountsWithDiffContexts2()
CreatingMonetaryAmountsTest.testMonetaryAmountFactoryCreateZeroAmountsWithDiffContexts3()
426-B3)

For each MonetaryAmount Factory: Bad Case: Create zero amounts from a factory with an invalid currency.

Coverage

org.javamoney.tck.tests
CreatingMonetaryAmountsTest.testMonetaryAmountFactoryCreateAmountsWithInvalidCurrency()
426-B4)

For each MonetaryAmount Factory: Bad Case: Create zero amounts from a factory with an invalid MonetaryContext.

Coverage

org.javamoney.tck.tests
CreatingMonetaryAmountsTest.testMonetaryAmountFactoryCreateAmountsWithInvalidMonetaryContext()

C. Testing Creation of Amounts with positive values

426-C1)

For each MonetaryAmount Factory: Create positive amounts from a factory with currencies.

Coverage

org.javamoney.tck.tests
CreatingMonetaryAmountsTest.testMonetaryAmountFactoryCreatePositiveAmountsWitCurrencies()
426-C2)

For each MonetaryAmount Factory: Create positive amounts from a factory with monetary contexts.

Coverage

org.javamoney.tck.tests
CreatingMonetaryAmountsTest.testMonetaryAmountFactoryCreatePositiveAmountsWithContexts()
CreatingMonetaryAmountsTest.testMonetaryAmountFactoryCreatePositiveAmountsWithContexts2()
CreatingMonetaryAmountsTest.testMonetaryAmountFactoryCreatePositiveAmountsWithContexts3()
426-C3)

For each MonetaryAmount Factory: Bad Case: Create positive amounts from a factory with an invalid numeric value (exceeding max MonetaryContext).

Coverage

org.javamoney.tck.tests
CreatingMonetaryAmountsTest.testMonetaryAmountFactoryCreatePositiveAmountsWithInvalidNumber()
426-C4)

For each MonetaryAmount Factory: Bad Case: Create positive amounts from a factory with an invalid currency.

Coverage

org.javamoney.tck.tests
CreatingMonetaryAmountsTest.testMonetaryAmountFactoryCreatePositiveNoCurrency_BadCase()
CreatingMonetaryAmountsTest.testMonetaryAmountFactoryCreatePositiveInvalidCurrency_BadCase()
426-C5)

For each MonetaryAmount Factory: Bad Case: Create positive amounts from a factory with an invalid MonetaryContext.

Coverage

org.javamoney.tck.tests
CreatingMonetaryAmountsTest.testMonetaryAmountFactoryCreatePositiveInvalidContext_BadCase()

D. Testing Creation of Amounts with negative values

426-D1)

For each MonetaryAmount Factory: Create negative amounts from a factory with currencies.

Coverage

org.javamoney.tck.tests
CreatingMonetaryAmountsTest.testMonetaryAmountFactoryNegativePositiveAmountsWitCurrencies()
426-D2)

For each MonetaryAmount Factory: Create negative amounts from a factory with monetary contexts.

Coverage

org.javamoney.tck.tests
CreatingMonetaryAmountsTest.testMonetaryAmountFactoryNegativePositiveAmountsWithContexts()
CreatingMonetaryAmountsTest.testMonetaryAmountFactoryNegativePositiveAmountsWithContexts2()
CreatingMonetaryAmountsTest.testMonetaryAmountFactoryNegativePositiveAmountsWithContexts3()
426-D3)

For each MonetaryAmount Factory: Bad Case: Create negative amounts from a factory with an invalid numeric value (exceeding max MonetaryContext).

Coverage

org.javamoney.tck.tests
CreatingMonetaryAmountsTest.testMonetaryAmountFactoryNegativePositiveAmountsWithInvalidNumber()
426-D4)

For each MonetaryAmount Factory: Bad Case: Create negative amounts from a factory with an invalid currency.

Coverage

org.javamoney.tck.tests
CreatingMonetaryAmountsTest.testMonetaryAmountFactoryCreateNegativeNoCurrency_BadCase()
CreatingMonetaryAmountsTest.testMonetaryAmountFactoryCreateNegativeInvalidCurrency_BadCase()
426-D5)

For each MonetaryAmount Factory: Bad Case: Create negative amounts from a factory with an invalid MonetaryContext.

Coverage

org.javamoney.tck.tests
CreatingMonetaryAmountsTest.testMonetaryAmountFactoryCreateNegativeInvalidContext_BadCase()

Section 4.2.7 - Accessing Currencies, Amounts and Roundings

A. Accessing Currencies

427-A1)

Test if MonetaryCurrencies provides all ISO related entries, similar to the JDK.

Coverage

org.javamoney.tck.tests
AccessingCurrenciesAmountsRoundingsTest.testAllISOCurrenciesAvailable()
427-A2)

Test if MonetaryCurrencies provides all Locale related entries, similar to the JDK.

Coverage

org.javamoney.tck.tests
AccessingCurrenciesAmountsRoundingsTest.testAllLocaleCurrenciesAvailable()
427-A3)

Test if MonetaryCurrencies provides correct check for ISO codes.

Coverage

org.javamoney.tck.tests
AccessingCurrenciesAmountsRoundingsTest.testCorrectISOCodes()
427-A4)

Test if MonetaryCurrencies provides correct check for Locales.

Coverage

org.javamoney.tck.tests
AccessingCurrenciesAmountsRoundingsTest.testCorrectLocales()
427-A5)

Test for custom MonetaryCurrencies provided, based on the TCK TestProvider.

Coverage

org.javamoney.tck.tests
AccessingCurrenciesAmountsRoundingsTest.testCustomCurrencies()

B. Accessing Monetary Amount Factories

427-B1)

Ensure the types available, must be at least one type.

Coverage

org.javamoney.tck.tests
CreatingMonetaryAmountsTest.testMonetaryAmountTypes_Available()
427-B2)

Ensure amount factories are accessible for all types available, providing also the some test implementations with the TCK.

Coverage

org.javamoney.tck.tests
AccessingCurrenciesAmountsRoundingsTest.testAmountTypesProvided()
427-B3)

Ensure amount factories are accessible for all types available, providing also the some test implementations with the TCK, and that every factory accessed is a new instance.

Coverage

org.javamoney.tck.tests
AccessingCurrenciesAmountsRoundingsTest.testAmountTypesInstantiatable()
427-B4)

Ensure correct query function implementations, providing also the some test implementations with the TCK.

Coverage

org.javamoney.tck.tests
AccessingCurrenciesAmountsRoundingsTest.testAmountQueryType()
427-B5)

Ensure a default factory is returned. Test javamoney.config for configuring default value.

Coverage

org.javamoney.tck.tests
AccessingCurrenciesAmountsRoundingsTest.testAmountDefaultType()

C. Accessing Roundings

427-C1)

Access roundings using all defined currencies, including TCK custom currencies.

Coverage

org.javamoney.tck.tests
AccessingCurrenciesAmountsRoundingsTest.testAccessRoundingsForCustomCurrencies_Default()
AccessingCurrenciesAmountsRoundingsTest.testAccessRoundingsForCustomCurrencies_Explicit()
AccessingCurrenciesAmountsRoundingsTest.testAccessRoundingsForCustomCurrencies_Explicit_Null()
427-C2)

Access roundings using a MonetaryContext. Use different MathContext/RoundingMode, as an attribute, when running on the JDK.

Coverage

org.javamoney.tck.tests
AccessingCurrenciesAmountsRoundingsTest.testAccessRoundingsWithRoundingContext()
AccessingCurrenciesAmountsRoundingsTest.testAccessRoundingsWithMonetaryContext_Null()
427-C3)

Access custom roundings and ensure TCK custom roundings are registered.

Coverage

org.javamoney.tck.tests
AccessingCurrenciesAmountsRoundingsTest.testAccessCustomRoundings()
427-C4)

Test TCK custom roundings.

Coverage

org.javamoney.tck.tests
AccessingCurrenciesAmountsRoundingsTest.testCustomRoundings()
AccessingCurrenciesAmountsRoundingsTest.testCustomRoundings_Null()
AccessingCurrenciesAmountsRoundingsTest.testCustomRoundings_Foo()

Section 4.3.1 - Accessing Monetary Conversions

A. Test Basic MonetaryConversions Accessors

431-A1)

Ensure at least one conversion provider is accessible.

Coverage

org.javamoney.tck.tests.conversion
MonetaryConversionsTest.testProvidersAvailable()
431-A2)

Access and test different Currency Conversions for the provider in place.

Coverage

org.javamoney.tck.tests.conversion
MonetaryConversionsTest.testConversionsAreAvailable()
MonetaryConversionsTest.testConversionsAreAvailableWithQuery()
431-A3)

Access and test the provider's meta data.

Coverage

org.javamoney.tck.tests.conversion
MonetaryConversionsTest.testProviderMetadata()
MonetaryConversionsTest.testProviderMetadata2()
MonetaryConversionsTest.testProviderMetadata3()
MonetaryConversionsTest.testProviderMetadata2WithContext()
MonetaryConversionsTest.testProviderMetadata3WithContext()
431-A4)

Access the default provider chain (must be defined).

Coverage

org.javamoney.tck.tests.conversion
MonetaryConversionsTest.testDefaultProviderChainIsDefined()
MonetaryConversionsTest.testDefaultProviderChainIsDefinedDefault()
MonetaryConversionsTest.testDefaultProviderChainIsDefinedDefault2()
MonetaryConversionsTest.testDefaultProviderChainIsDefinedDefaultWithContext()
431-A5)

Access and test conversion using the default provider chain.

Coverage

org.javamoney.tck.tests.conversion
MonetaryConversionsTest.testDefaultConversion()
431-A6)

Bad case: Test access of an inexistent provider.

Coverage

org.javamoney.tck.tests.conversion
MonetaryConversionsTest.testUseInvalidProvider()
431-A7)

Bad case: Test inclusion of an inexistent provider in a provider chain.

Coverage

org.javamoney.tck.tests.conversion
MonetaryConversionsTest.testUseInvalidProviderWithinChain()

Section 4.3.2 - Converting Amounts

A. Test Basic MonetaryConversions Accessors

432-A1)

Test successful conversion for possible currency pairs.

Coverage

org.javamoney.tck.tests.conversion
ConvertingAmountsTest.testConversion()
432-A2)

Compare conversions done with exchange rates provided for same conversion.

Coverage

org.javamoney.tck.tests.conversion
ConvertingAmountsTest.testConversionComparedWithRate()
432-A3)

Bad case: try converting from/to an inconvertible (custom) currency, ensure CurrencyConversionException is thrown.

Coverage

org.javamoney.tck.tests.conversion
ConvertingAmountsTest.testUnsupportedConversion()
432-A4)

Bad case: try converting from/to a null currency, ensure CurrencyConversionException is thrown.

Coverage

org.javamoney.tck.tests.conversion
ConvertingAmountsTest.testNullConversion1()
ConvertingAmountsTest.testNullConversion2()

Section 4.3.3 - Exchange Rates and Rate Providers

A. Test Basic MonetaryConversions Accessors

433-A1)

Test access to conversion rates.

Coverage

org.javamoney.tck.tests.conversion
ExchangeRatesAndRateProvidersTest.testAccessKnownRates()
ExchangeRatesAndRateProvidersTest.testAccessKnownRatesWithCodes()
ExchangeRatesAndRateProvidersTest.testAccessKnownRatesAndContext()
ExchangeRatesAndRateProvidersTest.testAccessKnownRatesWithCodesAndContext()
ExchangeRatesAndRateProvidersTest.testAccessRates_IdentityRatesWithUnits()
ExchangeRatesAndRateProvidersTest.testAccessRates_IdentityRatesWithCodes()
ExchangeRatesAndRateProvidersTest.testAccessRates_IdentityRatesWithUnitsAndContext()
433-A2)

Ensure additional ConversionContext is passed correctly to SPIs.

Coverage

org.javamoney.tck.tests.conversion
ExchangeRatesAndRateProvidersTest.testPassingOverConversionContextToSPIs()
433-A3)

Bad case: try accessing rates with incosistent data.

Coverage

org.javamoney.tck.tests.conversion
ExchangeRatesAndRateProvidersTest.testInvalidUsage_InvalidSourceCurrency()
ExchangeRatesAndRateProvidersTest.testInvalidUsage_NullSourceCurrency()
ExchangeRatesAndRateProvidersTest.testInvalidUsage_InvalidTargetCurrency()
ExchangeRatesAndRateProvidersTest.testInvalidUsage_NullTargetCurrency()
ExchangeRatesAndRateProvidersTest.testInvalidUsage_InvalidSourceCurrencyAndContext()
ExchangeRatesAndRateProvidersTest.testInvalidUsage_NullSourceCurrencyUnit()
ExchangeRatesAndRateProvidersTest.testInvalidUsage_NullTargetCurrencyUnit()

Section 4.3.4 - ExchangeRateProvider Chains

A. Test Basic MonetaryConversions Accessors

434-A1)

Test correct rate evaluation for different provider chains, providers defined by the TCK.

Coverage

org.javamoney.tck.tests.conversion
ProviderChainsTest.testCorrectRateEvaluationInChain_diffProviders()
ProviderChainsTest.testCorrectRateEvaluationInChain_sameProviders()
434-A2)

Test correct rate evaluation for different provider chains, providers defined by the TCK, with historic rates.

Coverage

org.javamoney.tck.tests.conversion
ProviderChainsTest.testCorrectRateEvaluationInChainHistoric()
434-A3)

Test availability of providers defined by the TCK.

Coverage

org.javamoney.tck.tests.conversion
ProviderChainsTest.testTCKRateChainAvailability()

Section 4.4.1 - Formatting of Monetary Amounts

A. Test all concrete MonetaryAmountFormat Implementations

441-A1)

Format several amounts, created using the default factory, but also a test instance, provided by the TCK, to ensure no implementation dependencies on the implementation.

Coverage

org.javamoney.tck.tests.format
FormattingMonetaryAmountsTest.testNoDepOnAmountImplementation()
441-A2)

Print several amounts, created using the default factory, but also a test instance, provided by the TCK, to ensure no implementation dependencies on the implementation.

Coverage

org.javamoney.tck.tests.format
FormattingMonetaryAmountsTest.testFormattingIsIndependentOfImplementation()
441-A3)

Parse back several amounts, input created using the formatting from 'Format_formatAmounts'.

Coverage

org.javamoney.tck.tests.format
FormattingMonetaryAmountsTest.testParseIsIndependentOfImplementation()
441-A4)

Get/set default currency, try to parse patterns without currency information.

Coverage

org.javamoney.tck.tests.format
FormattingMonetaryAmountsTest.testParseWithDifferentCurrencies()

Section 4.4.2 - Configuring a Monetary Amount Formatter

442-A1)

Get/set different amount styles (especially patterns, group sizes, group characters) and compare results with results as from RI. Also apply patterns without currency invovled.

Coverage

org.javamoney.tck.tests.format
FormattingMonetaryAmountsTest.testParseDifferentStyles()

Section 4.4.3 - MonetaryFormats Accessor Singleton

B. Accessing Monetary Amount Formats

443-A1)

AccessingMonetaryAmountFormat using MonetaryFormats.getAmountFormat(Locale locale), all locales available also from java.text.DecimalFormat must be supported.

Coverage

org.javamoney.tck.tests.format
FormattingMonetaryAmountsTest.testLocalesSupported()
443-A2)

AccessingMonetaryAmountFormat using MonetaryFormats.getAmountFormat(AmountStyle style), all locales available also from java.text.DecimalFormat must be supported (using AmountStyle.of(Locale)).

Coverage

org.javamoney.tck.tests.format
FormattingMonetaryAmountsTest.testGetAmountFormat()
443-A3)

Test MonetaryFormats.getAvailableLocales, all locales available also from java.text.DecimalFormat must be supported (using AmountStyle.of(Locale)), more locales are possible.

Coverage

org.javamoney.tck.tests.format
FormattingMonetaryAmountsTest.testGetAvailableLocales()
FormattingMonetaryAmountsTest.testAmountStyleOf()

Section 4.5.1 - Core SPI

A. Registering Currencies

451-A1)

Test registered CurrencyProviderSpi (at least one instance required). Test behaviour, especially bad case behaviour for invalid input.

Coverage

org.javamoney.tck.tests.spi
CoreSPITests.testCurrencyProviderSpi()
451-A2)

Test registered MonetaryCurrenciesSingletonSpi (at least one instance required). Test behaviour, especially bad case behaviour for invalid input.

Coverage

org.javamoney.tck.tests.spi
CoreSPITests.testMonetaryCurrenciesSingletonSpi()

B. Registering Monetary Amount Factories

451-B1)

Test registered MonetaryAmountsSpi (at least one instance required). Test behaviour, especially bad case behaviour for invalid input.

Coverage

org.javamoney.tck.tests.spi
CoreSPITests.testMonetaryAmountFactoryProviderSpis()

C. Backing the MonetaryAmounts Singleton

451-C1)

Test registered RoundingProviderSpi (at least one instance required). Test behaviour, especially bad case behaviour for invalid input.

Coverage

org.javamoney.tck.tests.spi
CoreSPITests.testMonetaryAmountsSingletonSpi()

D. Registering Roundings

451-D1)

Test registered RoundingProviderSpi (at least one instance required). Test behaviour, especially bad case behaviour for invalid input.

Coverage

org.javamoney.tck.tests.spi
CoreSPITests.testRoundingProviderSpi()

Section 4.5.2 - Currency Conversion SPI

A. Adapting Currency Conversion

452-A1)

Test SPI for ExhcnageRateProviders.

Coverage

org.javamoney.tck.tests.spi
CoreSPITests.testExchangeRateProviderSpi()
452-A2)

Test SPI for MonetaryConversions.

Coverage

org.javamoney.tck.tests.spi
CoreSPITests.testMonetaryConversionsSingletonSpi()

Section 4.5.3 - Formatting SPI

A. Prodivding Amount Formats

453-A1)

Test registered MonetaryAmountFormatProviderSpi (one is required), especially bad case behaviour for invalid input.

Coverage

org.javamoney.tck.tests.spi
FormattingSPITest.testMonetaryAmountFormatProviderSpiIsRegistered()