org.apache.sling.testing.tools.sling

## Class SlingInstancesRule

- java.lang.Object
- - org.apache.sling.testing.tools.sling.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 Summary

Constructors
Constructor and Description
`SlingInstancesRule(Iterable<SlingInstance> it)`
`SlingInstancesRule(String... instanceNames)`

### Method Summary

All Methods Instance Methods Concrete Methods
`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.
`SlingInstance` `getSlingInstance()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### SlingInstancesRule

    public SlingInstancesRule(String... instanceNames)

#### SlingInstancesRule

    public SlingInstancesRule(Iterable<SlingInstance> it)

### 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`

#### getSlingInstance

    public SlingInstance getSlingInstance()