blob: 1b37ee9974631f65b3bc377074977bb3eb2553a7 [file] [log] [blame]
Vsevolod Tolstopyatovd57bfa22019-04-04 14:25:13 +03001/*
2 * Copyright 2016-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3 */
4
5package kotlinx.coroutines.reactive.flow
6
7import org.junit.*
8import org.reactivestreams.*
9import org.reactivestreams.example.unicast.*
10import org.reactivestreams.tck.*
11
12class 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
31class 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}