Changeset 8509 in josm for trunk/test/unit/org/openstreetmap/josm/data
- Timestamp:
- 2015-06-20T14:36:00+02:00 (10 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/data
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.