public class FlowableFormRule extends Object implements org.junit.rules.TestRule
Usage:
public class YourTest { @Rule public FlowableFormRule flowableFormRule = new FlowableFormRule(); ... }
The FormEngine and the services will be made available to the test class through the getters of the FlowableRule. The formEngine will be initialized by default with the flowable.form.cfg.xml resource on the classpath. To specify a different configuration file, pass the resource location in FlowableFormRule(String) the appropriate constructor. Form 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 RepositoryService#deleteDeployment(String, boolean) cascade deleted after the tearDown.
Modifier and Type | Field and Description |
---|---|
protected String |
configurationResource |
protected String |
deploymentId |
protected FormEngine |
formEngine |
protected FormEngineConfiguration |
formEngineConfiguration |
protected FormRepositoryService |
repositoryService |
Constructor and Description |
---|
FlowableFormRule() |
FlowableFormRule(FormEngine formEngine) |
FlowableFormRule(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 |
configureFormEngine() |
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() |
FormEngine |
getFormEngine() |
FormRepositoryService |
getRepositoryService() |
protected void |
initializeFormEngine() |
protected void |
initializeServices() |
void |
setConfigurationResource(String configurationResource) |
void |
setFormEngine(FormEngine formEngine) |
void |
setFormEngineConfiguration(FormEngineConfiguration formEngineConfiguration) |
void |
setRepositoryService(FormRepositoryService repositoryService) |
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 FormEngineConfiguration formEngineConfiguration
protected FormEngine formEngine
protected FormRepositoryService repositoryService
public FlowableFormRule()
public FlowableFormRule(String configurationResource)
public FlowableFormRule(FormEngine formEngine)
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 initializeFormEngine()
protected void initializeServices()
protected void configureFormEngine()
protected void finished(org.junit.runner.Description description)
public String getConfigurationResource()
public void setConfigurationResource(String configurationResource)
public FormEngine getFormEngine()
public void setFormEngine(FormEngine formEngine)
public FormRepositoryService getRepositoryService()
public void setRepositoryService(FormRepositoryService repositoryService)
public void setFormEngineConfiguration(FormEngineConfiguration formEngineConfiguration)