1package org.testng.reporters.jq;2import org.testng.reporters.XMLStringBuffer;3public class SuitePanel extends BasePanel {4 private static final String JS = "suite-panel.js";5 public SuitePanel() {6 super(JS);7 }8 public void addSuite(String suiteName, String suiteId, String suiteDuration, String suiteStartedAt,9 String suiteTotal, String suitePercentage) {10 XMLStringBuffer xsb = new XMLStringBuffer();11 xsb.push("suite");12 xsb.addEncodedAttribute("name", suiteName);13 xsb.addEncodedAttribute("id", suiteId);14 xsb.addEncodedAttribute("duration", suiteDuration);15 xsb.addEncodedAttribute("started-at", suiteStartedAt);16 xsb.addEncodedAttribute("ended-at", suiteEndedAt);17 xsb.addEncodedAttribute("passed", suitePassed);18 xsb.addEncodedAttribute("failed", suiteFailed);19 xsb.addEncodedAttribute("skipped", suiteSkipped);20 xsb.addEncodedAttribute("total", suiteTotal);21 xsb.addEncodedAttribute("percentage", suitePercentage);22 xsb.pop("suite");23 add(xsb.toXML());24 }25 public void addTest(String suiteId, String testName, String testId, String testDuration,26 String testSkipped, String testTotal, String testPercentage) {27 XMLStringBuffer xsb = new XMLStringBuffer();28 xsb.push("test");29 xsb.addEncodedAttribute("suite-id", suiteId);30 xsb.addEncodedAttribute("name", testName);31 xsb.addEncodedAttribute("id", testId);32 xsb.addEncodedAttribute("duration", testDuration);33 xsb.addEncodedAttribute("started-at", testStartedAt);34 xsb.addEncodedAttribute("ended-at", testEndedAt);35 xsb.addEncodedAttribute("passed", testPassed);36 xsb.addEncodedAttribute("failed", testFailed);37 xsb.addEncodedAttribute("skipped", testSkipped);38 xsb.addEncodedAttribute("total", testTotal);39 xsb.addEncodedAttribute("percentage", testPercentage);40 xsb.pop("test");41 add(x