1 /*
2  * Copyright 2016-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3  */
4 
5 package kotlinx.coroutines.reactive
6 
7 import org.junit.*
8 import org.reactivestreams.*
9 import org.reactivestreams.example.unicast.*
10 import org.reactivestreams.tck.*
11 
12 class RangePublisherTest : PublisherVerification<Int>(TestEnvironment(50, 50)) {
13 
createPublishernull14     override fun createPublisher(elements: Long): Publisher<Int> {
15         return RangePublisher(1, elements.toInt()).asFlow().asPublisher()
16     }
17 
createFailedPublishernull18     override fun createFailedPublisher(): Publisher<Int>? {
19         return null
20     }
21 
22     @Ignore
required_spec309_requestZeroMustSignalIllegalArgumentExceptionnull23     override fun required_spec309_requestZeroMustSignalIllegalArgumentException() {
24     }
25 
26     @Ignore
required_spec309_requestNegativeNumberMustSignalIllegalArgumentExceptionnull27     override fun required_spec309_requestNegativeNumberMustSignalIllegalArgumentException() {
28     }
29 }
30 
31 class RangePublisherWrappedTwiceTest : PublisherVerification<Int>(TestEnvironment(50, 50)) {
32 
createPublishernull33     override fun createPublisher(elements: Long): Publisher<Int> {
34         return RangePublisher(1, elements.toInt()).asFlow().asPublisher().asFlow().asPublisher()
35     }
36 
createFailedPublishernull37     override fun createFailedPublisher(): Publisher<Int>? {
38         return null
39     }
40 
41     @Ignore
required_spec309_requestZeroMustSignalIllegalArgumentExceptionnull42     override fun required_spec309_requestZeroMustSignalIllegalArgumentException() {
43     }
44 
45     @Ignore
required_spec309_requestNegativeNumberMustSignalIllegalArgumentExceptionnull46     override fun required_spec309_requestNegativeNumberMustSignalIllegalArgumentException() {
47     }
48 }