blob: b3e90b6bf39f9cb034b3d633e08941d100c9d9a7 (
plain)
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
|
<html>
<head>
<script src="../OLLoader.js"></script>
<script type="text/javascript">
function test_read(t) {
t.plan(4);
var _v1_0_0 = OpenLayers.Format.WCSCapabilities.v1_0_0.prototype.read;
var _v1_1_0 = OpenLayers.Format.WCSCapabilities.v1_1_0.prototype.read;
var parser = new OpenLayers.Format.WCSCapabilities();
// version 1.0.0
var text =
'<?xml version="1.0" encoding="UTF-8"?>' +
'<wcs:WCS_Capabilities version="1.0.0" xmlns:wcs="http://www.opengis.net/wcs"></wcs:WCS_Capabilities>';
OpenLayers.Format.WCSCapabilities.v1_0_0.prototype.read = function() {
t.ok(true, "Version 1.0.0 detected");
return {};
}
var res = parser.read(text);
t.eq(res.version, "1.0.0", "version 1.0.0 written to result object");
OpenLayers.Format.WCSCapabilities.v1_1_0.prototype.read = _v1_1_0;
// version 1.1.0
var text =
'<?xml version="1.0" encoding="UTF-8"?>' +
'<wcs:WCS_Capabilities version="1.1.0" xmlns:wcs="http://www.opengis.net/wcs/1.1"></wcs:WCS_Capabilities>';
OpenLayers.Format.WCSCapabilities.v1_1_0.prototype.read = function() {
t.ok(true, "Version 1.1.0 detected");
return {};
}
var res = parser.read(text);
t.eq(res.version, "1.1.0", "version 1.1.0 written to result object");
OpenLayers.Format.WCSCapabilities.v1_1_0.prototype.read = _v1_1_0;
}
</script>
</head>
<body>
</body>
</html>
|