简体   繁体   中英

Robotium Unit Testing on an application having multiple processes

I have written an application running activities in multiple processes.

I tried Robotium by creating a new test project set target package to my application. When I executed it, the test stopped with the following error message:

Error in testDisplayBlackBox:
java.lang.RuntimeException: Intent in process com.abc.def resolved to different process com.abc.def:mail: Intent { act=android.intent.action.MAIN flg=0x10000000    cmp=com.abc.def/com.abc.def.email.activity.Welcome }
    at android.app.Instrumentation.startActivitySync(Instrumentation.java:377)
    at android.test.InstrumentationTestCase.launchActivityWithIntent(InstrumentationTestCase.java:119)
    at android.test.InstrumentationTestCase.launchActivity(InstrumentationTestCase.java:97)
    at android.test.ActivityInstrumentationTestCase2.getActivity(ActivityInstrumentationTestCase2.java:104)
    at com.abc.def.test.TestApk.setUp(TestApk.java:31)
    at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:190)
    at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:175)
    at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555)
    at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1584)

Test results for InstrumentationTestRunner=.E
Time: 0.027

FAILURES!!!
Tests run: 1,  Failures: 0,  Errors: 1

Is it possible to have any workaround provided that I have source code in hand?

Robotium不会测试您包装之外的活动……我猜这就是为什么当您通过Intent转到其他活动时,Robotium会将其释放在那里!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM