Changeset 31347 in osm


Ignore:
Timestamp:
2015-07-06T23:24:31+02:00 (9 years ago)
Author:
floscher
Message:

Test downloading of sequences in a given bbox

The new testcase starts the MapillarySequenceDownloadThread, waits until it's finished. Then it checks, if images were added to the MapillaryLayer. We can assume, that there are images in the given rectangle, as currently there are several images uploaded there.
This change required quite extensive changes, as the tests are run in headless mode and so the GUI must not be started. TestUtil is built along the lines of JosmFixture from josm-core, but trimmed a lot.

Location:
applications/editors/josm/plugins/mapillary
Files:
5 added
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java

    r31341 r31347  
    109109                Main.map.mapView.getEditLayer().data.addDataSetListener(this);
    110110        }
    111         MapillaryPlugin.setMenuEnabled(MapillaryPlugin.EXPORT_MENU, true);
    112         if (!MapillaryMainDialog.getInstance().isShowing())
    113             MapillaryMainDialog.getInstance().getButton().doClick();
     111        if (MapillaryPlugin.EXPORT_MENU != null) { // Does not execute when in headless mode
     112            MapillaryPlugin.setMenuEnabled(MapillaryPlugin.EXPORT_MENU, true);
     113            if (!MapillaryMainDialog.getInstance().isShowing())
     114                MapillaryMainDialog.getInstance().getButton().doClick();
     115        }
     116
    114117        createHatchTexture();
    115118        data.dataUpdated();
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryPlugin.java

    r31333 r31347  
    6969        downloadViewAction = new MapillaryDownloadViewAction();
    7070
    71         DOWNLOAD_MENU = MainMenu.add(Main.main.menu.imageryMenu,
    72                 downloadAction, false);
    73         EXPORT_MENU = MainMenu.add(Main.main.menu.fileMenu, exportAction,
    74                 false, 14);
    75         IMPORT_MENU = MainMenu.add(Main.main.menu.fileMenu, importAction,
    76                 false, 14);
    77         ZOOM_MENU = MainMenu
    78                 .add(Main.main.menu.viewMenu, zoomAction, false, 15);
    79         DOWNLOAD_VIEW_MENU = MainMenu.add(Main.main.menu.fileMenu,
    80                 downloadViewAction, false, 14);
     71        if (Main.main != null) { // important for headless mode
     72            DOWNLOAD_MENU = MainMenu.add(Main.main.menu.imageryMenu,
     73                    downloadAction, false);
     74            EXPORT_MENU = MainMenu.add(Main.main.menu.fileMenu, exportAction,
     75                    false, 14);
     76            IMPORT_MENU = MainMenu.add(Main.main.menu.fileMenu, importAction,
     77                    false, 14);
     78            ZOOM_MENU = MainMenu
     79                    .add(Main.main.menu.viewMenu, zoomAction, false, 15);
     80            DOWNLOAD_VIEW_MENU = MainMenu.add(Main.main.menu.fileMenu,
     81                    downloadViewAction, false, 14);
     82        }
    8183
    8284        EXPORT_MENU.setEnabled(false);
  • applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/ImportedImageTest.java

    r31346 r31347  
    11package org.openstreetmap.josm.plugins.mapillary;
    2 
    3 import static org.junit.Assert.*;
    42
    53import java.io.IOException;
     
    86import org.junit.Test;
    97
    10 public class ImportTest {
     8public class ImportedImageTest {
    119
    1210        @Before
     
    1816
    1917    @Test(expected=IllegalArgumentException.class)
    20     public void test() throws IOException {
     18    public void testNullFile() throws IOException {
    2119        MapillaryImportedImage img = new MapillaryImportedImage(0,0,0, null);
    2220        img.getImage();
    2321    }
    24 
    2522}
Note: See TracChangeset for help on using the changeset viewer.