Debian Codegraph @

src/test/java/io/reactivex/rxjava3/tck/MulticastProcessorRefCountedTckTest.java

raw
1 /*
2 * Copyright (c) 2016-present, RxJava Contributors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 * compliance with the License. You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 * the License for the specific language governing permissions and limitations under the License.
12 */
13
14 package io.reactivex.rxjava3.tck;
15
16 import java.util.concurrent.*;
17
18 import org.reactivestreams.*;
19 import org.reactivestreams.tck.*;
20 import org.testng.annotations.Test;
21
22 import io.reactivex.rxjava3.exceptions.TestException;
23 import io.reactivex.rxjava3.processors.MulticastProcessor;
24
25 @Test
26 public class MulticastProcessorRefCountedTckTest extends IdentityProcessorVerification<Integer> {
27
28 public MulticastProcessorRefCountedTckTest() {
29 super(new TestEnvironment(200));
30 }
31
32 @Override
33 public Processor<Integer, Integer> createIdentityProcessor(int bufferSize) {
34 MulticastProcessor<Integer> mp = MulticastProcessor.create(true);
35 return mp;
36 }
37
38 @Override
39 public Publisher<Integer> createFailedPublisher() {
40 MulticastProcessor<Integer> mp = MulticastProcessor.create();
41 mp.start();
42 mp.onError(new TestException());
43 return mp;
44 }
45
46 @Override
47 public ExecutorService publisherExecutorService() {
48 return Executors.newCachedThreadPool();
49 }
50
51 @Override
52 public Integer createElement(int element) {
53 return element;
54 }
55
56 @Override
57 public long maxSupportedSubscribers() {
58 return 1;
59 }
60
61 @Override
62 public long maxElementsFromPublisher() {
63 return 1024;
64 }
65 }