Added check result attribute value in results schema and tests for results schema
[qa-tools:test-definition.git] / data / testdefinition-results.xsd
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!--
4     
5     This file is part of test-definition
6     
7     Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
8     
9     Contact: Sami Lahtinen <ext-sami.t.lahtinen@nokia.com>
10     
11     This package is free software; you can redistribute it and/or
12     modify it under the terms of the GNU Lesser General Public License
13     version 2.1 as published by the Free Software Foundation.
14     
15     This package is distributed in the hope that it will be useful, but
16     WITHOUT ANY WARRANTY; without even the implied warranty of
17     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18     Lesser General Public License for more details.
19     
20     You should have received a copy of the GNU Lesser General Public
21     License along with this library; if not, write to the Free Software
22     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
23     02110-1301 USA
24     
25   -->
26
27 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
28
29   <xs:attributeGroup name="general_attributes">
30     <xs:attribute name="name" use="required">
31       <xs:simpleType>
32         <xs:restriction base="xs:anyURI"/>
33       </xs:simpleType>
34     </xs:attribute>
35
36     <xs:attribute name="description"/>
37
38     <xs:attribute name="requirement"/>
39
40     <xs:attribute name="timeout" default="90" type="xs:positiveInteger"/>
41
42     <xs:attribute name="type" default="unknown"/>
43
44     <xs:attribute name="level" default="unknown"/>
45
46     <xs:attribute name="manual" default="false" type="xs:boolean" />
47
48     <xs:attribute name="insignificant" default="false" type="xs:boolean" />
49   </xs:attributeGroup>
50
51   <xs:element name="testresults">
52     <xs:complexType>
53       <xs:sequence>
54         <xs:element ref="suite" minOccurs="1" maxOccurs="unbounded" />
55       </xs:sequence>
56       <xs:attribute name="version" use="required" />
57       <xs:attribute name="environment" use="required" />
58       <xs:attribute name="hwproduct" use="required" />
59       <xs:attribute name="hwbuild" use="required" />
60     </xs:complexType>
61
62     <xs:unique name="uniqueSuiteName">
63       <xs:selector xpath=".//suite"/>
64       <xs:field xpath="@name"/>
65     </xs:unique>
66   </xs:element>
67
68   <xs:element name="suite">
69     <xs:complexType>
70       <xs:sequence>
71         <xs:element ref="set" minOccurs="0" maxOccurs="unbounded" />
72       </xs:sequence>
73       <xs:attributeGroup ref="general_attributes"/>
74     </xs:complexType>
75
76     <xs:unique name="uniqueSetName">
77       <xs:selector xpath=".//set"/>
78       <xs:field xpath="@name"/>
79     </xs:unique>
80   </xs:element>
81
82   <xs:element name="set">
83     <xs:complexType>
84       <xs:sequence>
85         <xs:element ref="case" minOccurs="0" maxOccurs="unbounded" />
86       </xs:sequence>
87
88       <xs:attributeGroup ref="general_attributes"/>
89       <xs:attribute name="feature"/>
90       <xs:attribute name="environment" />
91     </xs:complexType>
92
93     <xs:unique name="uniqueCaseName">
94       <xs:selector xpath=".//case"/>
95       <xs:field xpath="@name"/>
96     </xs:unique>
97   </xs:element>
98
99   <xs:element name="case">
100     <xs:complexType>
101       <xs:sequence>
102         <xs:element ref="step" minOccurs="0" maxOccurs="unbounded" />
103       </xs:sequence>
104
105       <xs:attributeGroup ref="general_attributes"/>
106       <xs:attribute name="result" use="required">
107         <xs:simpleType>
108           <xs:restriction base="xs:string">
109             <xs:enumeration value="FAIL" />
110             <xs:enumeration value="PASS" />
111             <xs:enumeration value="N/A" />
112           </xs:restriction>
113         </xs:simpleType>
114       </xs:attribute>
115       <xs:attribute name="subfeature"/>
116       <xs:attribute name="comment"/>
117     </xs:complexType>
118   </xs:element>
119
120   <xs:element name="step">
121     <xs:complexType>
122       <xs:sequence>
123         <xs:element name="expected_result" minOccurs="1" maxOccurs="1" />
124         <xs:element name="return_code" minOccurs="1" maxOccurs="1" />
125         <xs:element name="start" minOccurs="1" maxOccurs="1"/>
126         <xs:element name="end" minOccurs="1" maxOccurs="1" />
127         <xs:element name="stdout" minOccurs="0" maxOccurs="1" />
128         <xs:element name="stderr" minOccurs="0" maxOccurs="1" />
129       </xs:sequence>
130
131       <xs:attribute name="command" use="required" />
132       <xs:attribute name="result" use="required">
133         <xs:simpleType>
134           <xs:restriction base="xs:string">
135             <xs:enumeration value="FAIL" />
136             <xs:enumeration value="PASS" />
137             <xs:enumeration value="N/A" />
138           </xs:restriction>
139         </xs:simpleType>
140       </xs:attribute>
141       <xs:attribute name="failure_info" />
142     </xs:complexType>
143   </xs:element>
144
145 </xs:schema>