Search in sources :

Example 1 with TestResultGroupNode

use of org.eclipse.che.plugin.testing.ide.view.navigation.nodes.TestResultGroupNode 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);
}
Also used : TestResultGroupNode(org.eclipse.che.plugin.testing.ide.view.navigation.nodes.TestResultGroupNode) HashMap(java.util.HashMap) TestResultGroupNode(org.eclipse.che.plugin.testing.ide.view.navigation.nodes.TestResultGroupNode) TestResultMethodNode(org.eclipse.che.plugin.testing.ide.view.navigation.nodes.TestResultMethodNode) TestResultClassNode(org.eclipse.che.plugin.testing.ide.view.navigation.nodes.TestResultClassNode) Node(org.eclipse.che.ide.api.data.tree.Node) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList) TestResultClassNode(org.eclipse.che.plugin.testing.ide.view.navigation.nodes.TestResultClassNode) Map(java.util.Map) HashMap(java.util.HashMap) Failure(org.eclipse.che.api.testing.shared.Failure)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Failure (org.eclipse.che.api.testing.shared.Failure)1 Node (org.eclipse.che.ide.api.data.tree.Node)1 TestResultClassNode (org.eclipse.che.plugin.testing.ide.view.navigation.nodes.TestResultClassNode)1 TestResultGroupNode (org.eclipse.che.plugin.testing.ide.view.navigation.nodes.TestResultGroupNode)1 TestResultMethodNode (org.eclipse.che.plugin.testing.ide.view.navigation.nodes.TestResultMethodNode)1