All Downloads are FREE. Search and download functionalities are using the official Maven repository.

.javamoney-tck.1.0.source-code.test-audit.xml Maven / Gradle / Ivy

Go to download

JSR 354 provides an API for representing, transporting, and performing comprehensive calculations with Money and Currency. This module implements JSR 354. This module provides the test code that is compatible with both the Java 7 and the Java 8 based API. The targeted API must be provided as well as the implementation under test to execute this TCK.

There is a newer version: 1.1
Show newest version
<?xml version="1.0" encoding="UTF-8"?>
<specification xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns="http://jboss.com/products/weld/org.javamoney.tck/audit"
               xsi:schemaLocation="http://jboss.com/products/weld/org.javamoney.tck/audit"
               name="JSR 354 Money and Currency" version="1.0.0" id="JSR 354"
               generateSectionIds="false">
    <section id="0" title="TCK Setup">
        <!-- Tests class TCKSetupTest -->
        <group>
            <text>Tests the correct setup of the TCK</text>
            <assertion id="Setup">
                <text>Ensure an implementation of
                    org.javamoney.tck.JSR354TestConfiguration is registered using the
                    java.util.ServiceLoader.
                </text>
            </assertion>
        </group>
    </section>
    <section id="1" title="Introduction, Use Cases, Requirements (no tests)"/>
    <section id="2" title="Use Cases"/>
    <section id="3" title="Requirements"/>
    <section id="3.1" title="Core Requirements"/>
    <section id="3.2" title="Formatting Requirements"/>
    <section id="3.3" title="EE and ME Support"/>
    <section id="3.4" title="Non Functional Requirements"/>

    <section id="4" title="Specification"/>

    <!-- **************************************************************** ****
        Core API **************************************************************** -->
    <section id="4.1" title="Package and Project Structure"/>
    <section id="4.1.1" title="Package Overview"/>
    <section id="4.1.2" title="Module/Repository Overview"/>
    <section id="4.2" title="Money and Currency Core API"/>
    <section id="4.2.1" title="Modelling of Currencies">
        <!-- Tests class ModellingCurrenciesTest -->
        <group>
            <text>A. Managing the Currency code</text>
            <assertion id="421-A1">
                <text>Ensure at least one javax.money.CurrencyUnit implementation
                    is
                    available and registered/accessible from Monetary.
                </text>
            </assertion>
            <assertion id="421-A2">
                <text>Test that currencies returned for same ISO currency code are
                    equal, ensure when listing all available currencies, that the
                    code
                    is unique.
                </text>
            </assertion>
            <assertion id="421-A3">
                <text>Ensure all ISO 3-letters codes as defined by the JDK are also
                    available from Monetary.
                </text>
            </assertion>
            <assertion id="421-A4">
                <text>Test that JDK currencies returned
                    match the values of
                    corresponding JDK Currency (code, numeric code,
                    default fraction
                    digits).
                </text>
            </assertion>
        </group>
        <group>
            <text>B. Currency Unit Implementation Requirements</text>
            <assertion id="421-B1">
                <text>CurrencyUnit must implement hashCode.
                </text>
            </assertion>
            <assertion id="421-B2">
                <text>CurrencyUnit must implement equals.
                </text>
            </assertion>
            <assertion id="421-B3">
                <text>CurrencyUnit implementation must be Comparable.
                </text>
            </assertion>
            <assertion id="421-B4">
                <text>CurrencyUnit implementation must be immutable.
                </text>
            </assertion>
            <assertion id="421-B5" testable="false">
                <text>CurrencyUnit implementation must be thread safe.
                </text>
            </assertion>
            <assertion id="421-B6">
                <text>CurrencyUnit implementation must be serializable.
                </text>
            </assertion>
        </group>
    </section>
    <section id="4.2.2" title="Modeling of Monetary Amounts">
        <!-- Tests class ModellingMonetaryTest -->
        <group>
            <text>Preconditions</text>
            <assertion id="422-0">
                <text>Ensure at least one javax.money.MonetaryAmount
                    implementation
                    is registered, by calling Monetary.getAmountTypes();
                </text>
            </assertion>
        </group>
        <!-- Test the following tests for each type registered. Use MonetaryAmountFactory
            to of instances to be compared. -->
        <group>
            <text>A. Data Interoperability</text>
            <assertion id="422-A1">
                <text>For each MonetaryAmount implementation: Ensure getCurrencyCode
                    returns correct results.
                </text>
            </assertion>
            <assertion id="422-A2">
                <text>For each MonetaryAmount implementation: Ensure getNumber()
                    returns correct results.
                </text>
            </assertion>
            <assertion id="422-A3">
                <text>For each MonetaryAmount implementation: Ensure
                    getMonetaryContext() returns correct results.
                </text>
            </assertion>
            <assertion id="422-A4">
                <text>For each MonetaryAmount implementation: Ensure isNegative()
                    returns correct results.
                </text>
            </assertion>
            <assertion id="422-A5">
                <text>For each MonetaryAmount implementation: Ensure isPositive()
                    returns correct results.
                </text>
            </assertion>
            <assertion id="422-A6">
                <text>For each MonetaryAmount implementation: Ensure isZero()
                    returns correct results (-0, +0 == 0).
                </text>
            </assertion>
            <assertion id="422-A7">
                <text>For each MonetaryAmount implementation: signum() function is
                    implemented correctly.
                </text>
            </assertion>
            <assertion id="422-A8">
                <text>For each MonetaryAmount implementation: Ensure isNegativeOrZero()
                    returns correct results.
                </text>
            </assertion>
            <assertion id="422-A9">
                <text>For each MonetaryAmount implementation: Ensure isPositiveOrZero()
                    returns correct results.
                </text>
            </assertion>
        </group>
        <group>
            <text>B. Prototyping Support</text>
            <assertion id="422-B1">
                <text>Ensure getFactory returns a MonetaryAmountFactory and that
                    instances created are of the same type.
                </text>
            </assertion>
            <assertion id="422-B2">
                <text>Call getFactory(), create a new MonetaryAmount instance, with
                    same input. The instances must
                    be equal (or even be identical!).
                </text>
            </assertion>
            <assertion id="422-B3">
                <text>Call getFactory(), create a new MonetaryAmount instance with a
                    new number
                    value. The instances must
                    be non equal and have the
                    according
                    numeric value.
                </text>
            </assertion>
            <assertion id="422-B4">
                <text>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.
                </text>
            </assertion>
            <assertion id="422-B5">
                <text>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.
                </text>
            </assertion>
            <assertion id="422-B6">
                <text>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.
                </text>
            </assertion>
        </group>
        <group>
            <text>C. Comparison Methods</text>
            <assertion id="422-C1">
                <text>The isGreaterThan() implemented correctly.</text>
            </assertion>
            <assertion id="422-C2">
                <text>The isGreaterThanOrEqals() implemented correctly, regardless
                    of trailing zeroes.
                </text>
            </assertion>
            <assertion id="422-C3">
                <text>The isLessThan() implemented correctly.</text>
            </assertion>
            <assertion id="422-C4">
                <text>The isLessThanOrEqals() implemented correctly, regardless of
                    trailing zeroes.
                </text>
            </assertion>
            <assertion id="422-C5">
                <text>For two amounts with same numeric value and currency:
                    isEqualTo() return true, regardless of trailing zeroes.
                </text>
            </assertion>
            <assertion id="422-C6">
                <text>For two amounts with same numeric value and currency:
                    isEqualTo() return true, regardless of MonetaryContext.
                </text>
            </assertion>
            <assertion id="422-C7">
                <text>For two amounts with same numeric value and currency:
                    isEqualTo() return true, regardless of Implementation Type.
                </text>
            </assertion>
        </group>
        <group>
            <text>D. Basic Arithmetic Operations</text>
            <assertion id="422-D1">
                <text>Tests that add() correctly adds two values.
                </text>
            </assertion>
            <assertion id="422-D2">
                <text>Tests that add() with non matching currencies throws a
                    MonetaryException.
                </text>
            </assertion>
            <assertion id="422-D3">
                <text>Tests that add(0) should return itself.
                </text>
            </assertion>
            <assertion id="422-D4">
                <text>Tests that add() which results in an amount exceeding the max
                    MonetaryContext throws a MonetaryException.
                </text>
            </assertion>
            <assertion id="422-D5">
                <text>Tests that add(null) throws an NullPointerException.
                </text>
            </assertion>
            <assertion id="422-D6">
                <text>subtract() must subtract a value from another.
                </text>
            </assertion>
            <assertion id="422-D7">
                <text>subtract(0) should return itself.
                </text>
            </assertion>
            <assertion id="422-D8">
                <text>subtract() with non matching currencies must
                    throw a
                    MonetaryException.
                </text>
            </assertion>
            <assertion id="422-D9">
                <text>subtract() which results in an amount exceeding the max
                    MonetaryContext must throw a
                    MonetaryException.
                </text>
            </assertion>
            <assertion id="422-D10">
                <text>subtract(null) must throw an NullPointerException.
                </text>
            </assertion>
            <assertion id="422-D11">
                <text>multiply() allow to multiply numbers.
                </text>
            </assertion>
            <assertion id="422-D12">
                <text>multiply(1) should return itself.
                </text>
            </assertion>
            <assertion id="422-D13">
                <text>multiply() which results in an amount exceeding the max
                    MonetaryContext must throw a
                    MonetaryException.
                </text>
            </assertion>
            <assertion id="422-D14">
                <text>multiply(null) must throw an NullPointerException.
                </text>
            </assertion>
            <assertion id="422-D15">
                <text>divide() function allow to divide numbers.
                </text>
            </assertion>
            <assertion id="422-D16">
                <text>divide(0) function must throw an
                    ArithmeticException.
                </text>
            </assertion>
            <assertion id="422-D17">
                <text>divide(1) should return itself.
                </text>
            </assertion>
            <assertion id="422-D18">
                <text>divide(null) must throw an NullPointerException.
                </text>
            </assertion>
            <assertion id="422-D19">
                <text>remainder() allow to calculate the remainder.
                </text>
            </assertion>
            <assertion id="422-D20">
                <text>remainder(0) must throw an ArithmeticException.
                </text>
            </assertion>
            <assertion id="422-D21">
                <text>remainder(null) must throw an NullPointerException.
                </text>
            </assertion>
            <assertion id="422-D22">
                <text>divideAndRemainder() allow to divide/remind
                    numbers.
                </text>
            </assertion>
            <assertion id="422-D23">
                <text>divideAndRemainder(0) must throw an ArithmeticException.
                </text>
            </assertion>
            <assertion id="422-D24">
                <text>divideAndRemainder(null) must throw an NullPointerException.
                </text>
            </assertion>
            <assertion id="422-D25">
                <text>divideAndRemainder(1) must retzrn -8itself, 0).
                </text>
            </assertion>
            <assertion id="422-D26">
                <text>scaleByPowerOfTen() allow to scale by power of
                    10.
                </text>
            </assertion>
            <assertion id="422-D27">
                <text>abs() allow to calculate the absolute value.
                </text>
            </assertion>
            <assertion id="422-D28">
                <text>negate() function allow to negate the value.
                </text>
            </assertion>
        </group>
        <group>
            <text>E. Functional Extension Points</text>
            <assertion id="422-E1">
                <text>Ensure with(MonetaryOperator) can be called and produces
                    amounts of the same type and correct value.
                </text>
            </assertion>
            <assertion id="422-E2">
                <text>When an invalid operator is passed (throwing any exception),
                    a
                    MonetaryException must be thrown. When null is passed, an NPE
                    must
                    be thrown.
                </text>
            </assertion>
            <assertion id="422-E3">
                <text>Ensure query(MonetaryQUery) can be called and produces
                    valuable results.
                </text>
            </assertion>
            <assertion id="422-E4">
                <text>When an invalid query is passed (throwing any exception), a
                    MonetaryException must be thrown. When null is passed, an NPE must
                    be thrown.
                </text>
            </assertion>
        </group>
        <group>
            <text>F. Monetary Amount Implementation Requirements</text>
            <assertion id="422-F1">
                <text>Implementations of MonetaryAmount must implement hashCode,
                    considering number, currency and implementation type,
                    monetary
                    context.
                </text>
            </assertion>
            <assertion id="422-F2">
                <text>Implementations of MonetaryAmount must implement
                    equals,
                    considering number, currency and implementation type,
                    monetary
                    context.
                </text>
            </assertion>
            <assertion id="422-F3">
                <text>Implementations of MonetaryAmount must be Comparable.
                </text>
            </assertion>
            <assertion id="422-F4">
                <text>Implementations of MonetaryAmount must be immutable.
                </text>
            </assertion>
            <assertion id="422-F5" testable="false">
                <text>Implementations of MonetaryAmount should be thread-safe.
                </text>
            </assertion>
        </group>
    </section>
    <section id="4.2.3" title="Externalizing the Numeric Value of an Amount">
        <group>
            <text>A. Testing Numeric Externalization for positive values</text>
            <assertion id="423-A1">
                <text>Checks if number type is not null and returning a concrete (no
                    abstract class or interface).
                </text>
            </assertion>
            <assertion id="423-A2">
                <text>Check if a correct integer value is returned, no truncation is
                    allowed to be performed.
                </text>
            </assertion>
            <assertion id="423-A3">
                <text>Check if a correct long value is returned, no truncation is
                    allowed to be performed.
                </text>
            </assertion>
            <assertion id="423-A4">
                <text>Check if a correct double value is returned, no truncation is
                    allowed to be performed.
                </text>
            </assertion>
            <assertion id="423-A5">
                <text>Check if a correct number value is returned, no truncation is
                    allowed to be performed.
                    Check should be done for every JDK type
                    supported.
                </text>
            </assertion>
            <assertion id="423-A6">
                <text>Check if a correct integer value is returned, truncation is
                    allowed to be performed.
                </text>
            </assertion>
            <assertion id="423-A7">
                <text>Check if a correct long value is returned, truncation is
                    allowed to be performed.
                </text>
            </assertion>
            <assertion id="423-A8">
                <text>Check if a correct double value is returned, truncation is
                    allowed to be performed.
                </text>
            </assertion>
            <assertion id="423-A9">
                <text>Check if a correct number value is returned, truncation is
                    allowed to be performed.
                    Check should be done for every JDK type
                    supported.
                </text>
            </assertion>
            <assertion id="423-A10">
                <text>Test correct precision values, including border cases.
                </text>
            </assertion>
            <assertion id="423-A11">
                <text>Test correct scale values, including border cases.
                </text>
            </assertion>
        </group>
        <group>
            <text>B. Testing Numeric Externalization for negative values</text>
            <assertion id="423-B1">
                <text>Checks if number type is not null and returning a concrete (no
                    abstract class or interface).
                </text>
            </assertion>
            <assertion id="423-B2">
                <text>Check if a correct integer value is returned, no truncation is
                    allowed to be performed.
                </text>
            </assertion>
            <assertion id="423-B3">
                <text>Check if a correct long value is returned, no truncation is
                    allowed to be performed.
                </text>
            </assertion>
            <assertion id="423-B4">
                <text>Check if a correct double value is returned, no truncation is
                    allowed to be performed.
                </text>
            </assertion>
            <assertion id="423-B5">
                <text>Check if a correct number value is returned, no truncation is
                    allowed to be performed.
                    Check should be done for every JDK type
                    supported.
                </text>
            </assertion>
            <assertion id="423-B6">
                <text>Check if a correct integer value is returned, truncation is
                    allowed to be performed.
                </text>
            </assertion>
            <assertion id="423-B7">
                <text>Check if a correct long value is returned, truncation is
                    allowed to be performed.
                </text>
            </assertion>
            <assertion id="423-B8">
                <text>Check if a correct double value is returned, truncation is
                    allowed to be performed.
                </text>
            </assertion>
            <assertion id="423-B9">
                <text>Check if a correct number value is returned, truncation is
                    allowed to be performed.
                    Check should be done for every JDK type
                    supported.
                </text>
            </assertion>
            <assertion id="423-B10">
                <text>Test correct precision values, including border cases.
                </text>
            </assertion>
            <assertion id="423-B11">
                <text>Test correct scale values, including border cases.
                </text>
            </assertion>
        </group>
        <group>
            <text>C. Testing Numeric Externalization for zero values</text>
            <assertion id="423-C1">
                <text>Checks if number type is not null and returning a concrete (no
                    abstract class or interface).
                </text>
            </assertion>
            <assertion id="423-C2">
                <text>Check if a correct integer value is returned, no truncation is
                    allowed to be performed.
                </text>
            </assertion>
            <assertion id="423-C3">
                <text>Check if a correct long value is returned, no truncation is
                    allowed to be performed.
                </text>
            </assertion>
            <assertion id="423-C4">
                <text>Check if a correct number value is returned, no truncation is
                    allowed to be performed. Check should be done for every JDK type
                    supported.
                </text>
            </assertion>
            <assertion id="423-C5">
                <text>Check if a correct integer value is returned, truncation is
                    allowed to be performed (but is not necessary).
                </text>
            </assertion>
            <assertion id="423-C6">
                <text>Check if a correct long value is returned, truncation is
                    allowed to be performed (but is not necessary).
                </text>
            </assertion>
            <assertion id="423-C7">
                <text>Check if a correct double value is returned, truncation is
                    allowed to be performed (but is not necessary).
                </text>
            </assertion>
            <assertion id="423-C8">
                <text>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.
                </text>
            </assertion>
            <assertion id="423-C9">
                <text>Test correct precision values, including border cases.
                </text>
            </assertion>
            <assertion id="423-C10">
                <text>Test correct scale values, including border cases.
                </text>
            </assertion>
        </group>
    </section>
    <section id="4.2.4" title="Functional Extension Points">
        <group>
            <text>A. Monetary Operator Implementation Requirements</text>
            <assertion id="424-A1">
                <text>The return type of apply must be the same type as the
                    parameter
                    (amount.getClass() == result.getClass()).
                </text>
            </assertion>
        </group>
    </section>
    <section id="4.2.5" title="The Monetary Context">
        <!-- No tests, class is part of API! -->
    </section>
    <!-- Theses tests must be done for every amount type registered. Factories
        must be accessed first using Monetary singleton, then from a created
        amount. -->
    <section id="4.2.6" title="Creating Monetary Amount Instances">
        <group>
            <text>A. Accessing MonetaryAmount Factories</text>
            <assertion id="426-A1">
                <text>Access a MonetaryAmountFactory for each registered type.
                </text>
            </assertion>
            <assertion id="426-A2">
                <text>Checks if getAmountType returns the correct type.</text>
            </assertion>
            <assertion id="426-A3">
                <text>Checks for default and max MonetaryContext.</text>
            </assertion>
            <assertion id="426-A4">
                <text>Checks if capabilities of default MonetaryContext are less
                    than Max
                    MonetaryContext.
                </text>
            </assertion>
        </group>
        <group>
            <text>B. Testing Creation of Amounts with zero values</text>
            <assertion id="426-B1">
                <text>For each MonetaryAmount Factory: Create zero amounts from a
                    factory with currencies.
                </text>
            </assertion>
            <assertion id="426-B2">
                <text>For each MonetaryAmount Factory: Create zero amounts from a
                    factory with monetary contexts.
                </text>
            </assertion>
            <assertion id="426-B3">
                <text>For each MonetaryAmount Factory: Bad Case: Create zero amounts
                    from a factory with an invalid currency.
                </text>
            </assertion>
            <assertion id="426-B4">
                <text>For each MonetaryAmount Factory: Bad Case: Create zero amounts
                    from a factory with an invalid MonetaryContext.
                </text>
            </assertion>
        </group>
        <group>
            <text>C. Testing Creation of Amounts with positive values</text>
            <assertion id="426-C1">
                <text>For each MonetaryAmount Factory: Create positive amounts from
                    a factory with currencies.
                </text>
            </assertion>
            <assertion id="426-C2">
                <text>For each MonetaryAmount Factory: Create positive amounts from
                    a factory with monetary contexts.
                </text>
            </assertion>
            <assertion id="426-C3">
                <text>For each MonetaryAmount Factory: Bad Case: Create positive
                    amounts from a factory with an invalid numeric value (exceeding max
                    MonetaryContext).
                </text>
            </assertion>
            <assertion id="426-C4">
                <text>For each MonetaryAmount Factory: Bad Case: Create positive
                    amounts from a factory with an invalid currency.
                </text>
            </assertion>
            <assertion id="426-C5">
                <text>For each MonetaryAmount Factory: Bad Case: Create positive
                    amounts from a factory with an invalid MonetaryContext.
                </text>
            </assertion>
        </group>
        <group>
            <text>D. Testing Creation of Amounts with negative values</text>
            <assertion id="426-D1">
                <text>For each MonetaryAmount Factory: Create negative amounts from
                    a factory with currencies.
                </text>
            </assertion>
            <assertion id="426-D2">
                <text>For each MonetaryAmount Factory: Create negative amounts from
                    a factory with monetary contexts.
                </text>
            </assertion>
            <assertion id="426-D3">
                <text>For each MonetaryAmount Factory: Bad Case: Create negative
                    amounts from a factory with an invalid numeric value (exceeding max
                    MonetaryContext).
                </text>
            </assertion>
            <assertion id="426-D4">
                <text>For each MonetaryAmount Factory: Bad Case: Create negative
                    amounts from a factory with an invalid currency.
                </text>
            </assertion>
            <assertion id="426-D5">
                <text>For each MonetaryAmount Factory: Bad Case: Create negative
                    amounts from a factory with an invalid MonetaryContext.
                </text>
            </assertion>
        </group>
    </section>
    <section id="4.2.7" title="Accessing Currencies, Amounts and Roundings">
        <group>
            <text>A. Accessing Currencies</text>
            <assertion id="427-A1">
                <text>Test if Monetary provides all ISO related entries,
                    similar to the JDK.
                </text>
            </assertion>
            <assertion id="427-A2">
                <text>Test if Monetary provides all Locale related
                    entries, similar to the JDK.
                </text>
            </assertion>
            <assertion id="427-A3">
                <text>Test if Monetary provides correct check for ISO
                    codes.
                </text>
            </assertion>
            <assertion id="427-A4">
                <text>Test if Monetary provides correct check for
                    Locales.
                </text>
            </assertion>
            <assertion id="427-A5">
                <text>Test for custom Monetary provided, based on the TCK
                    TestProvider.
                </text>
            </assertion>
        </group>
        <group>
            <text>B. Accessing Monetary Amount Factories</text>
            <assertion id="427-B1">
                <text>Ensure the types available, must be at least one type.</text>
            </assertion>
            <assertion id="427-B2">
                <text>Ensure amount factories are accessible for all types
                    available,
                    providing also the
                    some test implementations with the
                    TCK.
                </text>
            </assertion>
            <assertion id="427-B3">
                <text>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.
                </text>
            </assertion>
            <assertion id="427-B4">
                <text>Ensure correct query function implementations, providing also
                    the
                    some test implementations with the TCK.
                </text>
            </assertion>
            <assertion id="427-B5">
                <text>Ensure a default factory is returned. Test javamoney.config
                    for
                    configuring default value.
                </text>
            </assertion>
        </group>
        <group>
            <text>C. Accessing Roundings</text>
            <assertion id="427-C1">
                <text>Access roundings using all defined currencies, including TCK
                    custom currencies.
                </text>
            </assertion>
            <assertion id="427-C2">
                <text>Access roundings using a MonetaryContext. Use different
                    MathContext/RoundingMode, as an attribute, when running
                    on the JDK.
                </text>
            </assertion>
            <assertion id="427-C3">
                <text>Access custom roundings and ensure TCK custom roundings are
                    registered.
                </text>
            </assertion>
            <assertion id="427-C4">
                <text>Test TCK custom roundings.
                </text>
            </assertion>
        </group>
    </section>
    <section id="4.2.8" title="Additional Functional Support"/>
    <section id="4.2.9" title="Exception Types"/>

    <section id="4.3" title="Currency Conversion"/>
    <section id="4.3.1" title="Accessing Monetary Conversions">
        <group>
            <text>A. Test Basic MonetaryConversions Accessors
            </text>
            <assertion id="431-A1">
                <text>Ensure at least one conversion provider is accessible.</text>
            </assertion>
            <assertion id="431-A2">
                <text>Access and test different Currency Conversions for the provider in place.</text>
            </assertion>
            <assertion id="431-A3">
                <text>Access and test the provider's meta data.</text>
            </assertion>
            <assertion id="431-A4">
                <text>Access the default provider chain (must be defined).</text>
            </assertion>
            <assertion id="431-A5">
                <text>Access and test conversion using the default provider chain.</text>
            </assertion>
            <assertion id="431-A6">
                <text>Bad case: Test access of an inexistent provider.</text>
            </assertion>
            <assertion id="431-A7">
                <text>Bad case: Test inclusion of an inexistent provider in a provider chain.</text>
            </assertion>
        </group>
    </section>
    <section id="4.3.2" title="Converting Amounts">
        <group>
            <text>A. Test Basic MonetaryConversions Accessors
            </text>
            <assertion id="432-A1">
                <text>Test successful conversion for possible currency pairs.</text>
            </assertion>
            <assertion id="432-A2">
                <text>Compare conversions done with exchange rates provided for same conversion.</text>
            </assertion>
            <assertion id="432-A3">
                <text>Bad case: try converting from/to an inconvertible (custom) currency, ensure
                    CurrencyConversionException is thrown.
                </text>
            </assertion>
            <assertion id="432-A4">
                <text>Bad case: try converting from/to a null currency, ensure CurrencyConversionException is thrown.
                </text>
            </assertion>
        </group>
    </section>

    <section id="4.3.3" title="Exchange Rates and Rate Providers">
        <group>
            <text>A. Test Basic MonetaryConversions Accessors
            </text>
            <assertion id="433-A1">
                <text>Test access to conversion rates.</text>
            </assertion>
            <assertion id="433-A2">
                <text>Ensure additional ConversionContext is passed correctly to SPIs.</text>
            </assertion>
            <assertion id="433-A3">
                <text>Bad case: try accessing rates with incosistent data.</text>
            </assertion>
        </group>
    </section>
    <section id="4.3.4" title="ExchangeRateProvider Chains">
        <group>
            <text>A. Test Basic MonetaryConversions Accessors
            </text>
            <assertion id="434-A1">
                <text>Test correct rate evaluation for different provider chains, providers defined by the TCK.</text>
            </assertion>
            <assertion id="434-A2">
                <text>Test correct rate evaluation for different provider chains, providers defined by the TCK, with
                    historic rates.
                </text>
            </assertion>
            <assertion id="434-A3">
                <text>Test availability of providers defined by the TCK.</text>
            </assertion>
        </group>
    </section>

    <section id="4.4" title="Money and Currency Formatting API"/>
    <section id="4.4.1" title="Formatting of Monetary Amounts">
        <group>
            <text>A. Test all concrete MonetaryAmountFormat Implementations
            </text>
            <assertion id="441-A1">
                <text>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.
                </text>
            </assertion>
            <assertion id="441-A2">
                <text>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.
                </text>
            </assertion>
            <assertion id="441-A3">
                <text>Parse back several amounts, input created using the
                    formatting
                    from 'Format_formatAmounts'.
                </text>
            </assertion>
            <assertion id="441-A4">
                <text>Get/set default currency, try to parse patterns without
                    currency information.
                </text>
            </assertion>
        </group>
    </section>
    <section id="4.4.2" title="Configuring a Monetary Amount Formatter">
        <assertion id="442-A1">
            <text>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.
            </text>
        </assertion>
    </section>
    <section id="4.4.3" title="MonetaryFormats Accessor Singleton">
        <group>
            <text>B. Accessing Monetary Amount Formats</text>
            <assertion id="443-A1">
                <text>AccessingMonetaryAmountFormat using
                    MonetaryFormats.getAmountFormat(Locale locale), all locales
                    available also from java.text.DecimalFormat must be supported.
                </text>
            </assertion>
            <assertion id="443-A2">
                <text>AccessingMonetaryAmountFormat using
                    MonetaryFormats.getAmountFormat(AmountStyle style), all locales
                    available also from java.text.DecimalFormat must be supported
                    (using AmountStyle.of(Locale)).
                </text>
            </assertion>
            <assertion id="443-A3">
                <text>Test
                    MonetaryFormats.getAvailableLocales, all locales
                    available
                    also from java.text.DecimalFormat must be supported
                    (using
                    AmountStyle.of(Locale)), more locales are possible.
                </text>
            </assertion>
        </group>
    </section>
    <section id="4.4.4" title="Formatting Exceptions"/>

    <section id="4.5" title="Money and Currency SPI"/>
    <section id="4.5.1" title="Core SPI">
        <group>
            <text>A. Registering Currencies</text>
            <assertion id="451-A1">
                <text>Test registered CurrencyProviderSpi (at least one instance
                    required). Test behaviour,
                    especially bad case behaviour for invalid
                    input.
                </text>
            </assertion>
            <assertion id="451-A2">
                <text>Test registered MonetarySingletonSpi (at least one instance
                    required). Test behaviour, especially bad case behaviour for invalid
                    input.
                </text>
            </assertion>
        </group>
        <group>
            <text>B. Registering Monetary Amount Factories</text>
            <assertion id="451-B1">
                <text>Test registered MonetarySpi (at least one instance
                    required). Test behaviour,
                    especially bad case behaviour for invalid
                    input.
                </text>
            </assertion>
        </group>
        <group>
            <text>C. Backing the Monetary Singleton</text>
            <assertion id="451-C1">
                <text>Test registered RoundingProviderSpi (at least one instance
                    required). Test behaviour,
                    especially bad case behaviour for invalid
                    input.
                </text>
            </assertion>
        </group>
        <group>
            <text>D. Registering Roundings</text>
            <assertion id="451-D1">
                <text>Test registered RoundingProviderSpi (at least one instance
                    required). Test behaviour,
                    especially bad case behaviour for invalid
                    input.
                </text>
            </assertion>
        </group>
    </section>
    <section id="4.5.2" title="Currency Conversion SPI">
        <group>
            <text>A. Adapting Currency Conversion</text>
            <assertion id="452-A1">
                <text>Test SPI for ExhcnageRateProviders.</text>
            </assertion>
            <assertion id="452-A2">
                <text>Test SPI for MonetaryConversions.</text>
            </assertion>
        </group>
    </section>
    <section id="4.5.3" title="Formatting SPI">
        <group>
            <text>A. Prodivding Amount Formats</text>
            <assertion id="453-A1">
                <text>Test registered MonetaryAmountFormatProviderSpi (one is
                    required), especially bad case behaviour for invalid input.
                </text>
            </assertion>
        </group>
    </section>
    <section id="4.5.4" title="The Bootstrapping Mechanism">
    </section>

    <section id="5" title="Meta-Data Contexts and Query Models">
        <!-- Tested with API -->
    </section>
    <section id="5.1" title="Overview"/>
    <section id="5.2" title="AbstractContext"/>
    <section id="5.3" title="AbstractContextBuilder"/>
    <section id="5.3" title="AbstractQuery"/>
    <section id="5.3" title="AbstractQueryBuilder"/>

    <section id="6" title="Implementation Recommendations"/>
    <section id="6.1" title="Overview"/>
    <section id="6.2" title="Monetary Arithmetic"/>
    <section id="6.3" title="Numeric Precision"/>

    <section id="7" title="Examples"/>
</specification>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy