Vsevolod Tolstopyatov | d57bfa2 | 2019-04-04 14:25:13 +0300 | [diff] [blame] | 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.flow |
| 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 | |
| 14 | override fun createPublisher(elements: Long): Publisher<Int> { |
| 15 | return RangePublisher(1, elements.toInt()).asFlow().asPublisher() |
| 16 | } |
| 17 | |
| 18 | override fun createFailedPublisher(): Publisher<Int>? { |
| 19 | return null |
| 20 | } |
| 21 | |
| 22 | @Ignore |
| 23 | override fun required_spec309_requestZeroMustSignalIllegalArgumentException() { |
| 24 | } |
| 25 | |
| 26 | @Ignore |
| 27 | override fun required_spec309_requestNegativeNumberMustSignalIllegalArgumentException() { |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | class RangePublisherWrappedTwiceTest : PublisherVerification<Int>(TestEnvironment(50, 50)) { |
| 32 | |
| 33 | override fun createPublisher(elements: Long): Publisher<Int> { |
| 34 | return RangePublisher(1, elements.toInt()).asFlow().asPublisher().asFlow().asPublisher() |
| 35 | } |
| 36 | |
| 37 | override fun createFailedPublisher(): Publisher<Int>? { |
| 38 | return null |
| 39 | } |
| 40 | |
| 41 | @Ignore |
| 42 | override fun required_spec309_requestZeroMustSignalIllegalArgumentException() { |
| 43 | } |
| 44 | |
| 45 | @Ignore |
| 46 | override fun required_spec309_requestNegativeNumberMustSignalIllegalArgumentException() { |
| 47 | } |
| 48 | } |