mirror of
https://github.com/wahyd4/pinpoint.git
synced 2026-08-16 08:16:15 +10:00
#765 fix PinpointJUnit4ClassRunner to work with the updated junit
This commit is contained in:
@@ -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>
|
||||
|
||||
+2
-2
@@ -74,8 +74,8 @@ public final class PinpointJUnit4ClassRunner extends BlockJUnit4ClassRunner {
|
||||
// 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) {
|
||||
|
||||
Reference in New Issue
Block a user