public class LogTracerRule
extends org.junit.rules.ExternalResource
| Constructor and Description |
|---|
LogTracerRule(org.apache.sling.testing.junit.rules.instance.Instance quickstartRule) |
LogTracerRule(org.apache.sling.testing.junit.rules.instance.Instance quickstartRule,
int recordingCacheSizeInMB,
int recordingCacheDurationInSecs) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
after()
Restore the original configuration state of the log tracer.
|
protected void |
before()
Store the state of the log tracer configuration and enable it.
|
org.codehaus.jackson.JsonNode |
getLogs(org.apache.sling.testing.clients.SlingHttpResponse response)
Parse the tracer request id from the given response object and return the corresponding logs from the tracer servlet as
JSON array.
|
List<org.apache.http.Header> |
getTracerHeaders() |
org.codehaus.jackson.JsonNode |
getTracerReport(org.apache.sling.testing.clients.SlingHttpResponse response)
Parse the tracer request id from the given response object and return the corresponding tracer report from the tracer servlet as
JSON object.
|
void |
setTracerHeaders(List<org.apache.http.Header> headers) |
void |
verifyLog(org.apache.sling.testing.clients.SlingHttpResponse response)
Parse the tracer request id from the given response object and check if there are any entries in the corresponding log.
|
public LogTracerRule(org.apache.sling.testing.junit.rules.instance.Instance quickstartRule)
public LogTracerRule(org.apache.sling.testing.junit.rules.instance.Instance quickstartRule,
int recordingCacheSizeInMB,
int recordingCacheDurationInSecs)
public List<org.apache.http.Header> getTracerHeaders()
public void setTracerHeaders(List<org.apache.http.Header> headers)
protected void before()
throws org.apache.sling.testing.clients.ClientException,
org.apache.sling.testing.clients.util.config.InstanceConfigException,
InterruptedException
before in class org.junit.rules.ExternalResourceorg.apache.sling.testing.clients.ClientExceptionorg.apache.sling.testing.clients.util.config.InstanceConfigExceptionInterruptedExceptionprotected void after()
after in class org.junit.rules.ExternalResourcepublic org.codehaus.jackson.JsonNode getTracerReport(org.apache.sling.testing.clients.SlingHttpResponse response)
throws org.apache.sling.testing.clients.ClientException,
InterruptedException
response - SlingHttpResponse objectorg.apache.sling.testing.clients.ClientException - if the request failsInterruptedException - to mark this method as waitingpublic org.codehaus.jackson.JsonNode getLogs(org.apache.sling.testing.clients.SlingHttpResponse response)
throws org.apache.sling.testing.clients.ClientException,
InterruptedException
response - SlingHttpResponse objectorg.apache.sling.testing.clients.ClientException - if the request failsInterruptedException - to mark this method as waitingpublic void verifyLog(org.apache.sling.testing.clients.SlingHttpResponse response)
throws org.apache.sling.testing.clients.ClientException,
InterruptedException
response - SlingHttpResponse objectorg.apache.sling.testing.clients.ClientException - if the request failsInterruptedException - to mark this method as waitingCopyright © 2018. All rights reserved.