Code with Finding: |
class NavigatorPanel { private void generateMethodList(String name, IResultProvider provider, String suiteName, XMLStringBuffer main) { XMLStringBuffer xsb = new XMLStringBuffer(main.getCurrentIndent()); String type = provider.getType(); String image = Model.getImage(type);
xsb.push("li");
// The methods themselves xsb.addRequired(S, name, C, "method-list-title " + type);
// The mark up to show the (hide)/(show) links xsb.push(S, C, "show-or-hide-methods " + type); xsb.addRequired("a", " (hide)", "href", "#", C, "hide-methods " + type + " " + suiteName, "panel-name", suiteName); xsb.addRequired("a", " (show)", "href", "#",C, "show-methods " + type + " " + suiteName, "panel-name", suiteName); xsb.pop(S);
// List of methods xsb.push(D, C, "method-list-content " + type + " " + suiteName); int count = 0; List<ITestResult> testResults = provider.getResults(); if (testResults != null) { Collections.sort(testResults, ResultsByClass.METHOD_NAME_COMPARATOR); for (ITestResult tr : testResults) { String testName = Model.getTestResultName(tr); xsb.push(S); xsb.addEmptyElement("img", "src", image, "width", "3%"); xsb.addRequired("a", testName, "href", "#", "hash-for-method", getModel().getTag(tr), "panel-name", suiteName, "title", tr.getTestClass().getName(), C, "method navigator-link"); xsb.pop(S); xsb.addEmptyElement("br"); count++; } } xsb.pop(D); xsb.pop("li");
if (count > 0) { main.addString(xsb.toXML()); } }
}
|