Package org.apache.sling.testing.junit.rules

## Class RemoteLogDumperRule

- java.lang.Object
- - org.junit.rules.TestWatcher
  - - org.apache.sling.testing.junit.rules.RemoteLogDumperRule

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

    public class RemoteLogDumperRule
    extends org.junit.rules.TestWatcher

The RemoteLogDumper Rule fetches logs which are generated due to execution of test from the remote server and dumps them locally upon test failure. This simplifies determining failure cause by providing all required data locally. This would be specially useful when running test in CI server where server logs gets cluttered with all other test executions Can be constructed either with a `SlingClient` or with a `Instance`

         public class LoginTestIT {

         @Rule
         public TestRule logDumper = new RemoteLogDumperRule(slingClient);
         // OR public TestRule logDumper = new RemoteLogDumperRule(myInstance);

         @Test
         public void remoteLogin() {
              //Make calls to remote server
              assertEquals("testA", name.getMethodName());
         }

         }

### Constructor Summary

Constructors
`RemoteLogDumperRule()`
`RemoteLogDumperRule​(org.apache.sling.testing.clients.SlingClient slingClient)`
`RemoteLogDumperRule​(Instance instance)`

### Method Summary

All Methods Instance Methods Concrete Methods
`org.junit.runners.model.Statement` `apply​(org.junit.runners.model.Statement base, org.junit.runner.Description description)`
`protected void` `failed​(Throwable e, org.junit.runner.Description description)`
`protected void` `finished​(org.junit.runner.Description description)`
`RemoteLogDumperRule` `setInstance​(Instance instance)`
`RemoteLogDumperRule` `setSlingClient​(org.apache.sling.testing.clients.SlingClient slingClient)`
`protected void` `starting​(org.junit.runner.Description description)`

### Methods inherited from class org.junit.rules.TestWatcher

`skipped, skipped, succeeded`

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

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

### Constructor Detail

#### RemoteLogDumperRule

    public RemoteLogDumperRule()

#### RemoteLogDumperRule

    public RemoteLogDumperRule​(Instance instance)

#### RemoteLogDumperRule

    public RemoteLogDumperRule​(org.apache.sling.testing.clients.SlingClient slingClient)

### Method Detail

#### setSlingClient

    public RemoteLogDumperRule setSlingClient​(org.apache.sling.testing.clients.SlingClient slingClient)

#### setInstance

    public RemoteLogDumperRule setInstance​(Instance instance)

#### apply

    public org.junit.runners.model.Statement apply​(org.junit.runners.model.Statement base,
                                                   org.junit.runner.Description description)

Specified by:
  `apply` in interface `org.junit.rules.TestRule`
Overrides:
  `apply` in class `org.junit.rules.TestWatcher`

#### finished

    protected void finished​(org.junit.runner.Description description)

Overrides:
  `finished` in class `org.junit.rules.TestWatcher`

#### starting

    protected void starting​(org.junit.runner.Description description)

Overrides:
  `starting` in class `org.junit.rules.TestWatcher`

#### failed

    protected void failed​(Throwable e,
                          org.junit.runner.Description description)

Overrides:
  `failed` in class `org.junit.rules.TestWatcher`