I've a OSGI Plugin for which I'm writing unit tests and have used powermock to mock static dependecies.
But I'm facing issues while running the project as "Run as -> Junit Plugin test". However things works fine when I run project as "Junit test".
I'm getting this "java.lang.Exception: No runnable methods" error While running project as "Junit Plugin test"
I've checked over internet and tried everything but nothing worked for me.
I'm using following configurations:
- Using Junit, Mockito and Powermock to write tests. I've put @RunWith(PowerMockRunner.class) over my test class.
- Added following jars in my projects manifest file.
Junit Jar version 4.11.0
org.hamcrest.core 1.3.0
org.objenesis 2.1.0
Javaassist 3.18
org.mockito.mockito-core 1.9.5
- Running project as "Junit test" runs fine and all tests are getting passed. But running it as "Junit Plugin test" throws "No Runnable Methods" exception.
I've made sure that at least one test have @test notations and all mocks are declared inside @before.
- I've read that powermock has it's own classloaded so while running it with Junit Plugin test may cause problems. But I don't have enough information on this.
Question: Is is possible to use powermock with Junit Plugin Test? Or It's very complicated thing to achieve.
Please respond if you can help with this or could you add someone who has expertise in this field.
Thanks,
Jay