diff options
Diffstat (limited to 'reactive/kotlinx-coroutines-reactive/test/RangePublisherTest.kt')
-rw-r--r-- | reactive/kotlinx-coroutines-reactive/test/RangePublisherTest.kt | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/reactive/kotlinx-coroutines-reactive/test/RangePublisherTest.kt b/reactive/kotlinx-coroutines-reactive/test/RangePublisherTest.kt new file mode 100644 index 00000000..72d5de5e --- /dev/null +++ b/reactive/kotlinx-coroutines-reactive/test/RangePublisherTest.kt @@ -0,0 +1,48 @@ +/* + * Copyright 2016-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + */ + +package kotlinx.coroutines.reactive + +import org.junit.* +import org.reactivestreams.* +import org.reactivestreams.example.unicast.* +import org.reactivestreams.tck.* + +class RangePublisherTest : PublisherVerification<Int>(TestEnvironment(50, 50)) { + + override fun createPublisher(elements: Long): Publisher<Int> { + return RangePublisher(1, elements.toInt()).asFlow().asPublisher() + } + + override fun createFailedPublisher(): Publisher<Int>? { + return null + } + + @Ignore + override fun required_spec309_requestZeroMustSignalIllegalArgumentException() { + } + + @Ignore + override fun required_spec309_requestNegativeNumberMustSignalIllegalArgumentException() { + } +} + +class RangePublisherWrappedTwiceTest : PublisherVerification<Int>(TestEnvironment(50, 50)) { + + override fun createPublisher(elements: Long): Publisher<Int> { + return RangePublisher(1, elements.toInt()).asFlow().asPublisher().asFlow().asPublisher() + } + + override fun createFailedPublisher(): Publisher<Int>? { + return null + } + + @Ignore + override fun required_spec309_requestZeroMustSignalIllegalArgumentException() { + } + + @Ignore + override fun required_spec309_requestNegativeNumberMustSignalIllegalArgumentException() { + } +}
\ No newline at end of file |