Changeset 16006 in josm for trunk/test


Ignore:
Timestamp:
2020-03-03T02:12:44+01:00 (5 years ago)
Author:
Don-vip
Message:

see #18140 - reorganization of data(_nodist), images(_nodist), styles(_nodist), IDE and native files in a more practical file tree.

  • Everything belonging to the jar is now in resources (data, images, styles)
  • Everything not belonging to the jar is now in nodist (data, images, styles)
  • Everything related to OS native functions is now in native (linux, macosx, windows)
  • Everything related to an IDE is now in ide (eclipse, netbeans)
Location:
trunk/test
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/functional/org/openstreetmap/josm/gui/GettingStartedTest.java

    r11171 r16006  
    4040    @Test
    4141    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\" />.";
    4444        assertFalse(GettingStarted.fixImageLinks(html).equals(html));
    4545
  • trunk/test/functional/org/openstreetmap/josm/gui/mappaint/StyleCacheTest.java

    r14138 r16006  
    6363
    6464        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"));
    6666        ) {
    6767            dsCity = OsmReader.parseDataSet(fisC, NullProgressMonitor.INSTANCE);
  • trunk/test/performance/org/openstreetmap/josm/data/osm/OsmDataGenerator.java

    r14093 r16006  
    1818    private static final int DEFAULT_KEY_VALUE_RATIO = 3;
    1919    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";
    2121
    2222    private OsmDataGenerator() {
  • trunk/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRendererPerformanceTestParent.java

    r15034 r16006  
    8181        StyledMapRenderer.PREFERENCE_TEXT_ANTIALIASING.put("gasp");
    8282
    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"));) {
    8787            dsRestriction = OsmReader.parseDataSet(fisR, NullProgressMonitor.INSTANCE);
    8888            dsMultipolygon = OsmReader.parseDataSet(fisM, NullProgressMonitor.INSTANCE);
  • trunk/test/performance/org/openstreetmap/josm/gui/mappaint/MapRendererPerformanceTest.java

    r15987 r16006  
    1919import javax.imageio.ImageIO;
    2020
    21 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    2221import org.junit.AfterClass;
    2322import org.junit.Assert;
     
    4948import org.openstreetmap.josm.tools.Logging;
    5049
     50import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     51
    5152/**
    5253 * Performance test of map renderer.
     
    152153
    153154        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"));
    155156        ) {
    156157            dsCity = OsmReader.parseDataSet(fisC, NullProgressMonitor.INSTANCE);
  • trunk/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSPerformanceTest.java

    r12825 r16006  
    3535     * The path to the style file used for rendering.
    3636     */
    37     static final String STYLE_FILE = "styles/standard/elemstyles.mapcss";
     37    static final String STYLE_FILE = "resources/styles/standard/elemstyles.mapcss";
    3838
    3939    /**
    4040     * The data file to be rendered
    4141     */
    42     static final String DATA_FILE = "data_nodist/neubrandenburg.osm.bz2";
     42    static final String DATA_FILE = "nodist/data/neubrandenburg.osm.bz2";
    4343    /* ------------------------ / configuration section  ---------------------------- */
    4444
  • trunk/test/performance/org/openstreetmap/josm/io/OsmReaderPerformanceTest.java

    r10758 r16006  
    3131public class OsmReaderPerformanceTest {
    3232    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";
    3434
    3535    /**
  • trunk/test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java

    r15883 r16006  
    146146
    147147    /**
    148      * Non-regression test which checks example files in data_nodist
     148     * Non-regression test which checks example files in nodist/data
    149149     * @throws Exception if an error occurs
    150150     */
     
    153153    public void testExamples() throws Exception {
    154154        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"))) {
    156156            dsToJoin = OsmReader.parseDataSet(is, NullProgressMonitor.INSTANCE);
    157157        }
    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"))) {
    159159            dsExpected = OsmReader.parseDataSet(is, NullProgressMonitor.INSTANCE);
    160160        }
  • trunk/test/unit/org/openstreetmap/josm/data/osm/FilterTest.java

    r15034 r16006  
    7474        for (int i : new int[] {1, 2, 3, 11, 12, 13, 14, 15}) {
    7575            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"))) {
    7777                ds = OsmReader.parseDataSet(is, NullProgressMonitor.INSTANCE);
    7878            }
  • trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java

    r15034 r16006  
    8585    public void testRemove() throws Exception {
    8686        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"))) {
    8888            DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
    8989            removeAllTest(ds);
     
    9898    public void testMove() throws Exception {
    9999        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"))) {
    101101            DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
    102102
  • trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java

    r15716 r16006  
    4747 * Test projections using reference data from external program.
    4848 *
    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>,
    5050 * run the main method of this class. For this, you need to have the cs2cs
    5151 * program from the proj.4 library in path (or use <code>CS2CS_EXE</code> to set
    5252 * 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> or
     53 * can be accessed, i.e. copy them from <code>nodist/data/projection</code> to <code>/usr/share/proj</code> or
    5454 * wherever cs2cs expects them to be placed.
    5555 *
     
    6363    private static final String CS2CS_EXE = "cs2cs";
    6464
    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";
    6767
    6868    private static class RefEntry {
  • trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java

    r15034 r16006  
    3434 * This test is used to monitor changes in projection code.
    3535 *
    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.
    3737 * This record is generated from the current Projection classes available in JOSM. It needs to
    3838 * be updated, whenever a projection is added / removed or an algorithm is changed, such that
     
    4444public class ProjectionRegressionTest {
    4545
    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";
    4747
    4848    private static class TestData {
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/CoastlinesTest.java

    r15043 r16006  
    3131    @Test
    3232    public void testCoastlineFile() throws Exception {
    33         ValidatorTestUtils.testSampleFile("data_nodist/coastlines.osm",
     33        ValidatorTestUtils.testSampleFile("nodist/data/coastlines.osm",
    3434                ds -> ds.getWays().stream().filter(
    3535                        w -> "coastline".equals(w.get("natural"))).collect(Collectors.toList()),
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MultipolygonTestTest.java

    r15183 r16006  
    3838        final MultipolygonTest MULTIPOLYGON_TEST = new MultipolygonTest();
    3939        final RelationChecker RELATION_TEST = new RelationChecker();
    40         ValidatorTestUtils.testSampleFile("data_nodist/multipolygon.osm",
     40        ValidatorTestUtils.testSampleFile("nodist/data/multipolygon.osm",
    4141                ds -> ds.getRelations().stream().filter(Relation::isMultipolygon).collect(Collectors.toList()),
    4242                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  
    2929    @Test
    3030    public void testTurnrestrictionFile() throws Exception {
    31         ValidatorTestUtils.testSampleFile("data_nodist/restriction.osm",
     31        ValidatorTestUtils.testSampleFile("nodist/data/restriction.osm",
    3232                ds -> ds.getRelations(),
    3333                name -> name.startsWith("E"), TURNRESTRICTION_TEST, RELATION_TEST);
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/UnconnectedWaysTest.java

    r15354 r16006  
    4949    @Test
    5050    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"))) {
    5252            final DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
    5353            MainApplication.getLayerManager().addLayer(new OsmDataLayer(ds, null, null));
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorterTest.java

    r15034 r16006  
    4545    public void loadData() throws IllegalDataException, IOException {
    4646        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"))) {
    4848                testDataset = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
    4949            }
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculatorTest.java

    r15076 r16006  
    5252    public void loadData() throws IllegalDataException, IOException {
    5353        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"))) {
    5555                testDataset = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
    5656            }
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImagesTest.java

    r14205 r16006  
    4646    @Test
    4747    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");
    4949        final ImageEntry i0 = new ImageEntry();
    5050        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  
    6060    @Test
    6161    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);
    6363        assertEquals("[#000000, #000000, #000000, #000000, #000000, #000000, #000000, #000000, #000000, #000000]", colors.toString());
    6464    }
     
    7272    @Test
    7373    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",
    7575                ImmutableMap.of("colormode", Integer.toString(ColorMode.VELOCITY.toIndex())), 10);
    7676        assertEquals("[#000000, #FFAD00, #FFA800, #FFA800, #FF9E00, #FF9400, #FF7000, #FF7000, #FF8000, #FF9400]", colors.toString());
     
    8585    @Test
    8686    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",
    8888                ImmutableMap.of("colormode.dynamic-range", "true",
    8989                        "colormode", Integer.toString(ColorMode.VELOCITY.toIndex())),
     
    100100    @Test
    101101    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",
    103103                ImmutableMap.of("colormode", Integer.toString(ColorMode.DIRECTION.toIndex())), 10);
    104104        assertEquals("[#000000, #EAEC25, #EDEA26, #EDE525, #ECD322, #EBB81D, #E85A0D, #E73708, #E84D0B, #EA8A15]", colors.toString());
     
    113113    @Test
    114114    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",
    116116                ImmutableMap.of("colormode", Integer.toString(ColorMode.TIME.toIndex())), 10);
    117117        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  
    192192    @Test
    193193    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);
    195195        ChildOrParentSelector css = parse("node[tag(\"amenity\") = parent_tag(\"amenity\")] ∈ *[amenity] {}");
    196196        assertFalse(css.matches(new Environment(ds.getPrimitiveById(123, OsmPrimitiveType.NODE))));
  • trunk/test/unit/org/openstreetmap/josm/io/GeoJSONWriterTest.java

    r15034 r16006  
    128128    @Test
    129129    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"))) {
    131131            DataSet ds = OsmReader.parseDataSet(in, null);
    132132            final GeoJSONWriter writer = new GeoJSONWriter(ds);
  • trunk/test/unit/org/openstreetmap/josm/io/GpxReaderTest.java

    r15496 r16006  
    6161    @Test
    6262    public void testMunich() throws Exception {
    63         final GpxData result = parseGpxData("data_nodist/munich.gpx");
     63        final GpxData result = parseGpxData("nodist/data/munich.gpx");
    6464        assertEquals(2762, result.getTracks().size());
    6565        assertEquals(0, result.getRoutes().size());
  • trunk/test/unit/org/openstreetmap/josm/io/nmea/NmeaReaderTest.java

    r15502 r16006  
    6262    public void testReader() throws Exception {
    6363        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")));
    6565        in.parse(true);
    6666        assertEquals(30, in.getNumberOfCoordinates());
  • trunk/test/unit/org/openstreetmap/josm/io/rtklib/RtkLibPosReaderTest.java

    r15343 r16006  
    5858    @Test
    5959    public void testReader() throws Exception {
    60         RtkLibPosReader in = read("data_nodist/rtklib_example.pos");
     60        RtkLibPosReader in = read("nodist/data/rtklib_example.pos");
    6161        assertEquals(137, in.getNumberOfCoordinates());
    6262
     
    8484    @Test
    8585    public void testReader2() throws Exception {
    86         RtkLibPosReader in = read("data_nodist/rtklib_example2.pos");
     86        RtkLibPosReader in = read("nodist/data/rtklib_example2.pos");
    8787        assertEquals(6, in.getNumberOfCoordinates());
    8888    }
  • trunk/test/unit/org/openstreetmap/josm/tools/ExifReaderTest.java

    r15672 r16006  
    4242    @Before
    4343    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");
    4646    }
    4747
     
    6262    @Test
    6363    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"));
    6565        doTest("2015-07-11T19:34:19.100", date);
    6666    }
     
    108108    @Test
    109109    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")));
    111111    }
    112112
     
    116116    @Test
    117117    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")));
    119119    }
    120120
Note: See TracChangeset for help on using the changeset viewer.