Tabnine Logo
XMLStringBuffer.push
Code IndexAdd Tabnine to your IDE (free)

How to use
push
method
in
org.testng.reporters.XMLStringBuffer

Best Java code snippets using org.testng.reporters.XMLStringBuffer.push (Showing top 20 results out of 315)

origin: org.testng/testng

/**
 * 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, "");
}
origin: org.testng/testng

/**
 * 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.
 * @param schema The schema to use (can be null or an empty string).
 */
public void push(String tagName, @Nullable String schema) {
 push(tagName, schema, null);
}
origin: org.testng/testng

/**
 * 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.
 * @param attributes A Properties file representing the attributes (or null)
 */
public void push(String tagName, @Nullable Properties attributes) {
 push(tagName, "", attributes);
}
origin: org.testng/testng

/** 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;
}
origin: org.testng/testng

public void push(String tagName, String... attributes) {
 push(tagName, createProperties(attributes));
}
origin: org.testng/testng

private void addParameter(XMLStringBuffer xmlBuffer, Object parameter, int i) {
 Properties attrs = new Properties();
 attrs.setProperty(XMLReporterConfig.ATTR_INDEX, String.valueOf(i));
 xmlBuffer.push(XMLReporterConfig.TAG_PARAM, attrs);
 if (parameter == null) {
  Properties valueAttrs = new Properties();
  valueAttrs.setProperty(XMLReporterConfig.ATTR_IS_NULL, "true");
  xmlBuffer.addEmptyElement(XMLReporterConfig.TAG_PARAM_VALUE, valueAttrs);
 } else {
  xmlBuffer.push(XMLReporterConfig.TAG_PARAM_VALUE);
  xmlBuffer.addCDATA(parameter.toString());
  xmlBuffer.pop();
 }
 xmlBuffer.pop();
}
origin: org.testng/testng

private void writeReporterOutput(XMLStringBuffer xmlBuffer) {
 // TODO: Cosmin - maybe a <line> element isn't indicated for each line
 xmlBuffer.push(XMLReporterConfig.TAG_REPORTER_OUTPUT);
 List<String> output = Reporter.getOutput();
 for (String line : output) {
  if (line != null) {
   xmlBuffer.push(XMLReporterConfig.TAG_LINE);
   xmlBuffer.addCDATA(line);
   xmlBuffer.pop();
  }
 }
 xmlBuffer.pop();
}
origin: org.testng/testng

private void addTestResultOutput(XMLStringBuffer xmlBuffer, ITestResult testResult) {
 // TODO: Cosmin - maybe a <line> element isn't indicated for each line
 xmlBuffer.push(XMLReporterConfig.TAG_REPORTER_OUTPUT);
 List<String> output = Reporter.getOutput(testResult);
 for (String line : output) {
  if (line != null) {
   xmlBuffer.push(XMLReporterConfig.TAG_LINE);
   xmlBuffer.addCDATA(line);
   xmlBuffer.pop();
  }
 }
 xmlBuffer.pop();
}
origin: org.testng/testng

public String toXml(String indent) {
 XMLStringBuffer xsb = new XMLStringBuffer(indent);
 boolean hasElements = hasElements(m_xmlDependencyGroups);
 if (hasElements) {
  xsb.push("dependencies");
 }
 for (Map.Entry<String, String> entry : m_xmlDependencyGroups.entrySet()) {
  xsb.addEmptyElement("include", "name", entry.getKey(), "depends-on", entry.getValue());
 }
 if (hasElements) {
  xsb.pop("dependencies");
 }
 return xsb.toXML();
}
origin: org.testng/testng

public void addTestMethodParams(XMLStringBuffer xmlBuffer, ITestResult testResult) {
 Object[] parameters = testResult.getParameters();
 if ((parameters != null) && (parameters.length > 0)) {
  xmlBuffer.push(XMLReporterConfig.TAG_PARAMS);
  for (int i = 0; i < parameters.length; i++) {
   addParameter(xmlBuffer, parameters[i], i);
  }
  xmlBuffer.pop();
 }
}
origin: org.testng/testng

@Override
public void generate(XMLStringBuffer xsb) {
 for (ISuite s : getSuites()) {
  xsb.push(D, C, "panel", "panel-name", getPanelName(s));
  xsb.push(D, C, "main-panel-header rounded-window-top");
  xsb.addOptional(S, getHeader(s), C, "header-content");
  xsb.pop(D);
  xsb.push(D, C, "main-panel-content rounded-window-bottom");
  xsb.addString(getContent(s, xsb));
  xsb.pop(D);
  xsb.pop(D);
 }
}
origin: org.testng/testng

private void writeSuiteToBuffer(XMLStringBuffer xmlBuffer, ISuite suite) {
 xmlBuffer.push(XMLReporterConfig.TAG_SUITE, getSuiteAttributes(suite));
 writeSuiteGroups(xmlBuffer, suite);
 Map<String, ISuiteResult> results = suite.getResults();
 XMLSuiteResultWriter suiteResultWriter = new XMLSuiteResultWriter(config);
 for (Map.Entry<String, ISuiteResult> result : results.entrySet()) {
  suiteResultWriter.writeSuiteResult(xmlBuffer, result.getValue());
 }
 xmlBuffer.pop();
}
origin: org.testng/testng

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();
 }
}
origin: org.testng/testng

private void addLinkTo(XMLStringBuffer header, INavigatorPanel panel, ISuite suite) {
 String text = panel.getNavigatorLink(suite);
 header.push("li");
 header.push("a", "href", "#",
   "panel-name", panel.getPanelName(suite),
   C, "navigator-link ");
 String className = panel.getClassName();
 if (className != null) {
  header.addOptional(S, text, C, className);
 } else {
  header.addOptional(S, text);
 }
 header.pop("a");
 header.pop("li");
}
origin: org.testng/testng

 public String toXml(String indent) {
  XMLStringBuffer xsb = new XMLStringBuffer(indent);
  if (hasElements(m_methodSelectors)) {
   xsb.push("method-selectors");
   for (XmlMethodSelector selector : m_methodSelectors) {
    xsb.getStringBuffer().append(selector.toXml(indent + "  "));
   }
 
   xsb.pop("method-selectors");
  }
  return xsb.toXML();
 }
}
origin: org.testng/testng

@Override
public String getContent(ISuite suite, XMLStringBuffer main) {
 XMLStringBuffer xsb = new XMLStringBuffer(main.getCurrentIndent());
 xsb.push("ul");
 for (XmlTest test : suite.getXmlSuite().getTests()) {
  xsb.push("li");
  int count = test.getXmlClasses().size();
  String name = test.getName() + " (" + pluralize(count, "class") + ")";
  xsb.addRequired(S, name, C, "test-name");
  xsb.pop("li");
 }
 xsb.pop("ul");
 return xsb.toXML();
}
origin: org.testng/testng

public String toXml(String indent) {
 XMLStringBuffer xsb = new XMLStringBuffer(indent);
 boolean hasElements = hasElements(m_includes);
 if (hasElements) {
  xsb.push("define", "name", m_name);
 }
 for (String s : m_includes) {
  xsb.addEmptyElement("include", "name", s);
 }
 if (hasElements) {
  xsb.pop("define");
 }
 return xsb.toXML();
}
origin: org.testng/testng

@Override
public void generate(XMLStringBuffer xsb) {
 xsb.push(D, C, "top-banner-root");
 xsb.addRequired(S, "Test results", C, "top-banner-title-font");
 xsb.addEmptyElement("br");
 int failedCount = getModel().getAllFailedResults().size();
 String testResult = failedCount > 0 ? ", " + pluralize(failedCount, "failed test") : "";
 String subTitle = pluralize(getModel().getSuites().size(), "suite")
   + testResult;
 xsb.addRequired(S, subTitle, C, "top-banner-font-1");
 xsb.pop(D);
}
origin: org.testng/testng

private void addTestResult(XMLStringBuffer xmlBuffer, ITestResult testResult) {
 Properties attribs = getTestResultAttributes(testResult);
 attribs.setProperty(XMLReporterConfig.ATTR_STATUS, getStatusString(testResult.getStatus()));
 xmlBuffer.push(XMLReporterConfig.TAG_TEST_METHOD, attribs);
 addTestMethodParams(xmlBuffer, testResult);
 addTestResultException(xmlBuffer, testResult);
 addTestResultOutput(xmlBuffer, testResult);
 if (config.isGenerateTestResultAttributes()) {
  addTestResultAttributes(xmlBuffer, testResult);
 }
 xmlBuffer.pop();
}
origin: org.testng/testng

@Override
public String getContent(ISuite suite, XMLStringBuffer main) {
 XMLStringBuffer xsb = new XMLStringBuffer(main.getCurrentIndent());
 xsb.push("pre");
 xsb.addString(Utils.escapeHtml(suite.getXmlSuite().toXml()));
 xsb.pop("pre");
 return xsb.toXML();
}
org.testng.reportersXMLStringBufferpush

Javadoc

Push a new tag. Its value is stored and will be compared against the parameter passed to pop().

Popular methods of XMLStringBuffer

  • <init>
  • pop
    Pop the last pushed element and throws an AssertionError if it doesn't match the corresponding tag t
  • addEmptyElement
  • toXML
  • addCDATA
    Add a CDATA tag.
  • addComment
  • addOptional
  • addRequired
  • getStringBuffer
  • setDocType
    Set the doctype for this document.
  • addString
  • createProperties
  • addString,
  • createProperties,
  • getCurrentIndent,
  • init,
  • setDefaultComment,
  • setXmlDetails,
  • toWriter

Popular in Java

  • Creating JSON documents from java classes using gson
  • onCreateOptionsMenu (Activity)
  • setScale (BigDecimal)
  • findViewById (Activity)
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now