Skip to content

Commit c799e52

Browse files
committed
Remove the Action0 overloads
1 parent 46544c3 commit c799e52

File tree

2 files changed

+0
-138
lines changed

2 files changed

+0
-138
lines changed

rxjava-core/src/main/java/rx/Observable.java

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6271,43 +6271,6 @@ public <TKey, TValue, TDuration> Observable<GroupedObservable<TKey, TValue>> gro
62716271
return create(new OperationGroupByUntil<T, TKey, TValue, TDuration>(this, keySelector, valueSelector, durationSelector));
62726272
}
62736273

6274-
/**
6275-
* Invokes the action asynchronously, surfacing the result through an observable sequence.
6276-
* <p>
6277-
* Note: The action is called immediately, not during the subscription of the resulting
6278-
* sequence. Multiple subscriptions to the resulting sequence can observe the
6279-
* action's outcome.
6280-
*
6281-
* @param action
6282-
* Action to run asynchronously.
6283-
* @return An observable sequence exposing a null value upon completion of the action,
6284-
* or an exception.
6285-
* @see <a href="http://msdn.microsoft.com/en-us/library/hh229265(v=vs.103).aspx">MSDN: Observable.Start</a>
6286-
*/
6287-
public static Observable<Void> start(Action0 action) {
6288-
return Async.toAsync(action).call();
6289-
}
6290-
6291-
/**
6292-
* Invokes the action asynchronously on the specified scheduler, surfacing the
6293-
* result through an observable sequence.
6294-
* <p>
6295-
* Note: The action is called immediately, not during the subscription of the resulting
6296-
* sequence. Multiple subscriptions to the resulting sequence can observe the
6297-
* action's outcome.
6298-
*
6299-
* @param action
6300-
* Action to run asynchronously.
6301-
* @param scheduler
6302-
* Scheduler to run the function on.
6303-
* @return An observable sequence exposing a null value upon completion of the action,
6304-
* or an exception.
6305-
* @see <a href="http://msdn.microsoft.com/en-us/library/hh211971(v=vs.103).aspx">MSDN: Observable.Start</a>
6306-
*/
6307-
public static Observable<Void> start(Action0 action, Scheduler scheduler) {
6308-
return Async.toAsync(action, scheduler).call();
6309-
}
6310-
63116274
/**
63126275
* Invokes the specified function asynchronously, surfacing the result through an observable sequence.
63136276
* <p>

rxjava-core/src/test/java/rx/ObservableTests.java

Lines changed: 0 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -951,107 +951,6 @@ public void testRangeWithScheduler() {
951951
inOrder.verifyNoMoreInteractions();
952952
}
953953

954-
@Test
955-
public void testStartWithAction() {
956-
Action0 action = mock(Action0.class);
957-
assertEquals(null, Observable.start(action).toBlockingObservable().single());
958-
}
959-
960-
@Test(expected = RuntimeException.class)
961-
public void testStartWithActionError() {
962-
Action0 action = new Action0() {
963-
@Override
964-
public void call() {
965-
throw new RuntimeException("Some error");
966-
}
967-
};
968-
Observable.start(action).toBlockingObservable().single();
969-
}
970-
971-
@Test
972-
public void testStartWhenSubscribeRunBeforeAction() {
973-
TestScheduler scheduler = new TestScheduler();
974-
975-
Action0 action = mock(Action0.class);
976-
977-
Observable<Void> observable = Observable.start(action, scheduler);
978-
979-
@SuppressWarnings("unchecked")
980-
Observer<Void> observer = mock(Observer.class);
981-
observable.subscribe(observer);
982-
983-
InOrder inOrder = inOrder(observer);
984-
inOrder.verifyNoMoreInteractions();
985-
986-
// Run action
987-
scheduler.advanceTimeBy(100, TimeUnit.MILLISECONDS);
988-
989-
inOrder.verify(observer, times(1)).onNext(null);
990-
inOrder.verify(observer, times(1)).onCompleted();
991-
inOrder.verifyNoMoreInteractions();
992-
}
993-
994-
@Test
995-
public void testStartWhenSubscribeRunAfterAction() {
996-
TestScheduler scheduler = new TestScheduler();
997-
998-
Action0 action = mock(Action0.class);
999-
1000-
Observable<Void> observable = Observable.start(action, scheduler);
1001-
1002-
// Run action
1003-
scheduler.advanceTimeBy(100, TimeUnit.MILLISECONDS);
1004-
1005-
@SuppressWarnings("unchecked")
1006-
Observer<Void> observer = mock(Observer.class);
1007-
observable.subscribe(observer);
1008-
1009-
InOrder inOrder = inOrder(observer);
1010-
inOrder.verify(observer, times(1)).onNext(null);
1011-
inOrder.verify(observer, times(1)).onCompleted();
1012-
inOrder.verifyNoMoreInteractions();
1013-
}
1014-
1015-
@Test
1016-
public void testStartWithActionAndMultipleObservers() {
1017-
TestScheduler scheduler = new TestScheduler();
1018-
1019-
Action0 action = mock(Action0.class);
1020-
1021-
Observable<Void> observable = Observable.start(action, scheduler);
1022-
1023-
scheduler.advanceTimeBy(100, TimeUnit.MILLISECONDS);
1024-
1025-
@SuppressWarnings("unchecked")
1026-
Observer<Void> observer1 = mock(Observer.class);
1027-
@SuppressWarnings("unchecked")
1028-
Observer<Void> observer2 = mock(Observer.class);
1029-
@SuppressWarnings("unchecked")
1030-
Observer<Void> observer3 = mock(Observer.class);
1031-
1032-
observable.subscribe(observer1);
1033-
observable.subscribe(observer2);
1034-
observable.subscribe(observer3);
1035-
1036-
InOrder inOrder;
1037-
inOrder = inOrder(observer1);
1038-
inOrder.verify(observer1, times(1)).onNext(null);
1039-
inOrder.verify(observer1, times(1)).onCompleted();
1040-
inOrder.verifyNoMoreInteractions();
1041-
1042-
inOrder = inOrder(observer2);
1043-
inOrder.verify(observer2, times(1)).onNext(null);
1044-
inOrder.verify(observer2, times(1)).onCompleted();
1045-
inOrder.verifyNoMoreInteractions();
1046-
1047-
inOrder = inOrder(observer3);
1048-
inOrder.verify(observer3, times(1)).onNext(null);
1049-
inOrder.verify(observer3, times(1)).onCompleted();
1050-
inOrder.verifyNoMoreInteractions();
1051-
1052-
verify(action, times(1)).call();
1053-
}
1054-
1055954
@Test
1056955
public void testStartWithFunc() {
1057956
Func0<String> func = new Func0<String>() {

0 commit comments

Comments
 (0)