Ignore:
Timestamp:
2015-07-06T23:24:31+02:00 (10 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/src/org/openstreetmap/josm/plugins/mapillary
Files:
2 edited

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);
Note: See TracChangeset for help on using the changeset viewer.