The following issues were found
src/test/java/io/reactivex/rxjava3/validators/InternalWrongNaming.java
60 issues
Line: 86
static List<String> readFile(File u) throws Exception {
List<String> lines = new ArrayList<>();
BufferedReader in = new BufferedReader(new FileReader(u));
try {
for (;;) {
String line = in.readLine();
if (line == null) {
break;
Reported by PMD.
Line: 73
}
if (fail.length() != 0) {
System.out.println(fail);
System.out.println();
System.out.println("Total: " + count);
throw new AssertionError(fail.toString());
}
Reported by PMD.
Line: 75
if (fail.length() != 0) {
System.out.println(fail);
System.out.println();
System.out.println("Total: " + count);
throw new AssertionError(fail.toString());
}
}
Reported by PMD.
Line: 76
System.out.println(fail);
System.out.println();
System.out.println("Total: " + count);
throw new AssertionError(fail.toString());
}
}
}
Reported by PMD.
Line: 26
/**
* Adds license header to java files.
*/
public class InternalWrongNaming {
static void checkInternalOperatorNaming(String baseClassName, String consumerClassName, String... ignore) throws Exception {
File f = TestHelper.findSource(baseClassName);
if (f == null) {
return;
Reported by PMD.
Line: 26
/**
* Adds license header to java files.
*/
public class InternalWrongNaming {
static void checkInternalOperatorNaming(String baseClassName, String consumerClassName, String... ignore) throws Exception {
File f = TestHelper.findSource(baseClassName);
if (f == null) {
return;
Reported by PMD.
Line: 26
/**
* Adds license header to java files.
*/
public class InternalWrongNaming {
static void checkInternalOperatorNaming(String baseClassName, String consumerClassName, String... ignore) throws Exception {
File f = TestHelper.findSource(baseClassName);
if (f == null) {
return;
Reported by PMD.
Line: 28
*/
public class InternalWrongNaming {
static void checkInternalOperatorNaming(String baseClassName, String consumerClassName, String... ignore) throws Exception {
File f = TestHelper.findSource(baseClassName);
if (f == null) {
return;
}
Reported by PMD.
Line: 28
*/
public class InternalWrongNaming {
static void checkInternalOperatorNaming(String baseClassName, String consumerClassName, String... ignore) throws Exception {
File f = TestHelper.findSource(baseClassName);
if (f == null) {
return;
}
Reported by PMD.
Line: 28
*/
public class InternalWrongNaming {
static void checkInternalOperatorNaming(String baseClassName, String consumerClassName, String... ignore) throws Exception {
File f = TestHelper.findSource(baseClassName);
if (f == null) {
return;
}
Reported by PMD.
src/main/java/io/reactivex/rxjava3/processors/MulticastProcessor.java
60 issues
Line: 133
*/
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final class MulticastProcessor<@NonNull T> extends FlowableProcessor<T> {
final AtomicInteger wip;
final AtomicReference<Subscription> upstream;
Reported by PMD.
Line: 133
*/
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final class MulticastProcessor<@NonNull T> extends FlowableProcessor<T> {
final AtomicInteger wip;
final AtomicReference<Subscription> upstream;
Reported by PMD.
Line: 133
*/
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final class MulticastProcessor<@NonNull T> extends FlowableProcessor<T> {
final AtomicInteger wip;
final AtomicReference<Subscription> upstream;
Reported by PMD.
Line: 133
*/
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final class MulticastProcessor<@NonNull T> extends FlowableProcessor<T> {
final AtomicInteger wip;
final AtomicReference<Subscription> upstream;
Reported by PMD.
Line: 135
@SchedulerSupport(SchedulerSupport.NONE)
public final class MulticastProcessor<@NonNull T> extends FlowableProcessor<T> {
final AtomicInteger wip;
final AtomicReference<Subscription> upstream;
final AtomicReference<MulticastSubscription<T>[]> subscribers;
Reported by PMD.
Line: 137
final AtomicInteger wip;
final AtomicReference<Subscription> upstream;
final AtomicReference<MulticastSubscription<T>[]> subscribers;
final int bufferSize;
Reported by PMD.
Line: 139
final AtomicReference<Subscription> upstream;
final AtomicReference<MulticastSubscription<T>[]> subscribers;
final int bufferSize;
final int limit;
Reported by PMD.
Line: 141
final AtomicReference<MulticastSubscription<T>[]> subscribers;
final int bufferSize;
final int limit;
final boolean refcount;
Reported by PMD.
Line: 143
final int bufferSize;
final int limit;
final boolean refcount;
volatile SimpleQueue<T> queue;
Reported by PMD.
Line: 145
final int limit;
final boolean refcount;
volatile SimpleQueue<T> queue;
volatile boolean done;
volatile Throwable error;
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeZipArrayTest.java
59 issues
Line: 35
import io.reactivex.rxjava3.subjects.MaybeSubject;
import io.reactivex.rxjava3.testsupport.TestHelper;
public class MaybeZipArrayTest extends RxJavaTest {
final BiFunction<Object, Object, Object> addString = new BiFunction<Object, Object, Object>() {
@Override
public Object apply(Object a, Object b) throws Exception {
return "" + a + b;
Reported by PMD.
Line: 37
public class MaybeZipArrayTest extends RxJavaTest {
final BiFunction<Object, Object, Object> addString = new BiFunction<Object, Object, Object>() {
@Override
public Object apply(Object a, Object b) throws Exception {
return "" + a + b;
}
};
Reported by PMD.
Line: 40
final BiFunction<Object, Object, Object> addString = new BiFunction<Object, Object, Object>() {
@Override
public Object apply(Object a, Object b) throws Exception {
return "" + a + b;
}
};
final Function3<Object, Object, Object, Object> addString3 = new Function3<Object, Object, Object, Object>() {
@Override
Reported by PMD.
Line: 44
}
};
final Function3<Object, Object, Object, Object> addString3 = new Function3<Object, Object, Object, Object>() {
@Override
public Object apply(Object a, Object b, Object c) throws Exception {
return "" + a + b + c;
}
};
Reported by PMD.
Line: 47
final Function3<Object, Object, Object, Object> addString3 = new Function3<Object, Object, Object, Object>() {
@Override
public Object apply(Object a, Object b, Object c) throws Exception {
return "" + a + b + c;
}
};
@Test
public void firstError() {
Reported by PMD.
Line: 52
};
@Test
public void firstError() {
Maybe.zip(Maybe.error(new TestException()), Maybe.just(1), addString)
.test()
.assertFailure(TestException.class);
}
Reported by PMD.
Line: 59
}
@Test
public void secondError() {
Maybe.zip(Maybe.just(1), Maybe.<Integer>error(new TestException()), addString)
.test()
.assertFailure(TestException.class);
}
Reported by PMD.
Line: 66
}
@Test
public void dispose() {
PublishProcessor<Integer> pp = PublishProcessor.create();
TestObserver<Object> to = Maybe.zip(pp.singleElement(), pp.singleElement(), addString)
.test();
Reported by PMD.
Line: 69
public void dispose() {
PublishProcessor<Integer> pp = PublishProcessor.create();
TestObserver<Object> to = Maybe.zip(pp.singleElement(), pp.singleElement(), addString)
.test();
assertTrue(pp.hasSubscribers());
to.dispose();
Reported by PMD.
Line: 69
public void dispose() {
PublishProcessor<Integer> pp = PublishProcessor.create();
TestObserver<Object> to = Maybe.zip(pp.singleElement(), pp.singleElement(), addString)
.test();
assertTrue(pp.hasSubscribers());
to.dispose();
Reported by PMD.
src/main/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableCombineLatest.java
59 issues
Line: 41
extends Flowable<R> {
@Nullable
final Publisher<? extends T>[] array;
@Nullable
final Iterable<? extends Publisher<? extends T>> iterable;
final Function<? super Object[], ? extends R> combiner;
Reported by PMD.
Line: 44
final Publisher<? extends T>[] array;
@Nullable
final Iterable<? extends Publisher<? extends T>> iterable;
final Function<? super Object[], ? extends R> combiner;
final int bufferSize;
Reported by PMD.
Line: 46
@Nullable
final Iterable<? extends Publisher<? extends T>> iterable;
final Function<? super Object[], ? extends R> combiner;
final int bufferSize;
final boolean delayErrors;
Reported by PMD.
Line: 48
final Function<? super Object[], ? extends R> combiner;
final int bufferSize;
final boolean delayErrors;
public FlowableCombineLatest(@NonNull Publisher<? extends T>[] array,
@NonNull Function<? super Object[], ? extends R> combiner,
Reported by PMD.
Line: 50
final int bufferSize;
final boolean delayErrors;
public FlowableCombineLatest(@NonNull Publisher<? extends T>[] array,
@NonNull Function<? super Object[], ? extends R> combiner,
int bufferSize, boolean delayErrors) {
this.array = array;
Reported by PMD.
Line: 52
final boolean delayErrors;
public FlowableCombineLatest(@NonNull Publisher<? extends T>[] array,
@NonNull Function<? super Object[], ? extends R> combiner,
int bufferSize, boolean delayErrors) {
this.array = array;
this.iterable = null;
this.combiner = combiner;
Reported by PMD.
Line: 56
@NonNull Function<? super Object[], ? extends R> combiner,
int bufferSize, boolean delayErrors) {
this.array = array;
this.iterable = null;
this.combiner = combiner;
this.bufferSize = bufferSize;
this.delayErrors = delayErrors;
}
Reported by PMD.
Line: 65
public FlowableCombineLatest(@NonNull Iterable<? extends Publisher<? extends T>> iterable,
@NonNull Function<? super Object[], ? extends R> combiner,
int bufferSize, boolean delayErrors) {
this.array = null;
this.iterable = iterable;
this.combiner = combiner;
this.bufferSize = bufferSize;
this.delayErrors = delayErrors;
}
Reported by PMD.
Line: 72
this.delayErrors = delayErrors;
}
@SuppressWarnings("unchecked")
@Override
public void subscribeActual(Subscriber<? super R> s) {
Publisher<? extends T>[] sources = array;
int count;
if (sources == null) {
Reported by PMD.
Line: 84
try {
for (Publisher<? extends T> p : iterable) {
if (count == sources.length) {
Publisher<? extends T>[] b = new Publisher[count + (count >> 2)];
System.arraycopy(sources, 0, b, 0, count);
sources = b;
}
sources[count++] = Objects.requireNonNull(p, "The Iterator returned a null Publisher");
}
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableAllTest.java
59 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 static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.*;
Reported by PMD.
Line: 36
import io.reactivex.rxjava3.subscribers.TestSubscriber;
import io.reactivex.rxjava3.testsupport.*;
public class FlowableAllTest extends RxJavaTest {
@Test
public void all() {
Flowable<String> obs = Flowable.just("one", "two", "six");
Reported by PMD.
Line: 40
@Test
public void all() {
Flowable<String> obs = Flowable.just("one", "two", "six");
SingleObserver<Boolean> observer = TestHelper.mockSingleObserver();
obs.all(new Predicate<String>() {
@Override
Reported by PMD.
Line: 40
@Test
public void all() {
Flowable<String> obs = Flowable.just("one", "two", "six");
SingleObserver<Boolean> observer = TestHelper.mockSingleObserver();
obs.all(new Predicate<String>() {
@Override
Reported by PMD.
Line: 40
@Test
public void all() {
Flowable<String> obs = Flowable.just("one", "two", "six");
SingleObserver<Boolean> observer = TestHelper.mockSingleObserver();
obs.all(new Predicate<String>() {
@Override
Reported by PMD.
Line: 53
.subscribe(observer);
verify(observer).onSubscribe((Disposable)any());
verify(observer).onSuccess(true);
verifyNoMoreInteractions(observer);
}
@Test
public void notAll() {
Reported by PMD.
Line: 72
.subscribe(observer);
verify(observer).onSubscribe((Disposable)any());
verify(observer).onSuccess(false);
verifyNoMoreInteractions(observer);
}
@Test
public void empty() {
Reported by PMD.
Line: 91
.subscribe(observer);
verify(observer).onSubscribe((Disposable)any());
verify(observer).onSuccess(true);
verifyNoMoreInteractions(observer);
}
@Test
public void error() {
Reported by PMD.
Line: 111
.subscribe(observer);
verify(observer).onSubscribe((Disposable)any());
verify(observer).onError(error);
verifyNoMoreInteractions(observer);
}
@Test
public void followingFirst() {
Reported by PMD.
Line: 125
}
});
assertFalse(allOdd.blockingGet());
}
@Test
public void issue1935NoUnsubscribeDownstream() {
Flowable<Integer> source = Flowable.just(1)
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/jdk8/SingleToCompletionStageTest.java
59 issues
Line: 31
public class SingleToCompletionStageTest extends RxJavaTest {
@Test
public void just() throws Exception {
Integer v = Single.just(1)
.toCompletionStage()
.toCompletableFuture()
.get();
Reported by PMD.
Line: 32
@Test
public void just() throws Exception {
Integer v = Single.just(1)
.toCompletionStage()
.toCompletableFuture()
.get();
assertEquals((Integer)1, v);
Reported by PMD.
Line: 32
@Test
public void just() throws Exception {
Integer v = Single.just(1)
.toCompletionStage()
.toCompletableFuture()
.get();
assertEquals((Integer)1, v);
Reported by PMD.
Line: 32
@Test
public void just() throws Exception {
Integer v = Single.just(1)
.toCompletionStage()
.toCompletableFuture()
.get();
assertEquals((Integer)1, v);
Reported by PMD.
Line: 37
.toCompletableFuture()
.get();
assertEquals((Integer)1, v);
}
@Test
public void completableFutureCancels() throws Exception {
SingleSubject<Integer> source = SingleSubject.create();
Reported by PMD.
Line: 41
}
@Test
public void completableFutureCancels() throws Exception {
SingleSubject<Integer> source = SingleSubject.create();
CompletableFuture<Integer> cf = source
.toCompletionStage()
.toCompletableFuture();
Reported by PMD.
Line: 41
}
@Test
public void completableFutureCancels() throws Exception {
SingleSubject<Integer> source = SingleSubject.create();
CompletableFuture<Integer> cf = source
.toCompletionStage()
.toCompletableFuture();
Reported by PMD.
Line: 44
public void completableFutureCancels() throws Exception {
SingleSubject<Integer> source = SingleSubject.create();
CompletableFuture<Integer> cf = source
.toCompletionStage()
.toCompletableFuture();
assertTrue(source.hasObservers());
Reported by PMD.
Line: 44
public void completableFutureCancels() throws Exception {
SingleSubject<Integer> source = SingleSubject.create();
CompletableFuture<Integer> cf = source
.toCompletionStage()
.toCompletableFuture();
assertTrue(source.hasObservers());
Reported by PMD.
Line: 48
.toCompletionStage()
.toCompletableFuture();
assertTrue(source.hasObservers());
cf.cancel(true);
assertTrue(cf.isCancelled());
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableDematerializeTest.java
59 issues
Line: 146
TestObserverEx<Integer> to = new TestObserverEx<>(observer);
dematerialize.subscribe(to);
System.out.println(to.errors());
verify(observer, never()).onError(any(Throwable.class));
verify(observer, times(1)).onComplete();
verify(observer, times(0)).onNext(any(Integer.class));
}
Reported by PMD.
Line: 31
import io.reactivex.rxjava3.plugins.RxJavaPlugins;
import io.reactivex.rxjava3.testsupport.*;
public class ObservableDematerializeTest extends RxJavaTest {
@Test
public void simpleSelector() {
Observable<Notification<Integer>> notifications = Observable.just(1, 2).materialize();
Observable<Integer> dematerialize = notifications.dematerialize(Functions.<Notification<Integer>>identity());
Reported by PMD.
Line: 35
@Test
public void simpleSelector() {
Observable<Notification<Integer>> notifications = Observable.just(1, 2).materialize();
Observable<Integer> dematerialize = notifications.dematerialize(Functions.<Notification<Integer>>identity());
Observer<Integer> observer = TestHelper.mockObserver();
dematerialize.subscribe(observer);
Reported by PMD.
Line: 36
@Test
public void simpleSelector() {
Observable<Notification<Integer>> notifications = Observable.just(1, 2).materialize();
Observable<Integer> dematerialize = notifications.dematerialize(Functions.<Notification<Integer>>identity());
Observer<Integer> observer = TestHelper.mockObserver();
dematerialize.subscribe(observer);
Reported by PMD.
Line: 40
Observer<Integer> observer = TestHelper.mockObserver();
dematerialize.subscribe(observer);
verify(observer, times(1)).onNext(1);
verify(observer, times(1)).onNext(2);
verify(observer, times(1)).onComplete();
verify(observer, never()).onError(any(Throwable.class));
Reported by PMD.
Line: 42
dematerialize.subscribe(observer);
verify(observer, times(1)).onNext(1);
verify(observer, times(1)).onNext(2);
verify(observer, times(1)).onComplete();
verify(observer, never()).onError(any(Throwable.class));
}
Reported by PMD.
Line: 43
dematerialize.subscribe(observer);
verify(observer, times(1)).onNext(1);
verify(observer, times(1)).onNext(2);
verify(observer, times(1)).onComplete();
verify(observer, never()).onError(any(Throwable.class));
}
@Test
Reported by PMD.
Line: 44
verify(observer, times(1)).onNext(1);
verify(observer, times(1)).onNext(2);
verify(observer, times(1)).onComplete();
verify(observer, never()).onError(any(Throwable.class));
}
@Test
public void selectorCrash() {
Reported by PMD.
Line: 45
verify(observer, times(1)).onNext(1);
verify(observer, times(1)).onNext(2);
verify(observer, times(1)).onComplete();
verify(observer, never()).onError(any(Throwable.class));
}
@Test
public void selectorCrash() {
Observable.just(1, 2)
Reported by PMD.
Line: 49
}
@Test
public void selectorCrash() {
Observable.just(1, 2)
.materialize()
.dematerialize(new Function<Notification<Integer>, Notification<Object>>() {
@Override
public Notification<Object> apply(Notification<Integer> v) throws Exception {
Reported by PMD.
src/jmh/java/io/reactivex/rxjava3/core/CallableAsyncPerf.java
59 issues
Line: 30
@OutputTimeUnit(TimeUnit.SECONDS)
@Fork(value = 1)
@State(Scope.Thread)
public class CallableAsyncPerf {
Flowable<Integer> subscribeOnFlowable;
Flowable<Integer> observeOnFlowable;
Reported by PMD.
Line: 30
@OutputTimeUnit(TimeUnit.SECONDS)
@Fork(value = 1)
@State(Scope.Thread)
public class CallableAsyncPerf {
Flowable<Integer> subscribeOnFlowable;
Flowable<Integer> observeOnFlowable;
Reported by PMD.
Line: 32
@State(Scope.Thread)
public class CallableAsyncPerf {
Flowable<Integer> subscribeOnFlowable;
Flowable<Integer> observeOnFlowable;
Flowable<Integer> pipelineFlowable;
Reported by PMD.
Line: 32
@State(Scope.Thread)
public class CallableAsyncPerf {
Flowable<Integer> subscribeOnFlowable;
Flowable<Integer> observeOnFlowable;
Flowable<Integer> pipelineFlowable;
Reported by PMD.
Line: 34
Flowable<Integer> subscribeOnFlowable;
Flowable<Integer> observeOnFlowable;
Flowable<Integer> pipelineFlowable;
Observable<Integer> subscribeOnObservable;
Reported by PMD.
Line: 34
Flowable<Integer> subscribeOnFlowable;
Flowable<Integer> observeOnFlowable;
Flowable<Integer> pipelineFlowable;
Observable<Integer> subscribeOnObservable;
Reported by PMD.
Line: 36
Flowable<Integer> observeOnFlowable;
Flowable<Integer> pipelineFlowable;
Observable<Integer> subscribeOnObservable;
Observable<Integer> observeOnObservable;
Reported by PMD.
Line: 36
Flowable<Integer> observeOnFlowable;
Flowable<Integer> pipelineFlowable;
Observable<Integer> subscribeOnObservable;
Observable<Integer> observeOnObservable;
Reported by PMD.
Line: 38
Flowable<Integer> pipelineFlowable;
Observable<Integer> subscribeOnObservable;
Observable<Integer> observeOnObservable;
Observable<Integer> pipelineObservable;
Reported by PMD.
Line: 38
Flowable<Integer> pipelineFlowable;
Observable<Integer> subscribeOnObservable;
Observable<Integer> observeOnObservable;
Observable<Integer> pipelineObservable;
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/jdk8/CompletableToCompletionStageTest.java
59 issues
Line: 31
public class CompletableToCompletionStageTest extends RxJavaTest {
@Test
public void complete() throws Exception {
Object v = Completable.complete()
.toCompletionStage(null)
.toCompletableFuture()
.get();
Reported by PMD.
Line: 32
@Test
public void complete() throws Exception {
Object v = Completable.complete()
.toCompletionStage(null)
.toCompletableFuture()
.get();
assertNull(v);
Reported by PMD.
Line: 32
@Test
public void complete() throws Exception {
Object v = Completable.complete()
.toCompletionStage(null)
.toCompletableFuture()
.get();
assertNull(v);
Reported by PMD.
Line: 32
@Test
public void complete() throws Exception {
Object v = Completable.complete()
.toCompletionStage(null)
.toCompletableFuture()
.get();
assertNull(v);
Reported by PMD.
Line: 37
.toCompletableFuture()
.get();
assertNull(v);
}
@Test
public void completableFutureCancels() throws Exception {
CompletableSubject source = CompletableSubject.create();
Reported by PMD.
Line: 41
}
@Test
public void completableFutureCancels() throws Exception {
CompletableSubject source = CompletableSubject.create();
CompletableFuture<Object> cf = source
.toCompletionStage(null)
.toCompletableFuture();
Reported by PMD.
Line: 41
}
@Test
public void completableFutureCancels() throws Exception {
CompletableSubject source = CompletableSubject.create();
CompletableFuture<Object> cf = source
.toCompletionStage(null)
.toCompletableFuture();
Reported by PMD.
Line: 44
public void completableFutureCancels() throws Exception {
CompletableSubject source = CompletableSubject.create();
CompletableFuture<Object> cf = source
.toCompletionStage(null)
.toCompletableFuture();
assertTrue(source.hasObservers());
Reported by PMD.
Line: 44
public void completableFutureCancels() throws Exception {
CompletableSubject source = CompletableSubject.create();
CompletableFuture<Object> cf = source
.toCompletionStage(null)
.toCompletableFuture();
assertTrue(source.hasObservers());
Reported by PMD.
Line: 48
.toCompletionStage(null)
.toCompletableFuture();
assertTrue(source.hasObservers());
cf.cancel(true);
assertTrue(cf.isCancelled());
Reported by PMD.
src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableSkipTest.java
59 issues
Line: 33
@Test(expected = IllegalArgumentException.class)
public void skipNegativeElements() {
Observable<String> skip = Observable.just("one", "two", "three").skip(-99);
Observer<String> observer = TestHelper.mockObserver();
skip.subscribe(observer);
verify(observer, times(1)).onNext("one");
verify(observer, times(1)).onNext("two");
Reported by PMD.
Line: 33
@Test(expected = IllegalArgumentException.class)
public void skipNegativeElements() {
Observable<String> skip = Observable.just("one", "two", "three").skip(-99);
Observer<String> observer = TestHelper.mockObserver();
skip.subscribe(observer);
verify(observer, times(1)).onNext("one");
verify(observer, times(1)).onNext("two");
Reported by PMD.
Line: 33
@Test(expected = IllegalArgumentException.class)
public void skipNegativeElements() {
Observable<String> skip = Observable.just("one", "two", "three").skip(-99);
Observer<String> observer = TestHelper.mockObserver();
skip.subscribe(observer);
verify(observer, times(1)).onNext("one");
verify(observer, times(1)).onNext("two");
Reported by PMD.
Line: 33
@Test(expected = IllegalArgumentException.class)
public void skipNegativeElements() {
Observable<String> skip = Observable.just("one", "two", "three").skip(-99);
Observer<String> observer = TestHelper.mockObserver();
skip.subscribe(observer);
verify(observer, times(1)).onNext("one");
verify(observer, times(1)).onNext("two");
Reported by PMD.
Line: 36
Observable<String> skip = Observable.just("one", "two", "three").skip(-99);
Observer<String> observer = TestHelper.mockObserver();
skip.subscribe(observer);
verify(observer, times(1)).onNext("one");
verify(observer, times(1)).onNext("two");
verify(observer, times(1)).onNext("three");
verify(observer, never()).onError(any(Throwable.class));
verify(observer, times(1)).onComplete();
Reported by PMD.
Line: 37
Observer<String> observer = TestHelper.mockObserver();
skip.subscribe(observer);
verify(observer, times(1)).onNext("one");
verify(observer, times(1)).onNext("two");
verify(observer, times(1)).onNext("three");
verify(observer, never()).onError(any(Throwable.class));
verify(observer, times(1)).onComplete();
}
Reported by PMD.
Line: 38
Observer<String> observer = TestHelper.mockObserver();
skip.subscribe(observer);
verify(observer, times(1)).onNext("one");
verify(observer, times(1)).onNext("two");
verify(observer, times(1)).onNext("three");
verify(observer, never()).onError(any(Throwable.class));
verify(observer, times(1)).onComplete();
}
Reported by PMD.
Line: 39
skip.subscribe(observer);
verify(observer, times(1)).onNext("one");
verify(observer, times(1)).onNext("two");
verify(observer, times(1)).onNext("three");
verify(observer, never()).onError(any(Throwable.class));
verify(observer, times(1)).onComplete();
}
@Test
Reported by PMD.
Line: 40
verify(observer, times(1)).onNext("one");
verify(observer, times(1)).onNext("two");
verify(observer, times(1)).onNext("three");
verify(observer, never()).onError(any(Throwable.class));
verify(observer, times(1)).onComplete();
}
@Test
public void skipZeroElements() {
Reported by PMD.
Line: 41
verify(observer, times(1)).onNext("two");
verify(observer, times(1)).onNext("three");
verify(observer, never()).onError(any(Throwable.class));
verify(observer, times(1)).onComplete();
}
@Test
public void skipZeroElements() {
Reported by PMD.