當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。