@@ -0,0 +1,1684 @@
+package org.apache.taverna.mobile.utils;%0A%0Aimport org.junit.rules.TestRule;%0Aimport org.junit.runner.Description;%0Aimport org.junit.runners.model.Statement;%0A%0Aimport rx.Scheduler;%0Aimport rx.android.plugins.RxAndroidPlugins;%0Aimport rx.android.plugins.RxAndroidSchedulersHook;%0Aimport rx.plugins.RxJavaPlugins;%0Aimport rx.plugins.RxJavaSchedulersHook;%0Aimport rx.schedulers.Schedulers;%0A%0A%0Apublic class RxSchedulersOverrideRule implements TestRule %7B%0A%0A    private final RxJavaSchedulersHook mRxJavaSchedulersHook = new RxJavaSchedulersHook() %7B%0A        @Override%0A        public Scheduler getIOScheduler() %7B%0A            return Schedulers.immediate();%0A        %7D%0A%0A        @Override%0A        public Scheduler getNewThreadScheduler() %7B%0A            return Schedulers.immediate();%0A        %7D%0A    %7D;%0A%0A    private final RxAndroidSchedulersHook mRxAndroidSchedulersHook = new RxAndroidSchedulersHook() %7B%0A        @Override%0A        public Scheduler getMainThreadScheduler() %7B%0A            return Schedulers.immediate();%0A        %7D%0A    %7D;%0A%0A%0A    @Override%0A    public Statement apply(final Statement base, Description description) %7B%0A        return new Statement() %7B%0A            @Override%0A            public void evaluate() throws Throwable %7B%0A%0A                RxAndroidPlugins.getInstance().reset();%0A                RxAndroidPlugins.getInstance().registerSchedulersHook(mRxAndroidSchedulersHook);%0A                RxJavaPlugins.getInstance().reset();%0A                RxJavaPlugins.getInstance().registerSchedulersHook(mRxJavaSchedulersHook);%0A%0A                base.evaluate();%0A%0A                RxAndroidPlugins.getInstance().reset();%0A                RxJavaPlugins.getInstance().reset();%0A            %7D%0A        %7D;%0A    %7D%0A%7D

Implement RxSchedulersOverrideRule