Closed GoogleCodeExporter closed 9 years ago
Looks like the field has been renamed to just "testClass" in JUnit 4.12.
Original comment by jrh...@gmail.com
on 12 Dec 2014 at 4:15
This should be changed to High priority since there is no way to run PowerMock
with JUnit 4.12.
Original comment by nykolas....@gmail.com
on 23 Dec 2014 at 6:31
Also, changing to JUnit 4.11 to workaround this problem causes another problem:
org.powermock.reflect.exceptions.FieldNotFoundException: No instance field
named "fAnnotations" could be found in the class hierarchy of
org.junit.runner.Description.
Original comment by nykolas....@gmail.com
on 23 Dec 2014 at 6:35
Original comment by johan.ha...@gmail.com
on 3 Jan 2015 at 8:12
In https://github.com/junit-team/junit/releases, the version is 4.12-SNAPSHOT.
Hence the fix
static {
if(JUnitVersion.isGreaterThanOrEqualTo("4.12")) {
TEST_CLASS_FIELD = "testClass";
CLASS_UNDER_TEST_FIELD = "klass";
ERRORS_FIELD = "errors";
}
else {
TEST_CLASS_FIELD = "fTestClass";
CLASS_UNDER_TEST_FIELD = "fClass";
ERRORS_FIELD = "fErrors";
}
}
doesn't apply to this version as JUnitVersion.isGreaterThanOrEqualTo("4.12")
gives false in this case.
Original comment by reshm...@gmail.com
on 11 Feb 2015 at 2:59
Original issue reported on code.google.com by
cheis...@squareup.com
on 5 Dec 2014 at 9:07