Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#719 jfreechart-1.0.4: testMondayThroughFridayTranslations fails

1.0.x
closed-fixed
David Gilbert
General (896)
5
2007-07-11
2007-02-09
Miroslav Šulc
No

I ran tests using ant and got this error:
...
[junit] Testcase: testMs2BaseTimelineTranslations took 0,27 sec
[junit] Testcase: testMs2Translations took 18,47 sec
[junit] Testcase: testMondayThroughFridayTranslations took 0,01 sec
[junit] FAILED
[junit] expected:<978476400000> but was:<978390000000>
[junit] junit.framework.AssertionFailedError: expected:<978476400000> but was:<978390000000>
[junit] at org.jfree.chart.axis.junit.SegmentedTimelineTests.verifyTranslations(SegmentedTimelineTests.java:848)
[junit] at org.jfree.chart.axis.junit.SegmentedTimelineTests.testMondayThroughFridayTranslations(SegmentedTimelineTests.java:787)
[junit]

It looks like one day (24hrs) difference to me.

Discussion

  • David Gilbert
    David Gilbert
    2007-02-10

    Logged In: YES
    user_id=112975
    Originator: NO

    Can you post some details of your runtime? These tests all pass for me.

     
  • David Gilbert
    David Gilbert
    2007-02-10

    • labels: --> General
    • milestone: --> 1.0.x
    • assigned_to: nobody --> mungady
     
  • Miroslav Šulc
    Miroslav Šulc
    2007-02-10

    Logged In: YES
    user_id=1483986
    Originator: YES

    I put some System.out to the test and here is what I got:

    Monday: Mon Jan 01 00:00:00 CET 2001
    testCycle: 0
    Segment size: 978303600000
    translatedValue: 2275948800000
    newValue: 978390000000
    tempSegment.getMillisecond(): 978390000000
    translatedValue: 2275948800000
    newValue: 978390000000
    segment.getMillisecond(): 978390000000
    translatedValue: 2276035200000
    newValue: 978390000000
    segment.getMillisecond(): 978476400000

    I do not understand what exactly the code does but it seems to me that the problem might be in Monday. As it is "Mon Jan 01 00:00:00 CET 2001", it is in fact "Sun Dec 31 23:00:00 UTC 2000". Maybe this makes the one-day difference if compared as dates (without time info). But I'm just guessing. I hope this output helps. If not then ask what you need exactly and I'll give you that. Unfortunately "this.mondayFridayTimeline.toString()" does not give any info so the output here misses it too.

     
  • David Gilbert
    David Gilbert
    2007-02-12

    Logged In: YES
    user_id=112975
    Originator: NO

    Sorry, what I meant by runtime details was the exact version of the JRE you are using. For me, all the tests pass using:

    java version "1.6.0"
    Java(TM) SE Runtime Environment (build 1.6.0-b105)
    Java HotSpot(TM) 64-Bit Server VM (build 1.6.0-b105, mixed mode)

    ...on Ubuntu Linux (AMD 64). I also tested on 1.5.0_08 and all the tests passed. Once I can reproduce the failure, I'll probably be able to figure out whether the test is flawed or the JRE has a bug.

     
  • Miroslav Šulc
    Miroslav Šulc
    2007-02-12

    Logged In: YES
    user_id=1483986
    Originator: YES

    It fails with these all:

    java version "1.6.0"
    Java(TM) SE Runtime Environment (build 1.6.0-b105)
    Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode)

    java version "1.5.0_10"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_10-b03)
    Java HotSpot(TM) Client VM (build 1.5.0_10-b03, mixed mode)

    java version "1.4.2_13"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_13-b06)
    Java HotSpot(TM) Client VM (build 1.4.2_13-b06, mixed mode)

    java version "1.7.0-ea"
    Java(TM) SE Runtime Environment (build 1.7.0-ea-b06)
    Java HotSpot(TM) Client VM (build 1.7.0-ea-b06, mixed mode)

     
  • Miroslav Šulc
    Miroslav Šulc
    2007-04-18

    Logged In: YES
    user_id=1483986
    Originator: YES

    ANT_OPTS="-Duser.timezone=UTC" solves the problem.

     
  • David Gilbert
    David Gilbert
    2007-07-11

    Logged In: YES
    user_id=112975
    Originator: NO

    I've reproduced the problem now (by changing the time zone to something different - not London) and fixed it for the upcoming 1.0.7 release. Thanks for all your input, sorry it took me a while to get it...

    Regards,

    Dave Gilbert
    JFreeChart Project Leader

     
  • David Gilbert
    David Gilbert
    2007-07-11

    • status: open --> closed-fixed