Changeset 4126 in josm for trunk/test/unit
- Timestamp:
- 2011-06-07T19:05:14+02:00 (14 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetMergerTest.java
r3577 r4126 76 76 their = new DataSet(); 77 77 their.setVersion("0.6"); 78 Main. proj =new Mercator();78 Main.setProjection(new Mercator()); 79 79 } 80 80 -
trunk/test/unit/org/openstreetmap/josm/data/osm/FilterTest.java
r3577 r4126 29 29 @BeforeClass 30 30 public static void setUp() { 31 Main. proj =new Mercator();31 Main.setProjection(new Mercator()); 32 32 Main.pref = new Preferences(); 33 33 } -
trunk/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveTest.java
r3577 r4126 29 29 @BeforeClass 30 30 public static void setUp() { 31 Main. proj =new Mercator();31 Main.setProjection(new Mercator()); 32 32 } 33 33 -
trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java
r3577 r4126 66 66 @Test 67 67 public void testRemove() throws Exception { 68 Main. proj =new Mercator();68 Main.setProjection(new Mercator()); 69 69 DataSet ds = OsmReader.parseDataSet(new FileInputStream("data_nodist/restriction.osm"), NullProgressMonitor.INSTANCE); 70 70 removeAllTest(ds); … … 73 73 @Test 74 74 public void testMove() throws Exception { 75 Main. proj =new Mercator();75 Main.setProjection(new Mercator()); 76 76 DataSet ds = OsmReader.parseDataSet(new FileInputStream("data_nodist/restriction.osm"), NullProgressMonitor.INSTANCE); 77 77 -
trunk/test/unit/org/openstreetmap/josm/data/osm/RelationTest.java
r3577 r4126 16 16 @BeforeClass 17 17 public static void setUp() { 18 Main. proj =new Mercator();18 Main.setProjection(new Mercator()); 19 19 Main.pref = new Preferences(); 20 20 } -
trunk/test/unit/org/openstreetmap/josm/data/osm/visitor/MergeSourceBuildingVisitorTest.java
r3577 r4126 37 37 @BeforeClass 38 38 public static void setUp() { 39 Main. proj =new Mercator();39 Main.setProjection(new Mercator()); 40 40 Main.pref = new Preferences(); 41 41 } -
trunk/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java
r3485 r4126 15 15 @BeforeClass 16 16 public static void setUp() { 17 Main. proj =new SwissGrid();17 Main.setProjection(new SwissGrid()); 18 18 } 19 19 … … 62 62 { 63 63 LatLon ll = new LatLon(46.518, 6.567); 64 EastNorth en = Main.proj.latlon2eastNorth(ll); 65 if (debug) System.out.println(en); 64 EastNorth en = Main.getProjection().latlon2eastNorth(ll); 65 if (debug) { 66 System.out.println(en); 67 } 66 68 assertTrue("Lausanne", Math.abs(en.east() - 533111.69) < 0.1); 67 69 assertTrue("Lausanne", Math.abs(en.north() - 152227.85) < 0.1); … … 70 72 { 71 73 LatLon ll = new LatLon(47.78, 8.58); 72 EastNorth en = Main.proj.latlon2eastNorth(ll); 73 if (debug) System.out.println(en); 74 EastNorth en = Main.getProjection().latlon2eastNorth(ll); 75 if (debug) { 76 System.out.println(en); 77 } 74 78 assertTrue("Schafouse", Math.abs(en.east() - 685544.16) < 0.1); 75 79 assertTrue("Schafouse", Math.abs(en.north() - 292782.91) < 0.1); … … 78 82 { 79 83 LatLon ll = new LatLon(46.58, 10.48); 80 EastNorth en = Main.proj.latlon2eastNorth(ll); 81 if (debug) System.out.println(en); 84 EastNorth en = Main.getProjection().latlon2eastNorth(ll); 85 if (debug) { 86 System.out.println(en); 87 } 82 88 assertTrue("Grinson", Math.abs(en.east() - 833068.04) < 0.1); 83 89 assertTrue("Grinson", Math.abs(en.north() - 163265.39) < 0.1); … … 86 92 { 87 93 LatLon ll = new LatLon(46.0 + 57.0 / 60 + 3.89813884505 / 3600, 7.0 + 26.0 / 60 + 19.076595154147 / 3600); 88 EastNorth en = Main.proj.latlon2eastNorth(ll); 89 if (debug) System.out.println(en); 94 EastNorth en = Main.getProjection().latlon2eastNorth(ll); 95 if (debug) { 96 System.out.println(en); 97 } 90 98 assertTrue("Berne", Math.abs(en.east() - 600000.0) < 0.1); 91 99 assertTrue("Berne", Math.abs(en.north() - 200000.0) < 0.1); … … 93 101 { 94 102 LatLon ll = new LatLon(46.0 + 2.0 / 60 + 38.87 / 3600, 8.0 + 43.0 / 60 + 49.79 / 3600); 95 EastNorth en = Main.proj.latlon2eastNorth(ll); 96 if (debug) System.out.println(en); 103 EastNorth en = Main.getProjection().latlon2eastNorth(ll); 104 if (debug) { 105 System.out.println(en); 106 } 97 107 assertTrue("Ref", Math.abs(en.east() - 700000.0) < 0.1); 98 108 assertTrue("Ref", Math.abs(en.north() - 100000.0) < 0.1); … … 105 115 { 106 116 EastNorth en = new EastNorth(533111.69, 152227.85); 107 LatLon ll = Main.proj.eastNorth2latlon(en); 108 if (debug) System.out.println(ll); 117 LatLon ll = Main.getProjection().eastNorth2latlon(en); 118 if (debug) { 119 System.out.println(ll); 120 } 109 121 assertTrue("Lausanne", Math.abs(ll.lat() - 46.518) < 0.00001); 110 122 assertTrue("Lausanne", Math.abs(ll.lon() - 6.567) < 0.00001); … … 113 125 { 114 126 EastNorth en = new EastNorth(685544.16, 292782.91); 115 LatLon ll = Main.proj.eastNorth2latlon(en); 116 if (debug) System.out.println(ll); 127 LatLon ll = Main.getProjection().eastNorth2latlon(en); 128 if (debug) { 129 System.out.println(ll); 130 } 117 131 assertTrue("Schafouse", Math.abs(ll.lat() - 47.78) < 0.00001); 118 132 assertTrue("Schafouse", Math.abs(ll.lon() - 8.58) < 0.00001); … … 121 135 { 122 136 EastNorth en = new EastNorth(833068.04, 163265.39); 123 LatLon ll = Main.proj.eastNorth2latlon(en); 124 if (debug) System.out.println(ll); 137 LatLon ll = Main.getProjection().eastNorth2latlon(en); 138 if (debug) { 139 System.out.println(ll); 140 } 125 141 assertTrue("Grinson", Math.abs(ll.lat() - 46.58) < 0.00001); 126 142 assertTrue("Grinson", Math.abs(ll.lon() - 10.48) < 0.00001); … … 129 145 { 130 146 EastNorth en = new EastNorth(600000.0, 200000.0); 131 LatLon ll = Main.proj.eastNorth2latlon(en); 132 if (debug) System.out.println(ll); 147 LatLon ll = Main.getProjection().eastNorth2latlon(en); 148 if (debug) { 149 System.out.println(ll); 150 } 133 151 assertTrue("Berne", Math.abs(ll.lat() - (46.0 + 57.0 / 60 + 3.89813884505 / 3600)) < 0.00001); 134 152 assertTrue("Berne", Math.abs(ll.lon() - (7.0 + 26.0 / 60 + 19.076595154147 / 3600)) < 0.00001); … … 137 155 { 138 156 EastNorth en = new EastNorth(700000.0, 100000.0); 139 LatLon ll = Main.proj.eastNorth2latlon(en); 140 if (debug) System.out.println(ll); 157 LatLon ll = Main.getProjection().eastNorth2latlon(en); 158 if (debug) { 159 System.out.println(ll); 160 } 141 161 assertTrue("Ref", Math.abs(ll.lat() - (46.0 + 2.0 / 60 + 38.87 / 3600)) < 0.00001); 142 162 assertTrue("Ref", Math.abs(ll.lon() - (8.0 + 43.0 / 60 + 49.79 / 3600)) < 0.00001); … … 152 172 { 153 173 EastNorth en = new EastNorth(533111.69, 152227.85); 154 LatLon ll = Main.proj.eastNorth2latlon(en); 155 EastNorth en2 = Main.proj.latlon2eastNorth(ll); 156 if (debug) System.out.println(en.east() - en2.east()); 157 if (debug) System.out.println(en.north() - en2.north()); 174 LatLon ll = Main.getProjection().eastNorth2latlon(en); 175 EastNorth en2 = Main.getProjection().latlon2eastNorth(ll); 176 if (debug) { 177 System.out.println(en.east() - en2.east()); 178 } 179 if (debug) { 180 System.out.println(en.north() - en2.north()); 181 } 158 182 assertTrue("Lausanne", Math.abs(en.east() - en2.east()) < 0.002); 159 183 assertTrue("Lausanne", Math.abs(en.north() - en2.north()) < 0.002); … … 162 186 { 163 187 EastNorth en = new EastNorth(685544.16, 292782.91); 164 LatLon ll = Main.proj.eastNorth2latlon(en); 165 EastNorth en2 = Main.proj.latlon2eastNorth(ll); 166 if (debug) System.out.println(en.east() - en2.east()); 167 if (debug) System.out.println(en.north() - en2.north()); 188 LatLon ll = Main.getProjection().eastNorth2latlon(en); 189 EastNorth en2 = Main.getProjection().latlon2eastNorth(ll); 190 if (debug) { 191 System.out.println(en.east() - en2.east()); 192 } 193 if (debug) { 194 System.out.println(en.north() - en2.north()); 195 } 168 196 assertTrue("Schafouse", Math.abs(en.east() - en2.east()) < 0.002); 169 197 assertTrue("Schafouse", Math.abs(en.north() - en2.north()) < 0.002); … … 172 200 { 173 201 EastNorth en = new EastNorth(833068.04, 163265.39); 174 LatLon ll = Main.proj.eastNorth2latlon(en); 175 EastNorth en2 = Main.proj.latlon2eastNorth(ll); 176 if (debug) System.out.println(en.east() - en2.east()); 177 if (debug) System.out.println(en.north() - en2.north()); 202 LatLon ll = Main.getProjection().eastNorth2latlon(en); 203 EastNorth en2 = Main.getProjection().latlon2eastNorth(ll); 204 if (debug) { 205 System.out.println(en.east() - en2.east()); 206 } 207 if (debug) { 208 System.out.println(en.north() - en2.north()); 209 } 178 210 assertTrue("Grinson", Math.abs(en.east() - en2.east()) < 0.002); 179 211 assertTrue("Grinson", Math.abs(en.north() - en2.north()) < 0.002); … … 182 214 { 183 215 EastNorth en = new EastNorth(600000.0, 200000.0); 184 LatLon ll = Main.proj.eastNorth2latlon(en); 185 EastNorth en2 = Main.proj.latlon2eastNorth(ll); 186 if (debug) System.out.println(en.east() - en2.east()); 187 if (debug) System.out.println(en.north() - en2.north()); 216 LatLon ll = Main.getProjection().eastNorth2latlon(en); 217 EastNorth en2 = Main.getProjection().latlon2eastNorth(ll); 218 if (debug) { 219 System.out.println(en.east() - en2.east()); 220 } 221 if (debug) { 222 System.out.println(en.north() - en2.north()); 223 } 188 224 assertTrue("Berne", Math.abs(en.east() - en2.east()) < 0.002); 189 225 assertTrue("Berne", Math.abs(en.north() - en2.north()) < 0.002); … … 192 228 { 193 229 EastNorth en = new EastNorth(700000.0, 100000.0); 194 LatLon ll = Main.proj.eastNorth2latlon(en); 195 EastNorth en2 = Main.proj.latlon2eastNorth(ll); 196 if (debug) System.out.println(en.east() - en2.east()); 197 if (debug) System.out.println(en.north() - en2.north()); 230 LatLon ll = Main.getProjection().eastNorth2latlon(en); 231 EastNorth en2 = Main.getProjection().latlon2eastNorth(ll); 232 if (debug) { 233 System.out.println(en.east() - en2.east()); 234 } 235 if (debug) { 236 System.out.println(en.north() - en2.north()); 237 } 198 238 assertTrue("Ref", Math.abs(en.east() - en2.east()) < 0.002); 199 239 assertTrue("Ref", Math.abs(en.north() - en2.north()) < 0.002); -
trunk/test/unit/org/openstreetmap/josm/gui/conflict/properties/PropertiesMergeModelTest.java
r3577 r4126 47 47 @BeforeClass 48 48 public static void init() { 49 Main. proj =new Epsg4326();49 Main.setProjection(new Epsg4326()); 50 50 Main.pref = new Preferences(); 51 51 }
Note:
See TracChangeset
for help on using the changeset viewer.