Class TestReportFormatter

java.lang.Object
cloud.opencode.base.test.report.TestReportFormatter

public final class TestReportFormatter extends Object
Test Report Formatter 测试报告格式化器

Formats test reports for output.

格式化测试报告以供输出。

Features | 主要功能:

  • Test report formatting - 测试报告格式化
  • Text, XML, Markdown output - 文本、XML、Markdown输出

Usage Examples | 使用示例:

String text = TestReportFormatter.toText(report);
String xml = TestReportFormatter.toJUnitXml(report);
String md = TestReportFormatter.toMarkdown(report);

Security | 安全性:

  • Thread-safe: Yes (stateless) - 线程安全: 是(无状态)

Performance | 性能特性:

  • Time complexity: O(n) where n is the number of test results - 时间复杂度: O(n),n 为测试结果数量
  • Space complexity: O(n) for output string buffer - 空间复杂度: O(n) 输出字符串缓冲区
Since:
JDK 25, opencode-base-test V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Method Details

    • toText

      public static String toText(TestReport report)
      Format as plain text 格式化为纯文本
      Parameters:
      report - the report | 报告
      Returns:
      the formatted text | 格式化文本
    • toJUnitXml

      public static String toJUnitXml(TestReport report)
      Format as JUnit XML 格式化为JUnit XML
      Parameters:
      report - the report | 报告
      Returns:
      the XML | XML
    • toMarkdown

      public static String toMarkdown(TestReport report)
      Format as markdown 格式化为Markdown
      Parameters:
      report - the report | 报告
      Returns:
      the markdown | Markdown