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 Setup 1 1 1 0 0 1 100.00%
1 Introduction, Use Cases, Requirements (no tests) 0 0 0 0 0 0
2 Use Cases 0 0 0 0 0 0
3 Requirements 0 0 0 0 0 0
4 Specification 168 166 166 241 0 166 100.00%
5 Meta-Data Contexts and Query Models 0 0 0 0 0 0
6 Implementation Recommendations 0 0 0 0 0 0
7 Examples 0 0 0 0 0 0
Total 169 167 167 241 0 167 100.00%

Section Summary

Section Assertions Testable Total Tested Tested
(problematic)
Tested
(working)
Coverage %
0 TCK Setup 1 1 1 0 1 100.00%
1 Introduction, Use Cases, Requirements (no tests) 0 0 0 0 0
2 Use Cases 0 0 0 0 0
3 Requirements 0 0 0 0 0
3.1 Core Requirements 0 0 0 0 0
3.2 Formatting Requirements 0 0 0 0 0
3.3 EE and ME Support 0 0 0 0 0
3.4 Non Functional Requirements 0 0 0 0 0
4 Specification 0 0 0 0 0
4.1 Package and Project Structure 0 0 0 0 0
4.1.1 Package Overview 0 0 0 0 0
4.1.2 Module/Repository Overview 0 0 0 0 0
4.2 Money and Currency Core API 0 0 0 0 0
4.2.1 Modelling of Currencies 10 9 9 0 9 100.00%
4.2.2 Modeling of Monetary Amounts 60 59 59 0 59 100.00%
4.2.3 Externalizing the Numeric Value of an Amount 32 32 32 0 32 100.00%
4.2.4 Functional Extension Points 1 1 1 0 1 100.00%
4.2.5 The Monetary Context 0 0 0 0 0
4.2.6 Creating Monetary Amount Instances 18 18 18 0 18 100.00%
4.2.7 Accessing Currencies, Amounts and Roundings 14 14 14 0 14 100.00%
4.2.8 Additional Functional Support 0 0 0 0 0
4.2.9 Exception Types 0 0 0 0 0
4.3 Currency Conversion 0 0 0 0 0
4.3.1 Accessing Monetary Conversions 7 7 7 0 7 100.00%
4.3.2 Converting Amounts 4 4 4 0 4 100.00%
4.3.3 Exchange Rates and Rate Providers 3 3 3 0 3 100.00%
4.3.4 ExchangeRateProvider Chains 3 3 3 0 3 100.00%
4.4 Money and Currency Formatting API 0 0 0 0 0
4.4.1 Formatting of Monetary Amounts 4 4 4 0 4 100.00%
4.4.2 Configuring a Monetary Amount Formatter 1 1 1 0 1 100.00%
4.4.3 MonetaryFormats Accessor Singleton 3 3 3 0 3 100.00%
4.4.4 Formatting Exceptions 0 0 0 0 0
4.5 Money and Currency SPI 0 0 0 0 0
4.5.1 Core SPI 5 5 5 0 5 100.00%
4.5.2 Currency Conversion SPI 2 2 2 0 2 100.00%
4.5.3 Formatting SPI 1 1 1 0 1 100.00%
4.5.4 The Bootstrapping Mechanism 0 0 0 0 0
5 Meta-Data Contexts and Query Models 0 0 0 0 0
5.1 Overview 0 0 0 0 0
5.2 AbstractContext 0 0 0 0 0
5.3 AbstractQueryBuilder 0 0 0 0 0
6 Implementation Recommendations 0 0 0 0 0
6.1 Overview 0 0 0 0 0
6.2 Monetary Arithmetic 0 0 0 0 0
6.3 Numeric Precision 0 0 0 0 0
7 Examples 0 0 0 0 0

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 Monetary.

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 Monetary.

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 Monetary.getAmountTypes();

Coverage

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

A. Data Interoperability

422-A1)

For each MonetaryAmount implementation: Ensure getCurrencyCode returns correct results.

Coverage

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

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

Coverage

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

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

Coverage

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

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

Coverage

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

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

Coverage

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

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

Coverage

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

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

Coverage

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

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

Coverage

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

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

Coverage

org.javamoney.tck.tests
ModellingMonetaryTest.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
ModellingMonetaryTest.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
ModellingMonetaryTest.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
ModellingMonetaryTest.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
ModellingMonetaryTest.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
ModellingMonetaryTest.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
ModellingMonetaryTest.testMonetaryAmountFactories_CreateWithMonetaryContextNumberAndCurrency()

C. Comparison Methods

422-C1)

The isGreaterThan() implemented correctly.

Coverage

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

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

Coverage

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

The isLessThan() implemented correctly.

Coverage

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

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

Coverage

org.javamoney.tck.tests
ModellingMonetaryTest.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
ModellingMonetaryTest.testMonetaryAmount_isEqualTo()
422-C6)

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

Coverage

org.javamoney.tck.tests
ModellingMonetaryTest.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
ModellingMonetaryTest.testMonetaryAmount_isEqualToRegardlessType()

D. Basic Arithmetic Operations

422-D1)

Tests that add() correctly adds two values.

Coverage

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

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

Coverage

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

Tests that add(0) should return itself.

Coverage

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

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

Coverage

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

Tests that add(null) throws an NullPointerException.

Coverage

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

subtract() must subtract a value from another.

Coverage

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

subtract(0) should return itself.

Coverage

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

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

Coverage

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

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

Coverage

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

subtract(null) must throw an NullPointerException.

Coverage

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

multiply() allow to multiply numbers.

Coverage

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

multiply(1) should return itself.

Coverage

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

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

Coverage

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

multiply(null) must throw an NullPointerException.

Coverage

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

divide() function allow to divide numbers.

Coverage

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

divide(0) function must throw an ArithmeticException.

Coverage

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

divide(1) should return itself.

Coverage

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

divide(null) must throw an NullPointerException.

Coverage

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

remainder() allow to calculate the remainder.

Coverage

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

remainder(0) must throw an ArithmeticException.

Coverage

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

remainder(null) must throw an NullPointerException.

Coverage

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

divideAndRemainder() allow to divide/remind numbers.

Coverage

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

divideAndRemainder(0) must throw an ArithmeticException.

Coverage

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

divideAndRemainder(null) must throw an NullPointerException.

Coverage

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

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

Coverage

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

scaleByPowerOfTen() allow to scale by power of 10.

Coverage

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

abs() allow to calculate the absolute value.

Coverage

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

negate() function allow to negate the value.

Coverage

org.javamoney.tck.tests
ModellingMonetaryTest.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
ModellingMonetaryTest.testWith()
ModellingMonetaryTest.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
ModellingMonetaryTest.testWithInvalidOperator()
ModellingMonetaryTest.testWithNull()
ModellingMonetaryTest.testWithNull4ProvidedOperators()
422-E3)

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

Coverage

org.javamoney.tck.tests
ModellingMonetaryTest.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
ModellingMonetaryTest.testQueryInvalidQuery()
ModellingMonetaryTest.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
ModellingMonetaryTest.testImplementsHashCode()
422-F2)

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

Coverage

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

Implementations of MonetaryAmount must be Comparable.

Coverage

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

Implementations of MonetaryAmount must be immutable.

Coverage

org.javamoney.tck.tests
ModellingMonetaryTest.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
CreatingMonetaryTest.testAccessToMonetaryAmountFactory()
426-A2)

Checks if getAmountType returns the correct type.

Coverage

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

Checks for default and max MonetaryContext.

Coverage

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

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

Coverage

org.javamoney.tck.tests
CreatingMonetaryTest.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
CreatingMonetaryTest.testMonetaryAmountFactoryCreateZeroAmountsWithDiffCurrencies()
426-B2)

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

Coverage

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

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

Coverage

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

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

Coverage

org.javamoney.tck.tests
CreatingMonetaryTest.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
CreatingMonetaryTest.testMonetaryAmountFactoryCreatePositiveAmountsWitCurrencies()
426-C2)

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

Coverage

org.javamoney.tck.tests
CreatingMonetaryTest.testMonetaryAmountFactoryCreatePositiveAmountsWithContexts()
CreatingMonetaryTest.testMonetaryAmountFactoryCreatePositiveAmountsWithContexts2()
CreatingMonetaryTest.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
CreatingMonetaryTest.testMonetaryAmountFactoryCreatePositiveAmountsWithInvalidNumber()
426-C4)

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

Coverage

org.javamoney.tck.tests
CreatingMonetaryTest.testMonetaryAmountFactoryCreatePositiveNoCurrency_BadCase()
CreatingMonetaryTest.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
CreatingMonetaryTest.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
CreatingMonetaryTest.testMonetaryAmountFactoryNegativePositiveAmountsWitCurrencies()
426-D2)

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

Coverage

org.javamoney.tck.tests
CreatingMonetaryTest.testMonetaryAmountFactoryNegativePositiveAmountsWithContexts()
CreatingMonetaryTest.testMonetaryAmountFactoryNegativePositiveAmountsWithContexts2()
CreatingMonetaryTest.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
CreatingMonetaryTest.testMonetaryAmountFactoryNegativePositiveAmountsWithInvalidNumber()
426-D4)

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

Coverage

org.javamoney.tck.tests
CreatingMonetaryTest.testMonetaryAmountFactoryCreateNegativeNoCurrency_BadCase()
CreatingMonetaryTest.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
CreatingMonetaryTest.testMonetaryAmountFactoryCreateNegativeInvalidContext_BadCase()

Section 4.2.7 - Accessing Currencies, Amounts and Roundings

A. Accessing Currencies

427-A1)

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

Coverage

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

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

Coverage

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

Test if Monetary provides correct check for ISO codes.

Coverage

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

Test if Monetary provides correct check for Locales.

Coverage

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

Test for custom Monetary 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
CreatingMonetaryTest.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
FormattingMonetaryTest.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
FormattingMonetaryTest.testFormattingIsIndependentOfImplementation()
441-A3)

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

Coverage

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

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

Coverage

org.javamoney.tck.tests.format
FormattingMonetaryTest.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
FormattingMonetaryTest.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
FormattingMonetaryTest.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
FormattingMonetaryTest.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
FormattingMonetaryTest.testGetAvailableLocales()
FormattingMonetaryTest.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 MonetarySingletonSpi (at least one instance required). Test behaviour, especially bad case behaviour for invalid input.

Coverage

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

B. Registering Monetary Amount Factories

451-B1)

Test registered MonetarySpi (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 Monetary 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.testMonetarySingletonSpi()

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()