function exposeTestFunctionNames() { return [ 'testDatasetsAreDefined', 'testRSSItemLoaded', 'testRSSEarliestDate', 'testRSSItemAttributes', 'testAtomItemLoaded', 'testAtomEarliestDate', 'testAtomItemAttributes', 'testMixedItemsLoaded', 'testMixedPlacemarksFound', 'testMixedKMLTime', 'testMixedExtraTags' ]; } function testDatasetsAreDefined() { assertNotUndefined("RSS dataset is defined", tm.datasets["rss"]); assertNotUndefined("Atom dataset is defined", tm.datasets["atom"]); assertNotUndefined("Mixed dataset is defined", tm.datasets["mixed"]); } function testRSSItemLoaded() { var ds = tm.datasets["rss"]; assertEquals("one item in item array", ds.getItems().length, 1); } function testRSSEarliestDate() { var ds = tm.datasets["rss"]; assertEquals("year matches", ds.eventSource.getEarliestDate().getUTCFullYear(), 1980); assertEquals("month matches", ds.eventSource.getEarliestDate().getUTCMonth(), 0); // Timeline seems to adjust for the timezone after parsing :( assertEquals("day matches", ds.eventSource.getEarliestDate().getUTCDate(), 2); } function testRSSItemAttributes() { var items = tm.datasets["rss"].getItems(); var item = items[0]; assertEquals("title matches", item.getTitle(), "Test Event"); assertEquals("placemark type matches", item.getType(), "marker"); var point = new mxn.LatLonPoint(23.456, 12.345); assertTrue("point matches", item.getInfoPoint().equals(point)); } function testAtomItemLoaded() { var ds = tm.datasets["atom"]; assertEquals("one item in item array", ds.getItems().length, 1); } function testAtomEarliestDate() { var ds = tm.datasets["atom"]; assertEquals("year matches", ds.eventSource.getEarliestDate().getUTCFullYear(), 1980); assertEquals("month matches", ds.eventSource.getEarliestDate().getUTCMonth(), 0); // Timeline seems to adjust for the timezone after parsing :( assertEquals("day matches", ds.eventSource.getEarliestDate().getUTCDate(), 2); } function testAtomItemAttributes() { var items = tm.datasets["atom"].getItems(); var item = items[0]; assertEquals("title matches", item.getTitle(), "Test Event"); assertEquals("placemark type matches", item.getType(), "marker"); var point = new mxn.LatLonPoint(23.456, 12.345); assertTrue("point matches", item.getInfoPoint().equals(point)); } function testMixedItemsLoaded() { var ds = tm.datasets["mixed"]; assertEquals("Fourteen items in item array", 14, ds.getItems().length); } function testMixedPlacemarksFound() { var items = tm.datasets["mixed"].getItems(); var pmTypes = ['GeoRSS-Simple','GML (pos)','GML (coordinates)','W3C Geo']; var offset; for (x=0; x