[OpenLayers-Commits] r3128 - in sandbox/crschmidt/georss-fixed/tests: . Format

commits at openlayers.org commits at openlayers.org
Fri May 4 10:06:17 EDT 2007


Author: crschmidt
Date: 2007-05-04 10:06:17 -0400 (Fri, 04 May 2007)
New Revision: 3128

Added:
   sandbox/crschmidt/georss-fixed/tests/Format/test_GeoRSS.html
Modified:
   sandbox/crschmidt/georss-fixed/tests/list-tests.html
Log:
Add tests for GeoRSS serialization. 


Added: sandbox/crschmidt/georss-fixed/tests/Format/test_GeoRSS.html
===================================================================
--- sandbox/crschmidt/georss-fixed/tests/Format/test_GeoRSS.html	                        (rev 0)
+++ sandbox/crschmidt/georss-fixed/tests/Format/test_GeoRSS.html	2007-05-04 14:06:17 UTC (rev 3128)
@@ -0,0 +1,34 @@
+<html> 
+<head> 
+    <script src="../../lib/OpenLayers.js"></script> 
+    <script type="text/javascript"><!-- 
+
+
+     
+    function test_Format_GeoRSS_constructor(t) { 
+        t.plan(4); 
+         
+        var options = {'foo': 'bar'}; 
+        var format = new OpenLayers.Format.GeoRSS(options); 
+        t.ok(format instanceof OpenLayers.Format.GeoRSS, 
+             "new OpenLayers.Format.GeoRSS returns object" ); 
+        t.eq(format.foo, "bar", "constructor sets options correctly"); 
+        t.eq(typeof format.read, "function", "format has a read function"); 
+        t.eq(typeof format.write, "function", "format has a write function"); 
+    } 
+    function test_Format_GeoRSS_serializeline(t) { 
+        t.plan(1);
+        var parser = new OpenLayers.Format.GeoRSS();
+        var point = new OpenLayers.Geometry.Point(-111.04, 45.68);  
+        var point2 = new OpenLayers.Geometry.Point(-112.04, 45.68); 
+        var l = new OpenLayers.Geometry.LineString([point, point2]);
+        var f = new OpenLayers.Feature.Vector(l);
+        var data = parser.write([f]);
+        t.eq(data.firstChild.childNodes[2].firstChild.nodeValue, '-111.04 45.68 -112.04 45.68 ', 'GeoRSS serializes a line correctly');
+    }
+    // --> 
+    </script> 
+</head> 
+<body> 
+</body> 
+</html> 

Modified: sandbox/crschmidt/georss-fixed/tests/list-tests.html
===================================================================
--- sandbox/crschmidt/georss-fixed/tests/list-tests.html	2007-05-04 13:55:38 UTC (rev 3127)
+++ sandbox/crschmidt/georss-fixed/tests/list-tests.html	2007-05-04 14:06:17 UTC (rev 3128)
@@ -17,6 +17,7 @@
     <li>Geometry/test_Rectangle.html</li>
     <li>Geometry/test_Surface.html</li>
     <li>test_Format.html</li>
+    <li>Format/test_GeoRSS.html</li>
     <li>Format/test_GML.html</li>
     <li>Format/test_WKT.html</li>
     <li>test_Icon.html</li>
@@ -58,6 +59,5 @@
     <li>Control/test_PanZoomBar.html</li>
     <li>Control/test_Permalink.html</li>
     <li>Control/test_Scale.html</li>
-    <li>test_Format.html</li>
     <li>test_Map.html</li>
 </ul>



More information about the Commits mailing list