Improving TerminalOp tests

Paul Sandoz paul.sandoz at
Wed Sep 26 05:53:04 PDT 2012


Here is a webrev to improve on the terminal op tests:

This is primarily motivated by the refactoring of AbstractPipeline and TerminalOp that is currently work in progress, but this patch can be committed separately to reduce the size of the corresponding change set for that work (which is rather large already).

The existing approach is too low-level and uses methods on TerminalOp that will be removed.

The new approach creates a reference result by obtaining all elements output from the pipeline of source+intermediate-ops into an ArrayList or LinkedHashMap and then evaluating the pipeline of elements+terminal-op.

I think this will allow us at some future point to validate short-circuit behaviour by supplying a special stream accessor that monitors what is being done to it (specifically the Iterator instances). It's still an open question how such behaviour can be validated when evaluating the whole pipeline of source+intermediate-ops+terminal-op.

I also included some more TestData instances specifically for sequential streams and map streams whose size is unknown, thus exercising the case of sink.begin(-1).


More information about the lambda-dev mailing list