You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tck-flow/README.md
+34-43
Original file line number
Diff line number
Diff line change
@@ -5,8 +5,6 @@ and help Reactive Streams library implementers to validate their implementations
5
5
6
6
Since this version of the TCK is intended to verify the interfaces contained in Java 9 (under `java.util.concurrent.Flow.*`), at least Java `9` is required to run this TCK. If you're looking for the previous TCK that was intended for Reactive Streams prior to their inclusion in the JDK please look at []
7
7
8
-
The TCK is implemented using **plain Java (1.6)** and **TestNG** tests, and should be possible to use from other JVM-based languages and testing libraries.
9
-
10
8
## Structure of the TCK
11
9
12
10
The TCK aims to cover all rules defined in the Specification, however for some rules outlined in the Specification it is
@@ -138,7 +136,7 @@ The expected behaviour from the returned implementation is to follow Rule 1.4 an
138
136
with the order of emiting the `Subscription` and signaling the failure.
@@ -187,7 +185,7 @@ public class RangePublisherTest extends FlowPublisherVerification<Integer> {
187
185
188
186
@Override
189
187
publiclongmaxElementsFromPublisher() {
190
-
returnLong.MAX_VALUE—1;
188
+
returnLong.MAX_VALUE-1;
191
189
}
192
190
193
191
@Override
@@ -258,7 +256,7 @@ The helper `Publisher` is an asynchronous `Publisher` by default—meaning that
258
256
259
257
When extending `Subscriber` Verification classes a type parameter representing the element type passed through the stream must be given.
260
258
Implementations are typically not sensitive to the type of element being signalled, but sometimes a `Subscriber` may be limited to only be able to work within a known set of types -
261
-
like a `FileSubscriber extends Subscriber<ByteBuffer>` for example, that writes each element (ByteBuffer) it receives into a file.
259
+
like a `FileSubscriber extends Flow.Subscriber<ByteBuffer>` for example, that writes each element (ByteBuffer) it receives into a file.
262
260
For element type agnostic Subscribers the simplest way is to parameterize the tests using `Integer` and in the `createElement(int idx)` method (explained below in futher detail), return the incoming `int`.
263
261
In case an implementation needs to work on a specific type, the verification class should be parameterized using that type (e.g. `class StringSubTest extends FlowSubscriberWhiteboxVerification<String>`) and the `createElement` method must be overriden to return a `String`.
264
262
@@ -288,8 +286,8 @@ NOTE: The `createElement` method *MAY* be called *concurrently from multiple thr
288
286
**Very advanced**: While it is not expected for many implementations having to do so, it is possible to take full control of the `Publisher` which will be driving the TCKs test. This can be achieved by implementing the `createHelperPublisher` method in which one can implement the `createHelperPublisher` method by returning a custom `Publisher` implementation which will then be used by the TCK to drive your `Subscriber` tests:
0 commit comments