Changeset 1223
- Timestamp:
- 10/16/08 15:49:55 (3 months ago)
- Files:
-
- sandbox/camptocamp/MapFishUnhcr/client/mfbase/mapfish/MapFish.js (modified) (1 diff)
- sandbox/camptocamp/MapFishUnhcr/client/mfbase/mapfish/core/Strategy.js (modified) (1 diff)
- sandbox/camptocamp/MapFishUnhcr/client/mfbase/mapfish/core/Strategy/ProtocolListener.js (added)
- sandbox/camptocamp/MapFishUnhcr/client/mfbase/mapfish/core/Strategy/Search.js (deleted)
- sandbox/camptocamp/MapFishUnhcr/client/mfbase/mapfish/tests/core/Protocol/test_TriggerEventDecorator.html (modified) (2 diffs)
- sandbox/camptocamp/MapFishUnhcr/client/mfbase/mapfish/tests/core/Strategy/test_Search.html (modified) (4 diffs)
- sandbox/camptocamp/MapFishUnhcr/client/mfbase/mapfish/tests/list-tests.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/camptocamp/MapFishUnhcr/client/mfbase/mapfish/MapFish.js
r1219 r1223 103 103 "core/Searcher/Form.js", 104 104 "core/Strategy.js", 105 "core/Strategy/ Search.js",105 "core/Strategy/ProtocolListener.js", 106 106 "core/PrintProtocol.js", 107 107 "core/Offline.js", sandbox/camptocamp/MapFishUnhcr/client/mfbase/mapfish/core/Strategy.js
r1219 r1223 23 23 24 24 /** 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. 30 27 */ 31 mapfish.Strategy = OpenLayers.Strategy; 28 29 mapfish.Strategy = {}; sandbox/camptocamp/MapFishUnhcr/client/mfbase/mapfish/tests/core/Protocol/test_TriggerEventDecorator.html
r1191 r1223 33 33 } 34 34 function test_TriggerEventDecorator_CRUD(t) { 35 t.plan(1 6);35 t.plan(19); 36 36 37 37 // setup … … 83 83 scope: scope 84 84 }; 85 86 // 3 tests 87 type = "read"; 88 decorator.read(); 85 89 86 90 // 4 tests sandbox/camptocamp/MapFishUnhcr/client/mfbase/mapfish/tests/core/Strategy/test_Search.html
r1219 r1223 19 19 <script type="text/javascript"><!-- 20 20 21 function test_ Search_activate(t) {21 function test_ProtocolListener_activate(t) { 22 22 t.plan(5); 23 23 24 var s = new mapfish.Strategy. Search();24 var s = new mapfish.Strategy.ProtocolListener(); 25 25 var l = new OpenLayers.Layer.Vector( 26 26 'testLayer', { … … 44 44 } 45 45 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 47 50 t.plan(2); 48 51 49 var s = new mapfish.Strategy. Search();52 var s = new mapfish.Strategy.ProtocolListener(); 50 53 var l = new OpenLayers.Layer.Vector( 51 54 'testLayer', { … … 57 60 t.eq(activated, false, "activate returns false if layer protocol is not a TriggerEventDecorator"); 58 61 t.eq(s.active, false, "not active if layer protocol is not a TriggerEventDecorator"); 62 63 OpenLayers.Console.error = _consoleBackup; 59 64 } 60 65 61 function test_ Search_triggerRead(t) {66 function test_ProtocolListener_triggerRead(t) { 62 67 t.plan(2); 63 68 64 69 var protocolResponse = { 65 70 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 }; 68 78 69 79 var protocol = new mapfish.Protocol.TriggerEventDecorator({ … … 75 85 }); 76 86 77 var s = new mapfish.Strategy. Search();87 var s = new mapfish.Strategy.ProtocolListener(); 78 88 var l = new OpenLayers.Layer.Vector( 79 89 'testLayer', { sandbox/camptocamp/MapFishUnhcr/client/mfbase/mapfish/tests/list-tests.html
r1219 r1223 7 7 <li>core/Protocol/test_MergeFilterDecorator.html</li> 8 8 <li>core/Protocol/test_TriggerEventDecorator.html</li> 9 <li>core/Strategy/test_ Search.html</li>9 <li>core/Strategy/test_ProtocolListener.html</li> 10 10 <li>widgets/tree/test_LayerTree.html</li> 11 11 <li>widgets/tree/test_LayerTree_separator.html</li>