tiebin-zhang / powermock

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

Not working properly with JUnit 4.10+ #367

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use JUnit 4.10+

What is the expected output? What do you see instead?
The constructor of PowerMockRunner is using a method getJUnitVersion() that is 
return 4.1 for a JUnit 4.10+ and always returning false to condition ( 
getJUnitVersion() >= 4.7f ). so, i think it is executing wrong impl 
PowerMockJUnit44RunnerDelegateImpl instead of  
PowerMockJUnit47RunnerDelegateImpl

What version of the product are you using? On what operating system?
Win 7, 64 bits, JDK 7U2, compiling with 6.. and powermock-mockito-1.4.11-full

Please provide any additional information below.

Original issue reported on code.google.com by diego.co...@gmail.com on 2 Feb 2012 at 9:20

GoogleCodeExporter commented 9 years ago
Thanks for reporting. Could you create a patch for this? I think it should be 
relatively simple to fix. 

Original comment by johan.ha...@gmail.com on 3 Feb 2012 at 9:11

GoogleCodeExporter commented 9 years ago
I can try it tomorrow.. on saturday.

Original comment by diego.co...@gmail.com on 3 Feb 2012 at 11:44

GoogleCodeExporter commented 9 years ago
Thank you very much.

Original comment by johan.ha...@gmail.com on 3 Feb 2012 at 11:51

GoogleCodeExporter commented 9 years ago
Here is a patch, i did a class to hold principal version and major to compare 
when necessary, i tried to create some tests but i had problems with CGLib, im 
trying to repair... if you need any modification just tell me and ill try to 
help.

PS: I did the versioncompatibility class in project 
powermock-module-junit4-common

Original comment by diego.co...@gmail.com on 4 Feb 2012 at 3:00

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the patch. I've applied it (I think you created the patch for 
something else than the latest version though?) but for I can't seem to push 
right now because of 502 Bad Gateway. Will try again later.

Original comment by johan.ha...@gmail.com on 6 Feb 2012 at 8:01

GoogleCodeExporter commented 9 years ago
Btw, I created some tests as well and it works.

Original comment by johan.ha...@gmail.com on 6 Feb 2012 at 8:02

GoogleCodeExporter commented 9 years ago

Original comment by johan.ha...@gmail.com on 7 Feb 2012 at 10:26