blob: 763309e547fbdbe07f7d02cb830d0989f9dbe4fd [file] [log] [blame]
vinayakb93b76682012-10-06 03:38:51 +00001<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
2 xmlns:test="urn:xml.testframework.asterix.ics.uci.edu"
3 targetNamespace="urn:xml.testframework.asterix.ics.uci.edu" elementFormDefault="qualified">
4
5 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
6 <!-- test-suite - top level element -->
7 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
8
9 <xs:element name="test-suite">
10 <xs:annotation>
11 <xs:documentation>
12 This is the top level element for documents that use this schema.
13 </xs:documentation>
14 </xs:annotation>
15
16 <xs:complexType>
17 <xs:sequence>
18 <xs:element ref="test:test-group" maxOccurs="unbounded"/>
19 </xs:sequence>
20
21 <xs:attribute name="CatalogDesignDate" type="xs:date" use="required"/>
22
23 <xs:attribute name="ResultOffsetPath" type="test:SimplifiedRelativeFilePath" use="required">
24 <xs:annotation>
25 <xs:documentation>
26 offset from root to results
27 </xs:documentation>
28 </xs:annotation>
29 </xs:attribute>
30
31 <xs:attribute name="QueryOffsetPath" type="test:SimplifiedRelativeFilePath"
32 use="required">
33 <xs:annotation>
34 <xs:documentation>
35 offset from root to Query expression files
36 </xs:documentation>
37 </xs:annotation>
38 </xs:attribute>
39
vinayakb93b76682012-10-06 03:38:51 +000040 </xs:complexType>
41
42 <xs:unique name="unique-test-group">
43 <xs:selector xpath=".//test:test-group"/>
44 <xs:field xpath="@name"/>
45 </xs:unique>
46
47 </xs:element>
48
49
50 <!-- SimplifiedRelativeFilePath type -->
51
52 <xs:simpleType name="SimplifiedRelativeFilePath">
53 <xs:restriction base="xs:anyURI">
54 <xs:pattern value="([a-zA-Z0-9\-\.]+/)+"/>
55 </xs:restriction>
56 </xs:simpleType>
57
58 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
59 <!-- test-group -->
60 <!-- -->
61 <!-- Group of test cases and test groups. -->
62 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
63
64 <xs:element name="test-group">
65 <xs:annotation>
66 <xs:documentation>
67 Group of test cases and test groups.
68 </xs:documentation>
69 </xs:annotation>
70
71 <xs:complexType>
72 <xs:sequence>
73 <xs:element name="test-case" type="test:test-case" minOccurs="0" maxOccurs="unbounded">
74 <xs:unique name="unique-expected-error">
75 <xs:selector xpath=".//test:expected-error"/>
76 <xs:field xpath="."/>
77 </xs:unique>
78 </xs:element>
79
80 <xs:element ref="test:test-group" minOccurs="0" maxOccurs="unbounded"/>
81 </xs:sequence>
82 <xs:attribute name="name" type="xs:string" use="required"/>
83 </xs:complexType>
84 </xs:element>
85
86
87 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
88 <!-- test-case -->
89 <!-- -->
90 <!-- A test case to be run. -->
91 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
92
93 <xs:complexType name="test-case">
94 <xs:sequence>
95 <xs:element name="description" type="test:description"/>
96
97 <xs:element name="compilation-unit" minOccurs="1" maxOccurs="unbounded">
98 <xs:complexType>
99 <xs:sequence>
100 <xs:element name="description" type="test:description" minOccurs="0"/>
khfaraaz82@gmail.comd8b3b902013-03-09 01:05:01 +0000101 <xs:element name="output-dir" minOccurs="0">
vinayakb93b76682012-10-06 03:38:51 +0000102 <xs:annotation>
103 <xs:documentation>
104 Zero or one file containing expected results for this query.
105 </xs:documentation>
106 </xs:annotation>
107 <xs:complexType>
108 <xs:simpleContent>
109 <xs:extension base="xs:string">
110 <xs:attribute name="compare" type="test:comparison-enum" use="required"/>
111 </xs:extension>
112 </xs:simpleContent>
113 </xs:complexType>
114 </xs:element>
115
116
117 <!-- Zero or more expected errors for this query -->
118
119 <xs:element name="expected-error" minOccurs="0" maxOccurs="unbounded">
120 <xs:annotation>
121 <xs:documentation>
122 Zero or more expected errors for this query.
123 </xs:documentation>
124 </xs:annotation>
125
126 <xs:complexType>
127 <xs:simpleContent>
128 <xs:extension base="test:ErrorCode">
129 </xs:extension>
130 </xs:simpleContent>
131 </xs:complexType>
132 </xs:element>
133
134 </xs:sequence>
135
136 <!-- This name is always equal to the name of the test case -->
137 <xs:attribute name="name" type="xs:string" use="required"/>
Chris Hillery1cef8a92014-01-31 02:45:20 -0800138
vinayakb93b76682012-10-06 03:38:51 +0000139 </xs:complexType>
140 </xs:element>
141
142 <!-- Zero or more files containing expected results for this query -->
143
144 </xs:sequence>
145
146 <!-- The filename for this query can be constructed from: -->
147 <!-- the QueryOffsetPath -->
148 <!-- the FilePath -->
149 <!-- the name -->
150 <!-- the QueryFileExtension -->
151
152 <xs:attribute name="FilePath" type="test:SimplifiedRelativeFilePath" use="required"/>
153 <xs:attribute name="date" type="xs:date" use="required"/>
Chris Hillery1cef8a92014-01-31 02:45:20 -0800154 <xs:attribute name="category" type="test:category-enum"/>
vinayakb93b76682012-10-06 03:38:51 +0000155 </xs:complexType>
156
Chris Hillery1cef8a92014-01-31 02:45:20 -0800157 <!-- category-enum type -->
158 <!-- Identify which category of test this is. Currently only "slow". -->
159
160 <xs:simpleType name="category-enum">
161 <xs:annotation>
162 <xs:documentation>
163 Identify the category of test, for limiting when it is run.
164 </xs:documentation>
165 </xs:annotation>
166
167 <xs:restriction base="xs:string">
168 <xs:enumeration value="slow"/>
169 </xs:restriction>
170 </xs:simpleType>
171
vinayakb93b76682012-10-06 03:38:51 +0000172 <!-- comparison-enum type -->
173 <!-- Identify the type of comparison used to determine whether an -->
174 <!-- expected result and an actual result match. -->
175
176 <xs:simpleType name="comparison-enum">
177 <xs:annotation>
178 <xs:documentation>
179 Identify the type of comparison used to determine whether an
180 expected result and an actual result match.
181 </xs:documentation>
182 </xs:annotation>
183
184 <xs:restriction base="xs:string">
185 <xs:enumeration value="XML"/>
186 <xs:enumeration value="Text"/>
187 <xs:enumeration value="Inspect"/>
188 <xs:enumeration value="Ignore"/>
189 </xs:restriction>
190 </xs:simpleType>
191
192 <!-- description type -->
193
194 <xs:complexType name="description">
195 <xs:simpleContent>
196 <xs:extension base="xs:string">
197 <xs:attribute name="last-mod" type="xs:date"/>
198 </xs:extension>
199 </xs:simpleContent>
200 </xs:complexType>
201
202
203 <!-- ErrorCode type -->
204 <!-- * is used to mean that any error code is acceptable -->
205
206 <xs:simpleType name="ErrorCode">
207 <xs:annotation>
208 <xs:documentation>
209 * is used to mean that any error code is acceptable
210 </xs:documentation>
211 </xs:annotation>
212
213 <xs:restriction base="xs:string">
214 <xs:pattern value="\*|([A-Z]{4}[0-9]{4})"/>
215 </xs:restriction>
216 </xs:simpleType>
217
218</xs:schema>