Changeset 18494 in josm for trunk/test/unit
- Timestamp:
- 2022-06-15T19:27:05+02:00 (3 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/cache/JCSCacheManagerTest.java
r18037 r18494 9 9 import java.util.logging.Logger; 10 10 11 import org.openstreetmap.josm.testutils.annotations.BasicPreferences;12 13 import net.trajano.commons.testing.UtilityClassTestUtil;14 11 import org.apache.commons.jcs3.access.CacheAccess; 15 12 import org.apache.commons.jcs3.auxiliary.disk.block.BlockDiskCacheAttributes; 16 13 import org.junit.jupiter.api.Test; 17 14 import org.junit.jupiter.api.Timeout; 15 import org.openstreetmap.josm.testutils.annotations.BasicPreferences; 16 17 import net.trajano.commons.testing.UtilityClassTestUtil; 18 18 19 19 /** … … 59 59 CacheAccess<Object, Object> cache = JCSCacheManager.getCache("testUseBigDiskFile", 1, 100, "foobar"); 60 60 assertEquals(10*1024, 61 ((BlockDiskCacheAttributes) cache.getCacheControl().getAuxCache s()[0].getAuxiliaryCacheAttributes()).getMaxKeySize(),61 ((BlockDiskCacheAttributes) cache.getCacheControl().getAuxCacheList().get(0).getAuxiliaryCacheAttributes()).getMaxKeySize(), 62 62 "BlockDiskCache use file size to calculate its size"); 63 63 } -
trunk/test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java
r17275 r18494 170 170 @Test 171 171 void testBearing() { 172 LatLon c = new LatLon(47.000000, 19.000000); 173 LatLon e = new LatLon(47.000000, 19.000001); 174 LatLon n = new LatLon(47.000001, 19.000000); 172 ILatLon c = new LatLon(47.000000, 19.000000); 173 ILatLon e = new LatLon(47.000000, 19.000001); 174 ILatLon n = new LatLon(47.000001, 19.000000); 175 175 assertEquals(0, Math.toDegrees(c.bearing(n)), EPSILON); 176 176 assertEquals(90, Math.toDegrees(c.bearing(e)), EPSILON); -
trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxDataTest.java
r18287 r18494 26 26 import org.openstreetmap.josm.data.DataSource; 27 27 import org.openstreetmap.josm.data.coor.EastNorth; 28 import org.openstreetmap.josm.data.coor.ILatLon; 28 29 import org.openstreetmap.josm.data.coor.LatLon; 29 30 import org.openstreetmap.josm.data.gpx.GpxData.GpxDataChangeEvent; … … 322 323 data.addTrack(track1); 323 324 data.addTrack(track2); 324 assertEquals(3 * new LatLon(0, 0).greatCircleDistance(new LatLon(1, 1)), data.length(), 1); 325 assertEquals(3 * new LatLon(0, 0).greatCircleDistance((ILatLon) new LatLon(1, 1)), data.length(), 1); 325 326 } 326 327 -
trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionTest.java
r17275 r18494 14 14 import org.openstreetmap.josm.data.Bounds; 15 15 import org.openstreetmap.josm.data.coor.EastNorth; 16 import org.openstreetmap.josm.data.coor.ILatLon; 16 17 import org.openstreetmap.josm.data.coor.LatLon; 17 18 … … 171 172 LatLon ll2 = p.eastNorth2latlon(en); 172 173 assertTrue(ll2.isValid(), p.toCode() + " at " + ll1 + " is " + ll2); 173 double dist = ll1.greatCircleDistance(ll2); 174 double dist = ll1.greatCircleDistance((ILatLon) ll2); 174 175 if (dist > eps) { 175 176 error2 = true; -
trunk/test/unit/org/openstreetmap/josm/gui/mappaint/RenderingCLIAreaTest.java
r17276 r18494 16 16 import org.junit.jupiter.params.provider.MethodSource; 17 17 import org.openstreetmap.josm.data.Bounds; 18 import org.openstreetmap.josm.data.coor.ILatLon; 18 19 import org.openstreetmap.josm.data.coor.LatLon; 19 20 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 64 65 CoreMatchers.is(bFeldberg)}); 65 66 66 LatLon aFeldberg = bFeldberg.getMin(); 67 LatLon aFeldberg200mRight = new LatLon(aFeldberg.lat(), 13.433008399004041); 68 LatLon aFeldberg150mUp = new LatLon(53.33134745249311, aFeldberg.lon()); 67 ILatLon aFeldberg = bFeldberg.getMin(); 68 ILatLon aFeldberg200mRight = new LatLon(aFeldberg.lat(), 13.433008399004041); 69 ILatLon aFeldberg150mUp = new LatLon(53.33134745249311, aFeldberg.lon()); 69 70 assertThat(aFeldberg.greatCircleDistance(aFeldberg200mRight), isFP(200.0, 0.01)); 70 71 assertThat(aFeldberg.greatCircleDistance(aFeldberg150mUp), isFP(150.0, 0.01)); … … 142 143 } 143 144 144 private static String param(LatLon ll) { 145 private static String param(ILatLon ll) { 145 146 return ll.lon() + "," + ll.lat(); 146 147 } -
trunk/test/unit/org/openstreetmap/josm/tools/GeometryTest.java
r18109 r18494 24 24 import org.openstreetmap.josm.TestUtils; 25 25 import org.openstreetmap.josm.data.coor.EastNorth; 26 import org.openstreetmap.josm.data.coor.ILatLon; 26 27 import org.openstreetmap.josm.data.coor.LatLon; 27 28 import org.openstreetmap.josm.data.osm.DataSet; … … 503 504 ProjectionRegistry.setProjection(projection); 504 505 final double offset = offsetInMeters / projection.getMetersPerUnit(); 505 final LatLon original = new LatLon(lat, lon); 506 507 final LatLon actual = (LatLon)Geometry.getLatLonFrom(original, Math.toRadians(angle), offset);506 final ILatLon original = new LatLon(lat, lon); 507 508 final ILatLon actual = Geometry.getLatLonFrom(original, Math.toRadians(angle), offset); 508 509 // Due to degree -> radian -> degree conversion, there is a limit to how precise it can be 509 510 assertEquals(offsetInMeters, original.greatCircleDistance(actual), 0.000_000_1);
Note:
See TracChangeset
for help on using the changeset viewer.