blob: 80836a39aabe1a6d2b22157b73f1d66688e8c635 [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
40 <xs:attribute name="CatalogDesignDate" type="xs:date" use="required"/>
41
42 <xs:attribute name="ResultOffsetPath" type="test:SimplifiedRelativeFilePath" use="required">
43 <xs:annotation>
44 <xs:documentation>
45 offset from root to results
46 </xs:documentation>
47 </xs:annotation>
48 </xs:attribute>
49
50 <xs:attribute name="QueryOffsetPath" type="test:SimplifiedRelativeFilePath"
51 use="required">
52 <xs:annotation>
53 <xs:documentation>
54 offset from root to Query expression files
55 </xs:documentation>
56 </xs:annotation>
57 </xs:attribute>
58
59 </xs:complexType>
60
61 <xs:unique name="unique-test-group">
62 <xs:selector xpath=".//test:test-group"/>
63 <xs:field xpath="@name"/>
64 </xs:unique>
65
66 </xs:element>
67
68
69 <!-- SimplifiedRelativeFilePath type -->
70
71 <xs:simpleType name="SimplifiedRelativeFilePath">
72 <xs:restriction base="xs:anyURI">
73 <xs:pattern value="([a-zA-Z0-9\-\.]+/)+"/>
74 </xs:restriction>
75 </xs:simpleType>
76
77 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
78 <!-- test-group -->
79 <!-- -->
80 <!-- Group of test cases and test groups. -->
81 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
82
83 <xs:element name="test-group">
84 <xs:annotation>
85 <xs:documentation>
86 Group of test cases and test groups.
87 </xs:documentation>
88 </xs:annotation>
89
90 <xs:complexType>
91 <xs:sequence>
92 <xs:element name="test-case" type="test:test-case" minOccurs="0" maxOccurs="unbounded">
93 <xs:unique name="unique-expected-error">
94 <xs:selector xpath=".//test:expected-error"/>
95 <xs:field xpath="."/>
96 </xs:unique>
97 </xs:element>
98
99 <xs:element ref="test:test-group" minOccurs="0" maxOccurs="unbounded"/>
100 </xs:sequence>
101 <xs:attribute name="name" type="xs:string" use="required"/>
102 </xs:complexType>
103 </xs:element>
104
105
106 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
107 <!-- test-case -->
108 <!-- -->
109 <!-- A test case to be run. -->
110 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
111
112 <xs:complexType name="test-case">
113 <xs:sequence>
114 <xs:element name="description" type="test:description"/>
115
116 <xs:element name="compilation-unit" minOccurs="1" maxOccurs="unbounded">
117 <xs:complexType>
118 <xs:sequence>
119 <xs:element name="description" type="test:description" minOccurs="0"/>
120 <xs:element name="output-dir" minOccurs="0">
121 <xs:annotation>
122 <xs:documentation>
123 Zero or one file containing expected results for this query.
124 </xs:documentation>
125 </xs:annotation>
126 <xs:complexType>
127 <xs:simpleContent>
128 <xs:extension base="xs:string">
129 <xs:attribute name="compare" type="test:comparison-enum" use="required"/>
130 </xs:extension>
131 </xs:simpleContent>
132 </xs:complexType>
133 </xs:element>
Chris Hillery55f26c72015-11-05 22:28:00 -0800134 <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded">
135 <xs:annotation>
136 <xs:documentation>
137 Parameter to send to the HTTP API.
138 </xs:documentation>
139 </xs:annotation>
140 <xs:complexType>
141 <xs:attribute name="name" type="xs:string" />
142 <xs:attribute name="value" type="xs:string" />
143 </xs:complexType>
144 </xs:element>
Chris Hilleryd6f78282015-04-30 17:07:05 -0700145
146 <!-- Zero or more expected errors for this query -->
147
148 <xs:element name="expected-error" minOccurs="0" maxOccurs="unbounded">
149 <xs:annotation>
150 <xs:documentation>
151 Zero or more expected errors for this query.
152 </xs:documentation>
153 </xs:annotation>
154
155 <xs:complexType>
156 <xs:simpleContent>
157 <xs:extension base="test:ErrorCode">
158 </xs:extension>
159 </xs:simpleContent>
160 </xs:complexType>
161 </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"/>
182 <xs:attribute name="date" type="xs:date" use="required"/>
183 <xs:attribute name="category" type="test:category-enum"/>
184 </xs:complexType>
185
186 <!-- category-enum type -->
187 <!-- Identify which category of test this is. Currently only "slow". -->
188
189 <xs:simpleType name="category-enum">
190 <xs:annotation>
191 <xs:documentation>
192 Identify the category of test, for limiting when it is run.
193 </xs:documentation>
194 </xs:annotation>
195
196 <xs:restriction base="xs:string">
197 <xs:enumeration value="slow"/>
198 </xs:restriction>
199 </xs:simpleType>
200
201 <!-- comparison-enum type -->
202 <!-- Identify the type of comparison used to determine whether an -->
203 <!-- expected result and an actual result match. -->
204
205 <xs:simpleType name="comparison-enum">
206 <xs:annotation>
207 <xs:documentation>
208 Identify the type of comparison used to determine whether an
209 expected result and an actual result match.
210 </xs:documentation>
211 </xs:annotation>
212
213 <xs:restriction base="xs:string">
214 <xs:enumeration value="XML"/>
215 <xs:enumeration value="Text"/>
216 <xs:enumeration value="Inspect"/>
217 <xs:enumeration value="Ignore"/>
Chris Hilleryf4a1c3c2015-08-20 18:33:06 -0700218 <xs:enumeration value="Clean-JSON"/>
219 <xs:enumeration value="Lossless-JSON"/>
Chris Hilleryd6f78282015-04-30 17:07:05 -0700220 <xs:enumeration value="CSV"/>
221 <xs:enumeration value="CSV_Header"/>
Yingyi Bu391f09e2015-10-29 13:49:39 -0700222 <xs:enumeration value="AST"/>
223 <xs:enumeration value="PLAN"/>
Chris Hilleryd6f78282015-04-30 17:07:05 -0700224 </xs:restriction>
225 </xs:simpleType>
226
227 <!-- description type -->
228
229 <xs:complexType name="description">
230 <xs:simpleContent>
231 <xs:extension base="xs:string">
232 <xs:attribute name="last-mod" type="xs:date"/>
233 </xs:extension>
234 </xs:simpleContent>
235 </xs:complexType>
236
237
238 <!-- ErrorCode type -->
239 <!-- * is used to mean that any error code is acceptable -->
240
241 <xs:simpleType name="ErrorCode">
242 <xs:annotation>
243 <xs:documentation>
244 * is used to mean that any error code is acceptable
245 </xs:documentation>
246 </xs:annotation>
247
248 <xs:restriction base="xs:string">
249 <xs:pattern value="\*|([A-Z]{4}[0-9]{4})"/>
250 </xs:restriction>
251 </xs:simpleType>
Chris Hilleryf4a1c3c2015-08-20 18:33:06 -0700252
Chris Hilleryd6f78282015-04-30 17:07:05 -0700253</xs:schema>