@@ -951,107 +951,6 @@ public void testRangeWithScheduler() {
951
951
inOrder .verifyNoMoreInteractions ();
952
952
}
953
953
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
-
1055
954
@ Test
1056
955
public void testStartWithFunc () {
1057
956
Func0 <String > func = new Func0 <String >() {
0 commit comments