Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-10446

Helper for health checks in pax exam tests

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • Testing PaxExam 3.1.0
    • None
    • Testing
    • None

    Description

      Similar to SLING-10445, I'm assigning this to myself hoping to work on it later, but if someone beats me to it feel free to re-assign.

      Based on Eric Norman's code in the jackrabbit-accessmanager/AccessManagerClientTestSupport class that I think it would be useful to create a helper for setting up and verifying health checks in pax exam tests. It's a useful way of checking for system readiness in a precise way.

      Maybe something like this

      // when setting up pax Options
      HealthCheckPaxOptions
        .withFrameworkStartLevel(5)
        .withService("org.apache.sling.jcr.api.SlingRepository")
        .withService("javax.script.ScriptEngineManager")
        .withBundlesStarted()
        .withBundlesContentLoaded()
        .getOptions()
      
      // and then execute the health checks with
      HealthChecksAggregator(HealthCheckExecutor)..isOk(String ... tagsWhichDefaultToTheConfiguredOnes)
      
      // or wait a maximum time for ok
      HealthChecksAggregator(HealthCheckExecutor).waitForOk(Duration, String ... tagsWhichDefaultToTheConfiguredOnes)
      

      Attachments

        Issue Links

          Activity

            People

              bdelacretaz Bertrand Delacretaz
              bdelacretaz Bertrand Delacretaz
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: