Changeset 16006 in josm for trunk/test
- Timestamp:
- 2020-03-03T02:12:44+01:00 (5 years ago)
- Location:
- trunk/test
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/functional/org/openstreetmap/josm/gui/GettingStartedTest.java
r11171 r16006 40 40 @Test 41 41 public void testImageReplacementStatic() { 42 final String html = "the download button <img src=\"/browser/trunk/ images/download.png?format=raw\" " +43 "alt=\"source:trunk/ images/download.png\" title=\"source:trunk/images/download.png\" />.";42 final String html = "the download button <img src=\"/browser/trunk/resources/images/download.png?format=raw\" " + 43 "alt=\"source:trunk/resources/images/download.png\" title=\"source:trunk/resources/images/download.png\" />."; 44 44 assertFalse(GettingStarted.fixImageLinks(html).equals(html)); 45 45 -
trunk/test/functional/org/openstreetmap/josm/gui/mappaint/StyleCacheTest.java
r14138 r16006 63 63 64 64 try ( 65 InputStream fisC = Compression.getUncompressedFileInputStream(new File(" data_nodist/neubrandenburg.osm.bz2"));65 InputStream fisC = Compression.getUncompressedFileInputStream(new File("nodist/data/neubrandenburg.osm.bz2")); 66 66 ) { 67 67 dsCity = OsmReader.parseDataSet(fisC, NullProgressMonitor.INSTANCE); -
trunk/test/performance/org/openstreetmap/josm/data/osm/OsmDataGenerator.java
r14093 r16006 18 18 private static final int DEFAULT_KEY_VALUE_RATIO = 3; 19 19 private static final int DEFAULT_NODE_COUNT = 1000; 20 private static final String DATA_DIR = " data_nodist" + File.separator + "osmfiles";20 private static final String DATA_DIR = "nodist/data" + File.separator + "osmfiles"; 21 21 22 22 private OsmDataGenerator() { -
trunk/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRendererPerformanceTestParent.java
r15034 r16006 81 81 StyledMapRenderer.PREFERENCE_TEXT_ANTIALIASING.put("gasp"); 82 82 83 try (InputStream fisR = Files.newInputStream(Paths.get(" data_nodist/restriction.osm"));84 InputStream fisM = Files.newInputStream(Paths.get(" data_nodist/multipolygon.osm"));85 InputStream fisC = Compression.getUncompressedFileInputStream(new File(" data_nodist/neubrandenburg.osm.bz2"));86 InputStream fisO = Compression.getUncompressedFileInputStream(new File(" data_nodist/overpass-download.osm.bz2"));) {83 try (InputStream fisR = Files.newInputStream(Paths.get("nodist/data/restriction.osm")); 84 InputStream fisM = Files.newInputStream(Paths.get("nodist/data/multipolygon.osm")); 85 InputStream fisC = Compression.getUncompressedFileInputStream(new File("nodist/data/neubrandenburg.osm.bz2")); 86 InputStream fisO = Compression.getUncompressedFileInputStream(new File("nodist/data/overpass-download.osm.bz2"));) { 87 87 dsRestriction = OsmReader.parseDataSet(fisR, NullProgressMonitor.INSTANCE); 88 88 dsMultipolygon = OsmReader.parseDataSet(fisM, NullProgressMonitor.INSTANCE); -
trunk/test/performance/org/openstreetmap/josm/gui/mappaint/MapRendererPerformanceTest.java
r15987 r16006 19 19 import javax.imageio.ImageIO; 20 20 21 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;22 21 import org.junit.AfterClass; 23 22 import org.junit.Assert; … … 49 48 import org.openstreetmap.josm.tools.Logging; 50 49 50 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 51 51 52 /** 52 53 * Performance test of map renderer. … … 152 153 153 154 try ( 154 InputStream fisC = Compression.getUncompressedFileInputStream(new File(" data_nodist/neubrandenburg.osm.bz2"));155 InputStream fisC = Compression.getUncompressedFileInputStream(new File("nodist/data/neubrandenburg.osm.bz2")); 155 156 ) { 156 157 dsCity = OsmReader.parseDataSet(fisC, NullProgressMonitor.INSTANCE); -
trunk/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSPerformanceTest.java
r12825 r16006 35 35 * The path to the style file used for rendering. 36 36 */ 37 static final String STYLE_FILE = " styles/standard/elemstyles.mapcss";37 static final String STYLE_FILE = "resources/styles/standard/elemstyles.mapcss"; 38 38 39 39 /** 40 40 * The data file to be rendered 41 41 */ 42 static final String DATA_FILE = " data_nodist/neubrandenburg.osm.bz2";42 static final String DATA_FILE = "nodist/data/neubrandenburg.osm.bz2"; 43 43 /* ------------------------ / configuration section ---------------------------- */ 44 44 -
trunk/test/performance/org/openstreetmap/josm/io/OsmReaderPerformanceTest.java
r10758 r16006 31 31 public class OsmReaderPerformanceTest { 32 32 private static final int TIMES = 4; 33 private static String DATA_FILE = " data_nodist/neubrandenburg.osm.bz2";33 private static String DATA_FILE = "nodist/data/neubrandenburg.osm.bz2"; 34 34 35 35 /** -
trunk/test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java
r15883 r16006 146 146 147 147 /** 148 * Non-regression test which checks example files in data_nodist148 * Non-regression test which checks example files in nodist/data 149 149 * @throws Exception if an error occurs 150 150 */ … … 153 153 public void testExamples() throws Exception { 154 154 DataSet dsToJoin, dsExpected; 155 try (InputStream is = Files.newInputStream(Paths.get(" data_nodist/Join_Areas_Tests.osm"))) {155 try (InputStream is = Files.newInputStream(Paths.get("nodist/data/Join_Areas_Tests.osm"))) { 156 156 dsToJoin = OsmReader.parseDataSet(is, NullProgressMonitor.INSTANCE); 157 157 } 158 try (InputStream is = Files.newInputStream(Paths.get(" data_nodist/Join_Areas_Tests_joined.osm"))) {158 try (InputStream is = Files.newInputStream(Paths.get("nodist/data/Join_Areas_Tests_joined.osm"))) { 159 159 dsExpected = OsmReader.parseDataSet(is, NullProgressMonitor.INSTANCE); 160 160 } -
trunk/test/unit/org/openstreetmap/josm/data/osm/FilterTest.java
r15034 r16006 74 74 for (int i : new int[] {1, 2, 3, 11, 12, 13, 14, 15}) { 75 75 DataSet ds; 76 try (InputStream is = Files.newInputStream(Paths.get(" data_nodist/filterTests.osm"))) {76 try (InputStream is = Files.newInputStream(Paths.get("nodist/data/filterTests.osm"))) { 77 77 ds = OsmReader.parseDataSet(is, NullProgressMonitor.INSTANCE); 78 78 } -
trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java
r15034 r16006 85 85 public void testRemove() throws Exception { 86 86 ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator 87 try (InputStream fis = Files.newInputStream(Paths.get(" data_nodist/restriction.osm"))) {87 try (InputStream fis = Files.newInputStream(Paths.get("nodist/data/restriction.osm"))) { 88 88 DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE); 89 89 removeAllTest(ds); … … 98 98 public void testMove() throws Exception { 99 99 ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator 100 try (InputStream fis = Files.newInputStream(Paths.get(" data_nodist/restriction.osm"))) {100 try (InputStream fis = Files.newInputStream(Paths.get("nodist/data/restriction.osm"))) { 101 101 DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE); 102 102 -
trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java
r15716 r16006 47 47 * Test projections using reference data from external program. 48 48 * 49 * To update the reference data file <code> data_nodist/projection/projection-reference-data</code>,49 * To update the reference data file <code>nodist/data/projection/projection-reference-data</code>, 50 50 * run the main method of this class. For this, you need to have the cs2cs 51 51 * program from the proj.4 library in path (or use <code>CS2CS_EXE</code> to set 52 52 * the full path of the executable). Make sure the required *.gsb grid files 53 * can be accessed, i.e. copy them from <code> data_nodist/projection</code> to <code>/usr/share/proj</code> or53 * can be accessed, i.e. copy them from <code>nodist/data/projection</code> to <code>/usr/share/proj</code> or 54 54 * wherever cs2cs expects them to be placed. 55 55 * … … 63 63 private static final String CS2CS_EXE = "cs2cs"; 64 64 65 private static final String REFERENCE_DATA_FILE = " data_nodist/projection/projection-reference-data";66 private static final String PROJ_LIB_DIR = " data_nodist/projection";65 private static final String REFERENCE_DATA_FILE = "nodist/data/projection/projection-reference-data"; 66 private static final String PROJ_LIB_DIR = "nodist/data/projection"; 67 67 68 68 private static class RefEntry { -
trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java
r15034 r16006 34 34 * This test is used to monitor changes in projection code. 35 35 * 36 * It keeps a record of test data in the file data_nodist/projection/projection-regression-test-data.36 * It keeps a record of test data in the file nodist/data/projection/projection-regression-test-data. 37 37 * This record is generated from the current Projection classes available in JOSM. It needs to 38 38 * be updated, whenever a projection is added / removed or an algorithm is changed, such that … … 44 44 public class ProjectionRegressionTest { 45 45 46 private static final String PROJECTION_DATA_FILE = " data_nodist/projection/projection-regression-test-data";46 private static final String PROJECTION_DATA_FILE = "nodist/data/projection/projection-regression-test-data"; 47 47 48 48 private static class TestData { -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/CoastlinesTest.java
r15043 r16006 31 31 @Test 32 32 public void testCoastlineFile() throws Exception { 33 ValidatorTestUtils.testSampleFile(" data_nodist/coastlines.osm",33 ValidatorTestUtils.testSampleFile("nodist/data/coastlines.osm", 34 34 ds -> ds.getWays().stream().filter( 35 35 w -> "coastline".equals(w.get("natural"))).collect(Collectors.toList()), -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MultipolygonTestTest.java
r15183 r16006 38 38 final MultipolygonTest MULTIPOLYGON_TEST = new MultipolygonTest(); 39 39 final RelationChecker RELATION_TEST = new RelationChecker(); 40 ValidatorTestUtils.testSampleFile(" data_nodist/multipolygon.osm",40 ValidatorTestUtils.testSampleFile("nodist/data/multipolygon.osm", 41 41 ds -> ds.getRelations().stream().filter(Relation::isMultipolygon).collect(Collectors.toList()), 42 42 name -> name.startsWith("06") || name.startsWith("07") || name.startsWith("08"), MULTIPOLYGON_TEST, RELATION_TEST); -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/TurnRestrictionTestTest.java
r14966 r16006 29 29 @Test 30 30 public void testTurnrestrictionFile() throws Exception { 31 ValidatorTestUtils.testSampleFile(" data_nodist/restriction.osm",31 ValidatorTestUtils.testSampleFile("nodist/data/restriction.osm", 32 32 ds -> ds.getRelations(), 33 33 name -> name.startsWith("E"), TURNRESTRICTION_TEST, RELATION_TEST); -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/UnconnectedWaysTest.java
r15354 r16006 49 49 @Test 50 50 public void testTicket6313() throws IOException, IllegalDataException, FileNotFoundException { 51 try (InputStream fis = Files.newInputStream(Paths.get(" data_nodist/UnconnectedWaysTest.osm"))) {51 try (InputStream fis = Files.newInputStream(Paths.get("nodist/data/UnconnectedWaysTest.osm"))) { 52 52 final DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE); 53 53 MainApplication.getLayerManager().addLayer(new OsmDataLayer(ds, null, null)); -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorterTest.java
r15034 r16006 45 45 public void loadData() throws IllegalDataException, IOException { 46 46 if (testDataset == null) { 47 try (InputStream fis = Files.newInputStream(Paths.get(" data_nodist/relation_sort.osm"))) {47 try (InputStream fis = Files.newInputStream(Paths.get("nodist/data/relation_sort.osm"))) { 48 48 testDataset = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE); 49 49 } -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculatorTest.java
r15076 r16006 52 52 public void loadData() throws IllegalDataException, IOException { 53 53 if (testDataset == null) { 54 try (InputStream fis = Files.newInputStream(Paths.get(" data_nodist/relation_sort.osm"))) {54 try (InputStream fis = Files.newInputStream(Paths.get("nodist/data/relation_sort.osm"))) { 55 55 testDataset = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE); 56 56 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImagesTest.java
r14205 r16006 46 46 @Test 47 47 public void testAutoGuess() throws Exception { 48 final GpxData gpx = GpxReaderTest.parseGpxData(" data_nodist/2094047.gpx");48 final GpxData gpx = GpxReaderTest.parseGpxData("nodist/data/2094047.gpx"); 49 49 final ImageEntry i0 = new ImageEntry(); 50 50 i0.setExifTime(DateUtils.fromString("2016:01:03 11:59:54")); // 4 sec before start of GPX -
trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelperTest.java
r15497 r16006 60 60 @Test 61 61 public void testNone() throws IOException, SAXException { 62 final List<String> colors = calculateColors(" data_nodist/2094047.gpx", ImmutableMap.of(), 10);62 final List<String> colors = calculateColors("nodist/data/2094047.gpx", ImmutableMap.of(), 10); 63 63 assertEquals("[#000000, #000000, #000000, #000000, #000000, #000000, #000000, #000000, #000000, #000000]", colors.toString()); 64 64 } … … 72 72 @Test 73 73 public void testVelocity() throws IOException, SAXException { 74 final List<String> colors = calculateColors(" data_nodist/2094047.gpx",74 final List<String> colors = calculateColors("nodist/data/2094047.gpx", 75 75 ImmutableMap.of("colormode", Integer.toString(ColorMode.VELOCITY.toIndex())), 10); 76 76 assertEquals("[#000000, #FFAD00, #FFA800, #FFA800, #FF9E00, #FF9400, #FF7000, #FF7000, #FF8000, #FF9400]", colors.toString()); … … 85 85 @Test 86 86 public void testVelocityDynamic() throws IOException, SAXException { 87 final List<String> colors = calculateColors(" data_nodist/2094047.gpx",87 final List<String> colors = calculateColors("nodist/data/2094047.gpx", 88 88 ImmutableMap.of("colormode.dynamic-range", "true", 89 89 "colormode", Integer.toString(ColorMode.VELOCITY.toIndex())), … … 100 100 @Test 101 101 public void testDirection() throws IOException, SAXException { 102 final List<String> colors = calculateColors(" data_nodist/2094047.gpx",102 final List<String> colors = calculateColors("nodist/data/2094047.gpx", 103 103 ImmutableMap.of("colormode", Integer.toString(ColorMode.DIRECTION.toIndex())), 10); 104 104 assertEquals("[#000000, #EAEC25, #EDEA26, #EDE525, #ECD322, #EBB81D, #E85A0D, #E73708, #E84D0B, #EA8A15]", colors.toString()); … … 113 113 @Test 114 114 public void testTime() throws IOException, SAXException { 115 final List<String> colors = calculateColors(" data_nodist/2094047.gpx",115 final List<String> colors = calculateColors("nodist/data/2094047.gpx", 116 116 ImmutableMap.of("colormode", Integer.toString(ColorMode.TIME.toIndex())), 10); 117 117 assertEquals("[#000000, #FF0000, #FF0000, #FF0500, #FF0500, #FF0A00, #FF0A00, #FF1F00, #FF2E00, #FF3300]", colors.toString()); -
trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ChildOrParentSelectorTest.java
r15988 r16006 192 192 @Test 193 193 public void testContains() throws Exception { 194 ds = OsmReader.parseDataSet(Files.newInputStream(Paths.get(" data_nodist/amenity-in-amenity.osm")), null);194 ds = OsmReader.parseDataSet(Files.newInputStream(Paths.get("nodist/data/amenity-in-amenity.osm")), null); 195 195 ChildOrParentSelector css = parse("node[tag(\"amenity\") = parent_tag(\"amenity\")] ∈ *[amenity] {}"); 196 196 assertFalse(css.matches(new Environment(ds.getPrimitiveById(123, OsmPrimitiveType.NODE)))); -
trunk/test/unit/org/openstreetmap/josm/io/GeoJSONWriterTest.java
r15034 r16006 128 128 @Test 129 129 public void testMultipolygonRobustness() throws Exception { 130 try (InputStream in = Files.newInputStream(Paths.get(" data_nodist/multipolygon.osm"))) {130 try (InputStream in = Files.newInputStream(Paths.get("nodist/data/multipolygon.osm"))) { 131 131 DataSet ds = OsmReader.parseDataSet(in, null); 132 132 final GeoJSONWriter writer = new GeoJSONWriter(ds); -
trunk/test/unit/org/openstreetmap/josm/io/GpxReaderTest.java
r15496 r16006 61 61 @Test 62 62 public void testMunich() throws Exception { 63 final GpxData result = parseGpxData(" data_nodist/munich.gpx");63 final GpxData result = parseGpxData("nodist/data/munich.gpx"); 64 64 assertEquals(2762, result.getTracks().size()); 65 65 assertEquals(0, result.getRoutes().size()); -
trunk/test/unit/org/openstreetmap/josm/io/nmea/NmeaReaderTest.java
r15502 r16006 62 62 public void testReader() throws Exception { 63 63 TimeZone.setDefault(TimeZone.getTimeZone("Europe/Berlin")); 64 final NmeaReader in = new NmeaReader(Files.newInputStream(Paths.get(" data_nodist/btnmeatrack_2016-01-25.nmea")));64 final NmeaReader in = new NmeaReader(Files.newInputStream(Paths.get("nodist/data/btnmeatrack_2016-01-25.nmea"))); 65 65 in.parse(true); 66 66 assertEquals(30, in.getNumberOfCoordinates()); -
trunk/test/unit/org/openstreetmap/josm/io/rtklib/RtkLibPosReaderTest.java
r15343 r16006 58 58 @Test 59 59 public void testReader() throws Exception { 60 RtkLibPosReader in = read(" data_nodist/rtklib_example.pos");60 RtkLibPosReader in = read("nodist/data/rtklib_example.pos"); 61 61 assertEquals(137, in.getNumberOfCoordinates()); 62 62 … … 84 84 @Test 85 85 public void testReader2() throws Exception { 86 RtkLibPosReader in = read(" data_nodist/rtklib_example2.pos");86 RtkLibPosReader in = read("nodist/data/rtklib_example2.pos"); 87 87 assertEquals(6, in.getNumberOfCoordinates()); 88 88 } -
trunk/test/unit/org/openstreetmap/josm/tools/ExifReaderTest.java
r15672 r16006 42 42 @Before 43 43 public void setUp() { 44 directionSampleFile = new File(" data_nodist/exif-example_direction.jpg");45 orientationSampleFile = new File(" data_nodist/exif-example_orientation=6.jpg");44 directionSampleFile = new File("nodist/data/exif-example_direction.jpg"); 45 orientationSampleFile = new File("nodist/data/exif-example_orientation=6.jpg"); 46 46 } 47 47 … … 62 62 @Test 63 63 public void testReadTimeSubSecond1() throws ParseException { 64 Date date = ExifReader.readTime(new File(" data_nodist/IMG_20150711_193419.jpg"));64 Date date = ExifReader.readTime(new File("nodist/data/IMG_20150711_193419.jpg")); 65 65 doTest("2015-07-11T19:34:19.100", date); 66 66 } … … 108 108 @Test 109 109 public void testReadSpeed() { 110 assertEquals(Double.valueOf(12.3), ExifReader.readSpeed(new File(" data_nodist/exif-example_speed_ele.jpg")));110 assertEquals(Double.valueOf(12.3), ExifReader.readSpeed(new File("nodist/data/exif-example_speed_ele.jpg"))); 111 111 } 112 112 … … 116 116 @Test 117 117 public void testReadElevation() { 118 assertEquals(Double.valueOf(23.4), ExifReader.readElevation(new File(" data_nodist/exif-example_speed_ele.jpg")));118 assertEquals(Double.valueOf(23.4), ExifReader.readElevation(new File("nodist/data/exif-example_speed_ele.jpg"))); 119 119 } 120 120
Note:
See TracChangeset
for help on using the changeset viewer.