blob: a18f41c352393a06cf5e655912b91d65de1d0f61 [file] [log] [blame]
Till Westmann5b431ca2015-10-01 19:16:11 -07001<!--
2 ! Licensed to the Apache Software Foundation (ASF) under one
3 ! or more contributor license agreements. See the NOTICE file
4 ! distributed with this work for additional information
5 ! regarding copyright ownership. The ASF licenses this file
6 ! to you under the Apache License, Version 2.0 (the
7 ! "License"); you may not use this file except in compliance
8 ! with the License. You may obtain a copy of the License at
9 !
10 ! http://www.apache.org/licenses/LICENSE-2.0
11 !
12 ! Unless required by applicable law or agreed to in writing,
13 ! software distributed under the License is distributed on an
14 ! "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 ! KIND, either express or implied. See the License for the
16 ! specific language governing permissions and limitations
17 ! under the License.
18 !-->
19
Chris Hilleryd6f78282015-04-30 17:07:05 -070020<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
Ian Maxonf18bba22015-08-21 12:35:14 -070021 xmlns:test="urn:xml.testframework.asterix.apache.org"
22 targetNamespace="urn:xml.testframework.asterix.apache.org" elementFormDefault="qualified">
Chris Hilleryd6f78282015-04-30 17:07:05 -070023
24 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
25 <!-- test-suite - top level element -->
26 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
27
28 <xs:element name="test-suite">
29 <xs:annotation>
30 <xs:documentation>
31 This is the top level element for documents that use this schema.
32 </xs:documentation>
33 </xs:annotation>
34
35 <xs:complexType>
36 <xs:sequence>
37 <xs:element ref="test:test-group" maxOccurs="unbounded"/>
38 </xs:sequence>
39
Chris Hilleryd6f78282015-04-30 17:07:05 -070040 <xs:attribute name="ResultOffsetPath" type="test:SimplifiedRelativeFilePath" use="required">
41 <xs:annotation>
42 <xs:documentation>
43 offset from root to results
44 </xs:documentation>
45 </xs:annotation>
46 </xs:attribute>
47
48 <xs:attribute name="QueryOffsetPath" type="test:SimplifiedRelativeFilePath"
49 use="required">
50 <xs:annotation>
51 <xs:documentation>
52 offset from root to Query expression files
53 </xs:documentation>
54 </xs:annotation>
55 </xs:attribute>
56
Ildar Absalyamov53266582016-03-11 16:46:14 -080057 <xs:attribute name="QueryFileExtension" type="xs:string"
58 use="required">
59 <xs:annotation>
60 <xs:documentation>
61 extension of query expression files
62 </xs:documentation>
63 </xs:annotation>
64 </xs:attribute>
65
Chris Hilleryd6f78282015-04-30 17:07:05 -070066 </xs:complexType>
67
68 <xs:unique name="unique-test-group">
69 <xs:selector xpath=".//test:test-group"/>
70 <xs:field xpath="@name"/>
71 </xs:unique>
72
73 </xs:element>
74
75
76 <!-- SimplifiedRelativeFilePath type -->
77
78 <xs:simpleType name="SimplifiedRelativeFilePath">
79 <xs:restriction base="xs:anyURI">
Ildar Absalyamov53266582016-03-11 16:46:14 -080080 <xs:pattern value="([a-zA-Z0-9\-_\.]+\/?)+"/>
Chris Hilleryd6f78282015-04-30 17:07:05 -070081 </xs:restriction>
82 </xs:simpleType>
83
84 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
85 <!-- test-group -->
86 <!-- -->
87 <!-- Group of test cases and test groups. -->
88 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
89
90 <xs:element name="test-group">
91 <xs:annotation>
92 <xs:documentation>
93 Group of test cases and test groups.
94 </xs:documentation>
95 </xs:annotation>
96
97 <xs:complexType>
98 <xs:sequence>
99 <xs:element name="test-case" type="test:test-case" minOccurs="0" maxOccurs="unbounded">
100 <xs:unique name="unique-expected-error">
101 <xs:selector xpath=".//test:expected-error"/>
102 <xs:field xpath="."/>
103 </xs:unique>
104 </xs:element>
105
106 <xs:element ref="test:test-group" minOccurs="0" maxOccurs="unbounded"/>
107 </xs:sequence>
108 <xs:attribute name="name" type="xs:string" use="required"/>
109 </xs:complexType>
110 </xs:element>
111
112
113 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
114 <!-- test-case -->
115 <!-- -->
116 <!-- A test case to be run. -->
117 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
118
119 <xs:complexType name="test-case">
120 <xs:sequence>
Ildar Absalyamov53266582016-03-11 16:46:14 -0800121 <xs:element name="description" type="test:description" minOccurs="0" />
Chris Hilleryd6f78282015-04-30 17:07:05 -0700122
123 <xs:element name="compilation-unit" minOccurs="1" maxOccurs="unbounded">
124 <xs:complexType>
125 <xs:sequence>
126 <xs:element name="description" type="test:description" minOccurs="0"/>
Ildar Absalyamov53266582016-03-11 16:46:14 -0800127 <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded">
128 <xs:annotation>
129 <xs:documentation>
130 Parameter to send to the HTTP API.
131 </xs:documentation>
132 </xs:annotation>
133 <xs:complexType>
134 <xs:attribute name="name" type="xs:string" />
135 <xs:attribute name="value" type="xs:string" />
136 </xs:complexType>
137 </xs:element>
Chris Hilleryd6f78282015-04-30 17:07:05 -0700138 <xs:element name="output-dir" minOccurs="0">
139 <xs:annotation>
140 <xs:documentation>
141 Zero or one file containing expected results for this query.
142 </xs:documentation>
143 </xs:annotation>
144 <xs:complexType>
145 <xs:simpleContent>
146 <xs:extension base="xs:string">
147 <xs:attribute name="compare" type="test:comparison-enum" use="required"/>
148 </xs:extension>
149 </xs:simpleContent>
150 </xs:complexType>
151 </xs:element>
Chris Hilleryd6f78282015-04-30 17:07:05 -0700152
153 <!-- Zero or more expected errors for this query -->
154
Ildar Absalyamov53266582016-03-11 16:46:14 -0800155 <xs:element name="expected-error" type="xs:string" minOccurs="0" maxOccurs="unbounded">
Chris Hilleryd6f78282015-04-30 17:07:05 -0700156 <xs:annotation>
157 <xs:documentation>
158 Zero or more expected errors for this query.
159 </xs:documentation>
160 </xs:annotation>
Chris Hilleryd6f78282015-04-30 17:07:05 -0700161 </xs:element>
162
163 </xs:sequence>
164
165 <!-- This name is always equal to the name of the test case -->
166 <xs:attribute name="name" type="xs:string" use="required"/>
167
168 </xs:complexType>
169 </xs:element>
170
171 <!-- Zero or more files containing expected results for this query -->
172
173 </xs:sequence>
174
175 <!-- The filename for this query can be constructed from: -->
176 <!-- the QueryOffsetPath -->
177 <!-- the FilePath -->
178 <!-- the name -->
179 <!-- the QueryFileExtension -->
180
181 <xs:attribute name="FilePath" type="test:SimplifiedRelativeFilePath" use="required"/>
Chris Hilleryd6f78282015-04-30 17:07:05 -0700182 <xs:attribute name="category" type="test:category-enum"/>
183 </xs:complexType>
184
185 <!-- category-enum type -->
186 <!-- Identify which category of test this is. Currently only "slow". -->
187
188 <xs:simpleType name="category-enum">
189 <xs:annotation>
190 <xs:documentation>
191 Identify the category of test, for limiting when it is run.
192 </xs:documentation>
193 </xs:annotation>
194
195 <xs:restriction base="xs:string">
196 <xs:enumeration value="slow"/>
197 </xs:restriction>
198 </xs:simpleType>
199
200 <!-- comparison-enum type -->
201 <!-- Identify the type of comparison used to determine whether an -->
202 <!-- expected result and an actual result match. -->
203
204 <xs:simpleType name="comparison-enum">
205 <xs:annotation>
206 <xs:documentation>
207 Identify the type of comparison used to determine whether an
208 expected result and an actual result match.
209 </xs:documentation>
210 </xs:annotation>
211
212 <xs:restriction base="xs:string">
213 <xs:enumeration value="XML"/>
214 <xs:enumeration value="Text"/>
215 <xs:enumeration value="Inspect"/>
216 <xs:enumeration value="Ignore"/>
Chris Hilleryf4a1c3c2015-08-20 18:33:06 -0700217 <xs:enumeration value="Clean-JSON"/>
218 <xs:enumeration value="Lossless-JSON"/>
Chris Hilleryd6f78282015-04-30 17:07:05 -0700219 <xs:enumeration value="CSV"/>
220 <xs:enumeration value="CSV_Header"/>
Yingyi Bu391f09e2015-10-29 13:49:39 -0700221 <xs:enumeration value="AST"/>
222 <xs:enumeration value="PLAN"/>
Chris Hilleryd6f78282015-04-30 17:07:05 -0700223 </xs:restriction>
224 </xs:simpleType>
225
226 <!-- description type -->
227
228 <xs:complexType name="description">
229 <xs:simpleContent>
230 <xs:extension base="xs:string">
231 <xs:attribute name="last-mod" type="xs:date"/>
232 </xs:extension>
233 </xs:simpleContent>
234 </xs:complexType>
235
236
237 <!-- ErrorCode type -->
238 <!-- * is used to mean that any error code is acceptable -->
239
240 <xs:simpleType name="ErrorCode">
241 <xs:annotation>
242 <xs:documentation>
243 * is used to mean that any error code is acceptable
244 </xs:documentation>
245 </xs:annotation>
246
247 <xs:restriction base="xs:string">
248 <xs:pattern value="\*|([A-Z]{4}[0-9]{4})"/>
249 </xs:restriction>
250 </xs:simpleType>
Chris Hilleryf4a1c3c2015-08-20 18:33:06 -0700251
Chris Hilleryd6f78282015-04-30 17:07:05 -0700252</xs:schema>