Search in sources :

Example 1 with ObservableRange

use of io.reactivex.internal.operators.observable.ObservableRange in project RxJava by ReactiveX.

the class RxJavaPluginsTest method observableCreate.

@SuppressWarnings("rawtypes")
@Test
public void observableCreate() {
    try {
        RxJavaPlugins.setOnObservableAssembly(new Function<Observable, Observable>() {

            @Override
            public Observable apply(Observable t) {
                return new ObservableRange(1, 2);
            }
        });
        Observable.range(10, 3).test().assertValues(1, 2).assertNoErrors().assertComplete();
    } finally {
        RxJavaPlugins.reset();
    }
    // make sure the reset worked
    Observable.range(10, 3).test().assertValues(10, 11, 12).assertNoErrors().assertComplete();
}
Also used : ObservableRange(io.reactivex.internal.operators.observable.ObservableRange) Observable(io.reactivex.Observable) ConnectableObservable(io.reactivex.observables.ConnectableObservable)

Aggregations

Observable (io.reactivex.Observable)1 ObservableRange (io.reactivex.internal.operators.observable.ObservableRange)1 ConnectableObservable (io.reactivex.observables.ConnectableObservable)1