Changeset 1223

Show
Ignore:
Timestamp:
10/16/08 15:49:55 (3 months ago)
Author:
dcorpataux
Message:

Closes #265

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/camptocamp/MapFishUnhcr/client/mfbase/mapfish/MapFish.js

    r1219 r1223  
    103103            "core/Searcher/Form.js", 
    104104            "core/Strategy.js", 
    105             "core/Strategy/Search.js", 
     105            "core/Strategy/ProtocolListener.js", 
    106106            "core/PrintProtocol.js", 
    107107            "core/Offline.js", 
  • sandbox/camptocamp/MapFishUnhcr/client/mfbase/mapfish/core/Strategy.js

    r1219 r1223  
    2323 
    2424/** 
    25  * Class: mapfish.Strategy 
    26  * Abstract strategy class.  Not to be instantiated directly.  Use 
    27  *     one of the protocol subclasses instead. 
    28  *  
    29  * mapfish.Strategy actually references <OpenLayers.Strategy> 
     25 * Namespace: mapfish.Protocol 
     26 * Contains mapfish strategies. 
    3027 */ 
    31 mapfish.Strategy = OpenLayers.Strategy; 
     28 
     29mapfish.Strategy = {}; 
  • sandbox/camptocamp/MapFishUnhcr/client/mfbase/mapfish/tests/core/Protocol/test_TriggerEventDecorator.html

    r1191 r1223  
    3333    } 
    3434    function test_TriggerEventDecorator_CRUD(t) { 
    35         t.plan(16); 
     35        t.plan(19); 
    3636 
    3737        // setup 
     
    8383            scope: scope 
    8484        }; 
     85 
     86        // 3 tests 
     87        type = "read"; 
     88        decorator.read(); 
    8589 
    8690        // 4 tests 
  • sandbox/camptocamp/MapFishUnhcr/client/mfbase/mapfish/tests/core/Strategy/test_Search.html

    r1219 r1223  
    1919    <script type="text/javascript"><!-- 
    2020 
    21     function test_Search_activate(t) { 
     21    function test_ProtocolListener_activate(t) { 
    2222        t.plan(5); 
    2323 
    24         var s = new mapfish.Strategy.Search(); 
     24        var s = new mapfish.Strategy.ProtocolListener(); 
    2525        var l = new OpenLayers.Layer.Vector( 
    2626        'testLayer', { 
     
    4444    } 
    4545 
    46     function _test_Search_wrongProtocolType(t) { 
     46    function test_ProtocolListener_wrongProtocolType(t) { 
     47        var _consoleBackup = OpenLayers.Console.error; 
     48        OpenLayers.Console.error = function(m) {} 
     49 
    4750        t.plan(2); 
    4851 
    49         var s = new mapfish.Strategy.Search(); 
     52        var s = new mapfish.Strategy.ProtocolListener(); 
    5053        var l = new OpenLayers.Layer.Vector( 
    5154        'testLayer', { 
     
    5760        t.eq(activated, false, "activate returns false if layer protocol is not a TriggerEventDecorator"); 
    5861        t.eq(s.active, false, "not active if layer protocol is not a TriggerEventDecorator"); 
     62 
     63        OpenLayers.Console.error = _consoleBackup; 
    5964    } 
    6065 
    61     function test_Search_triggerRead(t) { 
     66    function test_ProtocolListener_triggerRead(t) { 
    6267        t.plan(2); 
    6368 
    6469        var protocolResponse = { 
    6570            requestType: 'read', 
    66             features: OpenLayers.Format.GeoJSON.prototype.read({"type": "FeatureCollection", "features": [{"geometry": {"type": "Point", "coordinates": [19.634102, -18.114539]}, "type": "Feature", "properties": {"type": "sometype"}, "id": 156}, {"geometry": {"type": "Point", "coordinates": [36.4472, 15.3606]}, "type": "Feature", "properties": {"type": "sometype"}, "id": 128}, {"geometry": {"type": "Point", "coordinates": [33.192, 2.83014]}, "type": "Feature", "properties": {"type": "sometype"}, "id": 1098}, {"geometry": {"type": "Point", "coordinates": [14.805, 50.501111]}, "type": "Feature", "properties": {"type": "sometype"}, "id": 618}, {"geometry": {"type": "Point", "coordinates": [42.727, 43.043]}, "type": "Feature", "properties": {"type": "sometype"}, "id": 631}, {"geometry": {"type": "Point", "coordinates": [38.973989, 32.724509]}, "type": "Feature", "properties": {"type": "sometype"}, "id": 664}, {"geometry": {"type": "Point", "coordinates": [1.88333, 6.40556]}, "type": "Feature", "properties": {"type": "sometype"}, "id": 9}, {"geometry": {"type": "Point", "coordinates": [22.79972, 15.00035]}, "type": "Feature", "properties": {"type": "sometype"}, "id": 888}, {"geometry": {"type": "Point", "coordinates": [41.967, 41.583]}, "type": "Feature", "properties": {"type": "sometype"}, "id": 636}, {"geometry": {"type": "Point", "coordinates": [97.8306, 19.3704]}, "type": "Feature", "properties": {"type": "sometype"}, "id": 145}, {"geometry": {"type": "Point", "coordinates": [97.779581, 17.775998]}, "type": "Feature", "properties": {"type": "sometype"}, "id": 820}, {"geometry": {"type": "Point", "coordinates": [30.410556, -2.664722]}, "type": "Feature", "properties": {"type": "sometype"}, "id": 21}, {"geometry": {"type": "Point", "coordinates": [17.60965, -0.6674]}, "type": "Feature", "properties": {"type": "sometype"}, "id": 24}, {"geometry": {"type": "Point", "coordinates": [17.11207, -1.03903]}, "type": "Feature", "properties": {"type": "sometype"}, "id": 25}, {"geometry": {"type": "Point", "coordinates": [17.69008, -0.33383]}, "type": "Feature", "properties": {"type": "sometype"}, "id": 26}]}) 
    67         } 
     71            features: [ 
     72                new OpenLayers.Feature.Vector( 
     73                    new OpenLayers.Geometry.Point(Math.random(), Math.random()), 
     74                new OpenLayers.Feature.Vector( 
     75                    new OpenLayers.Geometry.Point(Math.random(), Math.random()), 
     76            ] 
     77        }; 
    6878 
    6979        var protocol = new mapfish.Protocol.TriggerEventDecorator({ 
     
    7585        }); 
    7686 
    77         var s = new mapfish.Strategy.Search(); 
     87        var s = new mapfish.Strategy.ProtocolListener(); 
    7888        var l = new OpenLayers.Layer.Vector( 
    7989            'testLayer', { 
  • sandbox/camptocamp/MapFishUnhcr/client/mfbase/mapfish/tests/list-tests.html

    r1219 r1223  
    77    <li>core/Protocol/test_MergeFilterDecorator.html</li> 
    88    <li>core/Protocol/test_TriggerEventDecorator.html</li> 
    9     <li>core/Strategy/test_Search.html</li> 
     9    <li>core/Strategy/test_ProtocolListener.html</li> 
    1010    <li>widgets/tree/test_LayerTree.html</li> 
    1111    <li>widgets/tree/test_LayerTree_separator.html</li>