Uploaded image for project: 'Hibernate ORM'
  1. HHH-10327

Unit test failures due to date/time precision mismatches

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.4
    • Fix Version/s: 5.0.5
    • Component/s: testsuite
    • Labels:
      None
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      FooBarTest#testQuery is failing because a Oracle DATE values include time up to seconds.
      This method executes the following:

      {{list = s.createQuery( "from Foo foo where ? = some elements(foo.component.importantDates)" )
      .setParameter( 0, new Date(), StandardBasicTypes.DATE )
      .list();

      Unless the value is within a half second of what was persisted, no results will be returned and the test will fail.

      The test will pass if foo.getTimestamp() is bound instead. This is because Foo#onSave initializes the timestamp property to the current time, and the same value is ultimately added to {{Foo.component.importantDates.

        Attachments

          Activity

            People

            • Assignee:
              gbadner Gail Badner
              Reporter:
              gbadner Gail Badner
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: