-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Closed as not planned
Closed as not planned
Copy link
Description
In IntelliJ IDEA test's tree is build upon descriptors hierarchy. So if one would like to change it, he need to change the descriptors hierarchy. In some simple cases it's done by the IDE. E.g. if user ask to run one test method for a test class, descriptor for class with exactly one child is created but the IDE hides the top level node with the following reflection abuse
private static Description getFilteredDescription(Request request, Description description) throws NoSuchFieldException, IllegalAccessException {
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();
if (filterDescription != null) {
boolean isMethodFilter = filterDescription.startsWith("Method");
if (isMethodFilter && canCompress(description)) return (Description)description.getChildren().get(0);
}
return description;
}
Metadata
Metadata
Assignees
Labels
No labels