test/jdk/java/net/httpclient/reactivestreams-tck-tests/TckDriver.java
author dfuchs
Tue, 01 Oct 2019 12:10:33 +0100
changeset 58423 54de0c861d32
parent 55546 3ae57bbf9585
permissions -rw-r--r--
8231506: Fix some instabilities in a few networking tests Reviewed-by: alanb, chegar, msheppar
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
55546
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
     1
/*
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
     2
 * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
     4
 *
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
     7
 * published by the Free Software Foundation.
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
     8
 *
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    13
 * accompanied this code).
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    14
 *
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    18
 *
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    21
 * questions.
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    22
 */
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    23
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    24
/*
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    25
 * @test
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    26
 * @bug 8226602
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    27
 * @summary Tests convenience reactive primitives with RS TCK
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    28
 *
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    29
 * @library ../reactivestreams-tck
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    30
 * @build S
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    31
 *
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    32
 * @compile -encoding UTF-8 SPublisherOfStream.java
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    33
 *
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    34
 * @compile -encoding UTF-8 BodyPublishersFromPublisher.java
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    35
 * @compile -encoding UTF-8 BodyPublishersNoBody.java
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    36
 * @compile -encoding UTF-8 BodyPublishersOfByteArray.java
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    37
 * @compile -encoding UTF-8 BodyPublishersOfByteArrays.java
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    38
 * @compile -encoding UTF-8 BodyPublishersOfFile.java
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    39
 * @compile -encoding UTF-8 BodyPublishersOfInputStream.java
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    40
 * @compile -encoding UTF-8 BodyPublishersOfSubByteArray.java
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    41
 *
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    42
 * @compile -encoding UTF-8 BodySubscribersBuffering.java
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    43
 * @compile -encoding UTF-8 BodySubscribersDiscarding.java
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    44
 * @compile -encoding UTF-8 BodySubscribersFromLineSubscriber.java
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    45
 * @compile -encoding UTF-8 BodySubscribersFromSubscriber.java
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    46
 * @compile -encoding UTF-8 BodySubscribersMapping.java
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    47
 * @compile -encoding UTF-8 BodySubscribersOfByteArray.java
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    48
 * @compile -encoding UTF-8 BodySubscribersOfByteArrayConsumer.java
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    49
 * @compile -encoding UTF-8 BodySubscribersOfFile.java
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    50
 * @compile -encoding UTF-8 BodySubscribersOfInputStream.java
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    51
 * @compile -encoding UTF-8 BodySubscribersOfLines.java
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    52
 * @compile -encoding UTF-8 BodySubscribersOfPublisher.java
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    53
 * @compile -encoding UTF-8 BodySubscribersOfPublisher1.java
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    54
 * @compile -encoding UTF-8 BodySubscribersOfPublisherPublisher.java
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    55
 * @compile -encoding UTF-8 BodySubscribersOfString.java
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    56
 * @compile -encoding UTF-8 BodySubscribersReplacing.java
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    57
 *
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    58
 * @run testng/othervm STest
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    59
 * @run testng/othervm SPublisherOfStream
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    60
 *
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    61
 * @run testng/othervm BodyPublishersFromPublisher
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    62
 * @run testng/othervm BodyPublishersNoBody
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    63
 * @run testng/othervm BodyPublishersOfByteArray
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    64
 * @run testng/othervm BodyPublishersOfByteArrays
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    65
 * @run testng/othervm BodyPublishersOfFile
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    66
 * @run testng/othervm BodyPublishersOfInputStream
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    67
 * @run testng/othervm BodyPublishersOfSubByteArray
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    68
 *
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    69
 * @run testng/othervm BodySubscribersBuffering
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    70
 * @run testng/othervm BodySubscribersDiscarding
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    71
 * @run testng/othervm BodySubscribersFromLineSubscriber
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    72
 * @run testng/othervm BodySubscribersFromSubscriber
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    73
 * @run testng/othervm BodySubscribersMapping
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    74
 * @run testng/othervm BodySubscribersOfByteArray
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    75
 * @run testng/othervm BodySubscribersOfByteArrayConsumer
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    76
 * @run testng/othervm BodySubscribersOfFile
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    77
 * @run testng/othervm BodySubscribersOfInputStream
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    78
 * @run testng/othervm BodySubscribersOfLines
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    79
 * @run testng/othervm BodySubscribersOfPublisher
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    80
 * @run testng/othervm BodySubscribersOfPublisher1
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    81
 * @run testng/othervm BodySubscribersOfPublisherPublisher
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    82
 * @run testng/othervm BodySubscribersOfString
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    83
 * @run testng/othervm BodySubscribersReplacing
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    84
 *
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    85
 * @key randomness
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    86
 */
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    87
public class TckDriver {
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    88
   /*
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    89
        #### General Information
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    90
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    91
        1. This JTREG test aggregates multiple TestNG tests. This is because
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    92
        these tests share a common library (reactivestreams-tck), and we don't
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    93
        want this library to be compiled separately for each of those tests.
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    94
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    95
        2. Tests that use RS TCK are compiled with the UTF-8 encoding. This is
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    96
        performed for the sake of reactivestreams-tck. We don't want to patch
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    97
        the TCK because of the extra merging work in the future, should we bring
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    98
        update(s) from the RS repo.
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
    99
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   100
        #### Tests
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   101
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   102
        1. The purpose of each test should be easily digestible. The name of the
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   103
        test is derived from the very entity the test exercises. For example,
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   104
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   105
            the BodyPublishersOfFile test exercises the BodyPublisher obtained
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   106
            by calling BodyPublishers.ofFile(Path)
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   107
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   108
            the BodySubscribersOfFile test exercises the BodySubscriber obtained
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   109
            by calling BodySubscribers.ofFile(Path)
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   110
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   111
        2. RS TCK requires PublisherVerification tests to produce publishers
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   112
        capable of emitting a certain number of elements. In order to achieve
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   113
        this, we use some knowledge of the internal workings of our publishers.
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   114
        An example would be a chunk size a publisher uses to deliver a portion
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   115
        of data. Without knowing that it is not possible to guarantee that the
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   116
        publisher will emit a particular number of elements.
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   117
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   118
        3. Typically our publishers cannot be created in a known failed state.
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   119
        In this case the corresponding `createFailedFlowPublisher` method
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   120
        returns `null`.
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   121
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   122
        4. SubscriberBlackBoxVerification uses the `createElement(int element)`
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   123
        method. Our implementations usually cap the amount of data created by
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   124
        this method, because it's not known beforehand how big the `element`
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   125
        value is. Hence, sometimes there's code like as follows:
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   126
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   127
            @Override
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   128
            public List<ByteBuffer> createElement(int element) {
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   129
                return scatterBuffer(
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   130
                        bufferOfNRandomASCIIBytes(element % 17));
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   131
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   132
            }
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   133
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   134
        5. The amount of testing RS TCK performs on a publisher seems to depend
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   135
        on the number of elements this publisher reports it can emit. Sometimes
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   136
        a code like the following can be seen in the tests:
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   137
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   138
                @Override public long maxElementsFromPublisher() {
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   139
                    return 21;
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   140
                ~~~~~~~~~~~^
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   141
                }
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   142
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   143
        This magic number is a result of trial and error and seems to unlock
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   144
        most of the tests. Reporting big values (e.g. Long.MAX_VALUE - 1) is
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   145
        not an option for most of our publishers because they require to have
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   146
        all the elements upfront.
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   147
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   148
        6. It doesn't seem currently feasible to provide SubscriberWhiteboxVerification
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   149
        tests as a) it's not clear how much better the coverage is and b) it's
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   150
        significantly harder to code that.
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   151
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   152
        #### S (Support)
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   153
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   154
        Support utilities are being tested (STest) too.
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   155
    */
3ae57bbf9585 8226602: Test convenience reactive primitives from java.net.http with RS TCK
prappo
parents:
diff changeset
   156
}