Improving TerminalOp tests

Brian Goetz brian.goetz at oracle.com
Thu Sep 27 11:19:45 PDT 2012


Pushed.

On 9/26/2012 8:53 AM, Paul Sandoz wrote:
> Hi,
>
> Here is a webrev to improve on the terminal op tests:
>
> http://cr.openjdk.java.net/~psandoz/lambda/termtests/webrev/
>
> 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).
>
> Paul.
>


More information about the lambda-dev mailing list