gpt4 book ai didi

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

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

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

XMLStringBuffer.getStringBuffer介绍

暂无

代码示例

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

/**
  * Saves the content of the string buffer to the specified file.
  *
  * @param file the file to write to.
  * @param content the content to write to the file.
  */
 protected void saveSuiteContent(final File file, final XMLStringBuffer content) {
  try (OutputStreamWriter fw = new OutputStreamWriter(new FileOutputStream(file), Charset.forName("UTF-8"))) {
   fw.write(content.getStringBuffer().toString());
  } catch (IOException ioe) {
   // TODO CQ is this normal to swallow exception here
   LOGGER.error("IO Exception", ioe);
  }
 }
}

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

/**
  * Saves the content of the string buffer to the specified file.
  *
  * @param file the file to write to.
  * @param content the content to write to the file.
  */
 protected void saveSuiteContent(final File file, final XMLStringBuffer content) {
  try (OutputStreamWriter fw =
    new OutputStreamWriter(new FileOutputStream(file), Charset.forName("UTF-8"))) {
   fw.write(content.getStringBuffer().toString());
  } catch (IOException ioe) {
   // TODO CQ is this normal to swallow exception here
   LOGGER.error("IO Exception", ioe);
  }
 }
}

代码示例来源: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

xsb.getStringBuffer().append(m.toXml(indent + "    "));

代码示例来源:origin: cbeust/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

xsb.getStringBuffer().append(d.toXml(indent2));
  xsb.getStringBuffer().append(m_run.toXml(indent2));
xsb.getStringBuffer().append(d.toXml(indent2));

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

public String toXml(String indent) {
 XMLStringBuffer xsb = new XMLStringBuffer(indent);
 Properties prop = new Properties();
 prop.setProperty("name", getName());
 boolean hasMethods = !m_includedMethods.isEmpty() || !m_excludedMethods.isEmpty();
 boolean hasParameters = !m_parameters.isEmpty();
 if (hasParameters || hasMethods) {
  xsb.push("class", prop);
  XmlUtils.dumpParameters(xsb, m_parameters);
  if (hasMethods) {
   xsb.push("methods");
   for (XmlInclude m : getIncludedMethods()) {
    xsb.getStringBuffer().append(m.toXml(indent + "    "));
   }
   for (String m : getExcludedMethods()) {
    Properties p = new Properties();
    p.setProperty("name", m);
    xsb.addEmptyElement("exclude", p);
   }
   xsb.pop("methods");
  }
  xsb.pop("class");
 } else {
  xsb.addEmptyElement("class", prop);
 }
 return xsb.toXML();
}

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

xsb.getStringBuffer().append(d.toXml(indent2));
xsb.getStringBuffer().append(m_run.toXml(indent2));
xsb.getStringBuffer().append(d.toXml(indent2));

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

xsb.push("method-selectors");
for (XmlMethodSelector selector: xmlTest.getMethodSelectors()) {
  xsb.getStringBuffer().append(selector.toXml(indent + "    "));
  xsb.getStringBuffer().append(pack.toXml("      "));
xsb.push("classes");
for (XmlClass cls : xmlTest.getXmlClasses()) {
  xsb.getStringBuffer().append(cls.toXml(indent + "    "));

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

xsb.getStringBuffer().append(pack.toXml("    "));
  xsb.getStringBuffer().append(xmlSuite.getXmlMethodSelectors().toXml("  "));
} else {
    xsb.push("method-selectors");
    for (XmlMethodSelector selector : xmlSuite.getMethodSelectors()) {
      xsb.getStringBuffer().append(selector.toXml("  "));
  xsb.getStringBuffer().append(xmlSuite.getGroups().toXml("  "));
  xsb.getStringBuffer().append(test.toXml("  "));

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

xsb.push("method-selectors");
for (XmlMethodSelector selector : xmlTest.getMethodSelectors()) {
 xsb.getStringBuffer().append(selector.toXml(indent + "    "));
 xsb.getStringBuffer().append(pack.toXml("      "));
xsb.push("classes");
for (XmlClass cls : xmlTest.getXmlClasses()) {
 xsb.getStringBuffer().append(cls.toXml(indent + "    "));

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

xsb.getStringBuffer().append(pack.toXml("    "));
 xsb.getStringBuffer().append(xmlSuite.getXmlMethodSelectors().toXml("  "));
} else {
  xsb.push("method-selectors");
  for (XmlMethodSelector selector : xmlSuite.getMethodSelectors()) {
   xsb.getStringBuffer().append(selector.toXml("  "));
 xsb.getStringBuffer().append(xmlSuite.getGroups().toXml("  "));
 xsb.getStringBuffer().append(test.toXml("  "));

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

fw = new FileWriter(file);
bw = new BufferedWriter(fw);
bw.write(xmlBuffer.getStringBuffer().toString());
bw.flush();

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

protected void saveSuiteContent(final File file, final XMLStringBuffer content) {
 FileOutputStream fileOutputStream = null;
 BufferedOutputStream bufferedOutputStream = null;
 OutputStreamWriter osw = null;
 try {
  fileOutputStream = new FileOutputStream(file);
  bufferedOutputStream = new BufferedOutputStream(fileOutputStream);
  // use utf8 to solve special character problem
  osw = new OutputStreamWriter(bufferedOutputStream, Charset.forName("UTF-8"));
  osw.write(content.getStringBuffer().toString());
 } catch (IOException ioException) {
  TestNGPlugin.log(ioException);
 } finally {
   try {
     if (osw != null) osw.close();
     if (bufferedOutputStream != null) bufferedOutputStream.close();
     if (fileOutputStream != null) fileOutputStream.close();
   } catch (Exception e) {
    TestNGPlugin.log(e);
   }
 }
}

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