Changeset 35289 in osm for applications/editors/josm/plugins/comfort0/test/unit
- Timestamp:
- 2020-01-13T21:45:29+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/comfort0/test/unit/net/simon04/comfort0/OsmToLevel0LTest.java
r35282 r35289 5 5 6 6 import java.io.InputStream; 7 import java.util.ArrayList;8 7 8 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 9 9 import org.junit.Before; 10 import org.junit.Rule; 10 11 import org.junit.Test; 11 import org.openstreetmap.josm. Main;12 import org.openstreetmap.josm.data.Preferences; 12 13 import org.openstreetmap.josm.data.coor.LatLon; 13 14 import org.openstreetmap.josm.data.osm.DataSet; 14 15 import org.openstreetmap.josm.data.osm.Node; 15 16 import org.openstreetmap.josm.io.OsmReader; 17 import org.openstreetmap.josm.testutils.JOSMTestRules; 16 18 17 19 public class OsmToLevel0LTest { 18 20 21 /** 22 * Setup rule 23 */ 24 @Rule 25 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 26 public JOSMTestRules test = new JOSMTestRules().preferences(); 27 19 28 @Before 20 29 public void setUp() throws Exception { 21 Main.initApplicationPreferences();30 Preferences.main().putBoolean("osm-primitives.showcoor", true); 22 31 } 23 32 … … 38 47 // from https://wiki.openstreetmap.org/wiki/OSM_XML#OSM_XML_file_format 39 48 // compare to https://wiki.openstreetmap.org/wiki/Level0L#Examples 40 try (InputStream in = getClass().get Resource("/example.osm").openStream()) {49 try (InputStream in = getClass().getClassLoader().getResource("example.osm").openStream()) { 41 50 final DataSet dataSet = OsmReader.parseDataSet(in, null); 42 51 final OsmToLevel0L converter = new OsmToLevel0L(); 43 converter.visit( new ArrayList<>(dataSet.allPrimitives()));52 converter.visit(dataSet.allPrimitives()); 44 53 assertThat(converter.toString(), is("" + 54 "way 4579143 #\u200Eincomplete\n" + 55 "\n" + 45 56 "way 26659127 #\u200EPastower Straße\u200E (3 nodes)\n" + 46 57 " highway = unclassified\n" + … … 49 60 " n298884289 #incomplete\n" + 50 61 " n261728686 #261728686 \u200E(54.0906309, 12.2441924)\n" + 51 "\n" +52 "way 4579143 #\u200Eincomplete\n" +53 62 "\n" + 54 63 "relation 56688 #route (\"Küstenbus Linie 123\", 4 members, incomplete)\n" + … … 64 73 " nd 249673494 #incomplete\n" + 65 74 "\n" + 66 "node 1831881213: 54.0900666, 12.2539381 #Neu Broderstorf \u200E(54.0900666, 12.2539381)\n" + 67 " name = Neu Broderstorf\n" + 68 " traffic_sign = city_limit\n" + 75 "node 249673494 #incomplete\n" + 69 76 "\n" + 70 "node 2 49673494 #incomplete\n" +77 "node 261728686: 54.0906309, 12.2441924 #261728686 \u200E(54.0906309, 12.2441924)\n" + 71 78 "\n" + 72 79 "node 292403538 #incomplete\n" + … … 74 81 "node 294942404 #incomplete\n" + 75 82 "\n" + 76 "node 364933006 #incomplete\n" + 83 "node 298884269: 54.0901746, 12.2482632 #298884269 \u200E(54.0901746, 12.2482632)\n" + 84 "\n" + 85 "node 298884272: 54.0901447, 12.2516513 #298884272 \u200E(54.0901447, 12.2516513)\n" + 77 86 "\n" + 78 87 "node 298884289 #incomplete\n" + 79 88 "\n" + 80 "node 261728686: 54.0906309, 12.2441924 #261728686 \u200E(54.0906309, 12.2441924)\n" +89 "node 364933006 #incomplete\n" + 81 90 "\n" + 82 "node 298884269: 54.0901746, 12.2482632 #298884269 \u200E(54.0901746, 12.2482632)\n" +83 " \n" +84 " node 298884272: 54.0901447, 12.2516513 #298884272 \u200E(54.0901447, 12.2516513)"));91 "node 1831881213: 54.0900666, 12.2539381 #Neu Broderstorf \u200E(54.0900666, 12.2539381)\n" + 92 " name = Neu Broderstorf\n" + 93 " traffic_sign = city_limit")); 85 94 } 86 95 }
Note:
See TracChangeset
for help on using the changeset viewer.