Package dev.getelements.elements.test
Interface EmbeddedTestService
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
JeroMQEmbeddedTestService
Represents a completely and entirely separate test kit. This is an interface to a complete and total embedded test
instance containing a client as well as a single worker instance in a single memory space.
This allows test code to access both a client and worker instance
Context which can be used to issue calls
to the underlying script engine.
In the case of the client Context, the calls are serialized over a virtual network ensuring that the behavior
of the simulated cluster resembles the actual deployed behavior as closely as absolutely possible.-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the test service.default EmbeddedClientInstanceContainerGets the clientEmbeddedInstanceContainer.default ServiceLocatorDeprecated.Gets the clientOptional<EmbeddedInstanceContainer>.default ServiceLocatorDeprecated.default EmbeddedWorkerInstanceContainerGets the workerEmbeddedWorkerInstanceContainer.Gets the clientOptional<EmbeddedWorkerInstanceContainer>.onClose(Consumer<? super EmbeddedTestService> consumer) Subscribes to an even that is fired when the service is closed.start()Starts theEmbeddedTestService.
-
Method Details
-
start
EmbeddedTestService start()Starts theEmbeddedTestService.- Returns:
-
onClose
Subscribes to an even that is fired when the service is closed.- Parameters:
consumer-- Returns:
-
close
void close()Closes the test service.- Specified by:
closein interfaceAutoCloseable
-
getIocResolver
Deprecated. -
getClientIocResolver
Deprecated. -
getClient
Gets the clientEmbeddedInstanceContainer.- Returns:
- the client
EmbeddedInstanceContainer
-
getClientOptional
Optional<EmbeddedClientInstanceContainer> getClientOptional()Gets the clientOptional<EmbeddedInstanceContainer>. Is present only if configured.- Returns:
- the client
Optional<EmbeddedInstanceContainer>
-
getWorker
Gets the workerEmbeddedWorkerInstanceContainer.- Returns:
- the worker
EmbeddedWorkerInstanceContainer
-
getWorkerOptional
Optional<EmbeddedWorkerInstanceContainer> getWorkerOptional()Gets the clientOptional<EmbeddedWorkerInstanceContainer>. Is present only if configured.- Returns:
- the client
Optional<EmbeddedWorkerInstanceContainer>
-