Changeset 8513 in josm for trunk/test/unit
- Timestamp:
- 2015-06-21T02:25:56+02:00 (9 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryWayTest.java
r8510 r8513 10 10 11 11 import org.junit.Test; 12 import org.openstreetmap.josm.Main; 12 13 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 13 14 import org.openstreetmap.josm.data.osm.User; … … 73 74 } catch (IndexOutOfBoundsException e) { 74 75 // OK 76 if (Main.isTraceEnabled()) { 77 Main.trace(e.getMessage()); 78 } 75 79 } 76 80 -
trunk/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java
r8510 r8513 79 79 @Test 80 80 public void a_latlon2eastNorth_test() { 81 { 82 LatLon ll = new LatLon(46.518, 6.567); 83 EastNorth en = Main.getProjection().latlon2eastNorth(ll); 84 if (debug) { 85 System.out.println(en); 86 } 87 assertTrue("Lausanne", Math.abs(en.east() - 533111.69) < 0.1); 88 assertTrue("Lausanne", Math.abs(en.north() - 152227.85) < 0.1); 89 } 90 91 { 92 LatLon ll = new LatLon(47.78, 8.58); 93 EastNorth en = Main.getProjection().latlon2eastNorth(ll); 94 if (debug) { 95 System.out.println(en); 96 } 97 assertTrue("Schafouse", Math.abs(en.east() - 685544.16) < 0.1); 98 assertTrue("Schafouse", Math.abs(en.north() - 292782.91) < 0.1); 99 } 100 101 { 102 LatLon ll = new LatLon(46.58, 10.48); 103 EastNorth en = Main.getProjection().latlon2eastNorth(ll); 104 if (debug) { 105 System.out.println(en); 106 } 107 assertTrue("Grinson", Math.abs(en.east() - 833068.04) < 0.1); 108 assertTrue("Grinson", Math.abs(en.north() - 163265.39) < 0.1); 109 } 110 111 { 112 LatLon ll = new LatLon(46.0 + 57.0 / 60 + 3.89813884505 / 3600, 7.0 + 26.0 / 60 + 19.076595154147 / 3600); 113 EastNorth en = Main.getProjection().latlon2eastNorth(ll); 114 if (debug) { 115 System.out.println(en); 116 } 117 assertTrue("Berne", Math.abs(en.east() - 600000.0) < 0.1); 118 assertTrue("Berne", Math.abs(en.north() - 200000.0) < 0.1); 119 } 120 { 121 LatLon ll = new LatLon(46.0 + 2.0 / 60 + 38.87 / 3600, 8.0 + 43.0 / 60 + 49.79 / 3600); 122 EastNorth en = Main.getProjection().latlon2eastNorth(ll); 123 if (debug) { 124 System.out.println(en); 125 } 126 assertTrue("Ref", Math.abs(en.east() - 700000.0) < 0.1); 127 assertTrue("Ref", Math.abs(en.north() - 100000.0) < 0.1); 128 } 81 LatLon ll = new LatLon(46.518, 6.567); 82 EastNorth en = Main.getProjection().latlon2eastNorth(ll); 83 if (debug) { 84 System.out.println(en); 85 } 86 assertTrue("Lausanne", Math.abs(en.east() - 533111.69) < 0.1); 87 assertTrue("Lausanne", Math.abs(en.north() - 152227.85) < 0.1); 88 89 ll = new LatLon(47.78, 8.58); 90 en = Main.getProjection().latlon2eastNorth(ll); 91 if (debug) { 92 System.out.println(en); 93 } 94 assertTrue("Schafouse", Math.abs(en.east() - 685544.16) < 0.1); 95 assertTrue("Schafouse", Math.abs(en.north() - 292782.91) < 0.1); 96 97 ll = new LatLon(46.58, 10.48); 98 en = Main.getProjection().latlon2eastNorth(ll); 99 if (debug) { 100 System.out.println(en); 101 } 102 assertTrue("Grinson", Math.abs(en.east() - 833068.04) < 0.1); 103 assertTrue("Grinson", Math.abs(en.north() - 163265.39) < 0.1); 104 105 ll = new LatLon(46.0 + 57.0 / 60 + 3.89813884505 / 3600, 7.0 + 26.0 / 60 + 19.076595154147 / 3600); 106 en = Main.getProjection().latlon2eastNorth(ll); 107 if (debug) { 108 System.out.println(en); 109 } 110 assertTrue("Berne", Math.abs(en.east() - 600000.0) < 0.1); 111 assertTrue("Berne", Math.abs(en.north() - 200000.0) < 0.1); 112 113 ll = new LatLon(46.0 + 2.0 / 60 + 38.87 / 3600, 8.0 + 43.0 / 60 + 49.79 / 3600); 114 en = Main.getProjection().latlon2eastNorth(ll); 115 if (debug) { 116 System.out.println(en); 117 } 118 assertTrue("Ref", Math.abs(en.east() - 700000.0) < 0.1); 119 assertTrue("Ref", Math.abs(en.north() - 100000.0) < 0.1); 129 120 } 130 121 131 122 @Test 132 123 public void b_eastNorth2latlon_test() { 133 { 134 EastNorth en = new EastNorth(533111.69, 152227.85); 135 LatLon ll = Main.getProjection().eastNorth2latlon(en); 136 if (debug) { 137 System.out.println(ll); 138 } 139 assertTrue("Lausanne", Math.abs(ll.lat() - 46.518) < 0.00001); 140 assertTrue("Lausanne", Math.abs(ll.lon() - 6.567) < 0.00001); 141 } 142 143 { 144 EastNorth en = new EastNorth(685544.16, 292782.91); 145 LatLon ll = Main.getProjection().eastNorth2latlon(en); 146 if (debug) { 147 System.out.println(ll); 148 } 149 assertTrue("Schafouse", Math.abs(ll.lat() - 47.78) < 0.00001); 150 assertTrue("Schafouse", Math.abs(ll.lon() - 8.58) < 0.00001); 151 } 152 153 { 154 EastNorth en = new EastNorth(833068.04, 163265.39); 155 LatLon ll = Main.getProjection().eastNorth2latlon(en); 156 if (debug) { 157 System.out.println(ll); 158 } 159 assertTrue("Grinson", Math.abs(ll.lat() - 46.58) < 0.00001); 160 assertTrue("Grinson", Math.abs(ll.lon() - 10.48) < 0.00001); 161 } 162 163 { 164 EastNorth en = new EastNorth(600000.0, 200000.0); 165 LatLon ll = Main.getProjection().eastNorth2latlon(en); 166 if (debug) { 167 System.out.println(ll); 168 } 169 assertTrue("Berne", Math.abs(ll.lat() - (46.0 + 57.0 / 60 + 3.89813884505 / 3600)) < 0.00001); 170 assertTrue("Berne", Math.abs(ll.lon() - (7.0 + 26.0 / 60 + 19.076595154147 / 3600)) < 0.00001); 171 } 172 173 { 174 EastNorth en = new EastNorth(700000.0, 100000.0); 175 LatLon ll = Main.getProjection().eastNorth2latlon(en); 176 if (debug) { 177 System.out.println(ll); 178 } 179 assertTrue("Ref", Math.abs(ll.lat() - (46.0 + 2.0 / 60 + 38.87 / 3600)) < 0.00001); 180 assertTrue("Ref", Math.abs(ll.lon() - (8.0 + 43.0 / 60 + 49.79 / 3600)) < 0.00001); 181 } 182 } 183 124 EastNorth en = new EastNorth(533111.69, 152227.85); 125 LatLon ll = Main.getProjection().eastNorth2latlon(en); 126 if (debug) { 127 System.out.println(ll); 128 } 129 assertTrue("Lausanne", Math.abs(ll.lat() - 46.518) < 0.00001); 130 assertTrue("Lausanne", Math.abs(ll.lon() - 6.567) < 0.00001); 131 132 en = new EastNorth(685544.16, 292782.91); 133 ll = Main.getProjection().eastNorth2latlon(en); 134 if (debug) { 135 System.out.println(ll); 136 } 137 assertTrue("Schafouse", Math.abs(ll.lat() - 47.78) < 0.00001); 138 assertTrue("Schafouse", Math.abs(ll.lon() - 8.58) < 0.00001); 139 140 en = new EastNorth(833068.04, 163265.39); 141 ll = Main.getProjection().eastNorth2latlon(en); 142 if (debug) { 143 System.out.println(ll); 144 } 145 assertTrue("Grinson", Math.abs(ll.lat() - 46.58) < 0.00001); 146 assertTrue("Grinson", Math.abs(ll.lon() - 10.48) < 0.00001); 147 148 en = new EastNorth(600000.0, 200000.0); 149 ll = Main.getProjection().eastNorth2latlon(en); 150 if (debug) { 151 System.out.println(ll); 152 } 153 assertTrue("Berne", Math.abs(ll.lat() - (46.0 + 57.0 / 60 + 3.89813884505 / 3600)) < 0.00001); 154 assertTrue("Berne", Math.abs(ll.lon() - (7.0 + 26.0 / 60 + 19.076595154147 / 3600)) < 0.00001); 155 156 en = new EastNorth(700000.0, 100000.0); 157 ll = Main.getProjection().eastNorth2latlon(en); 158 if (debug) { 159 System.out.println(ll); 160 } 161 assertTrue("Ref", Math.abs(ll.lat() - (46.0 + 2.0 / 60 + 38.87 / 3600)) < 0.00001); 162 assertTrue("Ref", Math.abs(ll.lon() - (8.0 + 43.0 / 60 + 49.79 / 3600)) < 0.00001); 163 } 184 164 185 165 /** … … 188 168 @Test 189 169 public void c_sendandreturn_test() { 190 { 191 EastNorth en = new EastNorth(533111.69, 152227.85); 192 LatLon ll = Main.getProjection().eastNorth2latlon(en); 193 EastNorth en2 = Main.getProjection().latlon2eastNorth(ll); 194 if (debug) { 195 System.out.println(en.east() - en2.east()); 196 } 197 if (debug) { 198 System.out.println(en.north() - en2.north()); 199 } 200 assertTrue("Lausanne", Math.abs(en.east() - en2.east()) < 0.002); 201 assertTrue("Lausanne", Math.abs(en.north() - en2.north()) < 0.002); 202 } 203 204 { 205 EastNorth en = new EastNorth(685544.16, 292782.91); 206 LatLon ll = Main.getProjection().eastNorth2latlon(en); 207 EastNorth en2 = Main.getProjection().latlon2eastNorth(ll); 208 if (debug) { 209 System.out.println(en.east() - en2.east()); 210 } 211 if (debug) { 212 System.out.println(en.north() - en2.north()); 213 } 214 assertTrue("Schafouse", Math.abs(en.east() - en2.east()) < 0.002); 215 assertTrue("Schafouse", Math.abs(en.north() - en2.north()) < 0.002); 216 } 217 218 { 219 EastNorth en = new EastNorth(833068.04, 163265.39); 220 LatLon ll = Main.getProjection().eastNorth2latlon(en); 221 EastNorth en2 = Main.getProjection().latlon2eastNorth(ll); 222 if (debug) { 223 System.out.println(en.east() - en2.east()); 224 } 225 if (debug) { 226 System.out.println(en.north() - en2.north()); 227 } 228 assertTrue("Grinson", Math.abs(en.east() - en2.east()) < 0.002); 229 assertTrue("Grinson", Math.abs(en.north() - en2.north()) < 0.002); 230 } 231 232 { 233 EastNorth en = new EastNorth(600000.0, 200000.0); 234 LatLon ll = Main.getProjection().eastNorth2latlon(en); 235 EastNorth en2 = Main.getProjection().latlon2eastNorth(ll); 236 if (debug) { 237 System.out.println(en.east() - en2.east()); 238 } 239 if (debug) { 240 System.out.println(en.north() - en2.north()); 241 } 242 assertTrue("Berne", Math.abs(en.east() - en2.east()) < 0.002); 243 assertTrue("Berne", Math.abs(en.north() - en2.north()) < 0.002); 244 } 245 246 { 247 EastNorth en = new EastNorth(700000.0, 100000.0); 248 LatLon ll = Main.getProjection().eastNorth2latlon(en); 249 EastNorth en2 = Main.getProjection().latlon2eastNorth(ll); 250 if (debug) { 251 System.out.println(en.east() - en2.east()); 252 } 253 if (debug) { 254 System.out.println(en.north() - en2.north()); 255 } 256 assertTrue("Ref", Math.abs(en.east() - en2.east()) < 0.002); 257 assertTrue("Ref", Math.abs(en.north() - en2.north()) < 0.002); 258 } 170 EastNorth en = new EastNorth(533111.69, 152227.85); 171 LatLon ll = Main.getProjection().eastNorth2latlon(en); 172 EastNorth en2 = Main.getProjection().latlon2eastNorth(ll); 173 if (debug) { 174 System.out.println(en.east() - en2.east()); 175 } 176 if (debug) { 177 System.out.println(en.north() - en2.north()); 178 } 179 assertTrue("Lausanne", Math.abs(en.east() - en2.east()) < 0.002); 180 assertTrue("Lausanne", Math.abs(en.north() - en2.north()) < 0.002); 181 182 en = new EastNorth(685544.16, 292782.91); 183 ll = Main.getProjection().eastNorth2latlon(en); 184 en2 = Main.getProjection().latlon2eastNorth(ll); 185 if (debug) { 186 System.out.println(en.east() - en2.east()); 187 } 188 if (debug) { 189 System.out.println(en.north() - en2.north()); 190 } 191 assertTrue("Schafouse", Math.abs(en.east() - en2.east()) < 0.002); 192 assertTrue("Schafouse", Math.abs(en.north() - en2.north()) < 0.002); 193 194 en = new EastNorth(833068.04, 163265.39); 195 ll = Main.getProjection().eastNorth2latlon(en); 196 en2 = Main.getProjection().latlon2eastNorth(ll); 197 if (debug) { 198 System.out.println(en.east() - en2.east()); 199 } 200 if (debug) { 201 System.out.println(en.north() - en2.north()); 202 } 203 assertTrue("Grinson", Math.abs(en.east() - en2.east()) < 0.002); 204 assertTrue("Grinson", Math.abs(en.north() - en2.north()) < 0.002); 205 206 en = new EastNorth(600000.0, 200000.0); 207 ll = Main.getProjection().eastNorth2latlon(en); 208 en2 = Main.getProjection().latlon2eastNorth(ll); 209 if (debug) { 210 System.out.println(en.east() - en2.east()); 211 } 212 if (debug) { 213 System.out.println(en.north() - en2.north()); 214 } 215 assertTrue("Berne", Math.abs(en.east() - en2.east()) < 0.002); 216 assertTrue("Berne", Math.abs(en.north() - en2.north()) < 0.002); 217 218 en = new EastNorth(700000.0, 100000.0); 219 ll = Main.getProjection().eastNorth2latlon(en); 220 en2 = Main.getProjection().latlon2eastNorth(ll); 221 if (debug) { 222 System.out.println(en.east() - en2.east()); 223 } 224 if (debug) { 225 System.out.println(en.north() - en2.north()); 226 } 227 assertTrue("Ref", Math.abs(en.east() - en2.east()) < 0.002); 228 assertTrue("Ref", Math.abs(en.north() - en2.north()) < 0.002); 259 229 } 260 230 } -
trunk/test/unit/org/openstreetmap/josm/gui/conflict/nodes/NodeListMergeModelTest.java
r8510 r8513 21 21 import org.junit.Test; 22 22 import org.openstreetmap.josm.JOSMFixture; 23 import org.openstreetmap.josm.Main; 23 24 import org.openstreetmap.josm.data.osm.DatasetFactory; 24 25 import org.openstreetmap.josm.data.osm.Node; … … 357 358 } catch (IllegalArgumentException e) { 358 359 // OK 360 if (Main.isTraceEnabled()) { 361 Main.trace(e.getMessage()); 362 } 359 363 } 360 364 … … 364 368 } catch (IllegalArgumentException e) { 365 369 // OK 370 if (Main.isTraceEnabled()) { 371 Main.trace(e.getMessage()); 372 } 366 373 } 367 374 } -
trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/TagMergeItemTest.java
r8510 r8513 9 9 import org.junit.Test; 10 10 import org.openstreetmap.josm.JOSMFixture; 11 import org.openstreetmap.josm.Main; 11 12 import org.openstreetmap.josm.data.osm.Node; 12 13 import org.openstreetmap.josm.gui.conflict.pair.MergeDecisionType; … … 87 88 } catch (IllegalArgumentException e) { 88 89 // OK 90 if (Main.isTraceEnabled()) { 91 Main.trace(e.getMessage()); 92 } 89 93 } 90 94 } … … 133 137 } catch (IllegalStateException e) { 134 138 // OK 139 if (Main.isTraceEnabled()) { 140 Main.trace(e.getMessage()); 141 } 135 142 } 136 143 } … … 145 152 } catch (IllegalArgumentException e) { 146 153 // OK 154 if (Main.isTraceEnabled()) { 155 Main.trace(e.getMessage()); 156 } 147 157 } 148 158 } -
trunk/test/unit/org/openstreetmap/josm/tools/OsmUrlToBoundsTest.java
r8509 r8513 4 4 import org.junit.Assert; 5 5 import org.junit.Test; 6 import org.openstreetmap.josm.Main; 6 7 import org.openstreetmap.josm.data.Bounds; 7 8 … … 71 72 } catch (IllegalArgumentException e) { 72 73 // Ignore. check if bounds is null after 74 if (Main.isTraceEnabled()) { 75 Main.trace(e.getMessage()); 76 } 73 77 } 74 78 Assert.assertEquals(item.url, item.bounds, bounds);
Note:
See TracChangeset
for help on using the changeset viewer.