Guest User

Untitled

a guest
Jun 22nd, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.53 KB | None | 0 0
  1. @Rule
  2. ActivityTestRule<EmptyActivity> rule = new ActivityTestRule<>(EmptyActivity.class, false, false);
  3.  
  4.  
  5. @Before
  6. public void launchActivity() throws Exception {
  7. EmptyActivity appFakeActivity = rule.launchActivity(null);
  8. }
  9.  
  10. @After
  11. public void finishActivity() throws Exception {
  12. getActivity().finish();
  13. // TODO : Inspect stackTrace at the end of the final executed test. It seems that the test runner close before the activity is effectively stopped.
  14. }
  15.  
  16. private Activity getActivity() {
  17. return rule.getActivity();
  18. }
  19.  
  20. @Given("...")
  21. public void given() {
  22.  
  23. }
  24.  
  25. @When("...")
  26. public void when_step() {
  27. ...
  28. }
  29.  
  30. @Then("...")
  31. public void valid_M1() {
  32. Single<String> single = Single.just("qsdf");
  33. TestObserver<String> observer = new TestObserver<>();
  34. single
  35. .subscribeOn(Schedulers.io())
  36. .observeOn(AndroidSchedulers.mainThread())
  37. .subscribe(observer);
  38.  
  39. observer.awaitTerminalEvent();
  40. }
  41.  
  42. I/MonitoringInstr: Unstopped activity count: 1
  43. I/MonitoringInstr: Unstopped activity count: 1
  44. I/MonitoringInstr: Unstopped activity count: 1
  45. I/MonitoringInstr: Unstopped activity count: 1
  46. E/THREAD_STATE: Thread[FinalizerWatchdogDaemon,5,system]
  47. java.lang.Thread.sleep(Native Method)
  48. java.lang.Thread.sleep(Thread.java:1031)
  49. java.lang.Thread.sleep(Thread.java:985)
  50. java.lang.Daemons$FinalizerWatchdogDaemon.sleepFor(Daemons.java:257)
  51. java.lang.Daemons$FinalizerWatchdogDaemon.waitForFinalization(Daemons.java:268)
  52. java.lang.Daemons$FinalizerWatchdogDaemon.run(Daemons.java:216)
  53. java.lang.Thread.run(Thread.java:818)
  54.  
  55. Thread[Instr: com.schneider.electric.forum.integration.m1.test.CucumberRunner,5,main]
  56. dalvik.system.VMStack.getThreadStackTrace(Native Method)
  57. java.lang.Thread.getStackTrace(Thread.java:580)
  58. java.lang.Thread.getAllStackTraces(Thread.java:522)
  59. android.support.test.runner.MonitoringInstrumentation.getThreadState(MonitoringInstrumentation.java:636)
  60. android.support.test.runner.MonitoringInstrumentation.dumpThreadStateToOutputs(MonitoringInstrumentation.java:631)
  61. android.support.test.runner.MonitoringInstrumentation.waitForActivitiesToComplete(MonitoringInstrumentation.java:384)
  62. android.support.test.runner.MonitoringInstrumentation.finish(MonitoringInstrumentation.java:347)
  63. cucumber.api.android.CucumberInstrumentationCore.start(CucumberInstrumentationCore.java:92)
  64. com.schneider.electric.forum.integration.m1.test.CucumberRunner.onStart(CucumberRunner.java:44)
  65. android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1837)
  66.  
  67. Thread[FinalizerDaemon,5,system]
  68. java.lang.Object.wait(Native Method)
  69. java.lang.Object.wait(Object.java:422)
  70. java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:101)
  71. java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:72)
  72. java.lang.Daemons$FinalizerDaemon.run(Daemons.java:173)
  73. java.lang.Thread.run(Thread.java:818)
  74.  
  75. Thread[JDWP,5,system]
  76.  
  77. Thread[Binder_2,5,main]
  78.  
  79. ...
  80. W/MonitoringInstr: Still 1 activities active after waiting 2000 ms.
  81. I/MonitoringInstr: waitForActivitiesToComplete() took: 2042msTests ran to completion.
Add Comment
Please, Sign In to add comment