Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 0 additions & 33 deletions src/test/java/io/reactivex/flowable/FlowableSubscriberTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -463,39 +463,6 @@ public void onNext(Integer t) {
assertEquals(1, c.get());
}

@Ignore("Non-positive requests are relayed to the plugin and is a no-op otherwise")
@Test
public void negativeRequestThrowsIllegalArgumentException() throws InterruptedException {
final CountDownLatch latch = new CountDownLatch(1);
final AtomicReference<Throwable> exception = new AtomicReference<Throwable>();
Flowable.just(1, 2, 3, 4).subscribe(new DefaultSubscriber<Integer>() {

@Override
public void onStart() {
request(1);
}

@Override
public void onComplete() {

}

@Override
public void onError(Throwable e) {
exception.set(e);
latch.countDown();
}

@Override
public void onNext(Integer t) {
request(-1);
request(1);
}});

Assert.assertTrue(latch.await(10, TimeUnit.SECONDS));
Assert.assertTrue(exception.get() instanceof IllegalArgumentException);
}

@Test
public void onStartRequestsAreAdditive() {
final List<Integer> list = new ArrayList<Integer>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
package io.reactivex.internal.operators.observable;

import static org.junit.Assert.*;

import io.reactivex.RxJavaTest;
import org.junit.Test;

import io.reactivex.Observable;
import io.reactivex.internal.functions.Functions;
import io.reactivex.internal.fuseable.HasUpstreamObservableSource;

public class AbstractObservableWithUpstreamTest {
public class AbstractObservableWithUpstreamTest extends RxJavaTest {

@SuppressWarnings("unchecked")
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.util.*;
import java.util.concurrent.TimeUnit;

import io.reactivex.RxJavaTest;
import org.junit.*;

import io.reactivex.Observable;
Expand All @@ -28,8 +29,8 @@
import io.reactivex.subjects.PublishSubject;
import io.reactivex.testsupport.TestHelper;

public class BlockingObservableLatestTest {
@Test(timeout = 1000)
public class BlockingObservableLatestTest extends RxJavaTest {
@Test
public void simple() {
TestScheduler scheduler = new TestScheduler();

Expand All @@ -53,7 +54,7 @@ public void simple() {
Assert.assertFalse(it.hasNext());
}

@Test(timeout = 1000)
@Test
public void sameSourceMultipleIterators() {
TestScheduler scheduler = new TestScheduler();

Expand All @@ -79,7 +80,7 @@ public void sameSourceMultipleIterators() {
}
}

@Test(timeout = 1000, expected = NoSuchElementException.class)
@Test(expected = NoSuchElementException.class)
public void empty() {
Observable<Long> source = Observable.<Long> empty();

Expand All @@ -92,7 +93,7 @@ public void empty() {
it.next();
}

@Test(timeout = 1000, expected = NoSuchElementException.class)
@Test(expected = NoSuchElementException.class)
public void simpleJustNext() {
TestScheduler scheduler = new TestScheduler();

Expand All @@ -111,7 +112,7 @@ public void simpleJustNext() {
}
}

@Test(/* timeout = 1000, */expected = RuntimeException.class)
@Test(expected = RuntimeException.class)
public void hasNextThrows() {
TestScheduler scheduler = new TestScheduler();

Expand All @@ -126,7 +127,7 @@ public void hasNextThrows() {
it.hasNext();
}

@Test(timeout = 1000, expected = RuntimeException.class)
@Test(expected = RuntimeException.class)
public void nextThrows() {
TestScheduler scheduler = new TestScheduler();

Expand All @@ -140,7 +141,7 @@ public void nextThrows() {
it.next();
}

@Test(timeout = 1000)
@Test
public void fasterSource() {
PublishSubject<Integer> source = PublishSubject.create();
Observable<Integer> blocker = source;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
import java.util.*;
import java.util.concurrent.TimeUnit;

import io.reactivex.RxJavaTest;
import org.junit.*;

import io.reactivex.Observable;
import io.reactivex.exceptions.TestException;
import io.reactivex.schedulers.TestScheduler;
import io.reactivex.subjects.*;

public class BlockingObservableMostRecentTest {
public class BlockingObservableMostRecentTest extends RxJavaTest {
@Test
public void mostRecentNull() {
assertNull(Observable.<Void>never().blockingMostRecent(null).iterator().next());
Expand Down Expand Up @@ -76,7 +77,7 @@ public void mostRecentWithException() {
it.next();
}

@Test(timeout = 1000)
@Test
public void singleSourceManyIterators() {
TestScheduler scheduler = new TestScheduler();
Observable<Long> source = Observable.interval(1, TimeUnit.SECONDS, scheduler).take(10);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import io.reactivex.subjects.*;
import io.reactivex.testsupport.TestHelper;

public class BlockingObservableNextTest {
public class BlockingObservableNextTest extends RxJavaTest {

private void fireOnNextInNewThread(final Subject<String> o, final String value) {
new Thread() {
Expand Down Expand Up @@ -312,7 +312,7 @@ public void run() {
}
}

@Test /* (timeout = 8000) */
@Test
public void singleSourceManyIterators() throws InterruptedException {
Observable<Long> o = Observable.interval(250, TimeUnit.MILLISECONDS);
PublishSubject<Integer> terminal = PublishSubject.create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.*;
import java.util.concurrent.*;

import io.reactivex.RxJavaTest;
import org.junit.*;

import io.reactivex.Observable;
Expand All @@ -28,13 +29,7 @@
import io.reactivex.disposables.Disposables;
import io.reactivex.exceptions.TestException;

public class BlockingObservableToFutureTest {
@Ignore("No separate file")
@Test
public void constructorShouldBePrivate() {
// TestHelper.checkUtilityClass(FlowableToFuture.class);
}

public class BlockingObservableToFutureTest extends RxJavaTest {
@Test
public void toFuture() throws InterruptedException, ExecutionException {
Observable<String> obs = Observable.just("one");
Expand All @@ -51,7 +46,7 @@ public void toFutureList() throws InterruptedException, ExecutionException {
assertEquals("three", f.get().get(2));
}

@Test(/* timeout = 5000, */expected = IndexOutOfBoundsException.class)
@Test(expected = IndexOutOfBoundsException.class)
public void exceptionWithMoreThanOneElement() throws Throwable {
Observable<String> obs = Observable.just("one", "two");
Future<String> f = obs.toFuture();
Expand Down Expand Up @@ -115,12 +110,4 @@ public void getWithEmptyFlowable() throws Throwable {
throw e.getCause();
}
}

@Ignore("null value is not allowed")
@Test
public void getWithASingleNullItem() throws Exception {
Observable<String> obs = Observable.just((String)null);
Future<String> f = obs.toFuture();
assertNull(f.get());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.util.*;

import io.reactivex.RxJavaTest;
import org.junit.*;

import io.reactivex.Observable;
Expand All @@ -26,7 +27,7 @@
import io.reactivex.exceptions.TestException;
import io.reactivex.internal.operators.observable.BlockingObservableIterable.BlockingObservableIterator;

public class BlockingObservableToIteratorTest {
public class BlockingObservableToIteratorTest extends RxJavaTest {

@Test
public void toIterator() {
Expand Down Expand Up @@ -68,21 +69,6 @@ public void subscribe(Observer<? super String> observer) {
it.next();
}

@Ignore("subscribe() should not throw")
@Test(expected = TestException.class)
public void exceptionThrownFromOnSubscribe() {
Iterable<String> strings = Observable.unsafeCreate(new ObservableSource<String>() {
@Override
public void subscribe(Observer<? super String> observer) {
throw new TestException("intentional");
}
}).blockingIterable();
for (String string : strings) {
// never reaches here
System.out.println(string);
}
}

@Test
public void dispose() {
BlockingObservableIterator<Integer> it = new BlockingObservableIterator<Integer>(128);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import io.reactivex.plugins.RxJavaPlugins;
import io.reactivex.testsupport.*;

public class ObservableAllTest {
public class ObservableAllTest extends RxJavaTest {

@Test
public void allObservable() {
Expand Down Expand Up @@ -124,7 +124,7 @@ public boolean test(Integer i) {
assertFalse(allOdd.blockingFirst());
}

@Test(timeout = 5000)
@Test
public void issue1935NoUnsubscribeDownstreamObservable() {
Observable<Integer> source = Observable.just(1)
.all(new Predicate<Integer>() {
Expand Down Expand Up @@ -255,7 +255,7 @@ public boolean test(Integer i) {
assertFalse(allOdd.blockingGet());
}

@Test(timeout = 5000)
@Test
public void issue1935NoUnsubscribeDownstream() {
Observable<Integer> source = Observable.just(1)
.all(new Predicate<Integer>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import io.reactivex.subjects.PublishSubject;
import io.reactivex.testsupport.*;

public class ObservableAmbTest {
public class ObservableAmbTest extends RxJavaTest {

private TestScheduler scheduler;
private Scheduler.Worker innerScheduler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import io.reactivex.plugins.RxJavaPlugins;
import io.reactivex.testsupport.*;

public class ObservableAnyTest {
public class ObservableAnyTest extends RxJavaTest {

@Test
public void anyWithTwoItemsObservable() {
Expand Down Expand Up @@ -231,7 +231,7 @@ public boolean test(Integer i) {
assertTrue(anyEven.blockingFirst());
}

@Test(timeout = 5000)
@Test
public void issue1935NoUnsubscribeDownstreamObservable() {
Observable<Integer> source = Observable.just(1).isEmpty().toObservable()
.flatMap(new Function<Boolean, Observable<Integer>>() {
Expand Down Expand Up @@ -453,7 +453,7 @@ public boolean test(Integer i) {
assertTrue(anyEven.blockingGet());
}

@Test(timeout = 5000)
@Test
public void issue1935NoUnsubscribeDownstream() {
Observable<Integer> source = Observable.just(1).isEmpty()
.flatMapObservable(new Function<Boolean, Observable<Integer>>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
package io.reactivex.internal.operators.observable;

import static org.junit.Assert.*;

import io.reactivex.RxJavaTest;
import org.junit.Test;

import io.reactivex.subjects.PublishSubject;

public class ObservableAutoConnectTest {
public class ObservableAutoConnectTest extends RxJavaTest {

@Test
public void autoConnectImmediately() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.util.*;
import java.util.concurrent.TimeUnit;

import io.reactivex.RxJavaTest;
import org.junit.Test;

import io.reactivex.Observable;
Expand All @@ -31,7 +32,7 @@
import io.reactivex.schedulers.Schedulers;
import io.reactivex.testsupport.TestHelper;

public class ObservableBlockingTest {
public class ObservableBlockingTest extends RxJavaTest {

@Test
public void blockingFirst() {
Expand Down
Loading