Changeset 12795 in josm for trunk/test
- Timestamp:
- 2017-09-09T10:35:27+02:00 (7 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java
r12760 r12795 121 121 Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator 122 122 123 // setup projection grid files 124 MainApplication.setupNadGridSources(); 125 123 126 // make sure we don't upload to or test against production 124 127 url = OsmApi.getOsmApi().getBaseUrl().toLowerCase(Locale.ENGLISH).trim(); -
trunk/test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java
r12746 r12795 269 269 } 270 270 271 /**272 * Unit test of {@link LatLon#parse} method.273 */274 @Test275 public void testParse() {276 assertEquals(new LatLon(49.29918, 19.24788), LatLon.parse("49.29918° 19.24788°"));277 assertEquals(new LatLon(49.29918, 19.24788), LatLon.parse("N 49.29918 E 19.24788°"));278 assertEquals(new LatLon(49.29918, 19.24788), LatLon.parse("49.29918° 19.24788°"));279 assertEquals(new LatLon(49.29918, 19.24788), LatLon.parse("N 49.29918 E 19.24788"));280 assertEquals(new LatLon(49.29918, 19.24788), LatLon.parse("n 49.29918 e 19.24788"));281 assertEquals(new LatLon(-19 - 24.788 / 60, -49 - 29.918 / 60), LatLon.parse("W 49°29.918' S 19°24.788'"));282 assertEquals(new LatLon(-19 - 24.788 / 60, -49 - 29.918 / 60), LatLon.parse("w 49°29.918' s 19°24.788'"));283 assertEquals(new LatLon(49 + 29. / 60 + 04. / 3600, 19 + 24. / 60 + 43. / 3600), LatLon.parse("N 49°29'04\" E 19°24'43\""));284 assertEquals(new LatLon(49.29918, 19.24788), LatLon.parse("49.29918 N, 19.24788 E"));285 assertEquals(new LatLon(49.29918, 19.24788), LatLon.parse("49.29918 n, 19.24788 e"));286 assertEquals(new LatLon(49 + 29. / 60 + 21. / 3600, 19 + 24. / 60 + 38. / 3600), LatLon.parse("49°29'21\" N 19°24'38\" E"));287 assertEquals(new LatLon(49 + 29. / 60 + 51. / 3600, 19 + 24. / 60 + 18. / 3600), LatLon.parse("49 29 51, 19 24 18"));288 assertEquals(new LatLon(49 + 29. / 60, 19 + 24. / 60), LatLon.parse("49 29, 19 24"));289 assertEquals(new LatLon(19 + 24. / 60, 49 + 29. / 60), LatLon.parse("E 49 29, N 19 24"));290 assertEquals(new LatLon(49 + 29. / 60, 19 + 24. / 60), LatLon.parse("49° 29; 19° 24"));291 assertEquals(new LatLon(49 + 29. / 60, 19 + 24. / 60), LatLon.parse("49° 29; 19° 24"));292 assertEquals(new LatLon(49 + 29. / 60, -19 - 24. / 60), LatLon.parse("N 49° 29, W 19° 24"));293 assertEquals(new LatLon(-49 - 29.5 / 60, 19 + 24.6 / 60), LatLon.parse("49° 29.5 S, 19° 24.6 E"));294 assertEquals(new LatLon(49 + 29.918 / 60, 19 + 15.88 / 60), LatLon.parse("N 49 29.918 E 19 15.88"));295 assertEquals(new LatLon(49 + 29.4 / 60, 19 + 24.5 / 60), LatLon.parse("49 29.4 19 24.5"));296 assertEquals(new LatLon(-49 - 29.4 / 60, 19 + 24.5 / 60), LatLon.parse("-49 29.4 N -19 24.5 W"));297 }298 299 /**300 * Unit test of {@link LatLon#parse} method - invalid case 1.301 */302 @Test(expected = IllegalArgumentException.class)303 public void testParseInvalid1() {304 LatLon.parse("48°45'S 23°30'S");305 }306 307 /**308 * Unit test of {@link LatLon#parse} method - invalid case 2.309 */310 @Test(expected = IllegalArgumentException.class)311 public void testParseInvalid2() {312 LatLon.parse("47°45'N 24°00'S");313 }314 271 } -
trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java
r12438 r12795 84 84 @Rule 85 85 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 86 public JOSMTestRules test = new JOSMTestRules().platform(). timeout(30_000);86 public JOSMTestRules test = new JOSMTestRules().platform().projectionNadGrids().timeout(30_000); 87 87 88 88 /** -
trunk/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java
r11660 r12795 24 24 @Rule 25 25 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 26 public JOSMTestRules test = new JOSMTestRules().p latform();26 public JOSMTestRules test = new JOSMTestRules().projectionNadGrids().platform(); 27 27 28 28 /** -
trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java
r12760 r12795 55 55 private boolean platform; 56 56 private boolean useProjection; 57 private boolean useProjectionNadGrids; 57 58 private boolean commands; 58 59 private boolean allowMemoryManagerLeaks; … … 154 155 public JOSMTestRules projection() { 155 156 useProjection = true; 157 return this; 158 } 159 160 /** 161 * Set up loading of NTV2 grit shift files to support projections that need them. 162 * @return this instance, for easy chaining 163 */ 164 public JOSMTestRules projectionNadGrids() { 165 useProjectionNadGrids = true; 156 166 return this; 157 167 } … … 313 323 if (useProjection) { 314 324 Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator 325 } 326 327 if (useProjectionNadGrids) { 328 MainApplication.setupNadGridSources(); 315 329 } 316 330
Note:
See TracChangeset
for help on using the changeset viewer.