Package limn.testing

Class HeadlessUi

java.lang.Object
limn.testing.HeadlessUi
All Implemented Interfaces:
AutoCloseable

public final class HeadlessUi extends Object implements AutoCloseable
A UiRuntime bound to the calling thread for the life of a test, so that the thread confinement every widget asserts holds on the JUnit thread, and the worker pool and queue behind Ui exist to be drained.

Open it in @BeforeEach, close it in @AfterEach. Twenty-five test classes wrote the four lines this constructor is and the two lines close() is, most of them beside a base class that already had them; this is the pair once, with the clock as the one thing a test chooses.

  • Constructor Details

    • HeadlessUi

      public HeadlessUi()
      A runtime on the wall clock.
    • HeadlessUi

      public HeadlessUi(LongSupplier nanos)
      A runtime on a clock the test controls.
      Parameters:
      nanos - what the runtime reads as now
  • Method Details