Changeset 11282 in josm for trunk/test/unit/org
- Timestamp:
- 2016-11-18T18:27:07+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/importers/OsmLinkPasterTest.java
r10881 r11282 2 2 package org.openstreetmap.josm.gui.datatransfer.importers; 3 3 4 import static org.junit.Assert.assertArrayEquals; 4 import static org.junit.Assert.assertEquals; 5 import static org.junit.Assert.assertNull; 5 6 6 7 import org.junit.Rule; 7 8 import org.junit.Test; 8 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 9 import org.openstreetmap.josm.data.osm.SimplePrimitiveId; 9 import org.openstreetmap.josm.data.coor.LatLon; 10 10 import org.openstreetmap.josm.testutils.JOSMTestRules; 11 11 … … 25 25 26 26 /** 27 * Test of {@link OsmLinkPaster#parse Ids(String)}27 * Test of {@link OsmLinkPaster#parseLatLon(String)} 28 28 */ 29 29 @Test 30 public void testParseIds() { 31 assertArrayEquals(new Object[] {new SimplePrimitiveId(1234, OsmPrimitiveType.NODE) }, 32 OsmLinkPaster.parseIds("http://www.openstreetmap.org/node/1234").toArray()); 33 assertArrayEquals(new Object[] {new SimplePrimitiveId(1234, OsmPrimitiveType.WAY) }, 34 OsmLinkPaster.parseIds("http://www.openstreetmap.org/way/1234").toArray()); 35 assertArrayEquals(new Object[] {new SimplePrimitiveId(1234, OsmPrimitiveType.RELATION) }, 36 OsmLinkPaster.parseIds("http://www.openstreetmap.org/relation/1234").toArray()); 37 38 assertArrayEquals(new Object[] {new SimplePrimitiveId(1234, OsmPrimitiveType.NODE) }, 39 OsmLinkPaster.parseIds("http://www.osm.org/node/1234").toArray()); 40 assertArrayEquals(new Object[] {new SimplePrimitiveId(1234, OsmPrimitiveType.WAY) }, 41 OsmLinkPaster.parseIds("http://osm.org/way/1234").toArray()); 42 assertArrayEquals(new Object[] {new SimplePrimitiveId(1234, OsmPrimitiveType.RELATION) }, 43 OsmLinkPaster.parseIds("https://www.openstreetmap.org/relation/1234").toArray()); 44 45 assertArrayEquals(new Object[0], OsmLinkPaster.parseIds("http://www.openstreetmap.org/xx/1234").toArray()); 46 assertArrayEquals(new Object[0], OsmLinkPaster.parseIds("http://www.openstreetmap.org/way/1234x").toArray()); 47 assertArrayEquals(new Object[0], OsmLinkPaster.parseIds("").toArray()); 30 public void testParseLatLon() { 31 assertEquals(new LatLon(51.71873, 8.76164), 32 OsmLinkPaster.parseLatLon("https://www.openstreetmap.org/#map=17/51.71873/8.76164")); 33 assertNull(OsmLinkPaster.parseLatLon("http://www.openstreetmap.org/")); 34 assertNull(OsmLinkPaster.parseLatLon("foo-bar")); 48 35 } 49 36 }
Note:
See TracChangeset
for help on using the changeset viewer.