Uploaded image for project: 'Causeway'
  1. Causeway
  2. CAUSEWAY-782

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • core-1.4.0
    • core-1.5.0
    • Core
    • 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

            danhaywood Daniel Keir Haywood
            danhaywood Daniel Keir Haywood
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: