From 09dfe0b9aa6f32a19f3ce401e6f2c31eda794e5f Mon Sep 17 00:00:00 2001 From: HyunGil Jeong Date: Thu, 30 Jul 2015 14:37:06 +0900 Subject: [PATCH] #765 fix PinpointJUnit4ClassRunner to work with the updated junit --- pom.xml | 2 +- .../pinpoint/test/junit4/PinpointJUnit4ClassRunner.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 79ee26553ef7..b9be2c5b2116 100644 --- a/pom.xml +++ b/pom.xml @@ -563,7 +563,7 @@ junit junit - 4.8 + 4.12 org.hamcrest diff --git a/profiler/src/main/java/com/navercorp/pinpoint/test/junit4/PinpointJUnit4ClassRunner.java b/profiler/src/main/java/com/navercorp/pinpoint/test/junit4/PinpointJUnit4ClassRunner.java index 10715c8307c1..8aaf46f39286 100644 --- a/profiler/src/main/java/com/navercorp/pinpoint/test/junit4/PinpointJUnit4ClassRunner.java +++ b/profiler/src/main/java/com/navercorp/pinpoint/test/junit4/PinpointJUnit4ClassRunner.java @@ -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) {