I've an XML file in the assets directory of my test application. I want to access this file from my suite method of the test class.
ie.,
public static TestSuite suite(){ InputStream stream = // Some code which returns the asset }
Any idea how I can do this? I tried with Resources.Resources.getSystem().getAssets() but no luck :-(. help please.
Thanx in adv, Joseph
I encountered the same problem with my test app. Unfortunately, it looks like getContext() in a test case class actually returns the context of the application under test. In order to get the context of the test application itself, you have to inherit from InstrumentationTestCase
and then call getInstrumentation().getContext()
to get the context of the test app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With