public abstract class AbstractExternalResourceTestSupport<R> extends Object implements org.junit.rules.TestRule
Rules that detect the presence of some external
resource. If the resource is indeed present, it will be available during the test
lifecycle through getResource(). If it is not, tests will either fail or be
skipped, depending on the value of system property
"SCS_EXTERNAL_SERVERS_REQUIRED".| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.logging.Log |
logger |
protected R |
resource |
static String |
SCS_EXTERNAL_SERVERS_REQUIRED |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractExternalResourceTestSupport(String resourceDescription) |
| Modifier and Type | Method and Description |
|---|---|
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description) |
protected abstract void |
cleanupResource()
Perform cleanup of the
resource field, which is guaranteed to be non null. |
R |
getResource() |
protected abstract void |
obtainResource()
Try to obtain and validate a resource.
|
public static final String SCS_EXTERNAL_SERVERS_REQUIRED
protected final org.apache.commons.logging.Log logger
protected R resource
protected AbstractExternalResourceTestSupport(String resourceDescription)
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description)
apply in interface org.junit.rules.TestRulepublic R getResource()
protected abstract void cleanupResource()
throws Exception
resource field, which is guaranteed to be non null.Exception - any exception thrown by this method will be logged and swallowedCopyright © 2017 Pivotal Software, Inc.. All rights reserved.