public List<String> getMethodName() { List<String> result = ListSequence.fromList(new ArrayList<String>()); for (List<ITestNodeWrapper> values : MapSequence.fromMap(this.myState.getTestsMap()).values()) { for (ITestNodeWrapper value : values) { ListSequence.fromList(result).addElement(value.getName()); } } return result; }
public MPSTreeNode rebuild() { MPSTreeNode root = new TextTreeNode("Tests"); this.setRootVisible(false); TestNameMap<TestCaseTreeNode, TestMethodTreeNode> temp = new TestNameMap<TestCaseTreeNode, TestMethodTreeNode>(); for (ITestNodeWrapper testCase : SetSequence.fromSet(MapSequence.fromMap(this.myState.getTestsMap()).keySet())) { if (testCase == null) { continue; } TestCaseTreeNode testCaseTreeNode = this.myMap.get(testCase.getFqName()); if (testCaseTreeNode == null) { testCaseTreeNode = new TestCaseTreeNode(this.myOperationContext, testCase); } testCaseTreeNode.removeAllChildren(); boolean hasFailedTest = false; for (ITestNodeWrapper method : ListSequence.fromList(MapSequence.fromMap(this.myState.getTestsMap()).get(testCase))) { TestMethodTreeNode oldMethodTreeNode = this.myMap.get(testCase.getFqName(), method.getName()); TestMethodTreeNode newMethodTreeNode = new TestMethodTreeNode(this.myOperationContext, method); TestMethodTreeNode methodTreeNode = (oldMethodTreeNode == null ? newMethodTreeNode : oldMethodTreeNode); boolean isFailedMethod = isFailed(methodTreeNode); hasFailedTest = hasFailedTest || isFailedMethod; if (this.isAllTree || isFailedMethod) { if (methodTreeNode == null) { continue; } testCaseTreeNode.add(methodTreeNode); temp.put(testCase, method, methodTreeNode); } else { temp.put(testCase, method, methodTreeNode); } } if (this.isAllTree || hasFailedTest) { root.add(testCaseTreeNode); temp.put(testCase, testCaseTreeNode); } else { temp.put(testCase, testCaseTreeNode); } } this.myMap = temp; return root; }