规格 用于 JUnit XML 输出

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/442556/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-06 12:17:48  来源:igfitidea点击:

Spec. for JUnit XML Output

xmlunit-testingjunit

提问by Gilad Naor

Where can I find the specification of JUnit's XML output. My goal is to write a UnitTest++ XML reporter which produced JUnit like output.

在哪里可以找到 JUnit 的 XML 输出规范。我的目标是编写一个 UnitTest++ XML 报告器,它产生类似 JUnit 的输出。

See: "Unable to get hudson to parse JUnit test output XML" and "Hudson, C++ and UnitTest++"

请参阅:“无法让 hudson 解析 JUnit 测试输出 XML”和“ Hudson、C++ 和 UnitTest++

回答by Tom Howard

You can find an XSD based on the code in Apache Ant 1.8.2 at https://github.com/windyroad/JUnit-Schema

您可以在https://github.com/windyroad/JUnit-Schema 中找到基于 Apache Ant 1.8.2 中的代码的 XSD

回答by Laurent Doré

The xml output is not generated by JUnit (at least, not the junit.jar), but by the junit ant task.
The relevant class is org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter.

xml 输出不是由JUnit(至少不是junit.jar)生成的,而是由junit ant 任务生成的。
相关类是org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter

回答by case nelson

As others have mentioned the xml is handled by ANT not jUnit

正如其他人所提到的,xml 是由 ANT 而不是 jUnit 处理的

Here's the best spec I've seen. From thispost

是我见过的最好的规格。从这个帖子

回答by guerda

I can only give you an general information.

我只能给你一个大概的信息。

In the sourcecode of JUnit, you will find your information. If you provide some more information, I can help you further. My personal hint for finding your specification would be junit.framework.TestResult.

JUnit源代码中,您会找到您的信息。如果您提供更多信息,我可以进一步帮助您。我个人对找到您的规范的提示是junit.framework.TestResult.

Good luck!

祝你好运!