Test Activity which is located in tests AndroidManifest

93 Views Asked by At

I need to test Activity (the view in it, to be more specific). But I can't test it properly because it binds to service which affects my tests. So I want to create test activity that extends original Activity with overridden bindService. The problem is I don't want to place this test activity to the main AndroidManifest.xml. I want to keep it in .../tests/AndroidManifest.xml. But after that I get exception every time I call getActivity in my

public class MyTest extends ActivityInstrumentationTestCase2<TestActivity>

It says:

java.lang.RuntimeException: Unable to resolve activity for: Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=com.ascom.example/.test.TestActivity }

So the question: is it possible to implement this trick?

0

There are 0 best solutions below