use of org.apache.hop.pipeline.transform.BaseTransform in project hop by apache.
the class CheckSumTest method executeHexTest.
/**
* Create, execute, and return the row listener attached to the output transform with complete
* results from the execution.
*
* @param checkSumType Type of checksum to use
* @param input String to calculate checksum for
* @param meta meta to be used
* @return IRowListener with results.
*/
private MockRowListener executeHexTest(CheckSumMeta.CheckSumType checkSumType, Object input, IValueMeta meta) throws Exception {
Pipeline pipeline = buildHexadecimalChecksumPipeline(checkSumType);
pipeline.prepareExecution();
ITransform output = pipeline.getRunThread("Output", 0);
MockRowListener listener = new MockRowListener();
output.addRowListener(listener);
RowProducer rp = pipeline.addRowProducer("CheckSum", 0);
RowMeta inputRowMeta = createStringRowMeta(meta);
((BaseTransform) pipeline.getRunThread("CheckSum", 0)).setInputRowMeta(inputRowMeta);
pipeline.startThreads();
rp.putRow(inputRowMeta, new Object[] { input });
rp.finished();
pipeline.waitUntilFinished();
pipeline.stopAll();
pipeline.cleanup();
return listener;
}
Aggregations