7.9 Assertions

Cascading Stream Assertions are used to build robust reusable pipe assemblies. They can be planned out of a Flow instance during runtime. For more information see the section onStream Assertions. Below we describe the Assertions available in the core library.

AssertEquals

The cascading.operation.assertion.AssertEquals Assertion asserts the number of values given on the constructor is equal to the number of argument Tuple values and that each constructor value is .equals() to its corresponding argument value.

AssertNotEquals

The cascading.operation.assertion.AssertNotEquals Assertion asserts the number of values given on the constructor is equal to the number of argument Tuple values and that each constructor value is not .equals() to its corresponding argument value.

AssertEqualsAll

The cascading.operation.assertion.AssertEqualsAll Assertion asserts that every value in the argument Tuple is .equals() to the single value given on the constructor.

AssertExpression

The cascading.operation.assertion.AssertExpression Assertion dynamically resolves a given Java expression (see Expression Operations) using argument Tuple values. Any Tuple that returns true for the given expression passes the assertion.

AssertMatches

The cascading.operation.assertion.AssertMatches Assertion matches the given regular expression pattern String against the whole argument Tuple by joining each individual element of the Tuple with a TAB character (\t).

AssertMatchesAll

The cascading.operation.assertion.AssertMatchesAll Assertion matches the given regular expression pattern String against each argument Tuple value individually.

AssertNotNull

The cascading.operation.assertion.AssertNotNull Assertion asserts that every value in the argument Tuple is not a null value.

AssertNull

The cascading.operation.assertion.AssertNull Assertion asserts that every value in the argument Tuple is a null value.

AssertSizeEquals

The cascading.operation.assertion.AssertSizeEquals Assertion asserts that the current Tuple in the tuple stream is exactly the given size. On evaluation, Tuple#size() is called (note Tuples may hold null values).

AssertSizeLessThan

The cascading.operation.assertion.AssertSizeLessThan Assertion asserts that the current Tuple in the stream has a size less than (<) the given size. On evaluation, Tuple#size() is called (note Tuples may hold null values).

AssertSizeMoreThan

The cascading.operation.assertion.AssertSizeMoreThan Assertion asserts that the current Tuple in the stream has a size more than (>) the given size. On evaluation, Tuple#size() is called (note Tuples may hold null values).

AssertGroupSizeEquals

The cascading.operation.assertion.AssertGroupSizeEquals Group Assertion asserts that the number of items in the current grouping is equal (==) the given size. If a pattern String is given, only grouping keys that match the regular expression will have this assertion applied where multiple key values are delimited by a TAB character.

AssertGroupSizeLessThan

The cascading.operation.assertion.AssertGroupSizeEquals Group Assertion asserts that the number of items in the current grouping is less than (<) the given size. If a pattern String is given, only grouping keys that match the regular expression will have this assertion applied where multiple key values are delimited by a TAB character.

AssertGroupSizeMoreThan

The cascading.operation.assertion.AssertGroupSizeEquals Group Assertion asserts that the number of items in the current grouping is more than (>) the given size. If a pattern String is given, only grouping keys that match the regular expression will have this assertion applied where multiple key values are delimited by a TAB character.

Copyright © 2007-2008 Concurrent, Inc. All Rights Reserved.