The following issues were found
src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeCacheTest.java
113 issues
Line: 30
import io.reactivex.rxjava3.subscribers.TestSubscriber;
import io.reactivex.rxjava3.testsupport.TestHelper;
public class MaybeCacheTest extends RxJavaTest {
@Test
public void offlineSuccess() {
Maybe<Integer> source = Maybe.just(1).cache();
assertEquals(1, source.blockingGet().intValue());
Reported by PMD.
Line: 34
@Test
public void offlineSuccess() {
Maybe<Integer> source = Maybe.just(1).cache();
assertEquals(1, source.blockingGet().intValue());
source.test()
.assertResult(1);
}
Reported by PMD.
Line: 35
@Test
public void offlineSuccess() {
Maybe<Integer> source = Maybe.just(1).cache();
assertEquals(1, source.blockingGet().intValue());
source.test()
.assertResult(1);
}
Reported by PMD.
Line: 35
@Test
public void offlineSuccess() {
Maybe<Integer> source = Maybe.just(1).cache();
assertEquals(1, source.blockingGet().intValue());
source.test()
.assertResult(1);
}
Reported by PMD.
Line: 35
@Test
public void offlineSuccess() {
Maybe<Integer> source = Maybe.just(1).cache();
assertEquals(1, source.blockingGet().intValue());
source.test()
.assertResult(1);
}
Reported by PMD.
Line: 37
Maybe<Integer> source = Maybe.just(1).cache();
assertEquals(1, source.blockingGet().intValue());
source.test()
.assertResult(1);
}
@Test
public void offlineError() {
Reported by PMD.
Line: 37
Maybe<Integer> source = Maybe.just(1).cache();
assertEquals(1, source.blockingGet().intValue());
source.test()
.assertResult(1);
}
@Test
public void offlineError() {
Reported by PMD.
Line: 47
try {
source.blockingGet();
fail("Should have thrown");
} catch (TestException ex) {
// expected
}
source.test()
Reported by PMD.
Line: 48
try {
source.blockingGet();
fail("Should have thrown");
} catch (TestException ex) {
// expected
}
source.test()
.assertFailure(TestException.class);
Reported by PMD.
Line: 52
// expected
}
source.test()
.assertFailure(TestException.class);
}
@Test
public void offlineComplete() {
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableRepeatTest.java
113 issues
Line: 186
.concatMap(new Function<Integer, Observable<Integer>>() {
@Override
public Observable<Integer> apply(Integer x) {
System.out.println("testRepeatRetarget -> " + x);
concatBase.add(x);
return Observable.<Integer>empty()
.delay(200, TimeUnit.MILLISECONDS);
}
})
Reported by PMD.
Line: 14
* the License for the specific language governing permissions and limitations under the License.
*/
package io.reactivex.rxjava3.internal.operators.observable;
import static org.junit.Assert.*;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.*;
Reported by PMD.
Line: 38
import io.reactivex.rxjava3.subjects.PublishSubject;
import io.reactivex.rxjava3.testsupport.*;
public class ObservableRepeatTest extends RxJavaTest {
@Test
public void repetition() {
int num = 10;
final AtomicInteger count = new AtomicInteger();
Reported by PMD.
Line: 54
}).repeat().subscribeOn(Schedulers.computation())
.take(num).blockingLast();
assertEquals(num, value);
}
@Test
public void repeatTake() {
Observable<Integer> xs = Observable.just(1, 2);
Reported by PMD.
Line: 60
@Test
public void repeatTake() {
Observable<Integer> xs = Observable.just(1, 2);
Object[] ys = xs.repeat().subscribeOn(Schedulers.newThread()).take(4).toList().blockingGet().toArray();
assertArrayEquals(new Object[] { 1, 2, 1, 2 }, ys);
}
@Test
public void noStackOverFlow() {
Reported by PMD.
Line: 60
@Test
public void repeatTake() {
Observable<Integer> xs = Observable.just(1, 2);
Object[] ys = xs.repeat().subscribeOn(Schedulers.newThread()).take(4).toList().blockingGet().toArray();
assertArrayEquals(new Object[] { 1, 2, 1, 2 }, ys);
}
@Test
public void noStackOverFlow() {
Reported by PMD.
Line: 60
@Test
public void repeatTake() {
Observable<Integer> xs = Observable.just(1, 2);
Object[] ys = xs.repeat().subscribeOn(Schedulers.newThread()).take(4).toList().blockingGet().toArray();
assertArrayEquals(new Object[] { 1, 2, 1, 2 }, ys);
}
@Test
public void noStackOverFlow() {
Reported by PMD.
Line: 60
@Test
public void repeatTake() {
Observable<Integer> xs = Observable.just(1, 2);
Object[] ys = xs.repeat().subscribeOn(Schedulers.newThread()).take(4).toList().blockingGet().toArray();
assertArrayEquals(new Object[] { 1, 2, 1, 2 }, ys);
}
@Test
public void noStackOverFlow() {
Reported by PMD.
Line: 60
@Test
public void repeatTake() {
Observable<Integer> xs = Observable.just(1, 2);
Object[] ys = xs.repeat().subscribeOn(Schedulers.newThread()).take(4).toList().blockingGet().toArray();
assertArrayEquals(new Object[] { 1, 2, 1, 2 }, ys);
}
@Test
public void noStackOverFlow() {
Reported by PMD.
Line: 60
@Test
public void repeatTake() {
Observable<Integer> xs = Observable.just(1, 2);
Object[] ys = xs.repeat().subscribeOn(Schedulers.newThread()).take(4).toList().blockingGet().toArray();
assertArrayEquals(new Object[] { 1, 2, 1, 2 }, ys);
}
@Test
public void noStackOverFlow() {
Reported by PMD.
src/jmh/java/io/reactivex/rxjava3/core/BinaryFlatMapPerf.java
113 issues
Line: 31
@OutputTimeUnit(TimeUnit.SECONDS)
@Fork(value = 1)
@State(Scope.Thread)
public class BinaryFlatMapPerf {
@Param({ "1", "1000", "1000000" })
public int times;
Flowable<Integer> singleFlatMapPublisher;
Reported by PMD.
Line: 31
@OutputTimeUnit(TimeUnit.SECONDS)
@Fork(value = 1)
@State(Scope.Thread)
public class BinaryFlatMapPerf {
@Param({ "1", "1000", "1000000" })
public int times;
Flowable<Integer> singleFlatMapPublisher;
Reported by PMD.
Line: 31
@OutputTimeUnit(TimeUnit.SECONDS)
@Fork(value = 1)
@State(Scope.Thread)
public class BinaryFlatMapPerf {
@Param({ "1", "1000", "1000000" })
public int times;
Flowable<Integer> singleFlatMapPublisher;
Reported by PMD.
Line: 31
@OutputTimeUnit(TimeUnit.SECONDS)
@Fork(value = 1)
@State(Scope.Thread)
public class BinaryFlatMapPerf {
@Param({ "1", "1000", "1000000" })
public int times;
Flowable<Integer> singleFlatMapPublisher;
Reported by PMD.
Line: 31
@OutputTimeUnit(TimeUnit.SECONDS)
@Fork(value = 1)
@State(Scope.Thread)
public class BinaryFlatMapPerf {
@Param({ "1", "1000", "1000000" })
public int times;
Flowable<Integer> singleFlatMapPublisher;
Reported by PMD.
Line: 33
@State(Scope.Thread)
public class BinaryFlatMapPerf {
@Param({ "1", "1000", "1000000" })
public int times;
Flowable<Integer> singleFlatMapPublisher;
Flowable<Integer> singleFlatMapHidePublisher;
Reported by PMD.
Line: 35
@Param({ "1", "1000", "1000000" })
public int times;
Flowable<Integer> singleFlatMapPublisher;
Flowable<Integer> singleFlatMapHidePublisher;
Flowable<Integer> singleFlattenAsPublisher;
Reported by PMD.
Line: 35
@Param({ "1", "1000", "1000000" })
public int times;
Flowable<Integer> singleFlatMapPublisher;
Flowable<Integer> singleFlatMapHidePublisher;
Flowable<Integer> singleFlattenAsPublisher;
Reported by PMD.
Line: 37
Flowable<Integer> singleFlatMapPublisher;
Flowable<Integer> singleFlatMapHidePublisher;
Flowable<Integer> singleFlattenAsPublisher;
Flowable<Integer> maybeFlatMapPublisher;
Reported by PMD.
Line: 37
Flowable<Integer> singleFlatMapPublisher;
Flowable<Integer> singleFlatMapHidePublisher;
Flowable<Integer> singleFlattenAsPublisher;
Flowable<Integer> maybeFlatMapPublisher;
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/subscribers/DeferredScalarSubscriberTest.java
112 issues
Line: 35
import io.reactivex.rxjava3.subscribers.TestSubscriber;
import io.reactivex.rxjava3.testsupport.TestHelper;
public class DeferredScalarSubscriberTest extends RxJavaTest {
@Test
public void completeFirst() {
TestSubscriber<Integer> ts = TestSubscriber.create(0L);
TestingDeferredScalarSubscriber ds = new TestingDeferredScalarSubscriber(ts);
Reported by PMD.
Line: 38
public class DeferredScalarSubscriberTest extends RxJavaTest {
@Test
public void completeFirst() {
TestSubscriber<Integer> ts = TestSubscriber.create(0L);
TestingDeferredScalarSubscriber ds = new TestingDeferredScalarSubscriber(ts);
ds.setupDownstream();
ds.onNext(1);
Reported by PMD.
Line: 45
ds.onNext(1);
ts.assertNoValues();
ds.onComplete();
ts.assertNoValues();
Reported by PMD.
Line: 49
ds.onComplete();
ts.assertNoValues();
ts.request(1);
ts.assertValues(1);
ts.assertNoErrors();
Reported by PMD.
Line: 51
ts.assertNoValues();
ts.request(1);
ts.assertValues(1);
ts.assertNoErrors();
ts.assertComplete();
}
Reported by PMD.
Line: 53
ts.request(1);
ts.assertValues(1);
ts.assertNoErrors();
ts.assertComplete();
}
@Test
Reported by PMD.
Line: 54
ts.request(1);
ts.assertValues(1);
ts.assertNoErrors();
ts.assertComplete();
}
@Test
public void requestFirst() {
Reported by PMD.
Line: 55
ts.assertValues(1);
ts.assertNoErrors();
ts.assertComplete();
}
@Test
public void requestFirst() {
TestSubscriber<Integer> ts = TestSubscriber.create(1);
Reported by PMD.
Line: 59
}
@Test
public void requestFirst() {
TestSubscriber<Integer> ts = TestSubscriber.create(1);
TestingDeferredScalarSubscriber ds = new TestingDeferredScalarSubscriber(ts);
ds.setupDownstream();
ds.onNext(1);
Reported by PMD.
Line: 66
ds.onNext(1);
ts.assertNoValues();
ds.onComplete();
ts.assertValues(1);
ts.assertNoErrors();
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableTakeLastTimedTest.java
112 issues
Line: 31
import io.reactivex.rxjava3.subjects.PublishSubject;
import io.reactivex.rxjava3.testsupport.*;
public class ObservableTakeLastTimedTest extends RxJavaTest {
@Test(expected = IllegalArgumentException.class)
public void takeLastTimedWithNegativeCount() {
Observable.just("one").takeLast(-1, 1, TimeUnit.SECONDS);
}
Reported by PMD.
Line: 35
@Test(expected = IllegalArgumentException.class)
public void takeLastTimedWithNegativeCount() {
Observable.just("one").takeLast(-1, 1, TimeUnit.SECONDS);
}
@Test
public void takeLastTimed() {
TestScheduler scheduler = new TestScheduler();
Reported by PMD.
Line: 45
PublishSubject<Object> source = PublishSubject.create();
// FIXME time unit now matters!
Observable<Object> result = source.takeLast(1000, TimeUnit.MILLISECONDS, scheduler);
Observer<Object> o = TestHelper.mockObserver();
InOrder inOrder = inOrder(o);
Reported by PMD.
Line: 51
InOrder inOrder = inOrder(o);
result.subscribe(o);
source.onNext(1); // T: 0ms
scheduler.advanceTimeBy(250, TimeUnit.MILLISECONDS);
source.onNext(2); // T: 250ms
scheduler.advanceTimeBy(250, TimeUnit.MILLISECONDS);
Reported by PMD.
Line: 53
result.subscribe(o);
source.onNext(1); // T: 0ms
scheduler.advanceTimeBy(250, TimeUnit.MILLISECONDS);
source.onNext(2); // T: 250ms
scheduler.advanceTimeBy(250, TimeUnit.MILLISECONDS);
source.onNext(3); // T: 500ms
scheduler.advanceTimeBy(250, TimeUnit.MILLISECONDS);
Reported by PMD.
Line: 55
source.onNext(1); // T: 0ms
scheduler.advanceTimeBy(250, TimeUnit.MILLISECONDS);
source.onNext(2); // T: 250ms
scheduler.advanceTimeBy(250, TimeUnit.MILLISECONDS);
source.onNext(3); // T: 500ms
scheduler.advanceTimeBy(250, TimeUnit.MILLISECONDS);
source.onNext(4); // T: 750ms
scheduler.advanceTimeBy(250, TimeUnit.MILLISECONDS);
Reported by PMD.
Line: 57
scheduler.advanceTimeBy(250, TimeUnit.MILLISECONDS);
source.onNext(2); // T: 250ms
scheduler.advanceTimeBy(250, TimeUnit.MILLISECONDS);
source.onNext(3); // T: 500ms
scheduler.advanceTimeBy(250, TimeUnit.MILLISECONDS);
source.onNext(4); // T: 750ms
scheduler.advanceTimeBy(250, TimeUnit.MILLISECONDS);
source.onNext(5); // T: 1000ms
scheduler.advanceTimeBy(250, TimeUnit.MILLISECONDS);
Reported by PMD.
Line: 59
scheduler.advanceTimeBy(250, TimeUnit.MILLISECONDS);
source.onNext(3); // T: 500ms
scheduler.advanceTimeBy(250, TimeUnit.MILLISECONDS);
source.onNext(4); // T: 750ms
scheduler.advanceTimeBy(250, TimeUnit.MILLISECONDS);
source.onNext(5); // T: 1000ms
scheduler.advanceTimeBy(250, TimeUnit.MILLISECONDS);
source.onComplete(); // T: 1250ms
Reported by PMD.
Line: 61
scheduler.advanceTimeBy(250, TimeUnit.MILLISECONDS);
source.onNext(4); // T: 750ms
scheduler.advanceTimeBy(250, TimeUnit.MILLISECONDS);
source.onNext(5); // T: 1000ms
scheduler.advanceTimeBy(250, TimeUnit.MILLISECONDS);
source.onComplete(); // T: 1250ms
inOrder.verify(o, times(1)).onNext(2);
inOrder.verify(o, times(1)).onNext(3);
Reported by PMD.
Line: 63
scheduler.advanceTimeBy(250, TimeUnit.MILLISECONDS);
source.onNext(5); // T: 1000ms
scheduler.advanceTimeBy(250, TimeUnit.MILLISECONDS);
source.onComplete(); // T: 1250ms
inOrder.verify(o, times(1)).onNext(2);
inOrder.verify(o, times(1)).onNext(3);
inOrder.verify(o, times(1)).onNext(4);
inOrder.verify(o, times(1)).onNext(5);
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableFlatMapSingleTest.java
111 issues
Line: 14
* the License for the specific language governing permissions and limitations under the License.
*/
package io.reactivex.rxjava3.internal.operators.flowable;
import static org.junit.Assert.*;
import java.util.List;
import java.util.concurrent.*;
Reported by PMD.
Line: 37
import io.reactivex.rxjava3.subscribers.TestSubscriber;
import io.reactivex.rxjava3.testsupport.*;
public class FlowableFlatMapSingleTest extends RxJavaTest {
@Test
public void normal() {
Flowable.range(1, 10)
.flatMapSingle(new Function<Integer, SingleSource<Integer>>() {
Reported by PMD.
Line: 40
public class FlowableFlatMapSingleTest extends RxJavaTest {
@Test
public void normal() {
Flowable.range(1, 10)
.flatMapSingle(new Function<Integer, SingleSource<Integer>>() {
@Override
public SingleSource<Integer> apply(Integer v) throws Exception {
return Single.just(v);
Reported by PMD.
Line: 53
}
@Test
public void normalDelayError() {
Flowable.range(1, 10)
.flatMapSingle(new Function<Integer, SingleSource<Integer>>() {
@Override
public SingleSource<Integer> apply(Integer v) throws Exception {
return Single.just(v);
Reported by PMD.
Line: 66
}
@Test
public void normalAsync() {
TestSubscriberEx<Integer> ts = Flowable.range(1, 10)
.flatMapSingle(new Function<Integer, SingleSource<Integer>>() {
@Override
public SingleSource<Integer> apply(Integer v) throws Exception {
return Single.just(v).subscribeOn(Schedulers.computation());
Reported by PMD.
Line: 71
.flatMapSingle(new Function<Integer, SingleSource<Integer>>() {
@Override
public SingleSource<Integer> apply(Integer v) throws Exception {
return Single.just(v).subscribeOn(Schedulers.computation());
}
})
.to(TestHelper.<Integer>testConsumer())
.awaitDone(5, TimeUnit.SECONDS)
.assertSubscribed()
Reported by PMD.
Line: 85
}
@Test
public void normalAsyncMaxConcurrency() {
TestSubscriberEx<Integer> ts = Flowable.range(1, 10)
.flatMapSingle(new Function<Integer, SingleSource<Integer>>() {
@Override
public SingleSource<Integer> apply(Integer v) throws Exception {
return Single.just(v).subscribeOn(Schedulers.computation());
Reported by PMD.
Line: 90
.flatMapSingle(new Function<Integer, SingleSource<Integer>>() {
@Override
public SingleSource<Integer> apply(Integer v) throws Exception {
return Single.just(v).subscribeOn(Schedulers.computation());
}
}, false, 3)
.to(TestHelper.<Integer>testConsumer())
.awaitDone(5, TimeUnit.SECONDS)
.assertSubscribed()
Reported by PMD.
Line: 103
}
@Test
public void normalAsyncMaxConcurrency1() {
Flowable.range(1, 10)
.flatMapSingle(new Function<Integer, SingleSource<Integer>>() {
@Override
public SingleSource<Integer> apply(Integer v) throws Exception {
return Single.just(v).subscribeOn(Schedulers.computation());
Reported by PMD.
Line: 108
.flatMapSingle(new Function<Integer, SingleSource<Integer>>() {
@Override
public SingleSource<Integer> apply(Integer v) throws Exception {
return Single.just(v).subscribeOn(Schedulers.computation());
}
}, false, 1)
.test()
.awaitDone(5, TimeUnit.SECONDS)
.assertResult(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableElementAtTest.java
109 issues
Line: 34
import io.reactivex.rxjava3.processors.PublishProcessor;
import io.reactivex.rxjava3.testsupport.TestHelper;
public class FlowableElementAtTest extends RxJavaTest {
@Test
public void elementAtFlowable() {
assertEquals(2, Flowable.fromArray(1, 2).elementAt(1).toFlowable().blockingSingle()
.intValue());
Reported by PMD.
Line: 38
@Test
public void elementAtFlowable() {
assertEquals(2, Flowable.fromArray(1, 2).elementAt(1).toFlowable().blockingSingle()
.intValue());
}
@Test(expected = IndexOutOfBoundsException.class)
public void elementAtWithMinusIndexFlowable() {
Reported by PMD.
Line: 38
@Test
public void elementAtFlowable() {
assertEquals(2, Flowable.fromArray(1, 2).elementAt(1).toFlowable().blockingSingle()
.intValue());
}
@Test(expected = IndexOutOfBoundsException.class)
public void elementAtWithMinusIndexFlowable() {
Reported by PMD.
Line: 38
@Test
public void elementAtFlowable() {
assertEquals(2, Flowable.fromArray(1, 2).elementAt(1).toFlowable().blockingSingle()
.intValue());
}
@Test(expected = IndexOutOfBoundsException.class)
public void elementAtWithMinusIndexFlowable() {
Reported by PMD.
Line: 38
@Test
public void elementAtFlowable() {
assertEquals(2, Flowable.fromArray(1, 2).elementAt(1).toFlowable().blockingSingle()
.intValue());
}
@Test(expected = IndexOutOfBoundsException.class)
public void elementAtWithMinusIndexFlowable() {
Reported by PMD.
Line: 38
@Test
public void elementAtFlowable() {
assertEquals(2, Flowable.fromArray(1, 2).elementAt(1).toFlowable().blockingSingle()
.intValue());
}
@Test(expected = IndexOutOfBoundsException.class)
public void elementAtWithMinusIndexFlowable() {
Reported by PMD.
Line: 44
@Test(expected = IndexOutOfBoundsException.class)
public void elementAtWithMinusIndexFlowable() {
Flowable.fromArray(1, 2).elementAt(-1);
}
@Test
public void elementAtWithIndexOutOfBoundsFlowable() {
assertEquals(-100, Flowable.fromArray(1, 2).elementAt(2).toFlowable().blockingFirst(-100).intValue());
Reported by PMD.
Line: 49
@Test
public void elementAtWithIndexOutOfBoundsFlowable() {
assertEquals(-100, Flowable.fromArray(1, 2).elementAt(2).toFlowable().blockingFirst(-100).intValue());
}
@Test
public void elementAtOrDefaultFlowable() {
assertEquals(2, Flowable.fromArray(1, 2).elementAt(1, 0).toFlowable().blockingSingle().intValue());
Reported by PMD.
Line: 49
@Test
public void elementAtWithIndexOutOfBoundsFlowable() {
assertEquals(-100, Flowable.fromArray(1, 2).elementAt(2).toFlowable().blockingFirst(-100).intValue());
}
@Test
public void elementAtOrDefaultFlowable() {
assertEquals(2, Flowable.fromArray(1, 2).elementAt(1, 0).toFlowable().blockingSingle().intValue());
Reported by PMD.
Line: 49
@Test
public void elementAtWithIndexOutOfBoundsFlowable() {
assertEquals(-100, Flowable.fromArray(1, 2).elementAt(2).toFlowable().blockingFirst(-100).intValue());
}
@Test
public void elementAtOrDefaultFlowable() {
assertEquals(2, Flowable.fromArray(1, 2).elementAt(1, 0).toFlowable().blockingSingle().intValue());
Reported by PMD.
src/test/java/io/reactivex/rxjava3/validators/ParamValidationCheckerTest.java
108 issues
Line: 768
if (ignoreList != null) {
for (ParamIgnore e : ignoreList) {
if (Arrays.equals(e.arguments, m.getParameterTypes())) {
System.out.println("CheckClass - ignore: " + m);
continue outer;
}
}
}
Reported by PMD.
Line: 14
* the License for the specific language governing permissions and limitations under the License.
*/
package io.reactivex.rxjava3.validators;
import java.lang.reflect.*;
import java.time.Duration;
import java.util.*;
import java.util.concurrent.*;
Reported by PMD.
Line: 14
* the License for the specific language governing permissions and limitations under the License.
*/
package io.reactivex.rxjava3.validators;
import java.lang.reflect.*;
import java.time.Duration;
import java.util.*;
import java.util.concurrent.*;
Reported by PMD.
Line: 41
* Check that static and instance methods validate their parameters against
* null and invalid values properly.
*/
public class ParamValidationCheckerTest {
@Test(timeout = 30000)
public void checkFlowable() {
checkClass(Flowable.class);
}
Reported by PMD.
Line: 41
* Check that static and instance methods validate their parameters against
* null and invalid values properly.
*/
public class ParamValidationCheckerTest {
@Test(timeout = 30000)
public void checkFlowable() {
checkClass(Flowable.class);
}
Reported by PMD.
Line: 41
* Check that static and instance methods validate their parameters against
* null and invalid values properly.
*/
public class ParamValidationCheckerTest {
@Test(timeout = 30000)
public void checkFlowable() {
checkClass(Flowable.class);
}
Reported by PMD.
Line: 41
* Check that static and instance methods validate their parameters against
* null and invalid values properly.
*/
public class ParamValidationCheckerTest {
@Test(timeout = 30000)
public void checkFlowable() {
checkClass(Flowable.class);
}
Reported by PMD.
Line: 41
* Check that static and instance methods validate their parameters against
* null and invalid values properly.
*/
public class ParamValidationCheckerTest {
@Test(timeout = 30000)
public void checkFlowable() {
checkClass(Flowable.class);
}
Reported by PMD.
Line: 44
public class ParamValidationCheckerTest {
@Test(timeout = 30000)
public void checkFlowable() {
checkClass(Flowable.class);
}
@Test(timeout = 30000)
public void checkObservable() {
Reported by PMD.
Line: 49
}
@Test(timeout = 30000)
public void checkObservable() {
checkClass(Observable.class);
}
@Test(timeout = 30000)
public void checkSingle() {
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/subscribers/BoundedSubscriberTest.java
106 issues
Line: 14
* the License for the specific language governing permissions and limitations under the License.
*/
package io.reactivex.rxjava3.internal.subscribers;
import static org.junit.Assert.*;
import java.util.*;
Reported by PMD.
Line: 32
import io.reactivex.rxjava3.processors.PublishProcessor;
import io.reactivex.rxjava3.testsupport.*;
public class BoundedSubscriberTest extends RxJavaTest {
@Test
public void onSubscribeThrows() {
final List<Object> received = new ArrayList<>();
Reported by PMD.
Line: 35
public class BoundedSubscriberTest extends RxJavaTest {
@Test
public void onSubscribeThrows() {
final List<Object> received = new ArrayList<>();
BoundedSubscriber<Object> subscriber = new BoundedSubscriber<>(new Consumer<Object>() {
@Override
public void accept(Object o) throws Exception {
Reported by PMD.
Line: 60
}
}, 128);
assertFalse(subscriber.isDisposed());
Flowable.just(1).subscribe(subscriber);
assertTrue(received.toString(), received.get(0) instanceof TestException);
assertEquals(received.toString(), 1, received.size());
Reported by PMD.
Line: 62
assertFalse(subscriber.isDisposed());
Flowable.just(1).subscribe(subscriber);
assertTrue(received.toString(), received.get(0) instanceof TestException);
assertEquals(received.toString(), 1, received.size());
assertTrue(subscriber.isDisposed());
Reported by PMD.
Line: 65
Flowable.just(1).subscribe(subscriber);
assertTrue(received.toString(), received.get(0) instanceof TestException);
assertEquals(received.toString(), 1, received.size());
assertTrue(subscriber.isDisposed());
}
@Test
Reported by PMD.
Line: 67
assertTrue(received.toString(), received.get(0) instanceof TestException);
assertEquals(received.toString(), 1, received.size());
assertTrue(subscriber.isDisposed());
}
@Test
public void onNextThrows() {
final List<Object> received = new ArrayList<>();
Reported by PMD.
Line: 71
}
@Test
public void onNextThrows() {
final List<Object> received = new ArrayList<>();
BoundedSubscriber<Object> subscriber = new BoundedSubscriber<>(new Consumer<Object>() {
@Override
public void accept(Object o) throws Exception {
Reported by PMD.
Line: 96
}
}, 128);
assertFalse(subscriber.isDisposed());
Flowable.just(1).subscribe(subscriber);
assertTrue(received.toString(), received.get(0) instanceof TestException);
assertEquals(received.toString(), 1, received.size());
Reported by PMD.
Line: 98
assertFalse(subscriber.isDisposed());
Flowable.just(1).subscribe(subscriber);
assertTrue(received.toString(), received.get(0) instanceof TestException);
assertEquals(received.toString(), 1, received.size());
assertTrue(subscriber.isDisposed());
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableCacheTest.java
106 issues
Line: 73
@Override
public void run() {
counter.incrementAndGet();
System.out.println("published Observable being executed");
observer.onNext("one");
observer.onComplete();
}
}).start();
}
Reported by PMD.
Line: 89
@Override
public void accept(String v) {
assertEquals("one", v);
System.out.println("v: " + v);
latch.countDown();
}
});
// subscribe again
Reported by PMD.
Line: 99
@Override
public void accept(String v) {
assertEquals("one", v);
System.out.println("v: " + v);
latch.countDown();
}
});
if (!latch.await(1000, TimeUnit.MILLISECONDS)) {
Reported by PMD.
Line: 36
import io.reactivex.rxjava3.subjects.PublishSubject;
import io.reactivex.rxjava3.testsupport.*;
public class ObservableCacheTest extends RxJavaTest {
@Test
public void coldReplayNoBackpressure() {
ObservableCache<Integer> source = new ObservableCache<>(Observable.range(0, 1000), 16);
assertFalse("Source is connected!", source.isConnected());
Reported by PMD.
Line: 38
public class ObservableCacheTest extends RxJavaTest {
@Test
public void coldReplayNoBackpressure() {
ObservableCache<Integer> source = new ObservableCache<>(Observable.range(0, 1000), 16);
assertFalse("Source is connected!", source.isConnected());
TestObserverEx<Integer> to = new TestObserverEx<>();
Reported by PMD.
Line: 53
to.assertNoErrors();
to.assertTerminated();
List<Integer> onNextEvents = to.values();
assertEquals(1000, onNextEvents.size());
for (int i = 0; i < 1000; i++) {
assertEquals((Integer)i, onNextEvents.get(i));
}
}
Reported by PMD.
Line: 53
to.assertNoErrors();
to.assertTerminated();
List<Integer> onNextEvents = to.values();
assertEquals(1000, onNextEvents.size());
for (int i = 0; i < 1000; i++) {
assertEquals((Integer)i, onNextEvents.get(i));
}
}
Reported by PMD.
Line: 56
assertEquals(1000, onNextEvents.size());
for (int i = 0; i < 1000; i++) {
assertEquals((Integer)i, onNextEvents.get(i));
}
}
@Test
public void cache() throws InterruptedException {
Reported by PMD.
Line: 61
}
@Test
public void cache() throws InterruptedException {
final AtomicInteger counter = new AtomicInteger();
Observable<String> o = Observable.unsafeCreate(new ObservableSource<String>() {
@Override
public void subscribe(final Observer<? super String> observer) {
Reported by PMD.
Line: 88
o.subscribe(new Consumer<String>() {
@Override
public void accept(String v) {
assertEquals("one", v);
System.out.println("v: " + v);
latch.countDown();
}
});
Reported by PMD.