public class SingleNodeIntegrationTestSupport
extends java.lang.Object
SingleNodeApplication
. It exposes
components and methods used for stream creation, deployment, and destruction and provides access to the
MessageBus
. Additionally, it supports registration of modules contained in a local resource location
(default: "file:./config").
Note that all operations block until the expected state is verified or the operation times out.Constructor and Description |
---|
SingleNodeIntegrationTestSupport(SingleNodeApplication application) |
SingleNodeIntegrationTestSupport(SingleNodeApplication application,
java.lang.String moduleResourceLocation)
Constructor useful for testing custom modules
|
Modifier and Type | Method and Description |
---|---|
void |
addPathListener(java.lang.String path,
org.apache.curator.framework.recipes.cache.PathChildrenCacheListener listener)
Add a
PathChildrenCacheListener for the given path. |
boolean |
createAndDeployStream(StreamDefinition definition)
Create and deploy a stream.
|
void |
deleteStream(java.lang.String name)
Delete a stream.
|
boolean |
deployStream(StreamDefinition definition)
Deploy a stream.
|
boolean |
deployStream(StreamDefinition definition,
java.util.Map<java.lang.String,java.lang.String> properties)
Deploy a stream with properties.
|
boolean |
deployStream(StreamDefinition definition,
java.util.Map<java.lang.String,java.lang.String> properties,
boolean allowIncomplete)
Deploy a stream with properties and allow return on incomplete deployment
|
java.util.Map<java.lang.String,java.util.Map<java.lang.Integer,Module>> |
getDeployedModules()
Get all currently deployed modules.
|
Module |
getModule(java.lang.String streamName,
java.lang.String moduleName,
int index)
Get a deployed module instance.
|
JobDefinitionRepository |
jobDefinitionRepository() |
JobRepository |
jobRepository() |
ResourceStateVerifier |
jobStateVerifier() |
MessageBusSupport |
messageBus() |
void |
removePathListener(java.lang.String path,
org.apache.curator.framework.recipes.cache.PathChildrenCacheListener listener)
Remove a
PathChildrenCacheListener for the given path. |
StreamDefinitionRepository |
streamDefinitionRepository() |
StreamDeployer |
streamDeployer() |
StreamRepository |
streamRepository() |
ResourceStateVerifier |
streamStateVerifier() |
boolean |
undeployAndDestroyStream(StreamDefinition definition)
Undeploy and destroy a stream.
|
boolean |
undeployStream(StreamDefinition definition)
Undeploy a stream.
|
ZooKeeperConnection |
zooKeeperConnection() |
public SingleNodeIntegrationTestSupport(SingleNodeApplication application)
public SingleNodeIntegrationTestSupport(SingleNodeApplication application, java.lang.String moduleResourceLocation)
application
- the SingleNodeApplication
moduleResourceLocation
- an additional Spring (file: or classpath:) resource location used by the
ModuleRegistry
public final java.util.Map<java.lang.String,java.util.Map<java.lang.Integer,Module>> getDeployedModules()
public final StreamDeployer streamDeployer()
public final StreamRepository streamRepository()
public final ResourceStateVerifier streamStateVerifier()
public final ResourceStateVerifier jobStateVerifier()
public final JobRepository jobRepository()
public final JobDefinitionRepository jobDefinitionRepository()
public final StreamDefinitionRepository streamDefinitionRepository()
public final MessageBusSupport messageBus()
public final boolean deployStream(StreamDefinition definition)
definition
- the stream definitionpublic final boolean deployStream(StreamDefinition definition, java.util.Map<java.lang.String,java.lang.String> properties)
definition
- the stream definitionproperties
- the deployment propertiespublic final boolean deployStream(StreamDefinition definition, java.util.Map<java.lang.String,java.lang.String> properties, boolean allowIncomplete)
definition
- the stream definitionproperties
- the deployment propertiesallowIncomplete
- allow incomplete as well as deployed statepublic final boolean createAndDeployStream(StreamDefinition definition)
definition
- the stream definitionpublic final boolean undeployStream(StreamDefinition definition)
definition
- the stream definitionpublic final boolean undeployAndDestroyStream(StreamDefinition definition)
definition
- the stream definitionpublic final void deleteStream(java.lang.String name)
name
- the stream namepublic final Module getModule(java.lang.String streamName, java.lang.String moduleName, int index)
streamName
- the stream namemoduleName
- the module nameindex
- the index of the module in the stream, ordered left to right starting with 0.public ZooKeeperConnection zooKeeperConnection()
public void addPathListener(java.lang.String path, org.apache.curator.framework.recipes.cache.PathChildrenCacheListener listener)
PathChildrenCacheListener
for the given path.path
- the path whose children to listen tolistener
- the children listenerpublic void removePathListener(java.lang.String path, org.apache.curator.framework.recipes.cache.PathChildrenCacheListener listener)
PathChildrenCacheListener
for the given path.path
- the path whose children to listen tolistener
- the children listener