当前位置: 首页>>代码示例>>Java>>正文


Java Schedulers.immediate方法代码示例

本文整理汇总了Java中rx.schedulers.Schedulers.immediate方法的典型用法代码示例。如果您正苦于以下问题:Java Schedulers.immediate方法的具体用法?Java Schedulers.immediate怎么用?Java Schedulers.immediate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在rx.schedulers.Schedulers的用法示例。


在下文中一共展示了Schedulers.immediate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: fetchErrorShouldReturnErrorToView

import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Test
public void fetchErrorShouldReturnErrorToView() {

    Exception exception = new Exception();

    when(charactersDataSource.getCharacters())
            .thenReturn(Observable.<CharactersResponseModel>error(exception));

    MainPresenter mainPresenter = new MainPresenter(
            this.charactersDataSource,
            Schedulers.immediate(),
            Schedulers.immediate(),
            this.view
    );

    mainPresenter.loadData();

    InOrder inOrder = Mockito.inOrder(view);
    inOrder.verify(view, times(1)).onFetchDataStarted();
    inOrder.verify(view, times(1)).onFetchDataError(exception);
    verify(view, never()).onFetchDataCompleted();
}
 
开发者ID:fabiothiroki,项目名称:android-api-request-test,代码行数:23,代码来源:MainPresenterTest.java

示例2: init

import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Before
public void init() {
    useCaseExecutor = new UseCaseExecutor() {
        @Override
        public Scheduler getScheduler() {
            return Schedulers.immediate();
        }
    };
    postExecutionThread = new PostExecutionThread() {
        @Override
        public Scheduler getScheduler() {
            return Schedulers.immediate();
        }
    };
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:16,代码来源:UseCaseTest.java

示例3: startImmediate

import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Test
public void startImmediate() {
    RxState<Integer> state = new RxState<>(0, Schedulers.immediate());
    TestSubscriber<Integer> subscriber = new TestSubscriber<>();
    state.values(StartWith.IMMEDIATE).subscribe(subscriber);
    subscriber.assertValues(0);
    state.apply(it -> it + 1);
    subscriber.assertValues(0, 1);
}
 
开发者ID:konmik,项目名称:rxstate,代码行数:10,代码来源:RxStateTest.java

示例4: startNo

import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Test
public void startNo() {
    RxState<Integer> state = new RxState<>(0, Schedulers.immediate());
    TestSubscriber<Integer> subscriber = new TestSubscriber<>();
    state.values(StartWith.NO).subscribe(subscriber);
    subscriber.assertValues();
    state.apply(it -> it + 1);
    subscriber.assertValues(1);
}
 
开发者ID:konmik,项目名称:rxstate,代码行数:10,代码来源:RxStateTest.java

示例5: simplePrint

import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Test
public void simplePrint() throws Exception {
    RxState<Integer> state = new RxState<>(0, Schedulers.immediate());
    state.values(StartWith.SCHEDULE)
            .subscribe(it -> System.out.println(it));
    state.apply(it -> it + 1);
}
 
开发者ID:konmik,项目名称:rxstate,代码行数:8,代码来源:RxStateTest.java

示例6: setUp

import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    userSearchPresenter = new UserSearchPresenter(userRepository, Schedulers.immediate(),
            Schedulers.immediate());
    userSearchPresenter.attachView(view);
}
 
开发者ID:moyheen,项目名称:github-user-search,代码行数:8,代码来源:UserSearchPresenterTest.java

示例7: setUp

import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    makeUpSearchPresenter = new MakeUpSearchPresenter(makeUpRepository, Schedulers.immediate
            (), Schedulers.immediate());
    makeUpSearchPresenter.attachView(view);
}
 
开发者ID:moyheen,项目名称:MakeUpSearch,代码行数:8,代码来源:MakeUpSearchPresenterTest.java

示例8: getNewThreadScheduler

import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Override
public Scheduler getNewThreadScheduler(){
    return Schedulers.immediate();
}
 
开发者ID:hacktoberfest17,项目名称:programming,代码行数:5,代码来源:RxSchedulersOverrideRule.java

示例9: setUp

import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Before
public void setUp() {
    mMockHackerNewsService = mock(HackerNewsService.class);
    mDataManager = new DataManager(mMockHackerNewsService, Schedulers.immediate());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:DataManagerTest.java

示例10: getMainTrheadeScheduler

import rx.schedulers.Schedulers; //导入方法依赖的package包/类
public Scheduler getMainTrheadeScheduler(){
    return Schedulers.immediate();
}
 
开发者ID:hacktoberfest17,项目名称:programming,代码行数:4,代码来源:RxSchedulersOverrideRule.java

示例11: getIOScheduler

import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Override
public Scheduler getIOScheduler() {
    return Schedulers.immediate();
}
 
开发者ID:schul-cloud,项目名称:schulcloud-mobile-android,代码行数:5,代码来源:RxSchedulersOverrideRule.java

示例12: OperatorTimeoutWithSelector

import rx.schedulers.Schedulers; //导入方法依赖的package包/类
public OperatorTimeoutWithSelector(Func0<? extends Observable<U>> firstTimeoutSelector, Func1<? super T, ? extends Observable<V>> timeoutSelector, Observable<? extends T> other) {
    super(new AnonymousClass1(firstTimeoutSelector), new AnonymousClass2(timeoutSelector), other, Schedulers.immediate());
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:4,代码来源:OperatorTimeoutWithSelector.java

示例13: provideSubscribeScheduler

import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Provides
@PerDataManager
Scheduler provideSubscribeScheduler() {
    return Schedulers.immediate();
}
 
开发者ID:sathishmscict,项目名称:Pickr,代码行数:6,代码来源:DataManagerTestModule.java

示例14: getMainThreadScheduler

import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Override
public Scheduler getMainThreadScheduler() {
    return Schedulers.immediate();
}
 
开发者ID:OHoussein,项目名称:Android-Show-Reader,代码行数:5,代码来源:RxSchedulersOverrideRule.java

示例15: setUp

import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Before public void setUp() {
  RvtsPrime rvtsPrime = new RvtsPrime();

  advanceManager =
      new AdvanceManager(transport, new MemoryDBManager(), Schedulers.immediate(), rvtsPrime);
}
 
开发者ID:csync,项目名称:csync-android,代码行数:7,代码来源:AdvanceManagerTest.java


注:本文中的rx.schedulers.Schedulers.immediate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。