gpt4 book ai didi

org.testng.reporters.XMLStringBuffer.setDocType()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 20:26:40 24 4
gpt4 key购买 nike

本文整理了Java中org.testng.reporters.XMLStringBuffer.setDocType()方法的一些代码示例,展示了XMLStringBuffer.setDocType()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLStringBuffer.setDocType()方法的具体详情如下:
包路径:org.testng.reporters.XMLStringBuffer
类名称:XMLStringBuffer
方法名:setDocType

XMLStringBuffer.setDocType介绍

[英]Set the doctype for this document.
[中]设置此文档的doctype。

代码示例

代码示例来源:origin: org.testng/testng

/**
 * TODO cquezel JavaDoc
 *
 * @return
 */
protected XMLStringBuffer createContentBuffer() {
 XMLStringBuffer suiteBuffer = new XMLStringBuffer();
 suiteBuffer.setDocType("suite SYSTEM \"" + Parser.TESTNG_DTD_URL + "\"");
 Properties attrs = new Properties();
 attrs.setProperty("parallel", XmlSuite.ParallelMode.NONE.toString());
 attrs.setProperty("name", m_suiteName);
 suiteBuffer.push("suite", attrs);
 if (m_parameters != null) {
  for (Map.Entry<String, String> entry : m_parameters.entrySet()) {
   Properties paramAttrs = new Properties();
   paramAttrs.setProperty("name", entry.getKey());
   paramAttrs.setProperty("value", entry.getValue());
   suiteBuffer.push("parameter", paramAttrs);
   suiteBuffer.pop("parameter");
  }
 }
 initContentBuffer(suiteBuffer);
 suiteBuffer.pop("suite");
 return suiteBuffer;
}

代码示例来源:origin: cbeust/testng

/**
 * TODO cquezel JavaDoc
 *
 * @return
 */
protected XMLStringBuffer createContentBuffer() {
 XMLStringBuffer suiteBuffer = new XMLStringBuffer();
 suiteBuffer.setDocType("suite SYSTEM \"" + Parser.TESTNG_DTD_URL + "\"");
 Properties attrs = new Properties();
 attrs.setProperty("parallel", XmlSuite.ParallelMode.NONE.toString());
 attrs.setProperty("name", m_suiteName);
 suiteBuffer.push("suite", attrs);
 if (m_parameters != null) {
  for (Map.Entry<String, String> entry : m_parameters.entrySet()) {
   Properties paramAttrs = new Properties();
   paramAttrs.setProperty("name", entry.getKey());
   paramAttrs.setProperty("value", entry.getValue());
   suiteBuffer.push("parameter", paramAttrs);
   suiteBuffer.pop("parameter");
  }
 }
 initContentBuffer(suiteBuffer);
 suiteBuffer.pop("suite");
 return suiteBuffer;
}

代码示例来源:origin: org.testng/testng

XMLStringBuffer xsb = new XMLStringBuffer();
xsb.setDefaultComment(defaultComment);
xsb.setDocType("suite SYSTEM \"" + Parser.TESTNG_DTD_URL + '\"');
Properties p = new Properties();
p.setProperty("name", xmlSuite.getName());

代码示例来源:origin: cbeust/testng

XMLStringBuffer xsb = new XMLStringBuffer();
xsb.setDefaultComment(defaultComment);
xsb.setDocType("suite SYSTEM \"" + Parser.TESTNG_DTD_URL + '\"');
Properties p = new Properties();
p.setProperty("name", xmlSuite.getName());

代码示例来源:origin: cbeust/testng-eclipse

private static XMLStringBuffer getSuiteBuffer(String name) {
 XMLStringBuffer xmlBuf = new XMLStringBuffer(); //$NON-NLS-1$
 xmlBuf.setDocType("suite SYSTEM " + Parser.TESTNG_DTD_URL);
 Properties attrs = new Properties();
 attrs.setProperty("name", name);
 xmlBuf.push("suite", attrs);
 return xmlBuf;
}

代码示例来源:origin: cbeust/testng-eclipse

protected XMLStringBuffer createContentBuffer() {
 PreferenceStoreUtil storage =
   new PreferenceStoreUtil(TestNGPlugin.getDefault().getPreferenceStore());
 String suiteTemplateFile = storage.getXmlTemplateFile(m_projectName, false /* not only project */);
 XMLStringBuffer suiteBuffer = new XMLStringBuffer(); //$NON-NLS-1$
 suiteBuffer.setDocType("suite SYSTEM \"" + Parser.TESTNG_DTD_URL + "\"");
 if (!Utils.isStringEmpty(suiteTemplateFile)) {
  try {
   IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
   String resolvedXmlFile = manager.performStringSubstitution(suiteTemplateFile);
   if (!(new Path(resolvedXmlFile).isAbsolute()) && !Utils.isStringEmpty(workingDir)) {
    resolvedXmlFile = workingDir + "/" + resolvedXmlFile;
   }
   createXmlFileFromTemplate(suiteBuffer, resolvedXmlFile);
  } catch (CoreException e) {
   throw new RuntimeException("Failed to create TestNG suite from \"Template XML File\" '"
       + suiteTemplateFile + "': " + e.getMessage(), e);
  }
 } else {
  createXmlFileFromParameters(suiteBuffer);
 }
 // Done with the top of the XML file, now generate the <test> elements
 initContentBuffer(suiteBuffer);
 suiteBuffer.pop("suite");
 return suiteBuffer;
}

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com