Changeset 14332 in josm for trunk/src


Ignore:
Timestamp:
2018-10-14T17:30:28+02:00 (14 months ago)
Author:
Don-vip
Message:

fix #16841 - MergeLayerActionTest, DownloadWmsAlongTrackActionTest: fix for non-headless mode by properly mocking dialogs (patch by ris)

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AbstractMergeAction.java

    r14273 r14332  
    110110        pnl.add(new JLabel(label), GBC.eol());
    111111        pnl.add(layerList, GBC.eol().fill(GBC.HORIZONTAL));
    112         if (GraphicsEnvironment.isHeadless()) {
    113             // return first layer in headless mode, for unit tests
    114             return targetLayers[0];
    115         }
     112
    116113        ExtendedDialog ed = new ExtendedDialog(MainApplication.getMainFrame(), title, buttonText, tr("Cancel"));
    117114        ed.setButtonIcons(buttonIcon, "cancel");
     
    131128        String message = tr("<html>There are no layers the source layer<br>''{0}''<br>could be merged to.</html>",
    132129                Utils.escapeReservedCharactersHTML(sourceLayer.getName()));
    133         if (!GraphicsEnvironment.isHeadless()) {
    134             JOptionPane.showMessageDialog(MainApplication.getMainFrame(), message, tr("No target layers"), JOptionPane.WARNING_MESSAGE);
    135         }
     130        JOptionPane.showMessageDialog(MainApplication.getMainFrame(), message, tr("No target layers"), JOptionPane.WARNING_MESSAGE);
    136131    }
    137132}
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackAction.java

    r14153 r14332  
    118118        List<AbstractTileSourceLayer> targetLayers = MainApplication.getLayerManager().getLayersOfType(AbstractTileSourceLayer.class);
    119119        if (targetLayers.isEmpty()) {
    120             if (!GraphicsEnvironment.isHeadless()) {
    121                 warnNoImageryLayers();
    122             }
     120            warnNoImageryLayers();
    123121            return null;
    124122        }
Note: See TracChangeset for help on using the changeset viewer.