Skip to content

Commit 27c309f

Browse files
Piotr Wittchenakarnokd
authored andcommitted
removing commented code from tests (#5467)
1 parent 01232cb commit 27c309f

10 files changed

+0
-122
lines changed

src/test/java/io/reactivex/flowable/FlowableTests.java

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,17 +1026,6 @@ public void testAmbWith() {
10261026
Flowable.just(1).ambWith(Flowable.just(2)).subscribe(ts);
10271027
ts.assertValue(1);
10281028
}
1029-
// FIXME Subscribers can't throw
1030-
// @Test(expected = OnErrorNotImplementedException.class)
1031-
// public void testSubscribeWithoutOnError() {
1032-
// Observable<String> o = Observable.just("a", "b").flatMap(new Func1<String, Observable<String>>() {
1033-
// @Override
1034-
// public Observable<String> call(String s) {
1035-
// return Observable.error(new Exception("test"));
1036-
// }
1037-
// });
1038-
// o.subscribe();
1039-
// }
10401029

10411030
@Test
10421031
public void testTakeWhileToList() {
@@ -1113,28 +1102,6 @@ public void testEmptyIsEmpty() {
11131102
verify(w, never()).onError(any(Throwable.class));
11141103
}
11151104

1116-
// FIXME this test doesn't make sense
1117-
// @Test // cf. https://github.com/ReactiveX/RxJava/issues/2599
1118-
// public void testSubscribingSubscriberAsObserverMaintainsSubscriptionChain() {
1119-
// TestSubscriber<Object> subscriber = new TestSubscriber<T>();
1120-
// Subscription subscription = Observable.just("event").subscribe((Observer<Object>) subscriber);
1121-
// subscription.unsubscribe();
1122-
//
1123-
// subscriber.assertUnsubscribed();
1124-
// }
1125-
1126-
// FIXME subscribers can't throw
1127-
// @Test(expected=OnErrorNotImplementedException.class)
1128-
// public void testForEachWithError() {
1129-
// Observable.error(new Exception("boo"))
1130-
// //
1131-
// .forEach(new Action1<Object>() {
1132-
// @Override
1133-
// public void call(Object t) {
1134-
// //do nothing
1135-
// }});
1136-
// }
1137-
11381105
@Test(expected = NullPointerException.class)
11391106
public void testForEachWithNull() {
11401107
Flowable.error(new Exception("boo"))

src/test/java/io/reactivex/internal/operators/flowable/FlowableCacheTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ public void testTake() {
151151
ts.assertNoErrors();
152152
ts.assertComplete();
153153
ts.assertValues(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
154-
// ts.assertUnsubscribed(); // FIXME no longer valid
155154
assertFalse(cached.hasSubscribers());
156155
}
157156

src/test/java/io/reactivex/internal/operators/flowable/FlowableDoOnUnsubscribeTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ public void run() {
8080
for (int i = 0; i < subCount; ++i) {
8181
subscriptions.get(i).dispose();
8282
// Test that unsubscribe() method is not affected in any way
83-
// FIXME no longer valid
84-
// subscribers.get(i).assertUnsubscribed();
8583
}
8684

8785
upperLatch.await();
@@ -143,8 +141,6 @@ public void run() {
143141
for (int i = 0; i < subCount; ++i) {
144142
subscriptions.get(i).dispose();
145143
// Test that unsubscribe() method is not affected in any way
146-
// FIXME no longer valid
147-
// subscribers.get(i).assertUnsubscribed();
148144
}
149145

150146
upperLatch.await();

src/test/java/io/reactivex/internal/operators/flowable/FlowableIgnoreElementsTest.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ public void testCompletedOkFlowable() {
6565
ts.assertNoErrors();
6666
ts.assertNoValues();
6767
ts.assertTerminated();
68-
// FIXME no longer testable
69-
// ts.assertUnsubscribed();
7068
}
7169

7270
@Test
@@ -76,8 +74,6 @@ public void testErrorReceivedFlowable() {
7674
Flowable.error(ex).ignoreElements().toFlowable().subscribe(ts);
7775
ts.assertNoValues();
7876
ts.assertTerminated();
79-
// FIXME no longer testable
80-
// ts.assertUnsubscribed();
8177
ts.assertError(TestException.class);
8278
ts.assertErrorMessage("boo");
8379
}
@@ -183,8 +179,6 @@ public void testCompletedOk() {
183179
ts.assertNoErrors();
184180
ts.assertNoValues();
185181
ts.assertTerminated();
186-
// FIXME no longer testable
187-
// ts.assertUnsubscribed();
188182
}
189183

190184
@Test
@@ -194,8 +188,6 @@ public void testErrorReceived() {
194188
Flowable.error(ex).ignoreElements().subscribe(ts);
195189
ts.assertNoValues();
196190
ts.assertTerminated();
197-
// FIXME no longer testable
198-
// ts.assertUnsubscribed();
199191
ts.assertError(TestException.class);
200192
ts.assertErrorMessage("boo");
201193
}

src/test/java/io/reactivex/internal/operators/flowable/FlowableMapTest.java

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -256,59 +256,6 @@ public Integer apply(Integer i) {
256256
}).blockingGet();
257257
}
258258

259-
// FIXME RS subscribers can't throw
260-
// @Test(expected = OnErrorNotImplementedException.class)
261-
// public void verifyExceptionIsThrownIfThereIsNoExceptionHandler() {
262-
//
263-
// Publisher<Object> creator = new Publisher<Object>() {
264-
//
265-
// @Override
266-
// public void subscribe(Subscriber<? super Object> observer) {
267-
// observer.onSubscribe(EmptySubscription.INSTANCE);
268-
// observer.onNext("a");
269-
// observer.onNext("b");
270-
// observer.onNext("c");
271-
// observer.onComplete();
272-
// }
273-
// };
274-
//
275-
// Function<Object, Flowable<Object>> manyMapper = new Function<Object, Flowable<Object>>() {
276-
//
277-
// @Override
278-
// public Flowable<Object> apply(Object object) {
279-
// return Flowable.just(object);
280-
// }
281-
// };
282-
//
283-
// Function<Object, Object> mapper = new Function<Object, Object>() {
284-
// private int count = 0;
285-
//
286-
// @Override
287-
// public Object apply(Object object) {
288-
// ++count;
289-
// if (count > 2) {
290-
// throw new RuntimeException();
291-
// }
292-
// return object;
293-
// }
294-
// };
295-
//
296-
// Consumer<Object> onNext = new Consumer<Object>() {
297-
//
298-
// @Override
299-
// public void accept(Object object) {
300-
// System.out.println(object.toString());
301-
// }
302-
// };
303-
//
304-
// try {
305-
// Flowable.create(creator).flatMap(manyMapper).map(mapper).subscribe(onNext);
306-
// } catch (RuntimeException e) {
307-
// e.printStackTrace();
308-
// throw e;
309-
// }
310-
// }
311-
312259
private static Map<String, String> getMap(String prefix) {
313260
Map<String, String> m = new HashMap<String, String>();
314261
m.put("firstName", prefix + "First");

src/test/java/io/reactivex/internal/operators/flowable/FlowableMaterializeTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,6 @@ public void testUnsubscribeJustBeforeCompletionNotificationShouldPreventThatNoti
197197
ts.dispose();
198198
ts.request(1);
199199
ts.assertNoValues();
200-
// FIXME no longer assertable
201-
// ts.assertUnsubscribed();
202200
}
203201

204202
private static class TestNotificationSubscriber extends DefaultSubscriber<Notification<String>> {

src/test/java/io/reactivex/internal/operators/flowable/FlowableMergeTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,8 +506,6 @@ public void testEarlyUnsubscribe() {
506506
assertTrue(os2.get());
507507

508508
ts.assertValues(0L, 1L, 2L, 0L, 1L);
509-
// FIXME not happening anymore
510-
// ts.assertUnsubscribed();
511509
}
512510
}
513511

src/test/java/io/reactivex/internal/operators/flowable/FlowableOnBackpressureBufferTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,6 @@ public void run() {
144144
int size = ts.values().size();
145145
assertTrue(size <= 150); // will get up to 50 more
146146
assertTrue(ts.values().get(size - 1) == size - 1);
147-
// FIXME no longer assertable
148-
// assertTrue(s.isUnsubscribed());
149147
}
150148

151149
static final Flowable<Long> infinite = Flowable.unsafeCreate(new Publisher<Long>() {

src/test/java/io/reactivex/internal/operators/flowable/FlowableReplayTest.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,6 @@ public void testIssue2191_SchedulerUnsubscribe() throws Exception {
601601
verifyObserverMock(mockObserverBeforeConnect, 2, 6);
602602
verifyObserverMock(mockObserverAfterConnect, 2, 6);
603603

604-
// FIXME not supported
605-
// verify(spiedWorker, times(1)).isUnsubscribed();
606604
// FIXME publish calls cancel too
607605
verify(spiedWorker, times(1)).dispose();
608606
verify(sourceUnsubscribed, never()).run();
@@ -667,8 +665,6 @@ public void testIssue2191_SchedulerUnsubscribeOnError() throws Exception {
667665
verifyObserver(mockObserverBeforeConnect, 2, 2, illegalArgumentException);
668666
verifyObserver(mockObserverAfterConnect, 2, 2, illegalArgumentException);
669667

670-
// FIXME no longer supported
671-
// verify(spiedWorker, times(1)).isUnsubscribed();
672668
// FIXME publish also calls cancel
673669
verify(spiedWorker, times(1)).dispose();
674670
verify(sourceUnsubscribed, never()).run();
@@ -973,8 +969,6 @@ public void testTake() {
973969
ts.assertNoErrors();
974970
ts.assertTerminated();
975971
ts.assertValues(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
976-
// FIXME no longer assertable
977-
// ts.assertUnsubscribed();
978972
}
979973

980974
@Test

src/test/java/io/reactivex/observable/ObservableTest.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,17 +1044,6 @@ public void testAmbWith() {
10441044
Observable.just(1).ambWith(Observable.just(2)).subscribe(ts);
10451045
ts.assertValue(1);
10461046
}
1047-
// FIXME Subscribers can't throw
1048-
// @Test(expected = OnErrorNotImplementedException.class)
1049-
// public void testSubscribeWithoutOnError() {
1050-
// Observable<String> o = Observable.just("a", "b").flatMap(new Func1<String, Observable<String>>() {
1051-
// @Override
1052-
// public Observable<String> call(String s) {
1053-
// return Observable.error(new Exception("test"));
1054-
// }
1055-
// });
1056-
// o.subscribe();
1057-
// }
10581047

10591048
@Test
10601049
public void testTakeWhileToList() {

0 commit comments

Comments
 (0)