use of org.eclipse.che.plugin.testing.ide.view.navigation.nodes.TestResultClassNode in project che by eclipse.
the class TestResultViewImpl method buildTree.
private void buildTree() {
resultTree.getNodeStorage().clear();
outputResult.setText("");
TestResultGroupNode root = nodeFactory.getTestResultGroupNode(lastTestResult);
HashMap<String, List<Node>> classNodeHashMap = new HashMap<>();
for (Failure failure : lastTestResult.getFailures()) {
if (!classNodeHashMap.containsKey(failure.getFailingClass())) {
List<Node> methodNodes = new ArrayList<>();
classNodeHashMap.put(failure.getFailingClass(), methodNodes);
}
classNodeHashMap.get(failure.getFailingClass()).add(nodeFactory.getTestResultMethodNodeNode(failure.getFailingMethod(), failure.getTrace(), failure.getMessage(), failure.getFailingLine(), this));
}
List<Node> classNodes = new ArrayList<>();
for (Map.Entry<String, List<Node>> entry : classNodeHashMap.entrySet()) {
TestResultClassNode classNode = nodeFactory.getTestResultClassNodeNode(entry.getKey());
classNode.setChildren(entry.getValue());
classNodes.add(classNode);
}
root.setChildren(classNodes);
resultTree.getNodeStorage().add(root);
}
Aggregations