Skip to content

Commit

Permalink
Merge pull request #788 from Xylus/feature/issue-765/1.1.x
Browse files Browse the repository at this point in the history
fix PinpointJUnit4ClassRunner to work with the updated junit
  • Loading branch information
Xylus committed Jul 30, 2015
2 parents b5f10c2 + 09dfe0b commit 5d5b943
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8</version>
<version>4.12</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ public PinpointJUnit4ClassRunner(Class<?> clazz) throws InitializationError {
// Replace test target with a class loaded by TestClassLoader
// Cannot override getTestClass() which is used to get test class by JUnit because it's final.
try {
// PinpointJunit4ClassRunner -> BlockJUnit4ClassRunner -> ParentRunner.fTestClass
Field testClassField = this.getClass().getSuperclass().getSuperclass().getDeclaredField("fTestClass");
// PinpointJunit4ClassRunner -> BlockJUnit4ClassRunner -> ParentRunner.testClass
Field testClassField = this.getClass().getSuperclass().getSuperclass().getDeclaredField("testClass");
testClassField.setAccessible(true);
testClassField.set(this, this.testContext.getTestClass());
} catch (Exception e) {
Expand Down

0 comments on commit 5d5b943

Please # to comment.