Package com.rpl.rama.test
Class MockOutputCollector
java.lang.Object
com.rpl.rama.test.MockOutputCollector
- All Implemented Interfaces:
OutputCollector
Helper utility for unit testing a
RamaOperation
outside the context of a module or Block. Emits from the operation
are captured in internal state in this object and can be retrieved for performing
assertions.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classInformation about a captured emit -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidEmit any number of fields to the default output stream.voidemitStream(String streamName, Object... output) Emit any number of fields to a named output stream.getEmits()Retrieve captured emits in the order in which they happenedRetrieve captured emits split by stream name.
-
Constructor Details
-
MockOutputCollector
public MockOutputCollector()
-
-
Method Details
-
emit
Description copied from interface:OutputCollectorEmit any number of fields to the default output stream. This emit can be captured withBlock.Out.out(String...)- Specified by:
emitin interfaceOutputCollector- Parameters:
output- Output fields
-
emitStream
Description copied from interface:OutputCollectorEmit any number of fields to a named output stream. This emit can be captured withBlock.MultiOutImpl.outStream(String, String, String...)- Specified by:
emitStreamin interfaceOutputCollector- Parameters:
streamName- Name of output streamoutput- Output fields
-
getEmits
Retrieve captured emits in the order in which they happened -
getEmitsByStream
Retrieve captured emits split by stream name. The stream name for calls toOutputCollector.emit(java.lang.Object...)will benull.
-