The following issues were found
src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableDoOnUnsubscribeTest.java
36 issues
Line: 33
public class FlowableDoOnUnsubscribeTest extends RxJavaTest {
@Test
public void doOnUnsubscribe() throws Exception {
int subCount = 3;
final CountDownLatch upperLatch = new CountDownLatch(subCount);
final CountDownLatch lowerLatch = new CountDownLatch(subCount);
final CountDownLatch onNextLatch = new CountDownLatch(subCount);
Reported by PMD.
Line: 33
public class FlowableDoOnUnsubscribeTest extends RxJavaTest {
@Test
public void doOnUnsubscribe() throws Exception {
int subCount = 3;
final CountDownLatch upperLatch = new CountDownLatch(subCount);
final CountDownLatch lowerLatch = new CountDownLatch(subCount);
final CountDownLatch onNextLatch = new CountDownLatch(subCount);
Reported by PMD.
Line: 74
List<TestSubscriber<Long>> subscribers = new ArrayList<>();
for (int i = 0; i < subCount; ++i) {
TestSubscriber<Long> subscriber = new TestSubscriber<>();
subscriptions.add(Disposable.fromSubscription(subscriber));
longs.subscribe(subscriber);
subscribers.add(subscriber);
}
Reported by PMD.
Line: 82
onNextLatch.await();
for (int i = 0; i < subCount; ++i) {
subscriptions.get(i).dispose();
// Test that unsubscribe() method is not affected in any way
}
upperLatch.await();
lowerLatch.await();
Reported by PMD.
Line: 93
}
@Test
public void doOnUnSubscribeWorksWithRefCount() throws Exception {
int subCount = 3;
final CountDownLatch upperLatch = new CountDownLatch(1);
final CountDownLatch lowerLatch = new CountDownLatch(1);
final CountDownLatch onNextLatch = new CountDownLatch(subCount);
Reported by PMD.
Line: 93
}
@Test
public void doOnUnSubscribeWorksWithRefCount() throws Exception {
int subCount = 3;
final CountDownLatch upperLatch = new CountDownLatch(1);
final CountDownLatch lowerLatch = new CountDownLatch(1);
final CountDownLatch onNextLatch = new CountDownLatch(subCount);
Reported by PMD.
Line: 135
List<TestSubscriber<Long>> subscribers = new ArrayList<>();
for (int i = 0; i < subCount; ++i) {
TestSubscriber<Long> subscriber = new TestSubscriber<>();
longs.subscribe(subscriber);
subscriptions.add(Disposable.fromSubscription(subscriber));
subscribers.add(subscriber);
}
Reported by PMD.
Line: 143
onNextLatch.await();
for (int i = 0; i < subCount; ++i) {
subscriptions.get(i).dispose();
// Test that unsubscribe() method is not affected in any way
}
upperLatch.await();
lowerLatch.await();
Reported by PMD.
Line: 170
.subscribe()
.dispose();
assertEquals(1, cancelCalled.get());
}
}
Reported by PMD.
Line: 24
import org.junit.Test;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.disposables.*;
import io.reactivex.rxjava3.functions.*;
import io.reactivex.rxjava3.processors.BehaviorProcessor;
import io.reactivex.rxjava3.subscribers.TestSubscriber;
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableTakeLastOneTest.java
36 issues
Line: 32
public class FlowableTakeLastOneTest extends RxJavaTest {
@Test
public void lastOfManyReturnsLast() {
TestSubscriberEx<Integer> s = new TestSubscriberEx<>();
Flowable.range(1, 10).takeLast(1).subscribe(s);
s.assertValue(10);
s.assertNoErrors();
s.assertTerminated();
Reported by PMD.
Line: 34
@Test
public void lastOfManyReturnsLast() {
TestSubscriberEx<Integer> s = new TestSubscriberEx<>();
Flowable.range(1, 10).takeLast(1).subscribe(s);
s.assertValue(10);
s.assertNoErrors();
s.assertTerminated();
// NO longer assertable
// s.assertUnsubscribed();
Reported by PMD.
Line: 34
@Test
public void lastOfManyReturnsLast() {
TestSubscriberEx<Integer> s = new TestSubscriberEx<>();
Flowable.range(1, 10).takeLast(1).subscribe(s);
s.assertValue(10);
s.assertNoErrors();
s.assertTerminated();
// NO longer assertable
// s.assertUnsubscribed();
Reported by PMD.
Line: 43
}
@Test
public void lastOfEmptyReturnsEmpty() {
TestSubscriberEx<Object> s = new TestSubscriberEx<>();
Flowable.empty().takeLast(1).subscribe(s);
s.assertNoValues();
s.assertNoErrors();
s.assertTerminated();
Reported by PMD.
Line: 45
@Test
public void lastOfEmptyReturnsEmpty() {
TestSubscriberEx<Object> s = new TestSubscriberEx<>();
Flowable.empty().takeLast(1).subscribe(s);
s.assertNoValues();
s.assertNoErrors();
s.assertTerminated();
// NO longer assertable
// s.assertUnsubscribed();
Reported by PMD.
Line: 45
@Test
public void lastOfEmptyReturnsEmpty() {
TestSubscriberEx<Object> s = new TestSubscriberEx<>();
Flowable.empty().takeLast(1).subscribe(s);
s.assertNoValues();
s.assertNoErrors();
s.assertTerminated();
// NO longer assertable
// s.assertUnsubscribed();
Reported by PMD.
Line: 54
}
@Test
public void lastOfOneReturnsLast() {
TestSubscriberEx<Integer> s = new TestSubscriberEx<>();
Flowable.just(1).takeLast(1).subscribe(s);
s.assertValue(1);
s.assertNoErrors();
s.assertTerminated();
Reported by PMD.
Line: 56
@Test
public void lastOfOneReturnsLast() {
TestSubscriberEx<Integer> s = new TestSubscriberEx<>();
Flowable.just(1).takeLast(1).subscribe(s);
s.assertValue(1);
s.assertNoErrors();
s.assertTerminated();
// NO longer assertable
// s.assertUnsubscribed();
Reported by PMD.
Line: 56
@Test
public void lastOfOneReturnsLast() {
TestSubscriberEx<Integer> s = new TestSubscriberEx<>();
Flowable.just(1).takeLast(1).subscribe(s);
s.assertValue(1);
s.assertNoErrors();
s.assertTerminated();
// NO longer assertable
// s.assertUnsubscribed();
Reported by PMD.
Line: 74
}
};
Flowable.just(1).concatWith(Flowable.<Integer>never())
.doOnCancel(unsubscribeAction)
.takeLast(1)
.subscribe().dispose();
assertTrue(unsubscribed.get());
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableSwitchIfEmptyTest.java
36 issues
Line: 34
public class FlowableSwitchIfEmptyTest extends RxJavaTest {
@Test
public void switchWhenNotEmpty() throws Exception {
final AtomicBoolean subscribed = new AtomicBoolean(false);
final Flowable<Integer> flowable = Flowable.just(4)
.switchIfEmpty(Flowable.just(2)
.doOnSubscribe(new Consumer<Subscription>() {
@Override
Reported by PMD.
Line: 34
public class FlowableSwitchIfEmptyTest extends RxJavaTest {
@Test
public void switchWhenNotEmpty() throws Exception {
final AtomicBoolean subscribed = new AtomicBoolean(false);
final Flowable<Integer> flowable = Flowable.just(4)
.switchIfEmpty(Flowable.just(2)
.doOnSubscribe(new Consumer<Subscription>() {
@Override
Reported by PMD.
Line: 45
}
}));
assertEquals(4, flowable.blockingSingle().intValue());
assertFalse(subscribed.get());
}
@Test
public void switchWhenEmpty() throws Exception {
Reported by PMD.
Line: 45
}
}));
assertEquals(4, flowable.blockingSingle().intValue());
assertFalse(subscribed.get());
}
@Test
public void switchWhenEmpty() throws Exception {
Reported by PMD.
Line: 46
}));
assertEquals(4, flowable.blockingSingle().intValue());
assertFalse(subscribed.get());
}
@Test
public void switchWhenEmpty() throws Exception {
final Flowable<Integer> flowable = Flowable.<Integer>empty()
Reported by PMD.
Line: 50
}
@Test
public void switchWhenEmpty() throws Exception {
final Flowable<Integer> flowable = Flowable.<Integer>empty()
.switchIfEmpty(Flowable.fromIterable(Arrays.asList(42)));
assertEquals(42, flowable.blockingSingle().intValue());
}
Reported by PMD.
Line: 51
@Test
public void switchWhenEmpty() throws Exception {
final Flowable<Integer> flowable = Flowable.<Integer>empty()
.switchIfEmpty(Flowable.fromIterable(Arrays.asList(42)));
assertEquals(42, flowable.blockingSingle().intValue());
}
Reported by PMD.
Line: 51
@Test
public void switchWhenEmpty() throws Exception {
final Flowable<Integer> flowable = Flowable.<Integer>empty()
.switchIfEmpty(Flowable.fromIterable(Arrays.asList(42)));
assertEquals(42, flowable.blockingSingle().intValue());
}
Reported by PMD.
Line: 54
final Flowable<Integer> flowable = Flowable.<Integer>empty()
.switchIfEmpty(Flowable.fromIterable(Arrays.asList(42)));
assertEquals(42, flowable.blockingSingle().intValue());
}
@Test
public void switchWithProducer() throws Exception {
final AtomicBoolean emitted = new AtomicBoolean(false);
Reported by PMD.
Line: 54
final Flowable<Integer> flowable = Flowable.<Integer>empty()
.switchIfEmpty(Flowable.fromIterable(Arrays.asList(42)));
assertEquals(42, flowable.blockingSingle().intValue());
}
@Test
public void switchWithProducer() throws Exception {
final AtomicBoolean emitted = new AtomicBoolean(false);
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableConcatWithMaybeTest.java
36 issues
Line: 30
public class ObservableConcatWithMaybeTest extends RxJavaTest {
@Test
public void normalEmpty() {
final TestObserver<Integer> to = new TestObserver<>();
Observable.range(1, 5)
.concatWith(Maybe.<Integer>fromAction(new Action() {
@Override
Reported by PMD.
Line: 46
}
@Test
public void normalNonEmpty() {
final TestObserver<Integer> to = new TestObserver<>();
Observable.range(1, 5)
.concatWith(Maybe.just(100))
.subscribe(to);
Reported by PMD.
Line: 49
public void normalNonEmpty() {
final TestObserver<Integer> to = new TestObserver<>();
Observable.range(1, 5)
.concatWith(Maybe.just(100))
.subscribe(to);
to.assertResult(1, 2, 3, 4, 5, 100);
}
Reported by PMD.
Line: 49
public void normalNonEmpty() {
final TestObserver<Integer> to = new TestObserver<>();
Observable.range(1, 5)
.concatWith(Maybe.just(100))
.subscribe(to);
to.assertResult(1, 2, 3, 4, 5, 100);
}
Reported by PMD.
Line: 57
}
@Test
public void mainError() {
final TestObserver<Integer> to = new TestObserver<>();
Observable.<Integer>error(new TestException())
.concatWith(Maybe.<Integer>fromAction(new Action() {
@Override
Reported by PMD.
Line: 73
}
@Test
public void otherError() {
final TestObserver<Integer> to = new TestObserver<>();
Observable.range(1, 5)
.concatWith(Maybe.<Integer>error(new TestException()))
.subscribe(to);
Reported by PMD.
Line: 84
}
@Test
public void takeMain() {
final TestObserver<Integer> to = new TestObserver<>();
Observable.range(1, 5)
.concatWith(Maybe.<Integer>fromAction(new Action() {
@Override
Reported by PMD.
Line: 101
}
@Test
public void cancelOther() {
MaybeSubject<Object> other = MaybeSubject.create();
TestObserver<Object> to = Observable.empty()
.concatWith(other)
.test();
Reported by PMD.
Line: 104
public void cancelOther() {
MaybeSubject<Object> other = MaybeSubject.create();
TestObserver<Object> to = Observable.empty()
.concatWith(other)
.test();
assertTrue(other.hasObservers());
Reported by PMD.
Line: 104
public void cancelOther() {
MaybeSubject<Object> other = MaybeSubject.create();
TestObserver<Object> to = Observable.empty()
.concatWith(other)
.test();
assertTrue(other.hasObservers());
Reported by PMD.
src/test/java/io/reactivex/rxjava3/observable/ObservableMergeTests.java
36 issues
Line: 32
* This won't compile if super/extends isn't done correctly on generics.
*/
@Test
public void covarianceOfMerge() {
Observable<HorrorMovie> horrors = Observable.just(new HorrorMovie());
Observable<Observable<HorrorMovie>> metaHorrors = Observable.just(horrors);
Observable.<Media> merge(metaHorrors);
}
Reported by PMD.
Line: 45
Observable<Observable<Media>> os = Observable.just(o1, o2);
List<Media> values = Observable.merge(os).toList().blockingGet();
assertEquals(4, values.size());
}
@Test
Reported by PMD.
Line: 45
Observable<Observable<Media>> os = Observable.just(o1, o2);
List<Media> values = Observable.merge(os).toList().blockingGet();
assertEquals(4, values.size());
}
@Test
Reported by PMD.
Line: 47
List<Media> values = Observable.merge(os).toList().blockingGet();
assertEquals(4, values.size());
}
@Test
public void mergeCovariance2() {
Observable<Media> o1 = Observable.just(new HorrorMovie(), new Movie(), new Media());
Reported by PMD.
Line: 47
List<Media> values = Observable.merge(os).toList().blockingGet();
assertEquals(4, values.size());
}
@Test
public void mergeCovariance2() {
Observable<Media> o1 = Observable.just(new HorrorMovie(), new Movie(), new Media());
Reported by PMD.
Line: 57
Observable<Observable<Media>> os = Observable.just(o1, o2);
List<Media> values = Observable.merge(os).toList().blockingGet();
assertEquals(5, values.size());
}
@Test
Reported by PMD.
Line: 57
Observable<Observable<Media>> os = Observable.just(o1, o2);
List<Media> values = Observable.merge(os).toList().blockingGet();
assertEquals(5, values.size());
}
@Test
Reported by PMD.
Line: 59
List<Media> values = Observable.merge(os).toList().blockingGet();
assertEquals(5, values.size());
}
@Test
public void mergeCovariance3() {
Observable<Movie> o1 = Observable.just(new HorrorMovie(), new Movie());
Reported by PMD.
Line: 59
List<Media> values = Observable.merge(os).toList().blockingGet();
assertEquals(5, values.size());
}
@Test
public void mergeCovariance3() {
Observable<Movie> o1 = Observable.just(new HorrorMovie(), new Movie());
Reported by PMD.
Line: 63
}
@Test
public void mergeCovariance3() {
Observable<Movie> o1 = Observable.just(new HorrorMovie(), new Movie());
Observable<Media> o2 = Observable.just(new Media(), new HorrorMovie());
List<Media> values = Observable.merge(o1, o2).toList().blockingGet();
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/completable/CompletableAndThenCompletableTest.java
36 issues
Line: 163
try {
Thread.sleep(30);
} catch (InterruptedException e) {
System.out.println("Interrupted! " + Thread.currentThread());
interrupted[0] = true;
}
}
}))
.subscribe(new Action() {
Reported by PMD.
Line: 30
import io.reactivex.rxjava3.schedulers.Schedulers;
import io.reactivex.rxjava3.testsupport.TestHelper;
public class CompletableAndThenCompletableTest extends RxJavaTest {
@Test
public void andThenCompletableCompleteComplete() {
Completable.complete()
.andThen(Completable.complete())
.test()
Reported by PMD.
Line: 32
public class CompletableAndThenCompletableTest extends RxJavaTest {
@Test
public void andThenCompletableCompleteComplete() {
Completable.complete()
.andThen(Completable.complete())
.test()
.assertComplete();
}
Reported by PMD.
Line: 33
public class CompletableAndThenCompletableTest extends RxJavaTest {
@Test
public void andThenCompletableCompleteComplete() {
Completable.complete()
.andThen(Completable.complete())
.test()
.assertComplete();
}
Reported by PMD.
Line: 33
public class CompletableAndThenCompletableTest extends RxJavaTest {
@Test
public void andThenCompletableCompleteComplete() {
Completable.complete()
.andThen(Completable.complete())
.test()
.assertComplete();
}
Reported by PMD.
Line: 33
public class CompletableAndThenCompletableTest extends RxJavaTest {
@Test
public void andThenCompletableCompleteComplete() {
Completable.complete()
.andThen(Completable.complete())
.test()
.assertComplete();
}
Reported by PMD.
Line: 40
}
@Test
public void andThenCompletableCompleteError() {
Completable.complete()
.andThen(Completable.error(new TestException("test")))
.to(TestHelper.testConsumer())
.assertNotComplete()
.assertNoValues()
Reported by PMD.
Line: 51
}
@Test
public void andThenCompletableCompleteNever() {
Completable.complete()
.andThen(Completable.never())
.test()
.assertNoValues()
.assertNoErrors()
Reported by PMD.
Line: 52
@Test
public void andThenCompletableCompleteNever() {
Completable.complete()
.andThen(Completable.never())
.test()
.assertNoValues()
.assertNoErrors()
.assertNotComplete();
Reported by PMD.
Line: 52
@Test
public void andThenCompletableCompleteNever() {
Completable.complete()
.andThen(Completable.never())
.test()
.assertNoValues()
.assertNoErrors()
.assertNotComplete();
Reported by PMD.
src/main/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableSequenceEqualSingle.java
36 issues
Line: 31
import io.reactivex.rxjava3.plugins.RxJavaPlugins;
public final class FlowableSequenceEqualSingle<T> extends Single<Boolean> implements FuseToFlowable<Boolean> {
final Publisher<? extends T> first;
final Publisher<? extends T> second;
final BiPredicate<? super T, ? super T> comparer;
final int prefetch;
public FlowableSequenceEqualSingle(Publisher<? extends T> first, Publisher<? extends T> second,
Reported by PMD.
Line: 32
public final class FlowableSequenceEqualSingle<T> extends Single<Boolean> implements FuseToFlowable<Boolean> {
final Publisher<? extends T> first;
final Publisher<? extends T> second;
final BiPredicate<? super T, ? super T> comparer;
final int prefetch;
public FlowableSequenceEqualSingle(Publisher<? extends T> first, Publisher<? extends T> second,
BiPredicate<? super T, ? super T> comparer, int prefetch) {
Reported by PMD.
Line: 33
public final class FlowableSequenceEqualSingle<T> extends Single<Boolean> implements FuseToFlowable<Boolean> {
final Publisher<? extends T> first;
final Publisher<? extends T> second;
final BiPredicate<? super T, ? super T> comparer;
final int prefetch;
public FlowableSequenceEqualSingle(Publisher<? extends T> first, Publisher<? extends T> second,
BiPredicate<? super T, ? super T> comparer, int prefetch) {
this.first = first;
Reported by PMD.
Line: 34
final Publisher<? extends T> first;
final Publisher<? extends T> second;
final BiPredicate<? super T, ? super T> comparer;
final int prefetch;
public FlowableSequenceEqualSingle(Publisher<? extends T> first, Publisher<? extends T> second,
BiPredicate<? super T, ? super T> comparer, int prefetch) {
this.first = first;
this.second = second;
Reported by PMD.
Line: 56
return RxJavaPlugins.onAssembly(new FlowableSequenceEqual<>(first, second, comparer, prefetch));
}
static final class EqualCoordinator<T>
extends AtomicInteger
implements Disposable, EqualCoordinatorHelper {
private static final long serialVersionUID = -6178010334400373240L;
Reported by PMD.
Line: 56
return RxJavaPlugins.onAssembly(new FlowableSequenceEqual<>(first, second, comparer, prefetch));
}
static final class EqualCoordinator<T>
extends AtomicInteger
implements Disposable, EqualCoordinatorHelper {
private static final long serialVersionUID = -6178010334400373240L;
Reported by PMD.
Line: 62
private static final long serialVersionUID = -6178010334400373240L;
final SingleObserver<? super Boolean> downstream;
final BiPredicate<? super T, ? super T> comparer;
final EqualSubscriber<T> first;
Reported by PMD.
Line: 64
final SingleObserver<? super Boolean> downstream;
final BiPredicate<? super T, ? super T> comparer;
final EqualSubscriber<T> first;
final EqualSubscriber<T> second;
Reported by PMD.
Line: 66
final BiPredicate<? super T, ? super T> comparer;
final EqualSubscriber<T> first;
final EqualSubscriber<T> second;
final AtomicThrowable errors;
Reported by PMD.
Line: 68
final EqualSubscriber<T> first;
final EqualSubscriber<T> second;
final AtomicThrowable errors;
T v1;
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableScalarXMapTest.java
36 issues
Line: 28
import io.reactivex.rxjava3.subscribers.TestSubscriber;
import io.reactivex.rxjava3.testsupport.TestHelper;
public class FlowableScalarXMapTest extends RxJavaTest {
@Test
public void utilityClass() {
TestHelper.checkUtilityClass(FlowableScalarXMap.class);
}
Reported by PMD.
Line: 31
public class FlowableScalarXMapTest extends RxJavaTest {
@Test
public void utilityClass() {
TestHelper.checkUtilityClass(FlowableScalarXMap.class);
}
static final class CallablePublisher implements Publisher<Integer>, Supplier<Integer> {
@Override
Reported by PMD.
Line: 74
@Test
public void tryScalarXMap() {
TestSubscriber<Integer> ts = new TestSubscriber<>();
assertTrue(FlowableScalarXMap.tryScalarXMapSubscribe(new CallablePublisher(), ts, new Function<Integer, Publisher<Integer>>() {
@Override
public Publisher<Integer> apply(Integer f) throws Exception {
return Flowable.just(1);
}
}));
Reported by PMD.
Line: 88
public void emptyXMap() {
TestSubscriber<Integer> ts = new TestSubscriber<>();
assertTrue(FlowableScalarXMap.tryScalarXMapSubscribe(new EmptyCallablePublisher(), ts, new Function<Integer, Publisher<Integer>>() {
@Override
public Publisher<Integer> apply(Integer f) throws Exception {
return Flowable.just(1);
}
}));
Reported by PMD.
Line: 102
public void mapperCrashes() {
TestSubscriber<Integer> ts = new TestSubscriber<>();
assertTrue(FlowableScalarXMap.tryScalarXMapSubscribe(new OneCallablePublisher(), ts, new Function<Integer, Publisher<Integer>>() {
@Override
public Publisher<Integer> apply(Integer f) throws Exception {
throw new TestException();
}
}));
Reported by PMD.
Line: 116
public void mapperToJust() {
TestSubscriber<Integer> ts = new TestSubscriber<>();
assertTrue(FlowableScalarXMap.tryScalarXMapSubscribe(new OneCallablePublisher(), ts, new Function<Integer, Publisher<Integer>>() {
@Override
public Publisher<Integer> apply(Integer f) throws Exception {
return Flowable.just(1);
}
}));
Reported by PMD.
Line: 130
public void mapperToEmpty() {
TestSubscriber<Integer> ts = new TestSubscriber<>();
assertTrue(FlowableScalarXMap.tryScalarXMapSubscribe(new OneCallablePublisher(), ts, new Function<Integer, Publisher<Integer>>() {
@Override
public Publisher<Integer> apply(Integer f) throws Exception {
return Flowable.empty();
}
}));
Reported by PMD.
Line: 144
public void mapperToCrashingCallable() {
TestSubscriber<Integer> ts = new TestSubscriber<>();
assertTrue(FlowableScalarXMap.tryScalarXMapSubscribe(new OneCallablePublisher(), ts, new Function<Integer, Publisher<Integer>>() {
@Override
public Publisher<Integer> apply(Integer f) throws Exception {
return new CallablePublisher();
}
}));
Reported by PMD.
Line: 155
}
@Test
public void scalarMapToEmpty() {
FlowableScalarXMap.scalarXMap(1, new Function<Integer, Publisher<Integer>>() {
@Override
public Publisher<Integer> apply(Integer v) throws Exception {
return Flowable.empty();
}
Reported by PMD.
Line: 167
}
@Test
public void scalarMapToCrashingCallable() {
FlowableScalarXMap.scalarXMap(1, new Function<Integer, Publisher<Integer>>() {
@Override
public Publisher<Integer> apply(Integer v) throws Exception {
return new CallablePublisher();
}
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableFromArrayTest.java
36 issues
Line: 25
import io.reactivex.rxjava3.subscribers.TestSubscriber;
import io.reactivex.rxjava3.testsupport.TestHelper;
public class FlowableFromArrayTest extends RxJavaTest {
Flowable<Integer> create(int n) {
Integer[] array = new Integer[n];
for (int i = 0; i < n; i++) {
array[i] = i;
Reported by PMD.
Line: 39
public void simple() {
TestSubscriber<Integer> ts = new TestSubscriber<>();
create(1000).subscribe(ts);
ts.assertNoErrors();
ts.assertValueCount(1000);
ts.assertComplete();
}
Reported by PMD.
Line: 50
public void backpressure() {
TestSubscriber<Integer> ts = TestSubscriber.create(0);
create(1000).subscribe(ts);
ts.assertNoErrors();
ts.assertNoValues();
ts.assertNotComplete();
Reported by PMD.
Line: 52
create(1000).subscribe(ts);
ts.assertNoErrors();
ts.assertNoValues();
ts.assertNotComplete();
ts.request(10);
Reported by PMD.
Line: 53
create(1000).subscribe(ts);
ts.assertNoErrors();
ts.assertNoValues();
ts.assertNotComplete();
ts.request(10);
ts.assertNoErrors();
Reported by PMD.
Line: 54
ts.assertNoErrors();
ts.assertNoValues();
ts.assertNotComplete();
ts.request(10);
ts.assertNoErrors();
ts.assertValueCount(10);
Reported by PMD.
Line: 56
ts.assertNoValues();
ts.assertNotComplete();
ts.request(10);
ts.assertNoErrors();
ts.assertValueCount(10);
ts.assertNotComplete();
Reported by PMD.
Line: 58
ts.request(10);
ts.assertNoErrors();
ts.assertValueCount(10);
ts.assertNotComplete();
ts.request(1000);
Reported by PMD.
Line: 59
ts.request(10);
ts.assertNoErrors();
ts.assertValueCount(10);
ts.assertNotComplete();
ts.request(1000);
ts.assertNoErrors();
Reported by PMD.
Line: 60
ts.assertNoErrors();
ts.assertValueCount(10);
ts.assertNotComplete();
ts.request(1000);
ts.assertNoErrors();
ts.assertValueCount(1000);
Reported by PMD.
src/test/java/io/reactivex/rxjava3/flowable/FlowableMergeTests.java
36 issues
Line: 33
* This won't compile if super/extends isn't done correctly on generics.
*/
@Test
public void covarianceOfMerge() {
Flowable<HorrorMovie> horrors = Flowable.just(new HorrorMovie());
Flowable<Flowable<HorrorMovie>> metaHorrors = Flowable.just(horrors);
Flowable.<Media> merge(metaHorrors);
}
Reported by PMD.
Line: 46
Flowable<Flowable<Media>> os = Flowable.just(f1, f2);
List<Media> values = Flowable.merge(os).toList().blockingGet();
assertEquals(4, values.size());
}
@Test
Reported by PMD.
Line: 46
Flowable<Flowable<Media>> os = Flowable.just(f1, f2);
List<Media> values = Flowable.merge(os).toList().blockingGet();
assertEquals(4, values.size());
}
@Test
Reported by PMD.
Line: 48
List<Media> values = Flowable.merge(os).toList().blockingGet();
assertEquals(4, values.size());
}
@Test
public void mergeCovariance2() {
Flowable<Media> f1 = Flowable.just(new HorrorMovie(), new Movie(), new Media());
Reported by PMD.
Line: 48
List<Media> values = Flowable.merge(os).toList().blockingGet();
assertEquals(4, values.size());
}
@Test
public void mergeCovariance2() {
Flowable<Media> f1 = Flowable.just(new HorrorMovie(), new Movie(), new Media());
Reported by PMD.
Line: 58
Flowable<Flowable<Media>> os = Flowable.just(f1, f2);
List<Media> values = Flowable.merge(os).toList().blockingGet();
assertEquals(5, values.size());
}
@Test
Reported by PMD.
Line: 58
Flowable<Flowable<Media>> os = Flowable.just(f1, f2);
List<Media> values = Flowable.merge(os).toList().blockingGet();
assertEquals(5, values.size());
}
@Test
Reported by PMD.
Line: 60
List<Media> values = Flowable.merge(os).toList().blockingGet();
assertEquals(5, values.size());
}
@Test
public void mergeCovariance3() {
Flowable<Movie> f1 = Flowable.just(new HorrorMovie(), new Movie());
Reported by PMD.
Line: 60
List<Media> values = Flowable.merge(os).toList().blockingGet();
assertEquals(5, values.size());
}
@Test
public void mergeCovariance3() {
Flowable<Movie> f1 = Flowable.just(new HorrorMovie(), new Movie());
Reported by PMD.
Line: 64
}
@Test
public void mergeCovariance3() {
Flowable<Movie> f1 = Flowable.just(new HorrorMovie(), new Movie());
Flowable<Media> f2 = Flowable.just(new Media(), new HorrorMovie());
List<Media> values = Flowable.merge(f1, f2).toList().blockingGet();
Reported by PMD.