blob: 2f0f90663a5ebd2f534c6833f390247a675c2df0 [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>
134
135
136 <!-- Zero or more expected errors for this query -->
137
138 <xs:element name="expected-error" minOccurs="0" maxOccurs="unbounded">
139 <xs:annotation>
140 <xs:documentation>
141 Zero or more expected errors for this query.
142 </xs:documentation>
143 </xs:annotation>
144
145 <xs:complexType>
146 <xs:simpleContent>
147 <xs:extension base="test:ErrorCode">
148 </xs:extension>
149 </xs:simpleContent>
150 </xs:complexType>
151 </xs:element>
152
153 </xs:sequence>
154
155 <!-- This name is always equal to the name of the test case -->
156 <xs:attribute name="name" type="xs:string" use="required"/>
157
158 </xs:complexType>
159 </xs:element>
160
161 <!-- Zero or more files containing expected results for this query -->
162
163 </xs:sequence>
164
165 <!-- The filename for this query can be constructed from: -->
166 <!-- the QueryOffsetPath -->
167 <!-- the FilePath -->
168 <!-- the name -->
169 <!-- the QueryFileExtension -->
170
171 <xs:attribute name="FilePath" type="test:SimplifiedRelativeFilePath" use="required"/>
172 <xs:attribute name="date" type="xs:date" use="required"/>
173 <xs:attribute name="category" type="test:category-enum"/>
174 </xs:complexType>
175
176 <!-- category-enum type -->
177 <!-- Identify which category of test this is. Currently only "slow". -->
178
179 <xs:simpleType name="category-enum">
180 <xs:annotation>
181 <xs:documentation>
182 Identify the category of test, for limiting when it is run.
183 </xs:documentation>
184 </xs:annotation>
185
186 <xs:restriction base="xs:string">
187 <xs:enumeration value="slow"/>
188 </xs:restriction>
189 </xs:simpleType>
190
191 <!-- comparison-enum type -->
192 <!-- Identify the type of comparison used to determine whether an -->
193 <!-- expected result and an actual result match. -->
194
195 <xs:simpleType name="comparison-enum">
196 <xs:annotation>
197 <xs:documentation>
198 Identify the type of comparison used to determine whether an
199 expected result and an actual result match.
200 </xs:documentation>
201 </xs:annotation>
202
203 <xs:restriction base="xs:string">
204 <xs:enumeration value="XML"/>
205 <xs:enumeration value="Text"/>
206 <xs:enumeration value="Inspect"/>
207 <xs:enumeration value="Ignore"/>
208 <xs:enumeration value="JSON"/>
209 <xs:enumeration value="CSV"/>
210 <xs:enumeration value="CSV_Header"/>
211 </xs:restriction>
212 </xs:simpleType>
213
214 <!-- description type -->
215
216 <xs:complexType name="description">
217 <xs:simpleContent>
218 <xs:extension base="xs:string">
219 <xs:attribute name="last-mod" type="xs:date"/>
220 </xs:extension>
221 </xs:simpleContent>
222 </xs:complexType>
223
224
225 <!-- ErrorCode type -->
226 <!-- * is used to mean that any error code is acceptable -->
227
228 <xs:simpleType name="ErrorCode">
229 <xs:annotation>
230 <xs:documentation>
231 * is used to mean that any error code is acceptable
232 </xs:documentation>
233 </xs:annotation>
234
235 <xs:restriction base="xs:string">
236 <xs:pattern value="\*|([A-Z]{4}[0-9]{4})"/>
237 </xs:restriction>
238 </xs:simpleType>
239
240</xs:schema>