tiebin-zhang / powermock

Automatically exported from code.google.com/p/powermock
Apache License 2.0
0 stars 0 forks source link

How to get Context object with the PowerMock #446

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,

We are using the PowerMock tool for unit testing the Android application. For 
this unit testing we need the context object . For getting the context we are 
writing the following code :
Context context = PowerMockito.mock(HomeActivity.class);
The HomeActivity extends Activity in our application.

But the context object which we are getting above , we tried to use in our test 
methods but we are getting error that application context is unexpectedly null.

Can you please help us in finding out the way why we are not able to get 
context object?

Help Appreciated.

Thanks!
Bhushan

Original issue reported on code.google.com by bhushan....@gmail.com on 11 Jun 2013 at 2:31

GoogleCodeExporter commented 9 years ago
Please use the mailing list for asking questions.

Regards,
/Johan

Original comment by johan.ha...@gmail.com on 12 Jun 2013 at 6:08

GoogleCodeExporter commented 9 years ago
What is the meaning of use the mailing list for asking questions ??

Original comment by bhushan....@gmail.com on 12 Jun 2013 at 6:22

GoogleCodeExporter commented 9 years ago
PowerMock has a mailing list that you can subscribe to if you want to ask 
questions. Issues are not for discussion unless you've found a bug (after 
having discussed it on the mailing list). Hope it makes sense.

Original comment by johan.ha...@gmail.com on 13 Jun 2013 at 5:44