Changeset 8509 in josm for trunk/test/unit/org
- Timestamp:
- 2015-06-20T14:36:00+02:00 (10 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java
r7937 r8509 73 73 File f = new File(josmHome); 74 74 if (! f.exists() || ! f.canRead()) { 75 fail(MessageFormat.format("property ''{0}'' points to ''{1}'' which is either not existing ({2}) or not readable ({3}). Current directory is ''{4}''.", 75 fail(MessageFormat.format( 76 "property ''{0}'' points to ''{1}'' which is either not existing ({2}) or not readable ({3}). Current directory is ''{4}''.", 76 77 "josm.home", josmHome, f.exists(), f.canRead(), Paths.get("").toAbsolutePath())); 77 78 } -
trunk/test/unit/org/openstreetmap/josm/actions/CopyActionTest.java
r8194 r8509 1 // License: GPL. For details, see LICENSE file. 1 2 package org.openstreetmap.josm.actions; 3 4 import static org.hamcrest.CoreMatchers.is; 5 import static org.junit.Assert.assertThat; 6 7 import java.util.Arrays; 8 import java.util.Collections; 2 9 3 10 import org.junit.BeforeClass; … … 6 13 import org.openstreetmap.josm.data.osm.Relation; 7 14 import org.openstreetmap.josm.data.osm.Way; 8 9 import java.util.Arrays;10 import java.util.Collections;11 12 import static org.hamcrest.CoreMatchers.is;13 import static org.junit.Assert.*;14 15 15 16 public class CopyActionTest { -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/SelectActionTest.java
r8450 r8509 20 20 import org.openstreetmap.josm.JOSMFixture; 21 21 import org.openstreetmap.josm.Main; 22 import org.openstreetmap.josm.corrector.UserCancelException;23 22 import org.openstreetmap.josm.data.Preferences; 24 23 import org.openstreetmap.josm.data.coor.EastNorth; … … 131 130 /** 132 131 * Setup test. 133 * @throws UserCancelException134 132 */ 135 133 @BeforeClass 136 public static void setUp() throws UserCancelException{134 public static void setUp() { 137 135 JOSMFixture.createUnitTestFixture().init(true); 138 136 } -
trunk/test/unit/org/openstreetmap/josm/actions/search/SearchCompilerTest.java
r8250 r8509 1 // License: GPL. For details, see LICENSE file. 1 2 package org.openstreetmap.josm.actions.search; 2 3 -
trunk/test/unit/org/openstreetmap/josm/data/BoundsTest.java
r8450 r8509 1 // License: GPL. For details, see LICENSE file. 1 2 package org.openstreetmap.josm.data; 2 3 -
trunk/test/unit/org/openstreetmap/josm/data/osm/FilterTest.java
r8450 r8509 173 173 foundAtLeastOne = true; 174 174 if (!osm.get(key).equals(filterCode(osm))) { 175 failedPrimitives.append(String.format("Object %s. Expected [%s] but was [%s]%n", osm.toString(), osm.get(key), filterCode(osm))); 175 failedPrimitives.append(String.format( 176 "Object %s. Expected [%s] but was [%s]%n", osm.toString(), osm.get(key), filterCode(osm))); 176 177 } 177 178 } -
trunk/test/unit/org/openstreetmap/josm/data/osm/OsmUtilsTest.java
r8257 r8509 3 3 4 4 import static org.hamcrest.CoreMatchers.is; 5 import static org.junit.Assert.*; 5 import static org.junit.Assert.assertThat; 6 import static org.junit.Assert.assertTrue; 6 7 7 8 import org.junit.BeforeClass; -
trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java
r7151 r8509 30 30 /** 31 31 * create a list of epsg codes and bounds to be used by the perl script 32 * @param args 32 * @param args program main arguments 33 33 */ 34 34 public static void main(String[] args) { -
trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java
r8457 r8509 100 100 EastNorth en = proj.latlon2eastNorth(new LatLon(lat, lon)); 101 101 LatLon ll2 = proj.eastNorth2latlon(en); 102 out.write(String.format("%s%n ll %s %s%n en %s %s%n ll2 %s %s%n", proj.toCode(), lat, lon, en.east(), en.north(), ll2.lat(), ll2.lon())); 102 out.write(String.format( 103 "%s%n ll %s %s%n en %s %s%n ll2 %s %s%n", proj.toCode(), lat, lon, en.east(), en.north(), ll2.lat(), ll2.lon())); 103 104 } 104 105 } -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java
r8331 r8509 1 // License: GPL. For details, see LICENSE file. 1 2 package org.openstreetmap.josm.data.validation.tests; 2 3 -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/OpeningHourTestTest.java
r7937 r8509 53 53 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Su-Th sunset-24:00,04:00-sunrise; Fr-Sa sunset-sunrise"), isEmpty()); 54 54 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Su-Th sunset-24:00, 04:00-sunrise; Fr-Sa sunset-sunrise"), hasSize(1)); 55 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Su-Th sunset-24:00, 04:00-sunrise; Fr-Sa sunset-sunrise").get(0).getSeverity(), is(Severity.OTHER)); 56 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Su-Th sunset-24:00, 04:00-sunrise; Fr-Sa sunset-sunrise").get(0).getPrettifiedValue(), is("Su-Th sunset-24:00,04:00-sunrise; Fr-Sa sunset-sunrise")); 55 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Su-Th sunset-24:00, 04:00-sunrise; Fr-Sa sunset-sunrise") 56 .get(0).getSeverity(), is(Severity.OTHER)); 57 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Su-Th sunset-24:00, 04:00-sunrise; Fr-Sa sunset-sunrise") 58 .get(0).getPrettifiedValue(), is("Su-Th sunset-24:00,04:00-sunrise; Fr-Sa sunset-sunrise")); 57 59 } 58 60 … … 67 69 assertThat(errors.get(0).getMessage(), is(key + " - Mo-Tue <--- (Please use the abbreviation \"Tu\" for \"tue\".)")); 68 70 assertThat(errors.get(0).getSeverity(), is(Severity.WARNING)); 69 assertThat(errors.get(1).getMessage(), is(key + " - Mo-Tue <--- (This rule is not very explicit because there is no time selector being used."+ 71 assertThat(errors.get(1).getMessage(), is(key + 72 " - Mo-Tue <--- (This rule is not very explicit because there is no time selector being used."+ 70 73 " Please add a time selector to this rule or use a comment to make it more explicit.)")); 71 74 assertThat(errors.get(1).getSeverity(), is(Severity.WARNING)); … … 108 111 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "5.00 p.m-11.00 p.m"), hasSize(1)); 109 112 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "5.00 p.m-11.00 p.m").get(0).getMessage(), 110 is(key + " - 5.00 p <--- (hyphen (-) or open end (+) in time range expected. For working with points in time, the mode for opening_hours.js has to be altered. Maybe wrong tag?)")); 113 is(key + " - 5.00 p <--- (hyphen (-) or open end (+) in time range expected. " 114 + "For working with points in time, the mode for opening_hours.js has to be altered. Maybe wrong tag?)")); 111 115 } 112 116 … … 139 143 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo,Tu 04-17").get(0).getSeverity(), is(Severity.WARNING)); 140 144 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo,Tu 04-17").get(0).getMessage(), 141 is(key + " - Mo,Tu 04-17 <--- (Time range without minutes specified. Not very explicit! Please use this syntax instead \"04:00-17:00\".)")); 145 is(key + " - Mo,Tu 04-17 <--- (Time range without minutes specified. " 146 + "Not very explicit! Please use this syntax instead \"04:00-17:00\".)")); 142 147 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo,Tu 04-17").get(0).getPrettifiedValue(), is("Mo,Tu 04:00-17:00")); 143 148 } … … 154 159 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Sa 09:00-18:00", OpeningHourTest.CheckMode.BOTH), isEmpty()); 155 160 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Su 09:30; We 19:30", OpeningHourTest.CheckMode.BOTH), isEmpty()); 156 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 00:00-00:30,04:00-00:30; Sa,Su,PH 00:00-24:00", OpeningHourTest.CheckMode.BOTH), isEmpty()); 157 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 0:00-0:30,4:00-00:30; Sa,Su,PH 0:00-24:00", OpeningHourTest.CheckMode.BOTH), hasSize(1)); 158 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 0:00-0:30,4:00-00:30; Sa,Su,PH 0:00-24:00", OpeningHourTest.CheckMode.BOTH).get(0).getPrettifiedValue(), is("Mo-Fr 00:00-00:30,04:00-00:30; Sa,Su,PH 00:00-24:00")); 159 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 0:00-0:30,4:00-00:30; Sa,Su,PH 0:00-24:00", OpeningHourTest.CheckMode.BOTH).get(0).getPrettifiedValue(), is("Mo-Fr 00:00-00:30,04:00-00:30; Sa,Su,PH 00:00-24:00")); 161 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 00:00-00:30,04:00-00:30; Sa,Su,PH 00:00-24:00", 162 OpeningHourTest.CheckMode.BOTH), isEmpty()); 163 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 0:00-0:30,4:00-00:30; Sa,Su,PH 0:00-24:00", 164 OpeningHourTest.CheckMode.BOTH), hasSize(1)); 165 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 0:00-0:30,4:00-00:30; Sa,Su,PH 0:00-24:00", 166 OpeningHourTest.CheckMode.BOTH).get(0).getPrettifiedValue(), is("Mo-Fr 00:00-00:30,04:00-00:30; Sa,Su,PH 00:00-24:00")); 167 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 0:00-0:30,4:00-00:30; Sa,Su,PH 0:00-24:00", 168 OpeningHourTest.CheckMode.BOTH).get(0).getPrettifiedValue(), is("Mo-Fr 00:00-00:30,04:00-00:30; Sa,Su,PH 00:00-24:00")); 160 169 } 161 170 … … 170 179 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "fixme", OpeningHourTest.CheckMode.BOTH), not(isEmpty())); 171 180 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "daily", OpeningHourTest.CheckMode.BOTH), not(isEmpty())); 172 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 13:30,17:45,19:00; Sa 15:00; Su 11:00", OpeningHourTest.CheckMode.BOTH), isEmpty()); 173 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 13:30, 17:45, 19:00; Sa 15:00; Su 11:00", OpeningHourTest.CheckMode.BOTH), hasSize(1)); 174 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 13:30, 17:45, 19:00; Sa 15:00; Su 11:00", OpeningHourTest.CheckMode.BOTH).get(0).getSeverity(), is(Severity.OTHER)); 175 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 13:30, 17:45, 19:00; Sa 15:00; Su 11:00", OpeningHourTest.CheckMode.BOTH).get(0).getPrettifiedValue(), is("Mo-Fr 13:30,17:45,19:00; Sa 15:00; Su 11:00")); 181 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 13:30,17:45,19:00; Sa 15:00; Su 11:00", 182 OpeningHourTest.CheckMode.BOTH), isEmpty()); 183 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 13:30, 17:45, 19:00; Sa 15:00; Su 11:00", 184 OpeningHourTest.CheckMode.BOTH), hasSize(1)); 185 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 13:30, 17:45, 19:00; Sa 15:00; Su 11:00", 186 OpeningHourTest.CheckMode.BOTH).get(0).getSeverity(), is(Severity.OTHER)); 187 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 13:30, 17:45, 19:00; Sa 15:00; Su 11:00", 188 OpeningHourTest.CheckMode.BOTH).get(0).getPrettifiedValue(), is("Mo-Fr 13:30,17:45,19:00; Sa 15:00; Su 11:00")); 176 189 } 177 190 -
trunk/test/unit/org/openstreetmap/josm/gui/DefaultNameFormatterTest.java
r8450 r8509 44 44 /** 45 45 * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/9632">#9632</a>. 46 * @throws IllegalDataException 47 * @throws IOException 48 * @throws SAXException 46 * @throws IllegalDataException if an error was found while parsing the data from the source 47 * @throws IOException if any I/O error occurs 48 * @throws SAXException if any XML error occurs 49 49 */ 50 50 @Test … … 63 63 Relation p3 = (Relation) ds.getPrimitiveById(167042, OsmPrimitiveType.RELATION); 64 64 65 System.out.println("p1: "+DefaultNameFormatter.getInstance().format(p1)+" - "+p1); // route_master ("Bus 453", 6 members) 66 System.out.println("p2: "+DefaultNameFormatter.getInstance().format(p2)+" - "+p2); // TMC ("A 6 Kaiserslautern - Mannheim [negative]", 123 members) 67 System.out.println("p3: "+DefaultNameFormatter.getInstance().format(p3)+" - "+p3); // route(lcn Sal Salier-Radweg(412 members) 65 // route_master ("Bus 453", 6 members) 66 System.out.println("p1: "+DefaultNameFormatter.getInstance().format(p1)+" - "+p1); 67 // TMC ("A 6 Kaiserslautern - Mannheim [negative]", 123 members) 68 System.out.println("p2: "+DefaultNameFormatter.getInstance().format(p2)+" - "+p2); 69 // route(lcn Sal Salier-Radweg(412 members) 70 System.out.println("p3: "+DefaultNameFormatter.getInstance().format(p3)+" - "+p3); 68 71 69 72 assertSame(comparator.compare(p1, p2), -1); // p1 < p2 … … 91 94 assertThat(getFormattedRelationName("type=multipolygon building=yes"), is("multipolygon (\"building\", 0 members)")); 92 95 assertThat(getFormattedRelationName("type=multipolygon building=yes ref=123"), is("multipolygon (\"123\", 0 members)")); 93 assertThat(getFormattedRelationName("type=multipolygon building=yes addr:housenumber=123"), is("multipolygon (\"building\", 0 members)")); 94 assertThat(getFormattedRelationName("type=multipolygon building=residential addr:housenumber=123"), is("multipolygon (\"residential\", 0 members)")); 96 assertThat(getFormattedRelationName("type=multipolygon building=yes addr:housenumber=123"), 97 is("multipolygon (\"building\", 0 members)")); 98 assertThat(getFormattedRelationName("type=multipolygon building=residential addr:housenumber=123"), 99 is("multipolygon (\"residential\", 0 members)")); 95 100 } 96 101 … … 102 107 assertThat(getFormattedWayName("building=yes"), is("building (0 nodes)")); 103 108 assertThat(getFormattedWayName("building=yes addr:housenumber=123"), is("House number 123 (0 nodes)")); 104 assertThat(getFormattedWayName("building=yes addr:housenumber=123 addr:street=FooStreet"), is("House number 123 at FooStreet (0 nodes)")); 109 assertThat(getFormattedWayName("building=yes addr:housenumber=123 addr:street=FooStreet"), 110 is("House number 123 at FooStreet (0 nodes)")); 105 111 assertThat(getFormattedWayName("building=yes addr:housenumber=123 addr:housename=FooName"), is("House FooName (0 nodes)")); 106 112 } -
trunk/test/unit/org/openstreetmap/josm/gui/SystemOfMeasurementTest.java
r7937 r8509 1 // License: GPL. For details, see LICENSE file. 1 2 package org.openstreetmap.josm.gui; 2 3 -
trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/TagMergeItemTest.java
r7937 r8509 80 80 } 81 81 82 @Test ()82 @Test 83 83 public void test_decide_1() { 84 84 TagMergeItem item = new TagMergeItem("key", "myvalue", "theirvalue"); … … 91 91 } 92 92 93 @Test ()93 @Test 94 94 public void test_applyToMyPrimitive() { 95 95 TagMergeItem item = new TagMergeItem("key", "myvalue", "theirvalue"); … … 107 107 } 108 108 109 @Test ()109 @Test 110 110 public void test_applyToMyPrimitive_2() { 111 111 TagMergeItem item = new TagMergeItem("key", "myvalue", "theirvalue"); … … 122 122 } 123 123 124 @Test ()124 @Test 125 125 public void test_applyToMyPrimitive_3() { 126 126 TagMergeItem item = new TagMergeItem("key", "myvalue", "theirvalue"); … … 138 138 } 139 139 140 @Test ()140 @Test 141 141 public void test_applyToMyPrimitive_4() { 142 142 TagMergeItem item = new TagMergeItem("key", "myvalue", "theirvalue"); -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/LatLonDialogTest.java
r7937 r8509 1 // License: GPL. For details, see LICENSE file. 1 2 package org.openstreetmap.josm.gui.dialogs; 3 4 import static org.hamcrest.CoreMatchers.is; 5 import static org.junit.Assert.assertThat; 2 6 3 7 import org.junit.Test; 4 8 import org.openstreetmap.josm.data.coor.LatLon; 5 6 import static org.hamcrest.CoreMatchers.is;7 import static org.junit.Assert.assertThat;8 9 9 10 public class LatLonDialogTest { -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/ToolbarPreferencesTest.java
r8423 r8509 40 40 41 41 } 42 43 42 } 44 43 … … 67 66 checkAction(parser.loadAction("action(uknownParam=aa)")); 68 67 69 Assert.assertEquals("action(param1=value1,param2=value2)", parser.saveAction(parser.loadAction("action(param1=value1,param2=value2)"))); 70 Assert.assertEquals("action(param1=value1,param2=)", parser.saveAction(parser.loadAction("action(param1=value1)"))); 71 Assert.assertEquals("action(param1=value1,param2=2\\(\\=\\,\\\\)", parser.saveAction(parser.loadAction("action(param1=value1,param2=2\\(\\=\\,\\\\)"))); 68 Assert.assertEquals("action(param1=value1,param2=value2)", 69 parser.saveAction(parser.loadAction("action(param1=value1,param2=value2)"))); 70 Assert.assertEquals("action(param1=value1,param2=)", 71 parser.saveAction(parser.loadAction("action(param1=value1)"))); 72 Assert.assertEquals("action(param1=value1,param2=2\\(\\=\\,\\\\)", 73 parser.saveAction(parser.loadAction("action(param1=value1,param2=2\\(\\=\\,\\\\)"))); 72 74 } 73 74 75 } -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/PresetClassificationsTest.java
r8450 r8509 63 63 public void testRelationsForTram() { 64 64 final OsmPrimitive tram = OsmUtils.createPrimitive("way railway=tram"); 65 assertTrue("railway=tram should match 'Railway Route' for relation creation", getMatchingPresetNames("route", tram).contains("Railway Route")); 66 assertTrue("railway=tram should match 'Public Transport Route' for relation creation", getMatchingPresetNames("route", tram).contains("Public Transport Route")); 65 assertTrue("railway=tram should match 'Railway Route' for relation creation", getMatchingPresetNames("route", tram) 66 .contains("Railway Route")); 67 assertTrue("railway=tram should match 'Public Transport Route' for relation creation", getMatchingPresetNames("route", tram) 68 .contains("Public Transport Route")); 67 69 assertFalse("railway=tram should not match 'Bus route'", getMatchingPresetNames("route", tram).contains("Bus route")); 68 70 } -
trunk/test/unit/org/openstreetmap/josm/gui/util/RotationAngleTest.java
r8262 r8509 1 // License: GPL. For details, see LICENSE file. 1 2 package org.openstreetmap.josm.gui.util; 2 3 -
trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandlerTest.java
r8193 r8509 1 // License: GPL. For details, see LICENSE file. 1 2 package org.openstreetmap.josm.io.remotecontrol.handler; 3 4 import static org.junit.Assert.assertThat; 2 5 3 6 import org.hamcrest.CoreMatchers; 4 7 import org.junit.Test; 5 6 import static org.junit.Assert.*;7 8 8 9 public class ImportHandlerTest { … … 14 15 req.setUrl("http://localhost:8111/import?url=http://localhost:8888/relations?relations=19711&mode=recursive"); 15 16 assertThat(req.args.get("url"), CoreMatchers.is("http://localhost:8888/relations?relations=19711&mode=recursive")); 16 17 17 } 18 19 18 } -
trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandlerTest.java
r8193 r8509 1 // License: GPL. For details, see LICENSE file. 1 2 package org.openstreetmap.josm.io.remotecontrol.handler; 2 3 3 import org.junit.Test;4 import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault;4 import static org.hamcrest.CoreMatchers.is; 5 import static org.junit.Assert.assertThat; 5 6 6 7 import java.util.Collections; … … 8 9 import java.util.Map; 9 10 10 import static org.hamcrest.CoreMatchers.is;11 import static org.junit.Assert.*;11 import org.junit.Test; 12 import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault; 12 13 13 14 public class RequestHandlerTest { … … 70 71 @Test 71 72 public void testRequestParameter4() { 72 assertThat(getRequestParameter("http://example.com/:@-._~!$&'()*+,=;:@-._~!$&'()*+,=:@-._~!$&'()*+,==?/?:@-._~!$'()*+,;=/?:@-._~!$'()*+,;==#/?:@-._~!$&'()*+,;="), 73 assertThat(getRequestParameter( 74 "http://example.com/:@-._~!$&'()*+,=;:@-._~!$&'()*+,=:@-._~!$&'()*+,==?/?:@-._~!$'()*+,;=/?:@-._~!$'()*+,;==#/?:@-._~!$&'()*+,;="), 73 75 is(Collections.singletonMap("/?:@-._~!$'()* ,;", "/?:@-._~!$'()* ,;=="))); 74 76 } … … 82 84 is(expected)); 83 85 } 84 85 86 } -
trunk/test/unit/org/openstreetmap/josm/tools/BugReportExceptionHandlerTest.java
r8356 r8509 33 33 /** 34 34 * Test method for {@link org.openstreetmap.josm.tools.BugReportExceptionHandler#getBugReportUrl(java.lang.String)}. 35 * @throws IOException 35 * @throws IOException if any I/O error occurs 36 36 */ 37 37 @Test -
trunk/test/unit/org/openstreetmap/josm/tools/ExifReaderTest.java
r7959 r8509 23 23 24 24 private File orientationSampleFile, directionSampleFile; 25 25 26 26 /** 27 27 * Setup test 28 * @throws Exception29 28 */ 30 29 @Before 31 public void setUp() throws Exception{30 public void setUp() { 32 31 directionSampleFile = new File("data_nodist/exif-example_direction.jpg"); 33 32 orientationSampleFile = new File("data_nodist/exif-example_orientation=6.jpg"); 34 33 } 35 34 36 /** 35 /** 37 36 * Test time extraction 38 * @throws ParseException 37 * @throws ParseException if {@link ExifReader#readTime} fails to parse date/time of sample file 39 38 */ 40 39 @Test … … 52 51 assertEquals(Integer.valueOf(6), orientation); 53 52 } 54 53 55 54 /** 56 55 * Test coordinates extraction -
trunk/test/unit/org/openstreetmap/josm/tools/OsmUrlToBoundsTest.java
r6920 r8509 15 15 private static final ParseTestItem[] parseTestData = { 16 16 new ParseTestItem("https://www.openstreetmap.org", null), 17 new ParseTestItem("https://www.openstreetmap.org/?bbox=-0.489,51.28,0.236,51.686", new Bounds(51.28, -0.489, 51.686, 0.236)), 18 new ParseTestItem("https://www.openstreetmap.org/?minlon=-0.489&minlat=51.28&maxlon=0.236&maxlat=51.686", new Bounds(51.28, -0.489, 51.686, 0.236)), 19 new ParseTestItem("https://www.openstreetmap.org/?maxlat=51.686&maxlon=0.236&minlat=51.28&minlon=-0.489", new Bounds(51.28, -0.489, 51.686, 0.236)), 20 new ParseTestItem("https://www.openstreetmap.org/?zoom=17&lat=51.71873&lon=8.76164", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 17)), 21 new ParseTestItem("https://www.openstreetmap.org/?lon=8.76164&lat=51.71873&zoom=17&foo", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 17)), 22 new ParseTestItem("https://www.openstreetmap.org/?mlon=8.76164&mlat=51.71873", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 18)), 23 new ParseTestItem("http://osm.org/go/euulwp", OsmUrlToBounds.positionToBounds(51.48262023925781, -0.29937744140625, 8)), 24 new ParseTestItem("https://www.openstreetmap.org/#map=17/51.71873/8.76164", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 17)), 25 new ParseTestItem("https://www.openstreetmap.org/#map=17/51.71873/8.76164&layers=CN", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 17)), 26 new ParseTestItem("https%3A%2F%2Fwww.openstreetmap.org%2F%23map%3D16%2F51.71873%2F8.76164", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 16)), 27 new ParseTestItem("https%3A%2F%2Fwww.openstreetmap.org%2F%23map%3D16%2F51.71873%2F8.76164%26layers%3DCN", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 16)), 28 new ParseTestItem("https://www.openstreetmap.org/?note=26325#map=18/40.86215/-75.75020", OsmUrlToBounds.positionToBounds(40.86215, -75.75020, 18)), 29 new ParseTestItem("https://www.openstreetmap.org/?note=26325#map=18/40.86215/-75.75020&layers=N", OsmUrlToBounds.positionToBounds(40.86215, -75.75020, 18)), 30 new ParseTestItem("https://www.openstreetmap.org/?mlat=51.5&mlon=-0.01#map=10/51.4831/-0.1270", OsmUrlToBounds.positionToBounds(51.4831, -0.1270, 10)), 31 new ParseTestItem("https://www.openstreetmap.org/?mlat=51.5&mlon=-0.01#map=10/51.4831/-0.3509&layers=T", OsmUrlToBounds.positionToBounds(51.4831, -0.3509, 10)), 17 new ParseTestItem("https://www.openstreetmap.org/?bbox=-0.489,51.28,0.236,51.686", 18 new Bounds(51.28, -0.489, 51.686, 0.236)), 19 new ParseTestItem("https://www.openstreetmap.org/?minlon=-0.489&minlat=51.28&maxlon=0.236&maxlat=51.686", 20 new Bounds(51.28, -0.489, 51.686, 0.236)), 21 new ParseTestItem("https://www.openstreetmap.org/?maxlat=51.686&maxlon=0.236&minlat=51.28&minlon=-0.489", 22 new Bounds(51.28, -0.489, 51.686, 0.236)), 23 new ParseTestItem("https://www.openstreetmap.org/?zoom=17&lat=51.71873&lon=8.76164", 24 OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 17)), 25 new ParseTestItem("https://www.openstreetmap.org/?lon=8.76164&lat=51.71873&zoom=17&foo", 26 OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 17)), 27 new ParseTestItem("https://www.openstreetmap.org/?mlon=8.76164&mlat=51.71873", 28 OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 18)), 29 new ParseTestItem("http://osm.org/go/euulwp", 30 OsmUrlToBounds.positionToBounds(51.48262023925781, -0.29937744140625, 8)), 31 new ParseTestItem("https://www.openstreetmap.org/#map=17/51.71873/8.76164", 32 OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 17)), 33 new ParseTestItem("https://www.openstreetmap.org/#map=17/51.71873/8.76164&layers=CN", 34 OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 17)), 35 new ParseTestItem("https%3A%2F%2Fwww.openstreetmap.org%2F%23map%3D16%2F51.71873%2F8.76164", 36 OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 16)), 37 new ParseTestItem("https%3A%2F%2Fwww.openstreetmap.org%2F%23map%3D16%2F51.71873%2F8.76164%26layers%3DCN", 38 OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 16)), 39 new ParseTestItem("https://www.openstreetmap.org/?note=26325#map=18/40.86215/-75.75020", 40 OsmUrlToBounds.positionToBounds(40.86215, -75.75020, 18)), 41 new ParseTestItem("https://www.openstreetmap.org/?note=26325#map=18/40.86215/-75.75020&layers=N", 42 OsmUrlToBounds.positionToBounds(40.86215, -75.75020, 18)), 43 new ParseTestItem("https://www.openstreetmap.org/?mlat=51.5&mlon=-0.01#map=10/51.4831/-0.1270", 44 OsmUrlToBounds.positionToBounds(51.4831, -0.1270, 10)), 45 new ParseTestItem("https://www.openstreetmap.org/?mlat=51.5&mlon=-0.01#map=10/51.4831/-0.3509&layers=T", 46 OsmUrlToBounds.positionToBounds(51.4831, -0.3509, 10)), 32 47 new ParseTestItem("https://www.openstreetmap.org/#map", null), 33 48 new ParseTestItem("https://www.openstreetmap.org/#map=foo", null), -
trunk/test/unit/org/openstreetmap/josm/tools/date/DateUtilsTest.java
r8322 r8509 3 3 4 4 import static org.hamcrest.CoreMatchers.is; 5 import static org.junit.Assert. *;5 import static org.junit.Assert.assertThat; 6 6 7 7 import org.junit.Test; -
trunk/test/unit/org/openstreetmap/josm/tools/template_engine/TemplateEngineTest.java
r7937 r8509 36 36 public void testVariable() throws ParseError { 37 37 TemplateParser parser = new TemplateParser("abc{var}\\{ef\\$\\{g"); 38 ReflectionAssert.assertReflectionEquals(CompoundTemplateEntry.fromArray(new StaticText("abc"), new Variable("var"), new StaticText("{ef${g")), parser.parse()); 38 ReflectionAssert.assertReflectionEquals(CompoundTemplateEntry.fromArray(new StaticText("abc"), 39 new Variable("var"), new StaticText("{ef${g")), parser.parse()); 39 40 } 40 41
Note:
See TracChangeset
for help on using the changeset viewer.