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


Java RxJavaPlugins.reset方法代码示例

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


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

示例1: apply

import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Override
public Statement apply(final Statement base, final Description description) {
    return new Statement() {
        @Override
        public void evaluate() throws Throwable {
            RxJavaPlugins.setIoSchedulerHandler(scheduler -> testScheduler);
            RxJavaPlugins.setComputationSchedulerHandler(scheduler -> testScheduler);
            RxJavaPlugins.setNewThreadSchedulerHandler(scheduler -> testScheduler);

            try {
                base.evaluate();
            } finally {
                RxJavaPlugins.reset();
            }
        }
    };
}
 
开发者ID:juxeii,项目名称:dztools,代码行数:18,代码来源:TestSchedulerRule.java

示例2: apply

import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Override
public Statement apply(final Statement base, Description description) {
  return new Statement() {
    @Override
    public void evaluate() throws Throwable {
      RxJavaPlugins.reset();
      RxJavaPlugins.setIoSchedulerHandler(scheduler -> Schedulers.trampoline());
      RxJavaPlugins.setComputationSchedulerHandler(scheduler -> Schedulers.trampoline());
      RxJavaPlugins.setNewThreadSchedulerHandler(scheduler -> Schedulers.trampoline());

      try {
        base.evaluate();
      } finally {
        RxJavaPlugins.reset();
      }
    }
  };
}
 
开发者ID:dbof10,项目名称:redux-observable,代码行数:19,代码来源:ImmediateSchedulersRule.java

示例3: apply

import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Override
public Statement apply(Statement base, Description description) {
    return new Statement() {
        @Override
        public void evaluate() throws Throwable {
            RxAndroidPlugins.reset();
            RxAndroidPlugins.setInitMainThreadSchedulerHandler(scheduler -> Schedulers.trampoline());
            RxJavaPlugins.reset();
            RxJavaPlugins.setIoSchedulerHandler(schedulerCallable -> Schedulers.trampoline());

            base.evaluate();

            RxAndroidPlugins.reset();
            RxJavaPlugins.reset();
        }
    };
}
 
开发者ID:CoreFloDev,项目名称:OpenChat,代码行数:18,代码来源:RxPluginTestRule.java

示例4: apply

import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Override
public Statement apply(final Statement base, Description description) {
    return new Statement() {
        @Override
        public void evaluate() throws Throwable {
            RxJavaPlugins.setIoSchedulerHandler(scheduler ->
                    Schedulers.trampoline());
            RxJavaPlugins.setComputationSchedulerHandler(scheduler ->
                    Schedulers.trampoline());
            RxJavaPlugins.setNewThreadSchedulerHandler(scheduler ->
                    Schedulers.trampoline());
            try {
                base.evaluate();
            } finally {
                RxJavaPlugins.reset();
            }
        }
    };
}
 
开发者ID:OlegDokuka,项目名称:reactive-playing,代码行数:20,代码来源:WordServiceWithRuleTest.java

示例5: apply

import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Override
public Statement apply(final Statement base, Description description) {
    return new Statement() {
        @Override
        public void evaluate() throws Throwable {

            RxAndroidPlugins.setMainThreadSchedulerHandler(scheduler ->  Schedulers.trampoline());
            RxAndroidPlugins.setInitMainThreadSchedulerHandler(schedulerCallable ->  Schedulers.trampoline());

            try {
                base.evaluate();
            } finally {
                RxJavaPlugins.reset();
                RxAndroidPlugins.reset();
            }
        }
    };
}
 
开发者ID:listenzz,项目名称:RxCommand,代码行数:19,代码来源:ImmediateSchedulersRule.java

示例6: apply

import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Override
public Statement apply(final Statement base, Description description) {
    return new Statement() {
        @Override
        public void evaluate() throws Throwable {
            RxAndroidPlugins.reset();
            RxAndroidPlugins.setMainThreadSchedulerHandler(scheduler -> Schedulers.trampoline());

            RxJavaPlugins.reset();
            RxJavaPlugins.setIoSchedulerHandler(scheduler -> Schedulers.trampoline());
            RxJavaPlugins.setComputationSchedulerHandler(scheduler -> Schedulers.trampoline());
            RxJavaPlugins.setNewThreadSchedulerHandler(scheduler -> Schedulers.trampoline());

            base.evaluate();

            RxAndroidPlugins.reset();
            RxJavaPlugins.reset();
        }
    };
}
 
开发者ID:duyp,项目名称:mvvm-template,代码行数:21,代码来源:RxSchedulersOverrideRule.java

示例7: apply

import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Override
public Statement apply(final Statement base, Description description) {
    return new Statement() {
        @Override
        public void evaluate() throws Throwable {
            RxAndroidPlugins.reset();
            RxAndroidPlugins.setInitMainThreadSchedulerHandler(mRxAndroidSchedulersHook);

            RxJavaPlugins.reset();
            RxJavaPlugins.setIoSchedulerHandler(mRxJavaImmediateScheduler);
            RxJavaPlugins.setNewThreadSchedulerHandler(mRxJavaImmediateScheduler);

            base.evaluate();

            RxAndroidPlugins.reset();
            RxJavaPlugins.reset();
        }
    };
}
 
开发者ID:sztomek,项目名称:cleanarchitecture-unidirectional,代码行数:20,代码来源:RxSchedulersOverrideRule.java

示例8: apply

import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Override
public Statement apply(final Statement base, Description description) {
    return new Statement() {
        @Override
        public void evaluate() throws Throwable {
            RxJavaPlugins.setIoSchedulerHandler(scheduler -> Schedulers.trampoline());
            RxJavaPlugins.setComputationSchedulerHandler(scheduler -> Schedulers.trampoline());
            RxJavaPlugins.setNewThreadSchedulerHandler(scheduler -> Schedulers.trampoline());
            RxAndroidPlugins.setMainThreadSchedulerHandler(scheduler -> Schedulers.trampoline());
            try {
                base.evaluate();
            } finally {
                RxJavaPlugins.reset();
            }
        }
    };
}
 
开发者ID:Zeyad-37,项目名称:RxRedux,代码行数:18,代码来源:ImmediateSchedulersRule.java

示例9: apply

import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Override public Statement apply(final Statement base, Description description) {
  return new Statement() {
    @Override public void evaluate() throws Throwable {
      RxJavaPlugins.reset();
      try {
        base.evaluate();
      } finally {
        RxJavaPlugins.reset();
      }
    }
  };
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:RxJavaPluginsResetRule.java

示例10: shouldCompleteAndReplaceComputationOnTrampoline

import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Test
public void shouldCompleteAndReplaceComputationOnTrampoline() {
    TestObserver<String> testObserver = TestObserver.create();
    RxJavaPlugins.setComputationSchedulerHandler(old -> Schedulers.trampoline());

    try {
        wordService
                .enumerate(Observable.fromArray(STRINGS))
                .subscribeOn(Schedulers.computation())
                .subscribe(testObserver);

        testObserver
                .assertSubscribed()
                .assertComplete()
                .assertNoErrors()
                .assertValueCount(9)
                .assertValues(
                        " 1. the",
                        " 2. quick",
                        " 3. brown",
                        " 4. fox",
                        " 5. jumped",
                        " 6. over",
                        " 7. the",
                        " 8. lazy",
                        " 9. dog"
                );
    } finally {
        RxJavaPlugins.reset();
    }
}
 
开发者ID:OlegDokuka,项目名称:reactive-playing,代码行数:32,代码来源:WordServiceTest.java

示例11: setUp

import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Before
public void setUp() {
    RxJavaPlugins.reset();
    pauseMainLooper(); // Take manual control of looper task queue.
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:HandlerSchedulerTest.java

示例12: tearDown

import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@After
public void tearDown() {
    RxJavaPlugins.reset();
    unPauseMainLooper();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:HandlerSchedulerTest.java

示例13: after

import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Override
protected void after() {
    RxJavaPlugins.reset();
}
 
开发者ID:ecarrara-araujo,项目名称:yabaking,代码行数:5,代码来源:Rx2IdlingSchedulerRule.java

示例14: init

import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
public static void init(Function<? super Scheduler, ? extends Scheduler> scheduler) {
	RxJavaPlugins.reset();
	RxJavaPlugins.setIoSchedulerHandler(scheduler);
	RxJavaPlugins.setNewThreadSchedulerHandler(scheduler);
}
 
开发者ID:leocabral,项目名称:lacomida,代码行数:6,代码来源:RxJavaTestScheduler.java

示例15: resetPlugins

import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
private void resetPlugins() {
    RxJavaPlugins.reset();
}
 
开发者ID:florent37,项目名称:RxAndroidOrm,代码行数:4,代码来源:RxJavaSchedulersTestRule.java


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