本文整理匯總了Java中io.reactivex.subscribers.TestSubscriber.assertValueSequence方法的典型用法代碼示例。如果您正苦於以下問題:Java TestSubscriber.assertValueSequence方法的具體用法?Java TestSubscriber.assertValueSequence怎麽用?Java TestSubscriber.assertValueSequence使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類io.reactivex.subscribers.TestSubscriber
的用法示例。
在下文中一共展示了TestSubscriber.assertValueSequence方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: test
import io.reactivex.subscribers.TestSubscriber; //導入方法依賴的package包/類
@Test
public void test() throws InterruptedException {
// The values we want to publish on the stream
Iterable<Integer> streamValues = Arrays.asList(1, 2, 3, 4, 5);
// The actual stream. NOTE: it can be any implementation of a Publisher interface
Flowable<Integer> stream = Flowable.fromIterable(streamValues);
// The key for referring to the stream
StreamId<Integer> streamId = NamedStreamId.ofName("Any stream id");
// This will register the stream in the Streaming Pool system
providingService.provide(streamId, stream);
TestSubscriber<Integer> subscriber = TestSubscriber.create();
// With a test subscriber from RxJava2 we receives the values
discoveryService.discover(streamId).subscribe(subscriber);
subscriber.await();
subscriber.assertValueSequence(streamValues);
}