R - resource typepublic abstract class AbstractExternalResourceTestSupport<R> extends Object implements org.junit.jupiter.api.extension.BeforeEachCallback
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
SCS external servers required environment variable.
|
| 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) |
void |
beforeEach(org.junit.jupiter.api.extension.ExtensionContext context) |
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 void beforeEach(org.junit.jupiter.api.extension.ExtensionContext context)
throws Exception
beforeEach in interface org.junit.jupiter.api.extension.BeforeEachCallbackExceptionpublic org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description)
public 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 © 2023 Pivotal Software, Inc.. All rights reserved.