mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
workaround for junit rename (IDEA-127349)
This commit is contained in:
@@ -92,7 +92,13 @@ public class JUnit4IdeaTestRunner implements IdeaTestRunner {
|
||||
}
|
||||
|
||||
private static Description getFilteredDescription(Request request, Description description) throws NoSuchFieldException, IllegalAccessException {
|
||||
final Field field = FilterRequest.class.getDeclaredField("fFilter");
|
||||
Field field;
|
||||
try {
|
||||
field = FilterRequest.class.getDeclaredField("fFilter");
|
||||
}
|
||||
catch (NoSuchFieldException e) {
|
||||
field = FilterRequest.class.getDeclaredField("filter");
|
||||
}
|
||||
field.setAccessible(true);
|
||||
final Filter filter = (Filter)field.get(request);
|
||||
final String filterDescription = filter.describe();
|
||||
@@ -125,7 +131,13 @@ public class JUnit4IdeaTestRunner implements IdeaTestRunner {
|
||||
}
|
||||
|
||||
private static Description getSuiteMethodDescription(Request request, Description description) throws NoSuchFieldException, IllegalAccessException {
|
||||
final Field field = ClassRequest.class.getDeclaredField("fTestClass");
|
||||
Field field;
|
||||
try {
|
||||
field = ClassRequest.class.getDeclaredField("fTestClass");
|
||||
}
|
||||
catch (NoSuchFieldException e) {
|
||||
field = ClassRequest.class.getDeclaredField("testClass");
|
||||
}
|
||||
field.setAccessible(true);
|
||||
final Description methodDescription = Description.createSuiteDescription((Class)field.get(request));
|
||||
for (Iterator iterator = description.getChildren().iterator(); iterator.hasNext();) {
|
||||
|
||||
@@ -352,12 +352,18 @@ public class JUnit4TestRunnerUtil {
|
||||
for (Iterator iterator = children.iterator(); iterator.hasNext(); ) {
|
||||
Object child = iterator.next();
|
||||
try {
|
||||
Class aClass = child.getClass();
|
||||
Field f;
|
||||
try {
|
||||
f = child.getClass().getDeclaredField("fName");
|
||||
f = aClass.getDeclaredField("fName");
|
||||
}
|
||||
catch (NoSuchFieldException e) {
|
||||
continue;
|
||||
try {
|
||||
f = aClass.getDeclaredField("name");
|
||||
}
|
||||
catch (NoSuchFieldException e1) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
f.setAccessible(true);
|
||||
String fName = (String)f.get(child);
|
||||
|
||||
Reference in New Issue
Block a user