Changeset 10060 in josm for trunk/test
- Timestamp:
- 2016-03-27T19:26:23+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java
r9908 r10060 44 44 45 45 private static final String PROJECTION_DATA_FILE = "data_nodist/projection/projection-regression-test-data"; 46 private static final String PROJECTION_DATA_FILE_JAVA_9 = "data_nodist/projection/projection-regression-test-data-java9";47 46 48 47 private static class TestData { … … 51 50 public EastNorth en; 52 51 public LatLon ll2; 53 }54 55 private static String getProjectionDataFile() {56 return TestUtils.getJavaVersion() >= 9 ? PROJECTION_DATA_FILE_JAVA_9 : PROJECTION_DATA_FILE;57 52 } 58 53 … … 71 66 72 67 List<TestData> prevData = new ArrayList<>(); 73 if (new File( getProjectionDataFile()).exists()) {68 if (new File(PROJECTION_DATA_FILE).exists()) { 74 69 prevData = readData(); 75 70 } … … 93 88 Random rand = new Random(); 94 89 try (BufferedWriter out = new BufferedWriter(new OutputStreamWriter( 95 new FileOutputStream( getProjectionDataFile()), StandardCharsets.UTF_8))) {90 new FileOutputStream(PROJECTION_DATA_FILE), StandardCharsets.UTF_8))) { 96 91 out.write("# Data for test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java\n"); 97 92 out.write("# Format: 1. Projection code; 2. lat/lon; 3. lat/lon projected -> east/north; 4. east/north (3.) inverse projected\n"); … … 118 113 119 114 private static List<TestData> readData() throws IOException, FileNotFoundException { 120 try (BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream( getProjectionDataFile()),115 try (BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(PROJECTION_DATA_FILE), 121 116 StandardCharsets.UTF_8))) { 122 117 List<TestData> result = new ArrayList<>(); … … 136 131 next.en = new EastNorth(en.a, en.b); 137 132 next.ll2 = new LatLon(ll2.a, ll2.b); 133 if (TestUtils.getJavaVersion() >= 9) { 134 next.ll = next.ll.getRoundedToOsmPrecision(); 135 next.en = new EastNorth(LatLon.roundToOsmPrecision(en.a), LatLon.roundToOsmPrecision(en.b)); 136 next.ll2 = next.ll2.getRoundedToOsmPrecision(); 137 } 138 138 139 139 result.add(next);
Note:
See TracChangeset
for help on using the changeset viewer.