Class SlingInstancesRule

  • All Implemented Interfaces:
    org.junit.rules.TestRule

    public class SlingInstancesRule
    extends Object
    implements org.junit.rules.TestRule
    JUnit Rule that executes tests for multiple Sling instances.
    • Constructor Detail

      • SlingInstancesRule

        public SlingInstancesRule​(String... instanceNames)
                           throws org.apache.sling.testing.clients.ClientException
        Throws:
        org.apache.sling.testing.clients.ClientException
    • Method Detail

      • apply

        public org.junit.runners.model.Statement apply​(org.junit.runners.model.Statement base,
                                                       org.junit.runner.Description dest)
        Evaluate our base statement once for every instance. Tests can use our getSlingInstance() method to access the current one. See MultipleOsgiConsoleTest example in the samples integration tests module.
        Specified by:
        apply in interface org.junit.rules.TestRule