File: v2_0_2.html

package info (click to toggle)
openlayers 2.13.1%2Bds2-6
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 67,180 kB
  • sloc: xml: 7,435; python: 891; sh: 44; makefile: 19
file content (56 lines) | stat: -rw-r--r-- 1,648 bytes parent folder | download | duplicates (7)
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
<html> 
<head> 
    <script src="../../OLLoader.js"></script>
    <script src="v2_0_2.js"></script>
    <script type="text/javascript">

    var format = new OpenLayers.Format.CSWGetDomain();
    
    function test_write(t) {

        t.plan(1);

        var options = {
            PropertyName: "type"
        };

        var result = format.write(options);

        t.eq(result, csw_request, "check value returned by format " +
                "CSWGetDomain: write method");

    }

    
    function test_read(t) {
        
        t.plan(9);
        
        var obj = format.read(csw_response);
        
        var domainValues = obj.DomainValues;
        // test getRecordsResponse object
        t.ok(domainValues, "object contains DomainValues property");

        // test DomainValues
        t.eq(domainValues.length, 1, "object contains 1 object in DomainValues");
        var domainValue = domainValues[0];
        t.eq(domainValue.type, "csw:Record", "check value for attribute type");
        t.eq(domainValue.PropertyName, "type", "check value for element PropertyName");
        t.ok(domainValue.ListOfValues, "object contains ListOfValues property");

        // test ListOfValues
        t.eq(domainValue.ListOfValues.length, 2, "object contains 2 objects " +
                "in ListOfValues");
        var val = domainValue.ListOfValues[0];
        t.ok(val.Value, "object contains Value property");
        t.eq(val.Value.my_attr, "my_value", "check value for attribute my_attr");
        t.eq(val.Value.value, "dataset", "check value for element Value");
        
    }
    
    </script> 
</head> 
<body>
</body> 
</html>