public class FlowableContentRule extends Object implements org.junit.rules.TestRule
Usage:
public class YourTest { @Rule public FlowableContentRule flowableContentRule = new FlowableContentRule(); ... }
The ContentEngine and the services will be made available to the test class through the getters of the FlowableContentRule. The contentEngine will be initialized by default with the flowable.content.cfg.xml
resource on the classpath. To specify a different configuration file, pass the resource location in the appropriate constructor
. Process engines will be cached
statically. Right before the first time the setUp is called for a given configuration resource, the process engine will be constructed.
You can declare a deployment with the FormDeploymentAnnotation annotation. This base class will make sure that this deployment gets deployed before the setUp and DocumentRepositoryService deleteDeployment(String, boolean) cascade deleted after the tearDown.
Modifier and Type | Field and Description |
---|---|
protected String |
configurationResource |
protected ContentEngine |
contentEngine |
protected ContentEngineConfiguration |
contentEngineConfiguration |
protected ContentService |
contentService |
protected String |
deploymentId |
Constructor and Description |
---|
FlowableContentRule() |
FlowableContentRule(ContentEngine contentEngine) |
FlowableContentRule(String configurationResource) |
Modifier and Type | Method and Description |
---|---|
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description)
Implementation based on
TestWatcher . |
protected void |
configureContentEngine() |
protected void |
failed(Throwable e,
org.junit.runner.Description description)
Invoked when a test fails
|
protected void |
finished(org.junit.runner.Description description) |
String |
getConfigurationResource() |
ContentEngine |
getContentEngine() |
ContentService |
getContentService() |
protected void |
initializeContentEngine() |
protected void |
initializeServices() |
void |
setConfigurationResource(String configurationResource) |
void |
setContentEngine(ContentEngine contentEngine) |
void |
setContentEngineConfiguration(ContentEngineConfiguration contentEngineConfiguration) |
void |
setContentService(ContentService contentService) |
protected void |
skipped(org.junit.internal.AssumptionViolatedException e,
org.junit.runner.Description description)
Invoked when a test is skipped due to a failed assumption.
|
protected void |
starting(org.junit.runner.Description description) |
protected void |
succeeded(org.junit.runner.Description description)
Invoked when a test succeeds
|
protected String configurationResource
protected String deploymentId
protected ContentEngineConfiguration contentEngineConfiguration
protected ContentEngine contentEngine
protected ContentService contentService
public FlowableContentRule()
public FlowableContentRule(String configurationResource)
public FlowableContentRule(ContentEngine contentEngine)
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description)
TestWatcher
.apply
in interface org.junit.rules.TestRule
protected void succeeded(org.junit.runner.Description description)
protected void failed(Throwable e, org.junit.runner.Description description)
protected void skipped(org.junit.internal.AssumptionViolatedException e, org.junit.runner.Description description)
protected void starting(org.junit.runner.Description description)
protected void initializeContentEngine()
protected void initializeServices()
protected void configureContentEngine()
protected void finished(org.junit.runner.Description description)
public String getConfigurationResource()
public void setConfigurationResource(String configurationResource)
public ContentEngine getContentEngine()
public void setContentEngine(ContentEngine contentEngine)
public ContentService getContentService()
public void setContentService(ContentService contentService)
public void setContentEngineConfiguration(ContentEngineConfiguration contentEngineConfiguration)