Class FlowableEventRule
- java.lang.Object
-
- org.flowable.eventregistry.test.FlowableEventRule
-
- All Implemented Interfaces:
org.junit.rules.TestRule
public class FlowableEventRule extends Object implements org.junit.rules.TestRule
Convenience for EventRegistryEngine and services initialization in the form of a JUnit rule.Usage:
public class YourTest { @Rule public FlowableFormRule flowableEventRule = new FlowableEventRule(); ... }The EventRegistryEngine and the services will be made available to the test class through the getters of the FlowableRule. The dmnEngine will be initialized by default with the flowable.eventregistry.cfg.xml resource on the classpath. To specify a different configuration file, pass the resource location in
the appropriate constructor. Event registry engines will be cached statically. Right before the first time the setUp is called for a given configuration resource, the event registry engine will be constructed.You can declare a deployment with the
EventDeploymentAnnotationannotation. This base class will make sure that this deployment gets deployed before the setUp andEventRepositoryService.deleteDeployment(String)after the tearDown.- Author:
- Tijs Rademakers
-
-
Field Summary
Fields Modifier and Type Field Description protected StringconfigurationResourceprotected StringdeploymentIdprotected EventRegistryEngineConfigurationeventEngineConfigurationprotected EventRegistryEngineeventRegistryEngineprotected EventRepositoryServicerepositoryService
-
Constructor Summary
Constructors Constructor Description FlowableEventRule()FlowableEventRule(String configurationResource)FlowableEventRule(EventRegistryEngine eventRegistryEngine)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.junit.runners.model.Statementapply(org.junit.runners.model.Statement base, org.junit.runner.Description description)Implementation based onTestWatcher.protected voidconfigureEventRegistryEngine()voidEventRegistryEngineConfiguration(EventRegistryEngineConfiguration eventEngineConfiguration)protected voidfailed(Throwable e, org.junit.runner.Description description)Invoked when a test failsprotected voidfinished(org.junit.runner.Description description)StringgetConfigurationResource()EventRegistryEnginegetEventRegistryEngine()EventRepositoryServicegetRepositoryService()protected voidinitializeEventRegistryEngine()protected voidinitializeServices()voidsetConfigurationResource(String configurationResource)voidsetEventRegistryEngine(EventRegistryEngine eventRegistryEngine)voidsetRepositoryService(EventRepositoryService repositoryService)protected voidskipped(org.junit.internal.AssumptionViolatedException e, org.junit.runner.Description description)Invoked when a test is skipped due to a failed assumption.protected voidstarting(org.junit.runner.Description description)protected voidsucceeded(org.junit.runner.Description description)Invoked when a test succeeds
-
-
-
Field Detail
-
configurationResource
protected String configurationResource
-
deploymentId
protected String deploymentId
-
eventEngineConfiguration
protected EventRegistryEngineConfiguration eventEngineConfiguration
-
eventRegistryEngine
protected EventRegistryEngine eventRegistryEngine
-
repositoryService
protected EventRepositoryService repositoryService
-
-
Constructor Detail
-
FlowableEventRule
public FlowableEventRule()
-
FlowableEventRule
public FlowableEventRule(String configurationResource)
-
FlowableEventRule
public FlowableEventRule(EventRegistryEngine eventRegistryEngine)
-
-
Method Detail
-
apply
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description)Implementation based onTestWatcher.- Specified by:
applyin interfaceorg.junit.rules.TestRule
-
succeeded
protected void succeeded(org.junit.runner.Description description)
Invoked when a test succeeds
-
failed
protected void failed(Throwable e, org.junit.runner.Description description)
Invoked when a test fails
-
skipped
protected void skipped(org.junit.internal.AssumptionViolatedException e, org.junit.runner.Description description)Invoked when a test is skipped due to a failed assumption.
-
starting
protected void starting(org.junit.runner.Description description)
-
initializeEventRegistryEngine
protected void initializeEventRegistryEngine()
-
initializeServices
protected void initializeServices()
-
configureEventRegistryEngine
protected void configureEventRegistryEngine()
-
finished
protected void finished(org.junit.runner.Description description)
-
getConfigurationResource
public String getConfigurationResource()
-
setConfigurationResource
public void setConfigurationResource(String configurationResource)
-
getEventRegistryEngine
public EventRegistryEngine getEventRegistryEngine()
-
setEventRegistryEngine
public void setEventRegistryEngine(EventRegistryEngine eventRegistryEngine)
-
getRepositoryService
public EventRepositoryService getRepositoryService()
-
setRepositoryService
public void setRepositoryService(EventRepositoryService repositoryService)
-
EventRegistryEngineConfiguration
public void EventRegistryEngineConfiguration(EventRegistryEngineConfiguration eventEngineConfiguration)
-
-