[threeten-dev] Please help to review new test code for java.time.Instant

Stephen Colebourne scolebourne at joda.org
Fri Jan 11 03:11:19 PST 2013


The tests themselves are fine, however, they should be grouped in
source code as a set of three after the minus_Duration() tests.

The method names should also be changed to include "long";
"minus_TemporalUnit" -> "minus_longTemporalUnit"

The same additional three tests should be added for plus.

thanks
Stephen


On 11 January 2013 08:27, Patrick Zhang <patrick.zhang at oracle.com> wrote:
> Hi Team,
>
> Please help to review below new added test case:
> http://cr.openjdk.java.net/~sherman/jdk8_threeten/patrick/instant/
>
> In current test code, Instant.minus(TemporalSubtractor substractor) has been
> included but Instant.minus(long amountToSubtract, TemporalUnit unit) is
> missed.
>
> So below 3 methods are added to cover it:
> ==================
> minus_TemporalUnit()
> minus_TemporalUnit_overflowTooSmall()
> minus_TemporalUnit_overflowTooBig()
> ==================
>
> Actually the logic is same with existing minus_Duration(),
> minus_Duration_overflowTooSmall() and minus_Duration_overflowTooBig(). I
> just use Instant.minus(long amountToSubtract, TemporalUnit unit) to replace
> Instant.minus(TemporalSubtractor substractor).
>
> Test result is here:
> http://sqeweb.us.oracle.com/jsn/users/patrick/newresult1/work/java/time/tck/java/time/TCKInstant.jtr
>
> Regards
> Patrick
>


More information about the threeten-dev mailing list