-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmain.ctl
296 lines (274 loc) · 14.6 KB
/
main.ctl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
<?xml version="1.0" encoding="UTF-8"?>
<ctl:package
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ctl="http://www.occamlab.com/ctl"
xmlns:parsers="http://www.occamlab.com/te/parsers"
xmlns:myparsers="http://teamengine.sourceforge.net/parsers"
xmlns:saxon="http://saxon.sf.net/"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:sf="http://cite.opengeospatial.org/gmlsf"
xmlns:ows="http://www.opengis.net/ows"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xi:include href="functions.ctl" />
<xi:include href="parsers.ctl" />
<xi:include href="readiness-tests.ctl" />
<xi:include href="asserts.ctl" />
<xi:include href="basic/basic-main.xml" />
<xi:include href="wfs-transaction/transaction-tests.ctl" />
<xi:include href="wfs-locking/locking-tests.ctl" />
<xi:include href="wfs-xlink/xlink-main.xml" />
<ctl:suite name="ctl:wfs-1.1.0-compliance-suite" version="1.1.0.2-M1">
<ctl:title>WFS 1.1.0 Compliance Test Suite (1.1.0.2-M1)</ctl:title>
<ctl:description>Verifies that a WFS 1.1.0 implementation complies with a given conformance class.</ctl:description>
<ctl:link>docs/wfs/1.1.0/</ctl:link>
<ctl:link>data/data-wfs-1.1.0.zip</ctl:link>
<ctl:starting-test>wfs:wfs-main</ctl:starting-test>
<ctl:form xmlns="" >
<body>
<h2>Compliance test suite for Web Feature Service (WFS) 1.1.0</h2>
<h3>Service metadata</h3>
<p>
Please provide a URL from which a capabilities document can
be retrieved. Modify the URL template below to specify the
location of an OGC capabilities document for the WFS implementation
under test (this can refer to a static document or to a service endpoint).
</p>
<p>Examples of reference implementations that can be tested can be found at the <a href="http://cite.opengeospatial.org/reference">CITE wiki</a>.</p>
<blockquote>
<table border="1" padding="4" bgcolor="#00ffff">
<tr>
<td align="left">Capabilities URL:</td>
<td align="center">
<input name="capabilities-url" size="128"
type="text"
value="http://hostname:port/path?query"/>
</td>
</tr>
</table>
</blockquote>
<h3>Supported conformance classes</h3>
<p>
A conformance class denotes a set of functional capabilities provided by the WFS under test.
</p>
<blockquote>
<table border="1" frame="box" padding="4" bgcolor="#00ffff">
<tr>
<td align="center"></td>
<td align="left"><strong>WFS-Basic</strong> (Required) : Implements <em>GetCapabilities</em>, <em>DescribeFeatureType</em> and <em>GetFeature</em> requests
<div>Does not require test data</div>
</td>
</tr>
<tr>
<td align="center">
<input name="wfs-transaction" type="checkbox" value="Transaction" />
</td>
<td align="left"><strong>WFS-Transaction</strong> : Implements the <em>Transaction</em> request
<div style="color: red;">Don't forget to add the test data!</div>
</td>
</tr>
<tr>
<td align="center">
<input name="wfs-locking" type="checkbox" value="Locking" />
</td>
<td align="left"><strong>WFS-Locking</strong> : Implements optional <em>LockFeature</em> and <em>GetFeatureWithLock</em>
<div style="color: red;">Don't forget to add the test data!</div>
</td>
</tr>
<tr>
<td align="center">
<input name="wfs-xlink" type="checkbox" value="XLink" />
</td>
<td align="left"><strong>WFS-XLink</strong> : Implements the <em>GetGmlObject</em> request and supports (local) XLink processing in GetFeature requests.
<div style="color: red;">Don't forget to add the test data!</div>
</td>
</tr>
</table>
</blockquote>
<br/>
<h3>GML Simple Features (GMLSF) compliance level</h3>
<p>
This indicates the scope of GML 3.1 support, as documented in OGC 06-049.
Test data for levels SF-0 and SF-1 are currently available. This setting is
ignored when assessing XLink conformance because it requires support
at the SF-2 level.
</p>
<blockquote>
<table border="1" padding="4" bgcolor="#00ffff">
<tr>
<td align="center">
<input name="profile" type="radio" value="sf-0" checked="checked"/>
</td>
<td align="left">SF-0 : Level 0 (only simple non-spatial property types; Curve and Surface geometries are excluded)</td>
</tr>
<tr>
<td align="center">
<input name="profile" type="radio" value="sf-1"/>
</td>
<td align="left">SF-1 : Level 1 (complex non-spatial property types, plus Curve and Surface geometries)</td>
</tr>
</table>
</blockquote>
<p>
<div bgcolor="#ffffcc"><strong> WARNING </strong> WFS-Transaction, WFS-Locking and WFS-XLink requires test data, don't forget to add them! WFS-Basic is data agnostic.</div>
</p>
<br />
<input type="submit" value="Start"/>
</body>
</ctl:form>
</ctl:suite>
<ctl:test name="wfs:wfs-main">
<ctl:param name="capabilities-url" />
<ctl:param name="wfs-transaction" />
<ctl:param name="wfs-locking" />
<ctl:param name="wfs-xlink" />
<ctl:param name="profile" />
<ctl:assertion>WFS 1.1.0 Tests</ctl:assertion>
<ctl:comment>
The capabilities document is first checked for the presence of required
HTTP method bindings. Then a GetCapabilities request is submitted to the
SUT using the GET method. A subsequent GetFeature request to retrieve
one of the records in the test data set is then submitted and checked
for a non-empty response. If any of these checks fail, execution of the
test suite is aborted.
</ctl:comment>
<ctl:code>
<!-- Get user input: -->
<xsl:variable name="wfs.GetCapabilities.get.url" select="$capabilities-url" />
<xsl:variable name="gmlsf.profile.level" select="$profile" />
<!--TODO: Get GMLSF profile level from DescribeFeatureType and XPath expression (gmlsf conformance level 0 or 1) rather than user input-->
<!-- Attempt to retrieve capabilities document -->
<xsl:variable name="wfs.GetCapabilities.document">
<ctl:request>
<ctl:url>
<xsl:value-of select="$wfs.GetCapabilities.get.url" />
</ctl:url>
<ctl:method>GET</ctl:method>
</ctl:request>
</xsl:variable>
<!-- Call the readiness tests, which then call the conformance class tests -->
<xsl:choose>
<xsl:when test="not($wfs.GetCapabilities.document//wfs:WFS_Capabilities)">
<ctl:message>FAILURE: Did not receive a wfs:WFS_Capabilities document! Skipping remaining tests.</ctl:message>
<ctl:fail />
</xsl:when>
<xsl:otherwise>
<!-- Ingest initial test data -->
<!-- <xsl:variable name="ingest.data" select="$wfs-transaction"/>
<xsl:if test="string-length($ingest.data) gt 0">
<ctl:call-test name="wfs:ingest-test-data">
<ctl:with-param name="wfs.GetCapabilities.document" select="$wfs.GetCapabilities.document"/>
<ctl:with-param name="gmlsf.profile.level" select="$gmlsf.profile.level"/>
</ctl:call-test>
</xsl:if> -->
<ctl:call-test name="wfs:readiness-tests">
<ctl:with-param name="wfs.GetCapabilities.document" select="$wfs.GetCapabilities.document" />
<ctl:with-param name="wfs-transaction" select="$wfs-transaction" />
</ctl:call-test>
<xsl:variable name="conformance.class">basic</xsl:variable>
<xsl:variable name="conformance.class.method.get">true</xsl:variable>
<xsl:variable name="conformance.class.method.post">true</xsl:variable>
<xsl:variable name="GetCapabilities.get.url">
<xsl:value-of
select="$wfs.GetCapabilities.document//ows:OperationsMetadata/ows:Operation[@name='GetCapabilities']/ows:DCP/ows:HTTP/ows:Get/@xlink:href" />
</xsl:variable>
<xsl:variable name="GetFeature.get.url">
<xsl:value-of
select="$wfs.GetCapabilities.document//ows:OperationsMetadata/ows:Operation[@name='GetFeature']/ows:DCP/ows:HTTP/ows:Get/@xlink:href" />
</xsl:variable>
<xsl:variable name="GetFeature.post.url">
<xsl:value-of
select="$wfs.GetCapabilities.document//ows:OperationsMetadata/ows:Operation[@name='GetFeature']/ows:DCP/ows:HTTP/ows:Post/@xlink:href" />
</xsl:variable>
<xsl:choose>
<xsl:when test="not(starts-with($GetCapabilities.get.url,'http'))">
<ctl:message>
FAILURE: HTTP endpoint for GetCapabilities using GET method not found in capabilities document.
</ctl:message>
<ctl:fail />
</xsl:when>
<xsl:when test="not(starts-with($GetFeature.post.url,'http')) and not(starts-with($GetFeature.get.url,'http'))">
<ctl:message>
FAILURE: HTTP endpoint for GetFeature using POST or GET method not found in capabilities document.
</ctl:message>
<ctl:fail />
</xsl:when>
<xsl:otherwise>
<ctl:call-test name="wfs:basic-main">
<ctl:with-param name="wfs.GetCapabilities.document" select="$wfs.GetCapabilities.document" />
<ctl:with-param name="gmlsf.profile.level" select="$gmlsf.profile.level" />
<ctl:with-param name="wfs-xlink" select="$wfs-xlink" />
<ctl:with-param name="conformance.class" select="$conformance.class" />
<ctl:with-param name="conformance.class.method.get" select="$conformance.class.method.get" />
<ctl:with-param name="conformance.class.method.post" select="$conformance.class.method.post" />
</ctl:call-test>
<xsl:if test="string-length($wfs-transaction) gt 0">
<ctl:call-test name="wfs:transaction-main">
<ctl:with-param name="wfs.GetCapabilities.document" select="$wfs.GetCapabilities.document" />
<ctl:with-param name="gmlsf.profile.level" select="$gmlsf.profile.level" />
</ctl:call-test>
</xsl:if>
<xsl:if test="string-length($wfs-locking) gt 0">
<ctl:call-test name="wfs:locking-main">
<ctl:with-param name="wfs.GetCapabilities.document" select="$wfs.GetCapabilities.document" />
<ctl:with-param name="gmlsf.profile.level" select="$gmlsf.profile.level" />
</ctl:call-test>
</xsl:if>
<xsl:if test="string-length($wfs-xlink) gt 0">
<ctl:call-test name="wfs:XLinkTests">
<ctl:with-param name="wfs.GetCapabilities.document" select="$wfs.GetCapabilities.document" />
</ctl:call-test>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</ctl:code>
</ctl:test>
<!--<ctl:test name="wfs:ingest-test-data">
<ctl:param name="wfs.GetCapabilities.document"/>
<ctl:param name="gmlsf.profile.level"/>
<ctl:assertion>Ingests the mandatory test data for use by the test suite.</ctl:assertion>
<ctl:comment>Uses Transaction Inserts to load all WFS 1.1.0 test data into a service. The data must be relative to this file in "./data/wfs/1.1.0/sf-X/dataset-sfX-insert.xml", where "X" is the GMLSF level.</ctl:comment>
<ctl:code>
<xsl:variable name="wfs.Transaction.post.url">
<xsl:value-of select="$wfs.GetCapabilities.document//ows:OperationsMetadata/ows:Operation[@name='Transaction']/ows:DCP/ows:HTTP/ows:Post/@xlink:href"/>
</xsl:variable>
<xsl:variable name="transaction.response.1">
<ctl:request>
<ctl:url>
<xsl:value-of select="$wfs.Transaction.post.url"/>
</ctl:url>
<ctl:method>POST</ctl:method>
<ctl:body>
<xi:include href="../data/sf-0/dataset-sf0-insert.xml"/>
</ctl:body>
</ctl:request>
</xsl:variable>
<xsl:variable name="transaction.response.2">
<ctl:request>
<ctl:url>
<xsl:value-of select="$wfs.Transaction.post.url"/>
</ctl:url>
<ctl:method>POST</ctl:method>
<ctl:body>
<xi:include href="../data/sf-1/dataset-sf1-insert.xml"/>
</ctl:body>
</ctl:request>
</xsl:variable>
<xsl:variable name="transaction.response.3">
<ctl:request>
<ctl:url>
<xsl:value-of select="$wfs.Transaction.post.url"/>
</ctl:url>
<ctl:method>POST</ctl:method>
<ctl:body>
<xi:include href="../data/sf-2/dataset-sf2-insert.xml"/>
</ctl:body>
</ctl:request>
</xsl:variable>
</ctl:code>
</ctl:test>-->
</ctl:package>