jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Signup
Maven 2.x Changelog Plugin
  • Maven 2.x Changelog Plugin
  • MCHANGELOG-36

Tests fail on build

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0
  • Labels:
    None
  • Environment:
    osx 10.4.6, java 1.4.2_06
  • Testcase included:
    yes
  • Number of attachments :
    2

Description

The date test assertions all fail:

junit.framework.AssertionFailedError: Test changelog 1 set 1 date/time expected:<239635800000> but was:< 239715000000 >
at org.apache.maven.changelog.ChangeLogTest.testReadFile(ChangeLogTest.java:50)

assertEquals( "Test changelog 1 set 1 date/time", 239635800000L, changeSet.getDate().getTime() );

They just have the wrong date, and they are offset by the timezone ( 7 hours, in my case - I'm MST -0700)

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    MCHANGELOG-36.patch
    05/May/06 3:11 PM
    3 kB
    Julian Wood
  2. Text File
    MCHANGELOG-36a.patch
    29/May/06 5:46 PM
    4 kB
    Julian Wood

Issue Links

is related to

Bug - A problem which impairs or prevents the functions of the product. MCHANGELOG-68 testReadFile unit test timebased comparisons fail

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Julian Wood added a comment - 05/May/06 3:11 PM

This update patches the timezone problem, by offsetting the time by the amount of the local timezone in ChangeLogHandler. It also fixes the expectations on the test, which I guess were developed in the +0200 timezone?

The tests should pass in all timezones now.

Show
Julian Wood added a comment - 05/May/06 3:11 PM This update patches the timezone problem, by offsetting the time by the amount of the local timezone in ChangeLogHandler. It also fixes the expectations on the test, which I guess were developed in the +0200 timezone? The tests should pass in all timezones now.
Hide
Permalink
Edwin Punzalan added a comment - 26/May/06 1:17 AM

Julian, I applied your patch and it failed in my machine. Maybe something's missing. Thanks.

Show
Edwin Punzalan added a comment - 26/May/06 1:17 AM Julian, I applied your patch and it failed in my machine. Maybe something's missing. Thanks.
Hide
Permalink
Carlos Sanchez added a comment - 26/May/06 11:30 AM

I get also an error

-------------------------------------------------------------------------------
Test set: org.apache.maven.changelog.ChangeLogTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.015 sec <<< FAILURE!
testReadFile(org.apache.maven.changelog.ChangeLogTest) Time elapsed: 0.015 sec <<< FAILURE!
junit.framework.AssertionFailedError: Test changelog 1 set 1 date/time expected:<239635800000> but was:<239747400000>
at junit.framework.Assert.fail(Assert.java:47)
at junit.framework.Assert.failNotEquals(Assert.java:282)
at junit.framework.Assert.assertEquals(Assert.java:64)
at junit.framework.Assert.assertEquals(Assert.java:136)
at org.apache.maven.changelog.ChangeLogTest.testReadFile(ChangeLogTest.java:50)

Show
Carlos Sanchez added a comment - 26/May/06 11:30 AM I get also an error ------------------------------------------------------------------------------- Test set: org.apache.maven.changelog.ChangeLogTest ------------------------------------------------------------------------------- Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.015 sec <<< FAILURE! testReadFile(org.apache.maven.changelog.ChangeLogTest) Time elapsed: 0.015 sec <<< FAILURE! junit.framework.AssertionFailedError: Test changelog 1 set 1 date/time expected:<239635800000> but was:<239747400000> at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.failNotEquals(Assert.java:282) at junit.framework.Assert.assertEquals(Assert.java:64) at junit.framework.Assert.assertEquals(Assert.java:136) at org.apache.maven.changelog.ChangeLogTest.testReadFile(ChangeLogTest.java:50)
Hide
Permalink
Julian Wood added a comment - 29/May/06 12:10 PM

I think the real problem is that we don't get the timezone information into the changelog.xml. Thus I made the assumption that all change entries were in the timezone of the person creating the site, and just used that timezone to correct the date entry. I don't think that assumption is going to hold up. Let me see if I can correct the real problem.

Show
Julian Wood added a comment - 29/May/06 12:10 PM I think the real problem is that we don't get the timezone information into the changelog.xml. Thus I made the assumption that all change entries were in the timezone of the person creating the site, and just used that timezone to correct the date entry. I don't think that assumption is going to hold up. Let me see if I can correct the real problem.
Hide
Permalink
Julian Wood added a comment - 29/May/06 5:46 PM

MCHANGELOG-36a.patch does the following. It assumes that the change entry was made using the default time zone (on the machine invoking the changelog plugin). This assumption is made because the changelog.xml produced from scm reflects nothing about the timezone information of the event. To properly fix this problem, changes to maven-scm would need to be made. Either a new timezone element is needed, or the time element should not omit the timezone information that came from scm.

When a Date is created while parsing the changelog.xml file, we adjust for the default timezone. Otherwise the Date created will not reflect the date in the changelog.xml - it will be offset by the timezone.

ChangeLogTest.java is also modified so that tests will work no matter what the default timezone of the machine building the plugin.

Show
Julian Wood added a comment - 29/May/06 5:46 PM MCHANGELOG-36 a.patch does the following. It assumes that the change entry was made using the default time zone (on the machine invoking the changelog plugin). This assumption is made because the changelog.xml produced from scm reflects nothing about the timezone information of the event. To properly fix this problem, changes to maven-scm would need to be made. Either a new timezone element is needed, or the time element should not omit the timezone information that came from scm. When a Date is created while parsing the changelog.xml file, we adjust for the default timezone. Otherwise the Date created will not reflect the date in the changelog.xml - it will be offset by the timezone. ChangeLogTest.java is also modified so that tests will work no matter what the default timezone of the machine building the plugin.
Hide
Permalink
Julian Wood added a comment - 29/May/06 5:48 PM

MCHANGELOG-36a.patch supercedes MCHANGELOG-36.patch (ie ignore or delete MCHANGELOG-36.patch)

Show
Julian Wood added a comment - 29/May/06 5:48 PM MCHANGELOG-36 a.patch supercedes MCHANGELOG-36 .patch (ie ignore or delete MCHANGELOG-36 .patch)
Hide
Permalink
Julian Wood added a comment - 29/May/06 7:17 PM

While this patch is fine on it's own, if one then tries to apply the MCHANGELOG-3.patch, it won't work. Do it in the opposite order:

MCHANGELOG-3.patch
MCHANGELOG-36a.patch

Show
Julian Wood added a comment - 29/May/06 7:17 PM While this patch is fine on it's own, if one then tries to apply the MCHANGELOG-3 .patch, it won't work. Do it in the opposite order: MCHANGELOG-3 .patch MCHANGELOG-36 a.patch
Hide
Permalink
Edwin Punzalan added a comment - 29/May/06 9:52 PM

Patch applied. Thanks.

Show
Edwin Punzalan added a comment - 29/May/06 9:52 PM Patch applied. Thanks.

People

  • Assignee:
    Edwin Punzalan
    Reporter:
    Julian Wood
Vote (0)
Watch (0)

Dates

  • Created:
    05/May/06 3:04 PM
    Updated:
    09/Feb/12 5:09 AM
    Resolved:
    29/May/06 9:52 PM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.