*/
@Override
public void updateTestResult(RunInfo runInfo, boolean expand) {
m_runInfos.add(runInfo);
if (acceptTestResult(runInfo) && matchesSearchFilter(runInfo)) {
ITreeItem suite = m_suites.get(runInfo.getSuiteName());
if (suite == null) {
suite = new SuiteTreeItem(m_tree, runInfo);
m_suites.put(runInfo.getSuiteName(), suite);
}
String pathToTest = runInfo.getSuiteName() + "#" + runInfo.getTestName();
ITreeItem test = m_tests.get(pathToTest);
if (test == null) {
test = new TestTreeItem(suite.getTreeItem(), runInfo);
m_tests.put(pathToTest, test);
}
String pathToClass = pathToTest + "#" + runInfo.getInstanceName();
ITreeItem cls = m_classes.get(pathToClass);
if (cls == null) {
cls = new ClassTreeItem(test.getTreeItem(), runInfo);
m_classes.put(pathToClass, cls);
}
String pathToMethod = pathToClass + "#" + runInfo.getMethodName();
ITreeItem method = m_methods.get(pathToMethod);
if (method == null) {
method = new TestMethodTreeItem(cls.getTreeItem(), runInfo);
m_methods.put(pathToMethod, method);
}
// Create a node for the parameter values, if applicable
ITreeItem methodParam = null;
if (!StringUtils.isEmptyString(runInfo.getParametersDisplay())) {
methodParam = new TestMethodParametersTreeItem(method.getTreeItem(),
runInfo);
methodParam.addToCumulatedTime(runInfo);
}
if (expand) {
suite.getTreeItem().setExpanded(true);
test.getTreeItem().setExpanded(true);
cls.getTreeItem().setExpanded(true);
method.getTreeItem().setExpanded(true);
if (methodParam != null) {
methodParam.getTreeItem().setExpanded(true);
focus(methodParam.getTreeItem());
} else {
focus(method.getTreeItem());
}
}
suite.addToCumulatedTime(runInfo);