/** Put a XML start or empty tag to the XMLStringBuffer depending on hasChildElements parameter */ private boolean putElement(XMLStringBuffer xsb, String tagName, Properties attributes, boolean hasChildElements) { if (hasChildElements) { xsb.push(tagName, attributes); } else { xsb.addEmptyElement(tagName, attributes); } return hasChildElements; }
private synchronized void createElementFromIgnoredTests(XMLStringBuffer doc, ITestContext context) { Collection<ITestNGMethod> methods = context.getExcludedMethods(); for (ITestNGMethod method : methods) { Properties properties = getPropertiesFor(method, 0); doc.push(XMLConstants.TESTCASE,properties); doc.addEmptyElement(XMLConstants.ATTR_IGNORED); doc.pop(); } }
/** * Push a new tag. Its value is stored and will be compared against the parameter * passed to pop(). * * @param tagName The name of the tag. */ public void push(String tagName) { push(tagName, ""); }
/** * Pop the last pushed element without verifying it if matches the previously * pushed tag. */ public void pop() { pop(null); }
/** * Invoked after all the tests have run and all their * Configuration methods have been called. * */ @Override public void onFinish(ITestContext context) { generateReport(context); resetAll(); }
/** * Add an empty element tag (e.g. <foo/>) * * @param tagName The name of the tag * */ public void addEmptyElement(String tagName) { addEmptyElement(tagName, (Properties) null); }
public void addOptional(String tagName, @Nullable String value, String... attributes) { if (value != null) { XMLUtils.xmlOptional(m_buffer, m_currentIndent, tagName, value, createProperties(attributes)); } }
/** * Writes a TH element with the specified contents and CSS class names. * * @param html * the HTML contents * @param cssClasses * the space-delimited CSS classes or null if there are no * classes to apply */ protected void writeTableHeader(String html, String cssClasses) { writeTag("th", html, cssClasses); }
/** * Writes a TD element with the specified contents. * * @param html * the HTML contents */ protected void writeTableData(String html) { writeTableData(html, null); }
@Override public void onFinish(ITestContext context) { logResults(); suiteName = null; }
@Override public void onFinish(ITestContext context) { if (m_verbose >= 2) { logResults(); } }
private synchronized void createElementFromTestResults(XMLStringBuffer document, Collection<ITestResult> results) { for(ITestResult tr : results) { createElement(document, tr); } }
/** * @param buffer The StringBuffer to use internally to represent the * document. * @param start A string of spaces indicating the indentation at which * to start the generation. */ public XMLStringBuffer(IBuffer buffer, String start) { init(buffer, start); }
@Override public void onTestSuccess(ITestResult tr) { log("."); }
@Override public void onTestStart(ITestResult tr) { logTestResult(Status.STARTED, tr, false); }
/** * Add an empty element tag (e.g. <foo/>) * @param tagName The name of the tag * @param attributes A Properties file containing the attributes (or null) */ public void addEmptyElement(String tagName, @Nullable Properties attributes) { m_buffer.append(m_currentIndent).append("<").append(tagName); XMLUtils.appendAttributes(m_buffer, attributes); m_buffer.append("/>").append(EOL); }
/** * Writes a TD element with the specified contents and CSS class names. * * @param html * the HTML contents * @param cssClasses * the space-delimited CSS classes or null if there are no * classes to apply */ protected void writeTableData(String html, String cssClasses) { writeTag("td", html, cssClasses); }