From 93ed3580887ede92edef39c2ab46abc9045e133b Mon Sep 17 00:00:00 2001 From: Ben Christensen Date: Tue, 20 May 2014 11:12:19 -0700 Subject: [PATCH] Deprecate toBlockingObservable in favor of toBlocking As per discussion at https://github.com/Netflix/RxJava/pull/1224#issuecomment-43658284 --- rxjava-core/src/main/java/rx/Observable.java | 7 +++-- .../rx/observables/BlockingObservable.java | 2 +- .../schedulers/TestRecursionMemoryUsage.java | 2 +- .../src/test/java/rx/CombineLatestTests.java | 10 +++---- rxjava-core/src/test/java/rx/ConcatTests.java | 14 ++++----- .../src/test/java/rx/GroupByTests.java | 4 +-- rxjava-core/src/test/java/rx/MergeTests.java | 8 ++--- .../src/test/java/rx/ObservableDoOnTest.java | 6 ++-- .../src/test/java/rx/ObservableTests.java | 30 +++++++++---------- .../test/java/rx/ObservableWindowTests.java | 2 +- rxjava-core/src/test/java/rx/ReduceTests.java | 2 +- rxjava-core/src/test/java/rx/ScanTests.java | 2 +- .../src/test/java/rx/StartWithTests.java | 6 ++-- rxjava-core/src/test/java/rx/ZipTests.java | 14 ++++----- .../operators/BlockingOperatorLatestTest.java | 14 ++++----- .../BlockingOperatorMostRecentTest.java | 2 +- .../operators/BlockingOperatorNextTest.java | 2 +- .../rx/operators/OperatorElementAtTest.java | 8 ++--- .../rx/operators/OperatorGroupByTest.java | 12 ++++---- .../java/rx/operators/OperatorLastTest.java | 8 ++--- .../java/rx/operators/OperatorMapTest.java | 10 +++---- .../rx/operators/OperatorMaterializeTest.java | 4 +-- .../OperatorMergeMaxConcurrentTest.java | 8 ++--- .../java/rx/operators/OperatorMergeTest.java | 2 +- .../rx/operators/OperatorObserveOnTest.java | 6 ++-- .../operators/OperatorParallelMergeTest.java | 10 +++---- .../rx/operators/OperatorParallelTest.java | 4 +-- .../java/rx/operators/OperatorRepeatTest.java | 8 ++--- .../java/rx/operators/OperatorTakeTest.java | 4 +-- .../rx/operators/OperatorTakeWhileTest.java | 2 +- .../java/rx/operators/OperatorUsingTest.java | 6 ++-- .../java/rx/operators/OperatorWindowTest.java | 2 +- .../java/rx/operators/OperatorZipTest.java | 2 +- .../rx/schedulers/AbstractSchedulerTests.java | 4 +-- .../schedulers/ComputationSchedulerTests.java | 4 +-- .../rx/schedulers/ImmediateSchedulerTest.java | 4 +-- .../rx/schedulers/NewThreadSchedulerTest.java | 2 +- .../schedulers/TrampolineSchedulerTest.java | 2 +- .../java/rx/subjects/AsyncSubjectTest.java | 2 +- .../ReplaySubjectConcurrencyTest.java | 6 ++-- .../test/java/rx/util/AssertObservable.java | 2 +- 41 files changed, 125 insertions(+), 124 deletions(-) diff --git a/rxjava-core/src/main/java/rx/Observable.java b/rxjava-core/src/main/java/rx/Observable.java index e19f1855df..ada099b813 100644 --- a/rxjava-core/src/main/java/rx/Observable.java +++ b/rxjava-core/src/main/java/rx/Observable.java @@ -6949,7 +6949,10 @@ public final Observable> timestamp(Scheduler scheduler) { * * @return a {@code BlockingObservable} version of this Observable * @see RxJava Wiki: Blocking Observable Observers + * + * @deprecated Use {@link #toBlocking()} instead. */ + @Deprecated public final BlockingObservable toBlockingObservable() { return BlockingObservable.from(this); } @@ -6957,13 +6960,11 @@ public final BlockingObservable toBlockingObservable() { /** * Converts an Observable into a {@link BlockingObservable} (an Observable with blocking operators). * - * This method is an alias for {@link #toBlockingObservable()}. - * * @return a {@code BlockingObservable} version of this Observable * @see RxJava Wiki: Blocking Observable Observers */ public final BlockingObservable toBlocking() { - return toBlockingObservable(); + return BlockingObservable.from(this); } /** diff --git a/rxjava-core/src/main/java/rx/observables/BlockingObservable.java b/rxjava-core/src/main/java/rx/observables/BlockingObservable.java index bab6d67f90..da33d262d8 100644 --- a/rxjava-core/src/main/java/rx/observables/BlockingObservable.java +++ b/rxjava-core/src/main/java/rx/observables/BlockingObservable.java @@ -35,7 +35,7 @@ * An extension of {@link Observable} that provides blocking operators. *

* You construct a BlockingObservable from an - * Observable with {@link #from(Observable)} or {@link Observable#toBlockingObservable()}

+ * Observable with {@link #from(Observable)} or {@link Observable#toBlocking()}

* The documentation for this interface makes use of a form of marble diagram * that has been modified to illustrate blocking operators. The following legend * explains these marble diagrams: diff --git a/rxjava-core/src/perf/java/rx/archive/schedulers/TestRecursionMemoryUsage.java b/rxjava-core/src/perf/java/rx/archive/schedulers/TestRecursionMemoryUsage.java index 7fc70cdd9d..1a353decfc 100644 --- a/rxjava-core/src/perf/java/rx/archive/schedulers/TestRecursionMemoryUsage.java +++ b/rxjava-core/src/perf/java/rx/archive/schedulers/TestRecursionMemoryUsage.java @@ -66,6 +66,6 @@ public void call() { } }); } - }).toBlockingObservable().last(); + }).toBlocking().last(); } } diff --git a/rxjava-core/src/test/java/rx/CombineLatestTests.java b/rxjava-core/src/test/java/rx/CombineLatestTests.java index dfc2ec1245..e8340cc141 100644 --- a/rxjava-core/src/test/java/rx/CombineLatestTests.java +++ b/rxjava-core/src/test/java/rx/CombineLatestTests.java @@ -36,11 +36,11 @@ public void testCovarianceOfCombineLatest() { Observable horrors = Observable.from(new HorrorMovie()); Observable ratings = Observable.from(new CoolRating()); - Observable. combineLatest(horrors, ratings, combine).toBlockingObservable().forEach(action); - Observable. combineLatest(horrors, ratings, combine).toBlockingObservable().forEach(action); - Observable. combineLatest(horrors, ratings, combine).toBlockingObservable().forEach(extendedAction); - Observable. combineLatest(horrors, ratings, combine).toBlockingObservable().forEach(action); - Observable. combineLatest(horrors, ratings, combine).toBlockingObservable().forEach(action); + Observable. combineLatest(horrors, ratings, combine).toBlocking().forEach(action); + Observable. combineLatest(horrors, ratings, combine).toBlocking().forEach(action); + Observable. combineLatest(horrors, ratings, combine).toBlocking().forEach(extendedAction); + Observable. combineLatest(horrors, ratings, combine).toBlocking().forEach(action); + Observable. combineLatest(horrors, ratings, combine).toBlocking().forEach(action); Observable. combineLatest(horrors, ratings, combine); } diff --git a/rxjava-core/src/test/java/rx/ConcatTests.java b/rxjava-core/src/test/java/rx/ConcatTests.java index 0dae3e327a..63b90a7d6e 100644 --- a/rxjava-core/src/test/java/rx/ConcatTests.java +++ b/rxjava-core/src/test/java/rx/ConcatTests.java @@ -35,7 +35,7 @@ public void testConcatSimple() { Observable o1 = Observable.from("one", "two"); Observable o2 = Observable.from("three", "four"); - List values = Observable.concat(o1, o2).toList().toBlockingObservable().single(); + List values = Observable.concat(o1, o2).toList().toBlocking().single(); assertEquals("one", values.get(0)); assertEquals("two", values.get(1)); @@ -51,7 +51,7 @@ public void testConcatWithObservableOfObservable() { Observable> os = Observable.from(o1, o2, o3); - List values = Observable.concat(os).toList().toBlockingObservable().single(); + List values = Observable.concat(os).toList().toBlocking().single(); assertEquals("one", values.get(0)); assertEquals("two", values.get(1)); @@ -68,7 +68,7 @@ public void testConcatWithIterableOfObservable() { @SuppressWarnings("unchecked") Iterable> is = Arrays.asList(o1, o2, o3); - List values = Observable.concat(Observable.from(is)).toList().toBlockingObservable().single(); + List values = Observable.concat(Observable.from(is)).toList().toBlocking().single(); assertEquals("one", values.get(0)); assertEquals("two", values.get(1)); @@ -83,7 +83,7 @@ public void testConcatCovariance() { Observable> os = Observable.from(o1, o2); - List values = Observable.concat(os).toList().toBlockingObservable().single(); + List values = Observable.concat(os).toList().toBlocking().single(); assertEquals(4, values.size()); } @@ -95,7 +95,7 @@ public void testConcatCovariance2() { Observable> os = Observable.from(o1, o2); - List values = Observable.concat(os).toList().toBlockingObservable().single(); + List values = Observable.concat(os).toList().toBlocking().single(); assertEquals(5, values.size()); } @@ -105,7 +105,7 @@ public void testConcatCovariance3() { Observable o1 = Observable.from(new HorrorMovie(), new Movie()); Observable o2 = Observable.from(new Media(), new HorrorMovie()); - List values = Observable.concat(o1, o2).toList().toBlockingObservable().single(); + List values = Observable.concat(o1, o2).toList().toBlocking().single(); assertTrue(values.get(0) instanceof HorrorMovie); assertTrue(values.get(1) instanceof Movie); @@ -129,7 +129,7 @@ public void call(Subscriber o) { Observable o2 = Observable.from(new Media(), new HorrorMovie()); - List values = Observable.concat(o1, o2).toList().toBlockingObservable().single(); + List values = Observable.concat(o1, o2).toList().toBlocking().single(); assertTrue(values.get(0) instanceof HorrorMovie); assertTrue(values.get(1) instanceof Movie); diff --git a/rxjava-core/src/test/java/rx/GroupByTests.java b/rxjava-core/src/test/java/rx/GroupByTests.java index 414d1ad559..3530c08799 100644 --- a/rxjava-core/src/test/java/rx/GroupByTests.java +++ b/rxjava-core/src/test/java/rx/GroupByTests.java @@ -38,7 +38,7 @@ public String call(Event event) { } }).take(1) - .toBlockingObservable().forEach(new Action1>() { + .toBlocking().forEach(new Action1>() { @Override public void call(GroupedObservable g) { @@ -79,7 +79,7 @@ public String call(Event event) { }) .take(20) - .toBlockingObservable().forEach(new Action1() { + .toBlocking().forEach(new Action1() { @Override public void call(String v) { diff --git a/rxjava-core/src/test/java/rx/MergeTests.java b/rxjava-core/src/test/java/rx/MergeTests.java index 115c0b6a93..aca0cec086 100644 --- a/rxjava-core/src/test/java/rx/MergeTests.java +++ b/rxjava-core/src/test/java/rx/MergeTests.java @@ -46,7 +46,7 @@ public void testMergeCovariance() { Observable> os = Observable.from(o1, o2); - List values = Observable.merge(os).toList().toBlockingObservable().single(); + List values = Observable.merge(os).toList().toBlocking().single(); assertEquals(4, values.size()); } @@ -58,7 +58,7 @@ public void testMergeCovariance2() { Observable> os = Observable.from(o1, o2); - List values = Observable.merge(os).toList().toBlockingObservable().single(); + List values = Observable.merge(os).toList().toBlocking().single(); assertEquals(5, values.size()); } @@ -68,7 +68,7 @@ public void testMergeCovariance3() { Observable o1 = Observable.from(new HorrorMovie(), new Movie()); Observable o2 = Observable.from(new Media(), new HorrorMovie()); - List values = Observable.merge(o1, o2).toList().toBlockingObservable().single(); + List values = Observable.merge(o1, o2).toList().toBlocking().single(); assertTrue(values.get(0) instanceof HorrorMovie); assertTrue(values.get(1) instanceof Movie); @@ -92,7 +92,7 @@ public void call(Subscriber o) { Observable o2 = Observable.from(new Media(), new HorrorMovie()); - List values = Observable.merge(o1, o2).toList().toBlockingObservable().single(); + List values = Observable.merge(o1, o2).toList().toBlocking().single(); assertTrue(values.get(0) instanceof HorrorMovie); assertTrue(values.get(1) instanceof Movie); diff --git a/rxjava-core/src/test/java/rx/ObservableDoOnTest.java b/rxjava-core/src/test/java/rx/ObservableDoOnTest.java index bbbe88943e..7a39870bdf 100644 --- a/rxjava-core/src/test/java/rx/ObservableDoOnTest.java +++ b/rxjava-core/src/test/java/rx/ObservableDoOnTest.java @@ -39,7 +39,7 @@ public void testDoOnEach() { public void call(String v) { r.set(v); } - }).toBlockingObservable().single(); + }).toBlocking().single(); assertEquals("one", output); assertEquals("one", r.get()); @@ -56,7 +56,7 @@ Observable. error(new RuntimeException("an error")).doOnError(new Action public void call(Throwable v) { r.set(v); } - }).toBlockingObservable().single(); + }).toBlocking().single(); fail("expected exception, not a return value"); } catch (Throwable e) { t = e; @@ -75,7 +75,7 @@ public void testDoOnCompleted() { public void call() { r.set(true); } - }).toBlockingObservable().single(); + }).toBlocking().single(); assertEquals("one", output); assertTrue(r.get()); diff --git a/rxjava-core/src/test/java/rx/ObservableTests.java b/rxjava-core/src/test/java/rx/ObservableTests.java index e7da099eb6..d8ee4fe638 100644 --- a/rxjava-core/src/test/java/rx/ObservableTests.java +++ b/rxjava-core/src/test/java/rx/ObservableTests.java @@ -74,9 +74,9 @@ public void before() { @Test public void fromArray() { String[] items = new String[] { "one", "two", "three" }; - assertEquals(new Integer(3), Observable.from(items).count().toBlockingObservable().single()); - assertEquals("two", Observable.from(items).skip(1).take(1).toBlockingObservable().single()); - assertEquals("three", Observable.from(items).takeLast(1).toBlockingObservable().single()); + assertEquals(new Integer(3), Observable.from(items).count().toBlocking().single()); + assertEquals("two", Observable.from(items).skip(1).take(1).toBlocking().single()); + assertEquals("three", Observable.from(items).takeLast(1).toBlocking().single()); } @Test @@ -86,26 +86,26 @@ public void fromIterable() { items.add("two"); items.add("three"); - assertEquals(new Integer(3), Observable.from(items).count().toBlockingObservable().single()); - assertEquals("two", Observable.from(items).skip(1).take(1).toBlockingObservable().single()); - assertEquals("three", Observable.from(items).takeLast(1).toBlockingObservable().single()); + assertEquals(new Integer(3), Observable.from(items).count().toBlocking().single()); + assertEquals("two", Observable.from(items).skip(1).take(1).toBlocking().single()); + assertEquals("three", Observable.from(items).takeLast(1).toBlocking().single()); } @Test public void fromArityArgs3() { Observable items = Observable.from("one", "two", "three"); - assertEquals(new Integer(3), items.count().toBlockingObservable().single()); - assertEquals("two", items.skip(1).take(1).toBlockingObservable().single()); - assertEquals("three", items.takeLast(1).toBlockingObservable().single()); + assertEquals(new Integer(3), items.count().toBlocking().single()); + assertEquals("two", items.skip(1).take(1).toBlocking().single()); + assertEquals("three", items.takeLast(1).toBlocking().single()); } @Test public void fromArityArgs1() { Observable items = Observable.from("one"); - assertEquals(new Integer(1), items.count().toBlockingObservable().single()); - assertEquals("one", items.takeLast(1).toBlockingObservable().single()); + assertEquals(new Integer(1), items.count().toBlocking().single()); + assertEquals("one", items.takeLast(1).toBlocking().single()); } @Test @@ -253,7 +253,7 @@ public Integer call(Integer t1, Integer t2) { return t1 + t2; } - }).toBlockingObservable().forEach(new Action1() { + }).toBlocking().forEach(new Action1() { @Override public void call(Integer t1) { @@ -279,7 +279,7 @@ public Integer call(Integer t1, Integer t2) { return t1 + t2; } - }).toBlockingObservable().last(); + }).toBlocking().last(); assertEquals(1, value); } @@ -970,7 +970,7 @@ public void testCollectToList() { public void call(List list, Integer v) { list.add(v); } - }).toBlockingObservable().last(); + }).toBlocking().last(); assertEquals(3, list.size()); assertEquals(1, list.get(0).intValue()); @@ -989,7 +989,7 @@ public void call(StringBuilder sb, Integer v) { } sb.append(v); } - }).toBlockingObservable().last().toString(); + }).toBlocking().last().toString(); assertEquals("1-2-3", value); } diff --git a/rxjava-core/src/test/java/rx/ObservableWindowTests.java b/rxjava-core/src/test/java/rx/ObservableWindowTests.java index abcd053663..4b9ac9187d 100644 --- a/rxjava-core/src/test/java/rx/ObservableWindowTests.java +++ b/rxjava-core/src/test/java/rx/ObservableWindowTests.java @@ -37,7 +37,7 @@ public void testWindow() { public Observable> call(Observable xs) { return xs.toList(); } - })).toBlockingObservable().forEach(new Action1>() { + })).toBlocking().forEach(new Action1>() { @Override public void call(List xs) { diff --git a/rxjava-core/src/test/java/rx/ReduceTests.java b/rxjava-core/src/test/java/rx/ReduceTests.java index 906591d5ef..8fd3b7cefa 100644 --- a/rxjava-core/src/test/java/rx/ReduceTests.java +++ b/rxjava-core/src/test/java/rx/ReduceTests.java @@ -34,7 +34,7 @@ public void reduceInts() { public Integer call(Integer t1, Integer t2) { return t1 + t2; } - }).toBlockingObservable().single(); + }).toBlocking().single(); assertEquals(6, value); } diff --git a/rxjava-core/src/test/java/rx/ScanTests.java b/rxjava-core/src/test/java/rx/ScanTests.java index b94b8b50a3..36cb429255 100644 --- a/rxjava-core/src/test/java/rx/ScanTests.java +++ b/rxjava-core/src/test/java/rx/ScanTests.java @@ -40,7 +40,7 @@ public Map call(Map accum, Event perInstanceEven }) .take(10) - .toBlockingObservable().forEach(new Action1>() { + .toBlocking().forEach(new Action1>() { @Override public void call(Map v) { diff --git a/rxjava-core/src/test/java/rx/StartWithTests.java b/rxjava-core/src/test/java/rx/StartWithTests.java index b077046f89..f35cc14236 100644 --- a/rxjava-core/src/test/java/rx/StartWithTests.java +++ b/rxjava-core/src/test/java/rx/StartWithTests.java @@ -26,7 +26,7 @@ public class StartWithTests { @Test public void startWith1() { - List values = Observable.from("one", "two").startWith("zero").toList().toBlockingObservable().single(); + List values = Observable.from("one", "two").startWith("zero").toList().toBlocking().single(); assertEquals("zero", values.get(0)); assertEquals("two", values.get(2)); @@ -37,7 +37,7 @@ public void startWithIterable() { List li = new ArrayList(); li.add("alpha"); li.add("beta"); - List values = Observable.from("one", "two").startWith(li).toList().toBlockingObservable().single(); + List values = Observable.from("one", "two").startWith(li).toList().toBlocking().single(); assertEquals("alpha", values.get(0)); assertEquals("beta", values.get(1)); @@ -50,7 +50,7 @@ public void startWithObservable() { List li = new ArrayList(); li.add("alpha"); li.add("beta"); - List values = Observable.from("one", "two").startWith(Observable.from(li)).toList().toBlockingObservable().single(); + List values = Observable.from("one", "two").startWith(Observable.from(li)).toList().toBlocking().single(); assertEquals("alpha", values.get(0)); assertEquals("beta", values.get(1)); diff --git a/rxjava-core/src/test/java/rx/ZipTests.java b/rxjava-core/src/test/java/rx/ZipTests.java index a6f128ae8e..28bf13b9f4 100644 --- a/rxjava-core/src/test/java/rx/ZipTests.java +++ b/rxjava-core/src/test/java/rx/ZipTests.java @@ -69,7 +69,7 @@ public Map call(Map accum, Event perInstanceEven } }) .take(10) - .toBlockingObservable().forEach(new Action1>() { + .toBlocking().forEach(new Action1>() { @Override public void call(Map v) { @@ -89,11 +89,11 @@ public void testCovarianceOfZip() { Observable horrors = Observable.from(new HorrorMovie()); Observable ratings = Observable.from(new CoolRating()); - Observable. zip(horrors, ratings, combine).toBlockingObservable().forEach(action); - Observable. zip(horrors, ratings, combine).toBlockingObservable().forEach(action); - Observable. zip(horrors, ratings, combine).toBlockingObservable().forEach(extendedAction); - Observable. zip(horrors, ratings, combine).toBlockingObservable().forEach(action); - Observable. zip(horrors, ratings, combine).toBlockingObservable().forEach(action); + Observable. zip(horrors, ratings, combine).toBlocking().forEach(action); + Observable. zip(horrors, ratings, combine).toBlocking().forEach(action); + Observable. zip(horrors, ratings, combine).toBlocking().forEach(extendedAction); + Observable. zip(horrors, ratings, combine).toBlocking().forEach(action); + Observable. zip(horrors, ratings, combine).toBlocking().forEach(action); Observable. zip(horrors, ratings, combine); } @@ -120,7 +120,7 @@ public Object call(final Object... args) { } }); - assertSame(invoked, result.toBlockingObservable().last()); + assertSame(invoked, result.toBlocking().last()); } Func2 combine = new Func2() { diff --git a/rxjava-core/src/test/java/rx/operators/BlockingOperatorLatestTest.java b/rxjava-core/src/test/java/rx/operators/BlockingOperatorLatestTest.java index 58eaf4d6a4..433659e755 100644 --- a/rxjava-core/src/test/java/rx/operators/BlockingOperatorLatestTest.java +++ b/rxjava-core/src/test/java/rx/operators/BlockingOperatorLatestTest.java @@ -33,7 +33,7 @@ public class BlockingOperatorLatestTest { public void testSimple() { TestScheduler scheduler = new TestScheduler(); - BlockingObservable source = Observable.interval(1, TimeUnit.SECONDS, scheduler).take(10).toBlockingObservable(); + BlockingObservable source = Observable.interval(1, TimeUnit.SECONDS, scheduler).take(10).toBlocking(); Iterable iter = source.latest(); @@ -57,7 +57,7 @@ public void testSimple() { public void testSameSourceMultipleIterators() { TestScheduler scheduler = new TestScheduler(); - BlockingObservable source = Observable.interval(1, TimeUnit.SECONDS, scheduler).take(10).toBlockingObservable(); + BlockingObservable source = Observable.interval(1, TimeUnit.SECONDS, scheduler).take(10).toBlocking(); Iterable iter = source.latest(); @@ -81,7 +81,7 @@ public void testSameSourceMultipleIterators() { @Test(timeout = 1000, expected = NoSuchElementException.class) public void testEmpty() { - BlockingObservable source = Observable. empty().toBlockingObservable(); + BlockingObservable source = Observable. empty().toBlocking(); Iterable iter = source.latest(); @@ -96,7 +96,7 @@ public void testEmpty() { public void testSimpleJustNext() { TestScheduler scheduler = new TestScheduler(); - BlockingObservable source = Observable.interval(1, TimeUnit.SECONDS, scheduler).take(10).toBlockingObservable(); + BlockingObservable source = Observable.interval(1, TimeUnit.SECONDS, scheduler).take(10).toBlocking(); Iterable iter = source.latest(); @@ -115,7 +115,7 @@ public void testSimpleJustNext() { public void testHasNextThrows() { TestScheduler scheduler = new TestScheduler(); - BlockingObservable source = Observable. error(new RuntimeException("Forced failure!"), scheduler).toBlockingObservable(); + BlockingObservable source = Observable. error(new RuntimeException("Forced failure!"), scheduler).toBlocking(); Iterable iter = source.latest(); @@ -130,7 +130,7 @@ public void testHasNextThrows() { public void testNextThrows() { TestScheduler scheduler = new TestScheduler(); - BlockingObservable source = Observable. error(new RuntimeException("Forced failure!"), scheduler).toBlockingObservable(); + BlockingObservable source = Observable. error(new RuntimeException("Forced failure!"), scheduler).toBlocking(); Iterable iter = source.latest(); Iterator it = iter.iterator(); @@ -143,7 +143,7 @@ public void testNextThrows() { @Test(timeout = 1000) public void testFasterSource() { PublishSubject source = PublishSubject.create(); - BlockingObservable blocker = source.toBlockingObservable(); + BlockingObservable blocker = source.toBlocking(); Iterable iter = blocker.latest(); Iterator it = iter.iterator(); diff --git a/rxjava-core/src/test/java/rx/operators/BlockingOperatorMostRecentTest.java b/rxjava-core/src/test/java/rx/operators/BlockingOperatorMostRecentTest.java index c165c65411..60e1e2f5ac 100644 --- a/rxjava-core/src/test/java/rx/operators/BlockingOperatorMostRecentTest.java +++ b/rxjava-core/src/test/java/rx/operators/BlockingOperatorMostRecentTest.java @@ -79,7 +79,7 @@ public void testMostRecentWithException() { @Test(timeout = 1000) public void testSingleSourceManyIterators() { TestScheduler scheduler = new TestScheduler(); - BlockingObservable source = Observable.interval(1, TimeUnit.SECONDS, scheduler).take(10).toBlockingObservable(); + BlockingObservable source = Observable.interval(1, TimeUnit.SECONDS, scheduler).take(10).toBlocking(); Iterable iter = source.mostRecent(-1L); diff --git a/rxjava-core/src/test/java/rx/operators/BlockingOperatorNextTest.java b/rxjava-core/src/test/java/rx/operators/BlockingOperatorNextTest.java index 2a260c541c..953db5c6fd 100644 --- a/rxjava-core/src/test/java/rx/operators/BlockingOperatorNextTest.java +++ b/rxjava-core/src/test/java/rx/operators/BlockingOperatorNextTest.java @@ -295,7 +295,7 @@ public void run() { @Test /* (timeout = 8000) */ public void testSingleSourceManyIterators() throws InterruptedException { PublishSubject ps = PublishSubject.create(); - BlockingObservable source = ps.take(10).toBlockingObservable(); + BlockingObservable source = ps.take(10).toBlocking(); Iterable iter = source.next(); diff --git a/rxjava-core/src/test/java/rx/operators/OperatorElementAtTest.java b/rxjava-core/src/test/java/rx/operators/OperatorElementAtTest.java index a9a21f0087..d239988aca 100644 --- a/rxjava-core/src/test/java/rx/operators/OperatorElementAtTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperatorElementAtTest.java @@ -27,7 +27,7 @@ public class OperatorElementAtTest { @Test public void testElementAt() { - assertEquals(2, Observable.from(Arrays.asList(1, 2)).elementAt(1).toBlockingObservable().single() + assertEquals(2, Observable.from(Arrays.asList(1, 2)).elementAt(1).toBlocking().single() .intValue()); } @@ -38,18 +38,18 @@ public void testElementAtWithMinusIndex() { @Test(expected = IndexOutOfBoundsException.class) public void testElementAtWithIndexOutOfBounds() { - Observable.from(Arrays.asList(1, 2)).elementAt(2).toBlockingObservable().single(); + Observable.from(Arrays.asList(1, 2)).elementAt(2).toBlocking().single(); } @Test public void testElementAtOrDefault() { - assertEquals(2, Observable.from(Arrays.asList(1, 2)).elementAtOrDefault(1, 0).toBlockingObservable() + assertEquals(2, Observable.from(Arrays.asList(1, 2)).elementAtOrDefault(1, 0).toBlocking() .single().intValue()); } @Test public void testElementAtOrDefaultWithIndexOutOfBounds() { - assertEquals(0, Observable.from(Arrays.asList(1, 2)).elementAtOrDefault(2, 0).toBlockingObservable() + assertEquals(0, Observable.from(Arrays.asList(1, 2)).elementAtOrDefault(2, 0).toBlocking() .single().intValue()); } diff --git a/rxjava-core/src/test/java/rx/operators/OperatorGroupByTest.java b/rxjava-core/src/test/java/rx/operators/OperatorGroupByTest.java index ebc6ee8183..2e1249d2fc 100644 --- a/rxjava-core/src/test/java/rx/operators/OperatorGroupByTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperatorGroupByTest.java @@ -137,7 +137,7 @@ private static Map> toMap(Observable> result = new ConcurrentHashMap>(); - observable.toBlockingObservable().forEach(new Action1>() { + observable.toBlocking().forEach(new Action1>() { @Override public void call(final GroupedObservable o) { @@ -640,7 +640,7 @@ public String call(Integer t1) { } } - }).toBlockingObservable().forEach(new Action1() { + }).toBlocking().forEach(new Action1() { @Override public void call(String s) { @@ -732,7 +732,7 @@ public void call(Notification t1) { System.err.println("outer notification => " + t1); } - }).toBlockingObservable().forEach(new Action1() { + }).toBlocking().forEach(new Action1() { @Override public void call(String s) { @@ -809,7 +809,7 @@ public String call(Integer t1) { } } - }).toBlockingObservable().forEach(new Action1() { + }).toBlocking().forEach(new Action1() { @Override public void call(String s) { @@ -865,7 +865,7 @@ public void call(Notification t1) { System.out.println("notification => " + t1); } - }).toBlockingObservable().forEach(new Action1() { + }).toBlocking().forEach(new Action1() { @Override public void call(String s) { @@ -913,7 +913,7 @@ public String call(Integer t1) { }); } - }).toBlockingObservable().forEach(new Action1() { + }).toBlocking().forEach(new Action1() { @Override public void call(String s) { diff --git a/rxjava-core/src/test/java/rx/operators/OperatorLastTest.java b/rxjava-core/src/test/java/rx/operators/OperatorLastTest.java index 5eee929fbd..f4837daf37 100644 --- a/rxjava-core/src/test/java/rx/operators/OperatorLastTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperatorLastTest.java @@ -35,20 +35,20 @@ public class OperatorLastTest { @Test public void testLastWithElements() { Observable last = Observable.from(1, 2, 3).last(); - assertEquals(3, last.toBlockingObservable().single().intValue()); + assertEquals(3, last.toBlocking().single().intValue()); } @Test(expected = NoSuchElementException.class) public void testLastWithNoElements() { Observable last = Observable.empty().last(); - last.toBlockingObservable().single(); + last.toBlocking().single(); } @Test public void testLastMultiSubscribe() { Observable last = Observable.from(1, 2, 3).last(); - assertEquals(3, last.toBlockingObservable().single().intValue()); - assertEquals(3, last.toBlockingObservable().single().intValue()); + assertEquals(3, last.toBlocking().single().intValue()); + assertEquals(3, last.toBlocking().single().intValue()); } @Test diff --git a/rxjava-core/src/test/java/rx/operators/OperatorMapTest.java b/rxjava-core/src/test/java/rx/operators/OperatorMapTest.java index ae0c505d46..9a087d2587 100644 --- a/rxjava-core/src/test/java/rx/operators/OperatorMapTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperatorMapTest.java @@ -193,7 +193,7 @@ public void testMapWithIssue417() { public Integer call(Integer arg0) { throw new IllegalArgumentException("any error"); } - }).toBlockingObservable().single(); + }).toBlocking().single(); } @Test(expected = IllegalArgumentException.class) @@ -210,7 +210,7 @@ public String call(String arg0) { }); // block for response, expecting exception thrown - m.toBlockingObservable().last(); + m.toBlocking().last(); } /** @@ -225,7 +225,7 @@ public Integer call(Integer i) { return i; } - }).toBlockingObservable().single(); + }).toBlocking().single(); } /** @@ -240,7 +240,7 @@ public Object call(Object i) { return i; } - }).toBlockingObservable().single(); + }).toBlocking().single(); } /** @@ -256,7 +256,7 @@ public Integer call(Integer i) { return i / 0; } - }).toBlockingObservable().single(); + }).toBlocking().single(); } @Test(expected = OnErrorNotImplementedException.class) diff --git a/rxjava-core/src/test/java/rx/operators/OperatorMaterializeTest.java b/rxjava-core/src/test/java/rx/operators/OperatorMaterializeTest.java index 6f3e05efee..f3fa354ec6 100644 --- a/rxjava-core/src/test/java/rx/operators/OperatorMaterializeTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperatorMaterializeTest.java @@ -89,8 +89,8 @@ public void testMultipleSubscribes() throws InterruptedException, ExecutionExcep Observable> m = Observable.create(o).materialize(); - assertEquals(3, m.toList().toBlockingObservable().toFuture().get().size()); - assertEquals(3, m.toList().toBlockingObservable().toFuture().get().size()); + assertEquals(3, m.toList().toBlocking().toFuture().get().size()); + assertEquals(3, m.toList().toBlocking().toFuture().get().size()); } private static class TestObserver extends Subscriber> { diff --git a/rxjava-core/src/test/java/rx/operators/OperatorMergeMaxConcurrentTest.java b/rxjava-core/src/test/java/rx/operators/OperatorMergeMaxConcurrentTest.java index e4a68e6c56..a51f791f5f 100644 --- a/rxjava-core/src/test/java/rx/operators/OperatorMergeMaxConcurrentTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperatorMergeMaxConcurrentTest.java @@ -53,7 +53,7 @@ public void testWhenMaxConcurrentIsOne() { os.add(Observable.from("one", "two", "three", "four", "five").subscribeOn(Schedulers.newThread())); List expected = Arrays.asList("one", "two", "three", "four", "five", "one", "two", "three", "four", "five", "one", "two", "three", "four", "five"); - Iterator iter = Observable.merge(os, 1).toBlockingObservable().toIterable().iterator(); + Iterator iter = Observable.merge(os, 1).toBlocking().toIterable().iterator(); List actual = new ArrayList(); while (iter.hasNext()) { actual.add(iter.next()); @@ -78,7 +78,7 @@ public void testMaxConcurrent() { os.add(Observable.create(sco)); } - Iterator iter = Observable.merge(os, maxConcurrent).toBlockingObservable().toIterable().iterator(); + Iterator iter = Observable.merge(os, maxConcurrent).toBlocking().toIterable().iterator(); List actual = new ArrayList(); while (iter.hasNext()) { actual.add(iter.next()); @@ -134,7 +134,7 @@ public void testMergeALotOfSourcesOneByOneSynchronously() { for (int i = 0; i < n; i++) { sourceList.add(Observable.just(i)); } - Iterator it = Observable.merge(Observable.from(sourceList), 1).toBlockingObservable().getIterator(); + Iterator it = Observable.merge(Observable.from(sourceList), 1).toBlocking().getIterator(); int j = 0; while (it.hasNext()) { assertEquals((Integer)j, it.next()); @@ -149,7 +149,7 @@ public void testMergeALotOfSourcesOneByOneSynchronouslyTakeHalf() { for (int i = 0; i < n; i++) { sourceList.add(Observable.just(i)); } - Iterator it = Observable.merge(Observable.from(sourceList), 1).take(n / 2).toBlockingObservable().getIterator(); + Iterator it = Observable.merge(Observable.from(sourceList), 1).take(n / 2).toBlocking().getIterator(); int j = 0; while (it.hasNext()) { assertEquals((Integer)j, it.next()); diff --git a/rxjava-core/src/test/java/rx/operators/OperatorMergeTest.java b/rxjava-core/src/test/java/rx/operators/OperatorMergeTest.java index 7cec6e3e1f..7358194399 100644 --- a/rxjava-core/src/test/java/rx/operators/OperatorMergeTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperatorMergeTest.java @@ -159,7 +159,7 @@ public void run() { }); final AtomicInteger count = new AtomicInteger(); - Observable.merge(source).take(6).toBlockingObservable().forEach(new Action1() { + Observable.merge(source).take(6).toBlocking().forEach(new Action1() { @Override public void call(Long v) { diff --git a/rxjava-core/src/test/java/rx/operators/OperatorObserveOnTest.java b/rxjava-core/src/test/java/rx/operators/OperatorObserveOnTest.java index b556653b5a..daf203a25b 100644 --- a/rxjava-core/src/test/java/rx/operators/OperatorObserveOnTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperatorObserveOnTest.java @@ -235,7 +235,7 @@ public Integer call(Integer t1) { } }).observeOn(Schedulers.newThread()) - .toBlockingObservable().forEach(new Action1() { + .toBlocking().forEach(new Action1() { @Override public void call(Integer t1) { @@ -262,7 +262,7 @@ public Integer call(Integer t1) { } }).observeOn(Schedulers.computation()) - .toBlockingObservable().forEach(new Action1() { + .toBlocking().forEach(new Action1() { @Override public void call(Integer t1) { @@ -302,7 +302,7 @@ public Integer call(Integer t1) { } }).observeOn(Schedulers.computation()) - .toBlockingObservable().forEach(new Action1() { + .toBlocking().forEach(new Action1() { @Override public void call(Integer t1) { diff --git a/rxjava-core/src/test/java/rx/operators/OperatorParallelMergeTest.java b/rxjava-core/src/test/java/rx/operators/OperatorParallelMergeTest.java index 138fbff62b..c64e3e217b 100644 --- a/rxjava-core/src/test/java/rx/operators/OperatorParallelMergeTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperatorParallelMergeTest.java @@ -44,9 +44,9 @@ public void testParallelMerge() { Observable> twoStreams = Observable.parallelMerge(fourStreams, 2); Observable> threeStreams = Observable.parallelMerge(fourStreams, 3); - List> fourList = fourStreams.toList().toBlockingObservable().last(); - List> threeList = threeStreams.toList().toBlockingObservable().last(); - List> twoList = twoStreams.toList().toBlockingObservable().last(); + List> fourList = fourStreams.toList().toBlocking().last(); + List> threeList = threeStreams.toList().toBlocking().last(); + List> twoList = twoStreams.toList().toBlocking().last(); System.out.println("two list: " + twoList); System.out.println("three list: " + threeList); @@ -71,7 +71,7 @@ public Observable call(Observable o) { return o.observeOn(Schedulers.newThread()); } }) - .toBlockingObservable().forEach(new Action1() { + .toBlocking().forEach(new Action1() { @Override public void call(String o) { @@ -90,7 +90,7 @@ public void testNumberOfThreadsOnScheduledMerge() { // now we parallelMerge into 3 streams and observeOn for each // we expect 3 threads in the output Observable.merge(Observable.parallelMerge(getStreams(), 3, Schedulers.newThread())) - .toBlockingObservable().forEach(new Action1() { + .toBlocking().forEach(new Action1() { @Override public void call(String o) { diff --git a/rxjava-core/src/test/java/rx/operators/OperatorParallelTest.java b/rxjava-core/src/test/java/rx/operators/OperatorParallelTest.java index b0b3ebd712..4d8ab49fb4 100644 --- a/rxjava-core/src/test/java/rx/operators/OperatorParallelTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperatorParallelTest.java @@ -60,7 +60,7 @@ public Integer[] call(Integer t) { }); } }) - .toBlockingObservable().forEach(new Action1() { + .toBlocking().forEach(new Action1() { @Override public void call(Integer[] v) { @@ -94,7 +94,7 @@ public Observable call(Integer t) { }); } - }).toBlockingObservable().forEach(new Action1() { + }).toBlocking().forEach(new Action1() { @Override public void call(String v) { diff --git a/rxjava-core/src/test/java/rx/operators/OperatorRepeatTest.java b/rxjava-core/src/test/java/rx/operators/OperatorRepeatTest.java index 8693017478..e2916cea60 100644 --- a/rxjava-core/src/test/java/rx/operators/OperatorRepeatTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperatorRepeatTest.java @@ -48,7 +48,7 @@ public void call(final Subscriber o) { o.onNext(count.incrementAndGet()); o.onCompleted(); } - }).repeat(Schedulers.computation()).take(NUM).toBlockingObservable().last(); + }).repeat(Schedulers.computation()).take(NUM).toBlocking().last(); assertEquals(NUM, value); } @@ -56,13 +56,13 @@ public void call(final Subscriber o) { @Test(timeout = 2000) public void testRepeatTake() { Observable xs = Observable.from(1, 2); - Object[] ys = xs.repeat(Schedulers.newThread()).take(4).toList().toBlockingObservable().last().toArray(); + Object[] ys = xs.repeat(Schedulers.newThread()).take(4).toList().toBlocking().last().toArray(); assertArrayEquals(new Object[] { 1, 2, 1, 2 }, ys); } @Test(timeout = 20000) public void testNoStackOverFlow() { - Observable.from(1).repeat(Schedulers.newThread()).take(100000).toBlockingObservable().last(); + Observable.from(1).repeat(Schedulers.newThread()).take(100000).toBlocking().last(); } @Test @@ -92,7 +92,7 @@ public Integer call(Integer t1) { return t1; } - }).take(4).toList().toBlockingObservable().last().toArray(); + }).take(4).toList().toBlocking().last().toArray(); assertEquals(2, counter.get()); assertArrayEquals(new Object[] { 1, 2, 1, 2 }, ys); diff --git a/rxjava-core/src/test/java/rx/operators/OperatorTakeTest.java b/rxjava-core/src/test/java/rx/operators/OperatorTakeTest.java index ad2db450f4..2f663e7097 100644 --- a/rxjava-core/src/test/java/rx/operators/OperatorTakeTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperatorTakeTest.java @@ -83,7 +83,7 @@ public void testTakeWithError() { public Integer call(Integer t1) { throw new IllegalArgumentException("some error"); } - }).toBlockingObservable().single(); + }).toBlocking().single(); } @Test @@ -237,7 +237,7 @@ public void call(Subscriber s) { } } - }).take(100).take(1).toBlockingObservable().forEach(new Action1() { + }).take(100).take(1).toBlocking().forEach(new Action1() { @Override public void call(Integer t1) { diff --git a/rxjava-core/src/test/java/rx/operators/OperatorTakeWhileTest.java b/rxjava-core/src/test/java/rx/operators/OperatorTakeWhileTest.java index 00a8d5db34..b04e5f9965 100644 --- a/rxjava-core/src/test/java/rx/operators/OperatorTakeWhileTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperatorTakeWhileTest.java @@ -121,7 +121,7 @@ public void call(Subscriber observer) { public Boolean call(String s) { return false; } - }).toBlockingObservable().lastOrDefault(""); + }).toBlocking().lastOrDefault(""); } @Test diff --git a/rxjava-core/src/test/java/rx/operators/OperatorUsingTest.java b/rxjava-core/src/test/java/rx/operators/OperatorUsingTest.java index dba65f5206..c6baadd4c5 100644 --- a/rxjava-core/src/test/java/rx/operators/OperatorUsingTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperatorUsingTest.java @@ -152,7 +152,7 @@ public Observable call(Subscription subscription) { } }; - Observable.using(resourceFactory, observableFactory).toBlockingObservable().last(); + Observable.using(resourceFactory, observableFactory).toBlocking().last(); } @Test @@ -173,7 +173,7 @@ public Observable call(Subscription subscription) { }; try { - Observable.using(resourceFactory, observableFactory).toBlockingObservable().last(); + Observable.using(resourceFactory, observableFactory).toBlocking().last(); fail("Should throw a TestException when the observableFactory throws it"); } catch (TestException e) { // Make sure that unsubscribe is called so that users can close @@ -205,7 +205,7 @@ public void call(Subscriber t1) { }; try { - Observable.using(resourceFactory, observableFactory).toBlockingObservable().last(); + Observable.using(resourceFactory, observableFactory).toBlocking().last(); fail("Should throw a TestException when the observableFactory throws it"); } catch (TestException e) { // Make sure that unsubscribe is called so that users can close diff --git a/rxjava-core/src/test/java/rx/operators/OperatorWindowTest.java b/rxjava-core/src/test/java/rx/operators/OperatorWindowTest.java index d8d90aca1f..fbb094dcbd 100644 --- a/rxjava-core/src/test/java/rx/operators/OperatorWindowTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperatorWindowTest.java @@ -62,7 +62,7 @@ public Observable> call(Observable xs) { return xs.toList(); } })) - .toBlockingObservable() + .toBlocking() .forEach(new Action1>() { @Override public void call(List xs) { diff --git a/rxjava-core/src/test/java/rx/operators/OperatorZipTest.java b/rxjava-core/src/test/java/rx/operators/OperatorZipTest.java index 245dc85d2e..2068a98d80 100644 --- a/rxjava-core/src/test/java/rx/operators/OperatorZipTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperatorZipTest.java @@ -1036,7 +1036,7 @@ public Object call(final Object... args) { } }); - o.toBlockingObservable().last(); + o.toBlocking().last(); } Observable OBSERVABLE_OF_5_INTEGERS = OBSERVABLE_OF_5_INTEGERS(new AtomicInteger()); diff --git a/rxjava-core/src/test/java/rx/schedulers/AbstractSchedulerTests.java b/rxjava-core/src/test/java/rx/schedulers/AbstractSchedulerTests.java index c1f1ef69c7..003be4852c 100644 --- a/rxjava-core/src/test/java/rx/schedulers/AbstractSchedulerTests.java +++ b/rxjava-core/src/test/java/rx/schedulers/AbstractSchedulerTests.java @@ -130,7 +130,7 @@ public String call(String s) { }); - List strings = m.toList().toBlockingObservable().last(); + List strings = m.toList().toBlocking().last(); assertEquals(4, strings.size()); // because flatMap does a merge there is no guarantee of order @@ -333,7 +333,7 @@ public void call() { }); final AtomicInteger lastValue = new AtomicInteger(); - obs.toBlockingObservable().forEach(new Action1() { + obs.toBlocking().forEach(new Action1() { @Override public void call(Integer v) { diff --git a/rxjava-core/src/test/java/rx/schedulers/ComputationSchedulerTests.java b/rxjava-core/src/test/java/rx/schedulers/ComputationSchedulerTests.java index ae492f9997..c4090bd1aa 100644 --- a/rxjava-core/src/test/java/rx/schedulers/ComputationSchedulerTests.java +++ b/rxjava-core/src/test/java/rx/schedulers/ComputationSchedulerTests.java @@ -102,7 +102,7 @@ public String call(Integer t) { } }); - o.subscribeOn(Schedulers.computation()).toBlockingObservable().forEach(new Action1() { + o.subscribeOn(Schedulers.computation()).toBlocking().forEach(new Action1() { @Override public void call(String t) { @@ -129,7 +129,7 @@ public String call(Integer t) { } }); - o.toBlockingObservable().forEach(new Action1() { + o.toBlocking().forEach(new Action1() { @Override public void call(String t) { diff --git a/rxjava-core/src/test/java/rx/schedulers/ImmediateSchedulerTest.java b/rxjava-core/src/test/java/rx/schedulers/ImmediateSchedulerTest.java index 36cae71fee..ee52a0b5fd 100644 --- a/rxjava-core/src/test/java/rx/schedulers/ImmediateSchedulerTest.java +++ b/rxjava-core/src/test/java/rx/schedulers/ImmediateSchedulerTest.java @@ -68,7 +68,7 @@ public String call(Integer t) { } }); - o.toBlockingObservable().forEach(new Action1() { + o.toBlocking().forEach(new Action1() { @Override public void call(String t) { @@ -93,7 +93,7 @@ public String call(Integer t) { } }); - o.toBlockingObservable().forEach(new Action1() { + o.toBlocking().forEach(new Action1() { @Override public void call(String t) { diff --git a/rxjava-core/src/test/java/rx/schedulers/NewThreadSchedulerTest.java b/rxjava-core/src/test/java/rx/schedulers/NewThreadSchedulerTest.java index 2bc2f2088d..37b314a0dd 100644 --- a/rxjava-core/src/test/java/rx/schedulers/NewThreadSchedulerTest.java +++ b/rxjava-core/src/test/java/rx/schedulers/NewThreadSchedulerTest.java @@ -49,7 +49,7 @@ public String call(Integer t) { } }); - o.subscribeOn(Schedulers.io()).toBlockingObservable().forEach(new Action1() { + o.subscribeOn(Schedulers.io()).toBlocking().forEach(new Action1() { @Override public void call(String t) { diff --git a/rxjava-core/src/test/java/rx/schedulers/TrampolineSchedulerTest.java b/rxjava-core/src/test/java/rx/schedulers/TrampolineSchedulerTest.java index 0add9db59d..a904675f13 100644 --- a/rxjava-core/src/test/java/rx/schedulers/TrampolineSchedulerTest.java +++ b/rxjava-core/src/test/java/rx/schedulers/TrampolineSchedulerTest.java @@ -47,7 +47,7 @@ public String call(Integer t) { } }); - o.toBlockingObservable().forEach(new Action1() { + o.toBlocking().forEach(new Action1() { @Override public void call(String t) { diff --git a/rxjava-core/src/test/java/rx/subjects/AsyncSubjectTest.java b/rxjava-core/src/test/java/rx/subjects/AsyncSubjectTest.java index b6e5606dd7..1d7c189cae 100644 --- a/rxjava-core/src/test/java/rx/subjects/AsyncSubjectTest.java +++ b/rxjava-core/src/test/java/rx/subjects/AsyncSubjectTest.java @@ -274,7 +274,7 @@ public SubjectObserverThread(AsyncSubject subject) { public void run() { try { // a timeout exception will happen if we don't get a terminal state - String v = subject.timeout(2000, TimeUnit.MILLISECONDS).toBlockingObservable().single(); + String v = subject.timeout(2000, TimeUnit.MILLISECONDS).toBlocking().single(); value.set(v); } catch (Exception e) { e.printStackTrace(); diff --git a/rxjava-core/src/test/java/rx/subjects/ReplaySubjectConcurrencyTest.java b/rxjava-core/src/test/java/rx/subjects/ReplaySubjectConcurrencyTest.java index 7e0a58974b..54ea5ce21c 100644 --- a/rxjava-core/src/test/java/rx/subjects/ReplaySubjectConcurrencyTest.java +++ b/rxjava-core/src/test/java/rx/subjects/ReplaySubjectConcurrencyTest.java @@ -71,7 +71,7 @@ public void call(Subscriber o) { }); source.start(); - long v = replay.toBlockingObservable().last(); + long v = replay.toBlocking().last(); assertEquals(10000, v); // it's been played through once so now it will all be replays @@ -198,7 +198,7 @@ public void call(Subscriber o) { @Override public void run() { - List values = replay.toList().toBlockingObservable().last(); + List values = replay.toList().toBlocking().last(); listOfListsOfValues.add(values); System.out.println("Finished thread: " + count); } @@ -330,7 +330,7 @@ public SubjectObserverThread(ReplaySubject subject) { public void run() { try { // a timeout exception will happen if we don't get a terminal state - String v = subject.timeout(2000, TimeUnit.MILLISECONDS).toBlockingObservable().single(); + String v = subject.timeout(2000, TimeUnit.MILLISECONDS).toBlocking().single(); value.set(v); } catch (Exception e) { e.printStackTrace(); diff --git a/rxjava-core/src/test/java/rx/util/AssertObservable.java b/rxjava-core/src/test/java/rx/util/AssertObservable.java index f2249aa60b..d95a1bb54d 100644 --- a/rxjava-core/src/test/java/rx/util/AssertObservable.java +++ b/rxjava-core/src/test/java/rx/util/AssertObservable.java @@ -48,7 +48,7 @@ public static void assertObservableEqualsBlocking(Observable expected, Ob * Observable with actual values */ public static void assertObservableEqualsBlocking(String message, Observable expected, Observable actual) { - assertObservableEquals(expected, actual).toBlockingObservable().lastOrDefault(null); + assertObservableEquals(expected, actual).toBlocking().lastOrDefault(null); } /**