You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Bertrand Delacretaz (Jira)" <ji...@apache.org> on 2021/06/02 09:56:00 UTC

[jira] [Created] (SLING-10446) Helper for health checks in pax exam tests

Bertrand Delacretaz created SLING-10446:
-------------------------------------------

             Summary: Helper for health checks in pax exam tests
                 Key: SLING-10446
                 URL: https://issues.apache.org/jira/browse/SLING-10446
             Project: Sling
          Issue Type: Improvement
          Components: Testing
    Affects Versions: Testing PaxExam 3.1.0
            Reporter: Bertrand Delacretaz
            Assignee: Bertrand Delacretaz


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|https://github.com/apache/sling-org-apache-sling-jcr-jackrabbit-accessmanager/blob/master/src/test/java/org/apache/sling/jcr/jackrabbit/accessmanager/it/AccessManagerClientTestSupport.java] 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
{code}
// 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)
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)