I got this solved by the following :
- Created the setup as explained here
- Extended the InstrumentationTestCase instead of
TestCase. The InstrumentationTestCase has the method getInstrument() through which I got access to the Instrumentation's(The test app project) Context.