tiebin-zhang / powermock

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

PowerMock doesn't work with JUnit 4.12 #532

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. add junit 4.12 as dependency
2. add to any class: @RunWith(PowerMockRunner.class)

What is the expected output? What do you see instead?
org.powermock.reflect.exceptions.FieldNotFoundException: Field 'fTestClass' was 
not found in class org.junit.internal.runners.MethodValidator.
    at org.powermock.reflect.internal.WhiteboxImpl.getInternalState(WhiteboxImpl.java:581)

What version of the product are you using? On what operating system?
1.6.0

Please provide any additional information below.

in JUnit 4.12 they renamed a few internal fields from f* to something else. 
https://github.com/junit-team/junit/blob/master/doc/ReleaseNotes4.12.md

But since they had some errors with reflection based tools they reverted it 
partially:
https://github.com/junit-team/junit/pull/961

Seems that didn't use PowerMock ;)

But since the JUnit release is out now I think that PowerMock should handle 
this.

Original issue reported on code.google.com by lbeus...@googlemail.com on 9 Dec 2014 at 4:05

GoogleCodeExporter commented 8 years ago
http://stackoverflow.com/a/26222732/2408961

Original comment by dono...@switchbit.io on 11 Dec 2014 at 6:06

GoogleCodeExporter commented 8 years ago
duplicate of https://code.google.com/p/powermock/issues/detail?id=531

Original comment by lbeus...@googlemail.com on 11 Dec 2014 at 4:36

GoogleCodeExporter commented 8 years ago

Original comment by johan.ha...@gmail.com on 3 Jan 2015 at 8:12