Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Rule
- ActivityTestRule<EmptyActivity> rule = new ActivityTestRule<>(EmptyActivity.class, false, false);
- @Before
- public void launchActivity() throws Exception {
- EmptyActivity appFakeActivity = rule.launchActivity(null);
- }
- @After
- public void finishActivity() throws Exception {
- getActivity().finish();
- // TODO : Inspect stackTrace at the end of the final executed test. It seems that the test runner close before the activity is effectively stopped.
- }
- private Activity getActivity() {
- return rule.getActivity();
- }
- @Given("...")
- public void given() {
- }
- @When("...")
- public void when_step() {
- ...
- }
- @Then("...")
- public void valid_M1() {
- Single<String> single = Single.just("qsdf");
- TestObserver<String> observer = new TestObserver<>();
- single
- .subscribeOn(Schedulers.io())
- .observeOn(AndroidSchedulers.mainThread())
- .subscribe(observer);
- observer.awaitTerminalEvent();
- }
- I/MonitoringInstr: Unstopped activity count: 1
- I/MonitoringInstr: Unstopped activity count: 1
- I/MonitoringInstr: Unstopped activity count: 1
- I/MonitoringInstr: Unstopped activity count: 1
- E/THREAD_STATE: Thread[FinalizerWatchdogDaemon,5,system]
- java.lang.Thread.sleep(Native Method)
- java.lang.Thread.sleep(Thread.java:1031)
- java.lang.Thread.sleep(Thread.java:985)
- java.lang.Daemons$FinalizerWatchdogDaemon.sleepFor(Daemons.java:257)
- java.lang.Daemons$FinalizerWatchdogDaemon.waitForFinalization(Daemons.java:268)
- java.lang.Daemons$FinalizerWatchdogDaemon.run(Daemons.java:216)
- java.lang.Thread.run(Thread.java:818)
- Thread[Instr: com.schneider.electric.forum.integration.m1.test.CucumberRunner,5,main]
- dalvik.system.VMStack.getThreadStackTrace(Native Method)
- java.lang.Thread.getStackTrace(Thread.java:580)
- java.lang.Thread.getAllStackTraces(Thread.java:522)
- android.support.test.runner.MonitoringInstrumentation.getThreadState(MonitoringInstrumentation.java:636)
- android.support.test.runner.MonitoringInstrumentation.dumpThreadStateToOutputs(MonitoringInstrumentation.java:631)
- android.support.test.runner.MonitoringInstrumentation.waitForActivitiesToComplete(MonitoringInstrumentation.java:384)
- android.support.test.runner.MonitoringInstrumentation.finish(MonitoringInstrumentation.java:347)
- cucumber.api.android.CucumberInstrumentationCore.start(CucumberInstrumentationCore.java:92)
- com.schneider.electric.forum.integration.m1.test.CucumberRunner.onStart(CucumberRunner.java:44)
- android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1837)
- Thread[FinalizerDaemon,5,system]
- java.lang.Object.wait(Native Method)
- java.lang.Object.wait(Object.java:422)
- java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:101)
- java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:72)
- java.lang.Daemons$FinalizerDaemon.run(Daemons.java:173)
- java.lang.Thread.run(Thread.java:818)
- Thread[JDWP,5,system]
- Thread[Binder_2,5,main]
- ...
- W/MonitoringInstr: Still 1 activities active after waiting 2000 ms.
- I/MonitoringInstr: waitForActivitiesToComplete() took: 2042msTests ran to completion.
Add Comment
Please, Sign In to add comment