JSR 310 - new Date and Time API for Java
The LJC is getting involved in JSR-310 as we believe it's a vital technology for the Java language as software increasingly needs to be date, time and time zone aware in a safe immutable manner.
JSR in a Nutshell
Date and Calendar do not provide adequate functionality for day to day Java developers. JSR-310 addresses this with an implementation based on hard won lessons from JodaTime. For more information on JSR-310 please see the links below and this London Java Community Blog Post
- To assist the threeten project in meeting the Technology Compatibility Kit (TCK) requirements of this JSR, a major milestone to having JSR-310 accepted as part of the Java language.
- Promote the ThreeTen implementation and provide pathways for members to get involved in either writing tests on the TCK project or getting involved in the ThreeTen implementation.
We are looking for volunteers within the London Java Community and beyond to help us with our efforts, please contact either of the leads below if you are interested.
- Prospective LJC Contributors:
- Aidan McGinley
- Alan Chuter
- Alex Chen
- Faisal CM
- Renjith Nair
- Somay Nakhal
Proposed TCK Strategy
- Provide a method of running a TCK test suite against an arbitrary jar.
- Provide a method of specifying which TestNG tests are part of the TCK.
- Specify TestNG tests that are TCK appropriate from the current testsuite.
- Write any additional tests that are necessary in order to completely specify the API (It might be the case that this isn't necessary since you already have a lot of tests and test coverage)
Source code is available at GitHub and we intend to continue development in the open. We've added a new ant target for testing TCK acceptance. So if you've compiled the latest version of the existing source code, then in order to run the TCK against it you would execute:
ant -Dtck.implementation=build/threeten-0.6.3.jar tck
You can substitute any arbitrary jar as the 'tck.implementation' variable and it tests against the classes in that jar.
We are using TestNG's group feature to specify what tests we want to use as part of the TCK. Currently the 'tck' ant target, only runs tests that are annotated as being part of the 'tck' group from the existing ThreeTen unit tests. So if you want to make a unit test part of tck acceptance you annotated it with:
We've currently annotated a single test with the annotation, but that's just to make sure that it works, rather than a comment on what is tck-appropriate or not.
This step involves annotating all appropriate TestNG tests with the aforementioned group. We are yet to completely formalise the guidelines on what should be appropriate or not, here are some heuristics:
- The public API is contained within the compiled jar at "build/threeten-*.*.*.jar". Any TCK tests should be only on methods that are publicly accessible. You will get a linktime error if you try to run the ant 'TCK' command against a non-public API class, but you still need to be careful to not accidentally test implementation-specific methods.
- Don't test methods that are private or any package scoped classes.
- Don't rely on invariants that encapsulated within classes.
- Ignore any performance tests, for example an assert same on Object identity.
- Ignore any utility classes, for example MathUtils.
- Please check the allocation table below, as currently some classes are likely to be modified as part of ThreeTen.
- Tests are to be labelled either implementation or tck, omission of a test group indicates that this is to be revisited.
There is a work-allocation table on Step 3 of the Volunteering page.
Some Legal information on submitting to the TCK
Please note that to submit work to the JCP you will need to have a JSPA countersigned by your employer for legal reasons. The LJC/JCP is currently working on providing some guidance on this, but until then the full detail is here.
Further links and information
<span>* Don't rely on invariants that encapsulated within classes.
* Ignore any performance tests, for example an assert same on Object identity.
* Ignore any utility classes, for example MathUtils.
* Please check the allocation table below, as currently some classes are likely to be modified as part of ThreeTen.<span style="text-decoration:underline;color:green">* Tests are to be labelled either implementation or tck, omission of a test group indicates that this is to be revisited.
There is a work-allocation table on Step 3 of the [[JSR-310Volunteering|Volunteering]] page.
'''Some Legal information on submitting to the TCK'''<span>