blob: feadbd7b2084d2545ba80cbf8c1b51c0cc29a30b [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
40 <!-- file extension for XQuery expression files -->
41 <xs:attribute name="QueryFileExtension" type="xs:string" use="required">
42 <xs:annotation>
43 <xs:documentation>
44 file extension for Query files
45 </xs:documentation>
46 </xs:annotation>
47 </xs:attribute>
48
49 </xs:complexType>
50
51 <xs:unique name="unique-test-group">
52 <xs:selector xpath=".//test:test-group"/>
53 <xs:field xpath="@name"/>
54 </xs:unique>
55
56 </xs:element>
57
58
59 <!-- SimplifiedRelativeFilePath type -->
60
61 <xs:simpleType name="SimplifiedRelativeFilePath">
62 <xs:restriction base="xs:anyURI">
63 <xs:pattern value="([a-zA-Z0-9\-\.]+/)+"/>
64 </xs:restriction>
65 </xs:simpleType>
66
67 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
68 <!-- test-group -->
69 <!-- -->
70 <!-- Group of test cases and test groups. -->
71 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
72
73 <xs:element name="test-group">
74 <xs:annotation>
75 <xs:documentation>
76 Group of test cases and test groups.
77 </xs:documentation>
78 </xs:annotation>
79
80 <xs:complexType>
81 <xs:sequence>
82 <xs:element name="test-case" type="test:test-case" minOccurs="0" maxOccurs="unbounded">
83 <xs:unique name="unique-expected-error">
84 <xs:selector xpath=".//test:expected-error"/>
85 <xs:field xpath="."/>
86 </xs:unique>
87 </xs:element>
88
89 <xs:element ref="test:test-group" minOccurs="0" maxOccurs="unbounded"/>
90 </xs:sequence>
91 <xs:attribute name="name" type="xs:string" use="required"/>
92 </xs:complexType>
93 </xs:element>
94
95
96 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
97 <!-- test-case -->
98 <!-- -->
99 <!-- A test case to be run. -->
100 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
101
102 <xs:complexType name="test-case">
103 <xs:sequence>
104 <xs:element name="description" type="test:description"/>
105
106 <xs:element name="compilation-unit" minOccurs="1" maxOccurs="unbounded">
107 <xs:complexType>
108 <xs:sequence>
109 <xs:element name="description" type="test:description" minOccurs="0"/>
110 <xs:element name="output-file" minOccurs="0">
111 <xs:annotation>
112 <xs:documentation>
113 Zero or one file containing expected results for this query.
114 </xs:documentation>
115 </xs:annotation>
116 <xs:complexType>
117 <xs:simpleContent>
118 <xs:extension base="xs:string">
119 <xs:attribute name="compare" type="test:comparison-enum" use="required"/>
120 </xs:extension>
121 </xs:simpleContent>
122 </xs:complexType>
123 </xs:element>
124
125
126 <!-- Zero or more expected errors for this query -->
127
128 <xs:element name="expected-error" minOccurs="0" maxOccurs="unbounded">
129 <xs:annotation>
130 <xs:documentation>
131 Zero or more expected errors for this query.
132 </xs:documentation>
133 </xs:annotation>
134
135 <xs:complexType>
136 <xs:simpleContent>
137 <xs:extension base="test:ErrorCode">
138 </xs:extension>
139 </xs:simpleContent>
140 </xs:complexType>
141 </xs:element>
142
143 </xs:sequence>
144
145 <!-- This name is always equal to the name of the test case -->
146 <xs:attribute name="name" type="xs:string" use="required"/>
147 </xs:complexType>
148 </xs:element>
149
150 <!-- Zero or more files containing expected results for this query -->
151
152 </xs:sequence>
153
154 <!-- The filename for this query can be constructed from: -->
155 <!-- the QueryOffsetPath -->
156 <!-- the FilePath -->
157 <!-- the name -->
158 <!-- the QueryFileExtension -->
159
160 <xs:attribute name="FilePath" type="test:SimplifiedRelativeFilePath" use="required"/>
161 <xs:attribute name="date" type="xs:date" use="required"/>
162 </xs:complexType>
163
164 <!-- comparison-enum type -->
165 <!-- Identify the type of comparison used to determine whether an -->
166 <!-- expected result and an actual result match. -->
167
168 <xs:simpleType name="comparison-enum">
169 <xs:annotation>
170 <xs:documentation>
171 Identify the type of comparison used to determine whether an
172 expected result and an actual result match.
173 </xs:documentation>
174 </xs:annotation>
175
176 <xs:restriction base="xs:string">
177 <xs:enumeration value="XML"/>
178 <xs:enumeration value="Text"/>
179 <xs:enumeration value="Inspect"/>
180 <xs:enumeration value="Ignore"/>
181 </xs:restriction>
182 </xs:simpleType>
183
184 <!-- description type -->
185
186 <xs:complexType name="description">
187 <xs:simpleContent>
188 <xs:extension base="xs:string">
189 <xs:attribute name="last-mod" type="xs:date"/>
190 </xs:extension>
191 </xs:simpleContent>
192 </xs:complexType>
193
194
195 <!-- ErrorCode type -->
196 <!-- * is used to mean that any error code is acceptable -->
197
198 <xs:simpleType name="ErrorCode">
199 <xs:annotation>
200 <xs:documentation>
201 * is used to mean that any error code is acceptable
202 </xs:documentation>
203 </xs:annotation>
204
205 <xs:restriction base="xs:string">
206 <xs:pattern value="\*|([A-Z]{4}[0-9]{4})"/>
207 </xs:restriction>
208 </xs:simpleType>
209
210</xs:schema>