Open Test Reporting 0.2.0
The XML schemas of Open Test Reporting: one per namespace, for
the elements shared by both formats (core), the event-based and the hierarchical format, and the Java and Git
extensions. OpenTestReporting-0.2.0.xsd imports all of them and the JUnit Platform’s extension, so it validates
a file written by the JUnit Platform.
Read by pyEDAA.Reports.Unittesting.OpenTestReporting.Events.Document and
pyEDAA.Reports.Unittesting.OpenTestReporting.Hierarchy.Document - see Open Test Reporting.
The schemas of the core namespace, both formats, and the Java and Git extensions are unmodified copies of Open Test
Reporting’s schemas in schema/src/main/resources/org/opentest4j/reporting/schema (release
r0.2.7), licensed under the
Apache License 2.0. JUnit.xsd
declares the three elements of the JUnit Platform’s namespace https://schemas.junit.org/open-test-reporting, as
the JUnit Platform’s junit.xsd does.
Download
OpenTestReporting-0.2.0.xsd(1.1 kiB)core-0.2.0.xsd(5.7 kiB)events-0.2.0.xsd(1.4 kiB)hierarchy-0.2.0.xsd(1.2 kiB)java-0.2.0.xsd(2.3 kiB)git-0.2.0.xsd(2.1 kiB)JUnit.xsd(1.7 kiB)
Validate a report
All schema files in one directory:
xmllint --schema OpenTestReporting-0.2.0.xsd --noout open-test-report.xml
Source
OpenTestReporting-0.2.0.xsd
1<?xml version="1.0" encoding="utf-8" ?>
2<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
3 <xs:annotation>
4 <xs:documentation xml:lang="en">
5 Open Test Reporting 0.2.0: the event-based and the hierarchical format, with the Java, Git and JUnit Platform
6 extensions. The core, events, hierarchy, java and git schemas are copies of the schemas in
7 schema/src/main/resources/org/opentest4j/reporting/schema of https://github.com/ota4j-team/open-test-reporting
8 (release r0.2.7, Apache License 2.0).
9 </xs:documentation>
10 </xs:annotation>
11
12 <xs:import namespace="https://schemas.opentest4j.org/reporting/events/0.2.0" schemaLocation="events-0.2.0.xsd"/>
13 <xs:import namespace="https://schemas.opentest4j.org/reporting/hierarchy/0.2.0" schemaLocation="hierarchy-0.2.0.xsd"/>
14 <xs:import namespace="https://schemas.opentest4j.org/reporting/java/0.2.0" schemaLocation="java-0.2.0.xsd"/>
15 <xs:import namespace="https://schemas.opentest4j.org/reporting/git/0.2.0" schemaLocation="git-0.2.0.xsd"/>
16 <xs:import namespace="https://schemas.junit.org/open-test-reporting" schemaLocation="JUnit.xsd"/>
17</xs:schema>
core-0.2.0.xsd
1<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
2 xmlns:core="https://schemas.opentest4j.org/reporting/core/0.2.0"
3 targetNamespace="https://schemas.opentest4j.org/reporting/core/0.2.0"
4 elementFormDefault="qualified">
5 <xs:element name="infrastructure" type="core:Infrastructure"/>
6 <xs:complexType name="Infrastructure">
7 <xs:sequence>
8 <xs:element name="hostName" minOccurs="0" type="xs:string"/>
9 <xs:element name="userName" minOccurs="0" type="xs:string"/>
10 <xs:element name="operatingSystem" minOccurs="0" type="xs:string"/>
11 <xs:element name="cpuCores" minOccurs="0" type="xs:int"/>
12 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
13 </xs:sequence>
14 </xs:complexType>
15 <xs:complexType name="TestInfo">
16 <xs:sequence>
17 <xs:element name="metadata" minOccurs="0">
18 <xs:complexType>
19 <xs:sequence>
20 <xs:element name="tags" minOccurs="0">
21 <xs:complexType>
22 <xs:sequence>
23 <xs:element name="tag" type="xs:string" maxOccurs="unbounded"/>
24 </xs:sequence>
25 </xs:complexType>
26 </xs:element>
27 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
28 </xs:sequence>
29 </xs:complexType>
30 </xs:element>
31 <xs:element name="sources" minOccurs="0">
32 <xs:complexType>
33 <xs:sequence>
34 <xs:element name="directorySource" minOccurs="0" maxOccurs="unbounded">
35 <xs:complexType>
36 <xs:attribute name="path" type="xs:string" use="required"/>
37 </xs:complexType>
38 </xs:element>
39 <xs:element name="fileSource" minOccurs="0" maxOccurs="unbounded">
40 <xs:complexType>
41 <xs:sequence>
42 <xs:element name="filePosition" type="core:FilePosition" minOccurs="0"/>
43 </xs:sequence>
44 <xs:attribute name="path" type="xs:string" use="required"/>
45 </xs:complexType>
46 </xs:element>
47 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
48 </xs:sequence>
49 </xs:complexType>
50 </xs:element>
51 <xs:element name="attachments" minOccurs="0">
52 <xs:complexType>
53 <xs:sequence>
54 <xs:choice minOccurs="0" maxOccurs="unbounded">
55 <xs:element name="data">
56 <xs:complexType>
57 <xs:sequence>
58 <xs:element name="entry" minOccurs="0" maxOccurs="unbounded">
59 <xs:complexType>
60 <xs:simpleContent>
61 <xs:extension base="xs:string">
62 <xs:attribute name="key" type="xs:string" use="required"/>
63 </xs:extension>
64 </xs:simpleContent>
65 </xs:complexType>
66 </xs:element>
67 </xs:sequence>
68 <xs:attribute name="time" type="xs:dateTime" use="required"/>
69 </xs:complexType>
70 </xs:element>
71 <xs:element name="file">
72 <xs:complexType>
73 <xs:attribute name="time" type="xs:dateTime" use="required"/>
74 <xs:attribute name="path" type="xs:string" use="required"/>
75 <xs:attribute name="mediaType" type="xs:string">
76 <xs:annotation>
77 <xs:documentation>
78 The media type of the file content, e.g. 'text/plain' or 'application/json',
79 see https://www.iana.org/assignments/media-types/media-types.xhtml.
80 For text files, the charset should be specified in the 'charset' attribute,
81 e.g. 'text/plain; charset=utf-8'.
82 </xs:documentation>
83 </xs:annotation>
84 </xs:attribute>
85 </xs:complexType>
86 </xs:element>
87 <xs:element name="output">
88 <xs:complexType>
89 <xs:simpleContent>
90 <xs:extension base="xs:string">
91 <xs:attribute name="time" type="xs:dateTime" use="required"/>
92 <xs:attribute name="source" type="xs:string" use="required">
93 <xs:annotation>
94 <xs:documentation>
95 Typically 'stdout' or 'stderr' but may also be used for attaching other log output
96 </xs:documentation>
97 </xs:annotation>
98 </xs:attribute>
99 </xs:extension>
100 </xs:simpleContent>
101 </xs:complexType>
102 </xs:element>
103 <xs:any namespace="##other"/>
104 </xs:choice>
105 </xs:sequence>
106 </xs:complexType>
107 </xs:element>
108 <xs:element name="result" minOccurs="0">
109 <xs:complexType>
110 <xs:sequence>
111 <xs:element name="reason" type="xs:string" minOccurs="0"/>
112 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
113 </xs:sequence>
114 <xs:attribute name="status" type="core:Status"/>
115 </xs:complexType>
116 </xs:element>
117 </xs:sequence>
118 </xs:complexType>
119 <xs:simpleType name="Status">
120 <xs:restriction base="xs:string">
121 <xs:enumeration value="SUCCESSFUL"/>
122 <xs:enumeration value="SKIPPED"/>
123 <xs:enumeration value="ABORTED"/>
124 <xs:enumeration value="FAILED"/>
125 <xs:enumeration value="ERRORED"/>
126 </xs:restriction>
127 </xs:simpleType>
128 <xs:complexType name="FilePosition">
129 <xs:attribute name="line" type="xs:int" use="required"/>
130 <xs:attribute name="column" type="xs:int"/>
131 </xs:complexType>
132</xs:schema>
events-0.2.0.xsd
1<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
2 xmlns:core="https://schemas.opentest4j.org/reporting/core/0.2.0"
3 xmlns:e="https://schemas.opentest4j.org/reporting/events/0.2.0"
4 targetNamespace="https://schemas.opentest4j.org/reporting/events/0.2.0"
5 elementFormDefault="qualified">
6 <xs:import schemaLocation="core-0.2.0.xsd" namespace="https://schemas.opentest4j.org/reporting/core/0.2.0"/>
7 <xs:element name="events">
8 <xs:complexType>
9 <xs:sequence>
10 <xs:element ref="core:infrastructure" minOccurs="0"/>
11 <xs:choice minOccurs="0" maxOccurs="unbounded">
12 <xs:element name="started" type="e:Started"/>
13 <xs:element name="reported" type="e:Event"/>
14 <xs:element name="finished" type="e:Event"/>
15 </xs:choice>
16 </xs:sequence>
17 </xs:complexType>
18 </xs:element>
19 <xs:complexType name="Event">
20 <xs:complexContent>
21 <xs:extension base="core:TestInfo">
22 <xs:attribute name="id" type="xs:string" use="required"/>
23 <xs:attribute name="time" type="xs:dateTime" use="required"/>
24 </xs:extension>
25 </xs:complexContent>
26 </xs:complexType>
27 <xs:complexType name="Started">
28 <xs:complexContent>
29 <xs:extension base="e:Event">
30 <xs:attribute name="parentId" type="xs:string"/>
31 <xs:attribute name="name" type="xs:string" use="required"/>
32 </xs:extension>
33 </xs:complexContent>
34 </xs:complexType>
35</xs:schema>
hierarchy-0.2.0.xsd
1<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
2 xmlns:h="https://schemas.opentest4j.org/reporting/hierarchy/0.2.0"
3 xmlns:core="https://schemas.opentest4j.org/reporting/core/0.2.0"
4 targetNamespace="https://schemas.opentest4j.org/reporting/hierarchy/0.2.0"
5 elementFormDefault="qualified">
6 <xs:import schemaLocation="core-0.2.0.xsd" namespace="https://schemas.opentest4j.org/reporting/core/0.2.0"/>
7 <xs:element name="execution">
8 <xs:complexType>
9 <xs:sequence>
10 <xs:element ref="core:infrastructure" minOccurs="0"/>
11 <xs:element name="root" type="h:Node" minOccurs="0" maxOccurs="unbounded"/>
12 </xs:sequence>
13 </xs:complexType>
14 </xs:element>
15 <xs:complexType name="Node">
16 <xs:complexContent>
17 <xs:extension base="core:TestInfo">
18 <xs:sequence>
19 <xs:element name="child" type="h:Node" minOccurs="0" maxOccurs="unbounded"/>
20 </xs:sequence>
21 <xs:attribute name="duration" type="xs:duration"/>
22 <xs:attribute name="name" type="xs:string" use="required"/>
23 <xs:attribute name="start" type="xs:dateTime" use="required"/>
24 </xs:extension>
25 </xs:complexContent>
26 </xs:complexType>
27</xs:schema>
java-0.2.0.xsd
1<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
2 xmlns:core="https://schemas.opentest4j.org/reporting/core/0.2.0"
3 targetNamespace="https://schemas.opentest4j.org/reporting/java/0.2.0"
4 elementFormDefault="qualified">
5
6 <xs:import schemaLocation="core-0.2.0.xsd" namespace="https://schemas.opentest4j.org/reporting/core/0.2.0"/>
7
8 <!-- infrastructure -->
9 <xs:element name="javaVersion">
10 <xs:complexType>
11 <xs:simpleContent>
12 <xs:extension base="xs:string"/>
13 </xs:simpleContent>
14 </xs:complexType>
15 </xs:element>
16 <xs:element name="fileEncoding">
17 <xs:complexType>
18 <xs:simpleContent>
19 <xs:extension base="xs:string"/>
20 </xs:simpleContent>
21 </xs:complexType>
22 </xs:element>
23 <xs:element name="heapSize">
24 <xs:complexType>
25 <xs:attribute name="max" type="xs:string" use="required"/>
26 </xs:complexType>
27 </xs:element>
28
29 <!-- source -->
30 <xs:element name="classSource">
31 <xs:complexType>
32 <xs:all>
33 <xs:element name="filePosition" type="core:FilePosition" minOccurs="0"/>
34 </xs:all>
35 <xs:attribute name="className" type="xs:string" use="required"/>
36 </xs:complexType>
37 </xs:element>
38 <xs:element name="methodSource">
39 <xs:complexType>
40 <xs:attribute name="className" type="xs:string" use="required"/>
41 <xs:attribute name="methodName" type="xs:string" use="required"/>
42 <xs:attribute name="methodParameterTypes" type="xs:string"/>
43 </xs:complexType>
44 </xs:element>
45 <xs:element name="classpathResourceSource">
46 <xs:complexType>
47 <xs:all>
48 <xs:element name="filePosition" type="core:FilePosition" minOccurs="0"/>
49 </xs:all>
50 <xs:attribute name="resourceName" type="xs:string" use="required"/>
51 </xs:complexType>
52 </xs:element>
53 <xs:element name="packageSource">
54 <xs:complexType>
55 <xs:attribute name="name" type="xs:string" use="required"/>
56 </xs:complexType>
57 </xs:element>
58
59 <!-- result -->
60 <xs:element name="throwable">
61 <xs:complexType>
62 <xs:simpleContent>
63 <xs:extension base="xs:string">
64 <xs:attribute name="type" type="xs:string" use="required"/>
65 <xs:attribute name="assertionError" type="xs:boolean" use="required"/>
66 </xs:extension>
67 </xs:simpleContent>
68 </xs:complexType>
69 </xs:element>
70
71</xs:schema>
git-0.2.0.xsd
1<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
2 targetNamespace="https://schemas.opentest4j.org/reporting/git/0.2.0"
3 elementFormDefault="qualified">
4
5 <!-- infrastructure -->
6
7 <xs:element name="repository">
8 <xs:complexType>
9 <xs:attribute name="originUrl" use="required">
10 <xs:annotation>
11 <xs:documentation>the URL of the 'origin' remote of the Git repository</xs:documentation>
12 </xs:annotation>
13 <xs:simpleType>
14 <xs:union memberTypes="xs:anyURI">
15 <xs:simpleType>
16 <xs:restriction base="xs:string">
17 <xs:pattern value=".*:.*"/>
18 </xs:restriction>
19 </xs:simpleType>
20 </xs:union>
21 </xs:simpleType>
22 </xs:attribute>
23 </xs:complexType>
24 </xs:element>
25
26 <xs:element name="branch">
27 <xs:complexType>
28 <xs:simpleContent>
29 <xs:extension base="xs:string">
30 <xs:annotation>
31 <xs:documentation>the branch the HEAD commit is pointing to, if any</xs:documentation>
32 </xs:annotation>
33 </xs:extension>
34 </xs:simpleContent>
35 </xs:complexType>
36 </xs:element>
37
38 <xs:element name="commit">
39 <xs:complexType>
40 <xs:simpleContent>
41 <xs:extension base="xs:string">
42 <xs:annotation>
43 <xs:documentation>the commit hash</xs:documentation>
44 </xs:annotation>
45 </xs:extension>
46 </xs:simpleContent>
47 </xs:complexType>
48 </xs:element>
49
50 <xs:element name="status">
51 <xs:complexType>
52 <xs:simpleContent>
53 <xs:extension base="xs:string">
54 <xs:annotation>
55 <xs:documentation>the output of `git status --porcelain`, potentially empty</xs:documentation>
56 </xs:annotation>
57 <xs:attribute name="clean" type="xs:boolean" use="required">
58 <xs:annotation>
59 <xs:documentation>
60 whether the working directory clean contains no changes or untracked files
61 </xs:documentation>
62 </xs:annotation>
63 </xs:attribute>
64 </xs:extension>
65 </xs:simpleContent>
66 </xs:complexType>
67 </xs:element>
68
69</xs:schema>
JUnit.xsd
1<?xml version="1.0" encoding="utf-8" ?>
2<xs:schema
3 xmlns:xs="http://www.w3.org/2001/XMLSchema"
4 targetNamespace="https://schemas.junit.org/open-test-reporting"
5 elementFormDefault="qualified">
6 <xs:annotation>
7 <xs:documentation xml:lang="en">
8 The JUnit Platform's extension of Open Test Reporting: metadata of a test or container, written into the
9 'metadata' element of the core namespace. The JUnit Platform names the namespace's schema
10 'https://schemas.junit.org/open-test-reporting/junit-1.9.xsd'; its source is
11 junit-platform-reporting/src/main/resources/org/junit/platform/reporting/open/xml/junit.xsd in
12 https://github.com/junit-team/junit-framework. This schema declares the same three elements.
13 </xs:documentation>
14 </xs:annotation>
15
16 <xs:element name="uniqueId" type="xs:string">
17 <xs:annotation>
18 <xs:documentation xml:lang="en">
19 The unique ID of the test or container, e.g. '[engine:junit-jupiter]/[class:my.pack.MyClassTest]'.
20 </xs:documentation>
21 </xs:annotation>
22 </xs:element>
23
24 <xs:element name="legacyReportingName" type="xs:string">
25 <xs:annotation>
26 <xs:documentation xml:lang="en">
27 The name for reporting tools, which can't show a display name, e.g. a class or method name.
28 </xs:documentation>
29 </xs:annotation>
30 </xs:element>
31
32 <xs:element name="type">
33 <xs:annotation>
34 <xs:documentation xml:lang="en">
35 The kind of the test descriptor: a test, a container of tests, or both.
36 </xs:documentation>
37 </xs:annotation>
38 <xs:simpleType>
39 <xs:restriction base="xs:string">
40 <xs:enumeration value="TEST"/>
41 <xs:enumeration value="CONTAINER"/>
42 <xs:enumeration value="CONTAINER_AND_TEST"/>
43 </xs:restriction>
44 </xs:simpleType>
45 </xs:element>
46</xs:schema>