Uploaded image for project: 'Isis'
  1. Isis
  2. ISIS-782

Integration testing framework should automatically install the FixtureClock singleton rather than the regular Clock

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: core-1.4.0
    • Fix Version/s: core-1.5.0
    • Component/s: Core
    • Labels:
      None

      Description

      The ClockService delegates to the Clock singleton. If the absence of any explicit initialization, the Clock singleton lazily instantiates itself with a non-replaceable SystemClock that simply delegates to the system time.

      In integration tests, however, we should use FixtureClock. The default behaviour of this is to act the same as the SystemClock, however it also exposes methods to allow the date/time to be set. Once set, any call for the date/time is fixed.

      Currently, because of the way in which Isis bootstraps, by the time the test starts the Clock singleton has already been hit, meaning that it isn't possible for a developer-written fixture to install the FixtureClock explicitly.

      This ticket is for the testing framework (in IsisSystemForTest) to automatically install the FixtureClock on behalf of any tests that want to use it.

        Attachments

          Activity

            People

            • Assignee:
              danhaywood Dan Haywood
              Reporter:
              danhaywood Dan Haywood
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: