Giter Site home page Giter Site logo

jsr354-tck's Introduction

JSR 354: Money and Currency TCK

JSR 354 provides an API for representing, transporting, and performing comprehensive calculations with Money and Currency. For more details see JavaMoney.org and JSR 354: Money and Currency API

The current module contains the technical compatibility kit of JSR 354.

Basically the TCK can be run as a standalone application. Hereby you must ensure you add the following libraries to your classpath:

  • the TCK itself
  • the JSR 354 API jar (for Java 8 and above)
  • your implementation under test and all its dependencies
  • TestNG and all its dependencies
  • your implementation and SE service registration of org.javamoney.tck.JSR354TestConfiguration

You can do this all manually, use your IDE or use Maven, the latter by performing the following tasks:

  1. Create a new project Maven or Gradle.

  2. Add dependencies:

  3. Implement a class of type org.javamoney.tck.JSR354TestConfiguration, read the Javadoc, what you must provide with this class.

  4. Add a single test class with a single test as follows:

    @Test
    public void runTCK(){
        TCKRunner.main();
    }
  5. To execute the TCK, simply execute

        mvn clean test
    
  6. Go to target - there you will find your TCK test results.

As jump-start you can clone javamoney-tck-usage-example

Additional details and options are documented in user guide.

The JSR 354 Team.

This module is licenced under the the Apache 2 Licence.

Maven Central CircleCI License

Built with Maven

jsr354-tck's People

Contributors

atsticks avatar keilw avatar marschall avatar ollin avatar rac2030 avatar simkuenzi avatar stokito avatar vyazelenko avatar zumi1 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jsr354-tck's Issues

CI builds fail because of Oracle JDK 7

Currently all pull request builds fail with

$ ~/bin/install-jdk.sh --target "/home/travis/oraclejdk7" --workspace "/home/travis/.cache/install-jdk" --feature "7" --license "BCL"
Ignoring license option: BCL -- using GPLv2+CE by default
install-jdk.sh 2019-07-17
Expected feature release number in range of 9 to 14, but got: 7
�[31;1mThe command "~/bin/install-jdk.sh --target "/home/travis/oraclejdk7" --workspace "/home/travis/.cache/install-jdk" --feature "7" --license "BCL"" failed and exited with 3 during .�

It looks as if oralcejdk7 is only available on precise builds. For trusty builds openjdk7 should be available.

ModellingMonetaryAmountsTest.testImplementComparable does not cover the specification

For Comparable only two notices appears in section 4.2.2.:

  • must be comparable
  • Comparison methods for comparing two arbitrary amounts of the same currency, hereby comparing
    based on the (effective) numeric value (e.g. ignoring trailing zeroes).

When I run the TCK I get the following error report:

[FAILED]  4.2.2 For each amount class, test is Comparable.(ModellingMonetaryAmountsTest#testImplementComparable):
java.lang.AssertionError: Section 4.2.2: Comparable failed for: de.jfachwert.bank.Geldbetrag
	at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
	at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
	at org.javamoney.tck.tests.ModellingMonetaryAmountsTest.testImplementComparable(ModellingMonetaryAmountsTest.java:2522)
        ...

The input values for failed tests are:

  • amount = "0 XXX"
  • amount3 = "1 CHF"

The failing assert is assertTrue(amount.compareTo(amount3) > 0), or in other words

"0 XXX" > "1 CHF" should be true.

This is not covered by the specification (see above - or did I miss something?) and also from the semantic view I would expect it the other way around.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.